@aui.io/apollo 0.1.89 → 0.1.90
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 +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js +36 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.d.ts +4 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +290 -32
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/confirm.d.ts +25 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/confirm.js +36 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/confirm.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js +54 -49
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/kb.js +3 -2
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/kb.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.js +7 -6
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/open.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/open.js +33 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/open.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.d.ts +2 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.js +7 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/vault.js +5 -7
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/vault.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js +2 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/package.json +3 -3
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +2 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +3 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.js +8 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/builder-api.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/identity.d.ts +8 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/identity.js +7 -5
- package/node_modules/@aui.io/apollo-core/dist/src/api/identity.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.d.ts +18 -2
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js +45 -24
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.d.ts +3 -2
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js +4 -2
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/timeouts.d.ts +26 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/timeouts.js +27 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/timeouts.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +19 -9
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/browser.d.ts +12 -0
- package/node_modules/@aui.io/apollo-core/dist/src/browser.js +41 -0
- package/node_modules/@aui.io/apollo-core/dist/src/browser.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.d.ts +35 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js +81 -2
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.d.ts +2 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.js +2 -1
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/patch.d.ts +25 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/patch.js +41 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/patch.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +3 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +7 -0
- package/node_modules/@aui.io/apollo-core/dist/src/errors/index.d.ts +22 -0
- package/node_modules/@aui.io/apollo-core/dist/src/errors/index.js +39 -0
- package/node_modules/@aui.io/apollo-core/dist/src/errors/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +3 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +3 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.d.ts +6 -0
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js +14 -0
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/auth.d.ts +28 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/auth.js +42 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/auth.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +59 -2
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +197 -14
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +6 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clone.js +9 -2
- package/node_modules/@aui.io/apollo-core/dist/src/services/clone.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/content.d.ts +111 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/content.js +220 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/content.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.d.ts +65 -8
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +127 -11
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/playground.d.ts +17 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/playground.js +23 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/playground.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/versions.d.ts +25 -5
- package/node_modules/@aui.io/apollo-core/dist/src/services/versions.js +125 -43
- package/node_modules/@aui.io/apollo-core/dist/src/services/versions.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/node_modules/diff/CONTRIBUTING.md +28 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/LICENSE +29 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/README.md +378 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/dist/diff.js +1674 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/dist/diff.min.js +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/eslint.config.mjs +182 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/convert/dmp.d.ts +8 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/convert/dmp.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/convert/dmp.js +24 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/convert/xml.d.ts +6 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/convert/xml.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/convert/xml.js +34 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/array.d.ts +19 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/array.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/array.js +40 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/base.d.ts +20 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/base.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/base.js +265 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/character.d.ts +19 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/character.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/character.js +31 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/css.d.ts +18 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/css.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/css.js +34 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/json.d.ts +24 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/json.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/json.js +105 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/line.d.ts +24 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/line.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/line.js +89 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/sentence.d.ts +21 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/sentence.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/sentence.js +67 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/word.d.ts +35 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/word.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/diff/word.js +307 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/index.d.ts +20 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/index.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/index.js +61 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/package.json +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/apply.d.ts +62 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/apply.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/apply.js +267 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/create.d.ts +100 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/create.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/create.js +223 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/line-endings.d.ts +17 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/line-endings.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/line-endings.js +61 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/parse.d.ts +8 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/parse.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/parse.js +133 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/reverse.d.ts +9 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/reverse.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/patch/reverse.js +37 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/types.d.ts +213 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/types.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/types.js +2 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/array.d.ts +3 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/array.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/array.js +21 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/distance-iterator.d.ts +2 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/distance-iterator.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/distance-iterator.js +40 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/params.d.ts +4 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/params.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/params.js +17 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/string.d.ts +18 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/string.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libcjs/util/string.js +141 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/convert/dmp.d.ts +8 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/convert/dmp.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/convert/dmp.js +21 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/convert/xml.d.ts +6 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/convert/xml.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/convert/xml.js +31 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/array.d.ts +19 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/array.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/array.js +16 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/base.d.ts +20 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/base.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/base.js +253 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/character.d.ts +19 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/character.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/character.js +7 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/css.d.ts +18 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/css.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/css.js +10 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/json.d.ts +24 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/json.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/json.js +78 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/line.d.ts +24 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/line.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/line.js +65 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/sentence.d.ts +21 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/sentence.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/sentence.js +43 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/word.d.ts +35 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/word.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/diff/word.js +276 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/index.d.ts +20 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/index.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/index.js +30 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/package.json +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/apply.d.ts +62 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/apply.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/apply.js +257 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/create.d.ts +100 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/create.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/create.js +201 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/line-endings.d.ts +17 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/line-endings.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/line-endings.js +44 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/parse.d.ts +8 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/parse.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/parse.js +130 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/reverse.d.ts +9 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/reverse.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/patch/reverse.js +23 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/types.d.ts +213 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/types.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/types.js +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/array.d.ts +3 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/array.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/array.js +17 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/distance-iterator.d.ts +2 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/distance-iterator.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/distance-iterator.js +37 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/params.d.ts +4 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/params.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/params.js +14 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/string.d.ts +18 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/string.d.ts.map +1 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/libesm/util/string.js +128 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/package.json +131 -0
- package/node_modules/@aui.io/apollo-core/node_modules/diff/release-notes.md +397 -0
- package/node_modules/@aui.io/apollo-core/package.json +2 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/data.js +2 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/author/data.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +19 -30
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +5 -5
|
@@ -2,6 +2,8 @@ import type { AgentSettingsClient } from "../api/agent-settings.js";
|
|
|
2
2
|
import type { IdentityClient, Organization } from "../api/identity.js";
|
|
3
3
|
import { type Agent, type AgentVersion, type ManagementClient, type Project } from "../api/management.js";
|
|
4
4
|
import { type Context, type ProjectBinding } from "../config/index.js";
|
|
5
|
+
import { type AvailabilityOptions } from "../runtime-version/availability.js";
|
|
6
|
+
import { type SeededCheckout } from "./bundles.js";
|
|
5
7
|
export declare function listOrganizations(identity: IdentityClient): Promise<Organization[]>;
|
|
6
8
|
export declare function useOrganization(context: Context, identity: IdentityClient, organizationId: string): Promise<{
|
|
7
9
|
token: string;
|
|
@@ -51,14 +53,14 @@ export declare function bindAgent(context: Context, agent: Agent, cwd: string, o
|
|
|
51
53
|
runtimeVersion?: string;
|
|
52
54
|
}): Promise<ProjectBinding>;
|
|
53
55
|
/**
|
|
54
|
-
* The baseline a fresh `agent create` checkout measures against
|
|
55
|
-
*
|
|
56
|
-
* `program.yaml`
|
|
57
|
-
* would make `apollo push` read the checkout as clean and never
|
|
58
|
-
* and `apollo diff` report nothing on a file the server has never
|
|
59
|
-
* rule `pull` already applies on a 404). With no baseline at all,
|
|
60
|
-
* `diff` refused outright on a checkout create had just made (CLI
|
|
61
|
-
* release test, 2026-09-20).
|
|
56
|
+
* The baseline a fresh `agent create` checkout measures against when the
|
|
57
|
+
* seeded draft could not be checked out: EMPTY, under the draft's tag. The
|
|
58
|
+
* starter `program.yaml` create writes then is unpushed work — recording it
|
|
59
|
+
* as synced would make `apollo push` read the checkout as clean and never
|
|
60
|
+
* publish it, and `apollo diff` report nothing on a file the server has never
|
|
61
|
+
* seen (the rule `pull` already applies on a 404). With no baseline at all,
|
|
62
|
+
* `pull` and `diff` refused outright on a checkout create had just made (CLI
|
|
63
|
+
* 0.1.79 release test, 2026-09-20).
|
|
62
64
|
*/
|
|
63
65
|
export declare function seedCheckoutBaseline(homeDir: string, agentId: string, checkoutRoot: string, versionTag: string): Promise<void>;
|
|
64
66
|
/**
|
|
@@ -72,6 +74,61 @@ export declare function seedCheckoutBaseline(homeDir: string, agentId: string, c
|
|
|
72
74
|
* use` recovers.
|
|
73
75
|
*/
|
|
74
76
|
export declare function initialVersionTag(management: ManagementClient, agent: Agent): Promise<string | undefined>;
|
|
77
|
+
/** What `agent create` checked out into its directory. */
|
|
78
|
+
export interface CreatedCheckout {
|
|
79
|
+
binding: ProjectBinding;
|
|
80
|
+
/** The seeded draft, checked out; absent when the starter was written instead. */
|
|
81
|
+
seeded?: SeededCheckout;
|
|
82
|
+
/** The two-line starter `program.yaml` was written. */
|
|
83
|
+
starter?: boolean;
|
|
84
|
+
/** Why the checkout is not the seeded draft, when it is not. */
|
|
85
|
+
note?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The checkout a new agent starts with — one path for the CLI and the TUI
|
|
89
|
+
* (R7). The server seeds the agent's first draft (the template's program and
|
|
90
|
+
* build bundle with `--template`, its bootstrap program without), so the
|
|
91
|
+
* checkout IS that draft: its files, and a baseline recording them, so `diff`
|
|
92
|
+
* starts clean and `pull` works. Nothing already in the directory is replaced
|
|
93
|
+
* (see `seedCheckout`).
|
|
94
|
+
*
|
|
95
|
+
* The agent already exists remotely, so nothing here fails the create — a
|
|
96
|
+
* rerun would make a second agent. A draft with no program (an older server's
|
|
97
|
+
* schema-1 skeleton), or one that cannot be read, falls back to the starter
|
|
98
|
+
* program under an empty baseline, and the note says so. With no draft found
|
|
99
|
+
* at all the checkout stays unbound: `apollo branch use` binds one later.
|
|
100
|
+
*/
|
|
101
|
+
export declare function checkoutCreatedAgent(context: Context, clients: {
|
|
102
|
+
management: ManagementClient;
|
|
103
|
+
agentSettings: AgentSettingsClient;
|
|
104
|
+
}, created: Agent, directory: string, options: {
|
|
105
|
+
runtimeVersion: string;
|
|
106
|
+
homeDir?: string;
|
|
107
|
+
fetch?: typeof globalThis.fetch;
|
|
108
|
+
}): Promise<CreatedCheckout>;
|
|
109
|
+
/** The runtime a new agent starts on, as `runtimeForNewAgent` resolved it. */
|
|
110
|
+
export interface NewAgentRuntime {
|
|
111
|
+
/** The build the agent is created on, and its checkout pins. */
|
|
112
|
+
version: string;
|
|
113
|
+
/** Said when the build is not the one asked for, or could not be checked. */
|
|
114
|
+
note?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The runtime a NEW agent starts on: the one the user chose
|
|
118
|
+
* (`--runtime-version`, APOLLO_RUNTIME_VERSION, or the `.apollorc` of a
|
|
119
|
+
* checkout they stand in), else the newest published build.
|
|
120
|
+
*
|
|
121
|
+
* A chosen runtime is resolved the way `apollo runtime use` resolves it — a
|
|
122
|
+
* family, a label or an older patch lands on its family's current build — and
|
|
123
|
+
* REFUSED before anything is created when the catalog does not offer it or the
|
|
124
|
+
* gateway does not serve it: the agent's first version would be stamped with
|
|
125
|
+
* it, and its checkout could neither validate, push nor chat. A catalog that
|
|
126
|
+
* cannot be read never fails a command: the choice goes through as given, and
|
|
127
|
+
* the note says it was not checked.
|
|
128
|
+
*/
|
|
129
|
+
export declare function runtimeForNewAgent(context: Context, clients: {
|
|
130
|
+
agentSettings: AgentSettingsClient;
|
|
131
|
+
}, options?: AvailabilityOptions): Promise<NewAgentRuntime>;
|
|
75
132
|
/**
|
|
76
133
|
* The engine build a fresh checkout pins — the runtime half of what
|
|
77
134
|
* `initialVersionTag` does for the agent's own version. Create and import
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
1
2
|
import { homedir } from "node:os";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { findLiveVersion, } from "../api/management.js";
|
|
4
5
|
import { writeBaseline } from "../bundle/baseline.js";
|
|
5
6
|
import { patchBinding, setDefaultProject, writeBinding, } from "../config/index.js";
|
|
6
|
-
import { ConfigError } from "../errors/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { CliError, ConfigError, ExitCode } from "../errors/index.js";
|
|
8
|
+
import { checkRuntimeAvailability } from "../runtime-version/availability.js";
|
|
9
|
+
import { matchRuntimeVersion, resolveRuntimeVersion } from "../runtime-version/index.js";
|
|
10
|
+
import { resolveBranch, seedCheckout } from "./bundles.js";
|
|
9
11
|
/**
|
|
10
12
|
* Patch the checkout's existing `.apollorc`. Bindings are never invented in
|
|
11
13
|
* arbitrary directories — outside a checkout, selection goes to the
|
|
@@ -128,14 +130,14 @@ export async function bindAgent(context, agent, cwd, options = {}) {
|
|
|
128
130
|
return binding;
|
|
129
131
|
}
|
|
130
132
|
/**
|
|
131
|
-
* The baseline a fresh `agent create` checkout measures against
|
|
132
|
-
*
|
|
133
|
-
* `program.yaml`
|
|
134
|
-
* would make `apollo push` read the checkout as clean and never
|
|
135
|
-
* and `apollo diff` report nothing on a file the server has never
|
|
136
|
-
* rule `pull` already applies on a 404). With no baseline at all,
|
|
137
|
-
* `diff` refused outright on a checkout create had just made (CLI
|
|
138
|
-
* release test, 2026-09-20).
|
|
133
|
+
* The baseline a fresh `agent create` checkout measures against when the
|
|
134
|
+
* seeded draft could not be checked out: EMPTY, under the draft's tag. The
|
|
135
|
+
* starter `program.yaml` create writes then is unpushed work — recording it
|
|
136
|
+
* as synced would make `apollo push` read the checkout as clean and never
|
|
137
|
+
* publish it, and `apollo diff` report nothing on a file the server has never
|
|
138
|
+
* seen (the rule `pull` already applies on a 404). With no baseline at all,
|
|
139
|
+
* `pull` and `diff` refused outright on a checkout create had just made (CLI
|
|
140
|
+
* 0.1.79 release test, 2026-09-20).
|
|
139
141
|
*/
|
|
140
142
|
export async function seedCheckoutBaseline(homeDir, agentId, checkoutRoot, versionTag) {
|
|
141
143
|
await writeBaseline(homeDir, agentId, checkoutRoot, versionTag, {}, undefined, {});
|
|
@@ -162,6 +164,120 @@ export async function initialVersionTag(management, agent) {
|
|
|
162
164
|
return undefined;
|
|
163
165
|
}
|
|
164
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* The checkout a new agent starts with — one path for the CLI and the TUI
|
|
169
|
+
* (R7). The server seeds the agent's first draft (the template's program and
|
|
170
|
+
* build bundle with `--template`, its bootstrap program without), so the
|
|
171
|
+
* checkout IS that draft: its files, and a baseline recording them, so `diff`
|
|
172
|
+
* starts clean and `pull` works. Nothing already in the directory is replaced
|
|
173
|
+
* (see `seedCheckout`).
|
|
174
|
+
*
|
|
175
|
+
* The agent already exists remotely, so nothing here fails the create — a
|
|
176
|
+
* rerun would make a second agent. A draft with no program (an older server's
|
|
177
|
+
* schema-1 skeleton), or one that cannot be read, falls back to the starter
|
|
178
|
+
* program under an empty baseline, and the note says so. With no draft found
|
|
179
|
+
* at all the checkout stays unbound: `apollo branch use` binds one later.
|
|
180
|
+
*/
|
|
181
|
+
export async function checkoutCreatedAgent(context, clients, created, directory, options) {
|
|
182
|
+
const homeDir = options.homeDir ?? homedir();
|
|
183
|
+
await mkdir(path.join(directory, "bundle", "src"), { recursive: true });
|
|
184
|
+
const tag = await initialVersionTag(clients.management, created);
|
|
185
|
+
const binding = await bindAgent(context, created, directory, {
|
|
186
|
+
...(tag ? { versionTag: tag } : {}),
|
|
187
|
+
runtimeVersion: options.runtimeVersion,
|
|
188
|
+
});
|
|
189
|
+
if (tag === undefined)
|
|
190
|
+
return { binding, starter: await writeStarter(directory, created.name) };
|
|
191
|
+
let note;
|
|
192
|
+
try {
|
|
193
|
+
const seeded = await seedCheckout(context, clients, created.id, directory, tag, {
|
|
194
|
+
homeDir,
|
|
195
|
+
...(options.fetch ? { fetch: options.fetch } : {}),
|
|
196
|
+
});
|
|
197
|
+
if ("program.yaml" in seeded.files)
|
|
198
|
+
return { binding, seeded };
|
|
199
|
+
note = `${tag} holds no program.yaml (an older server seeds none), so a starter one was written.`;
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
note =
|
|
203
|
+
`Could not check out ${tag} (${error instanceof Error ? error.message : String(error)}) — ` +
|
|
204
|
+
`a starter program.yaml was written instead; \`apollo pull --force\` replaces it with ${tag}.`;
|
|
205
|
+
}
|
|
206
|
+
await seedCheckoutBaseline(homeDir, created.id, directory, tag);
|
|
207
|
+
return { binding, starter: await writeStarter(directory, created.name), note };
|
|
208
|
+
}
|
|
209
|
+
/** The two-line starter program, unless the directory already has one. True when it was written. */
|
|
210
|
+
async function writeStarter(directory, name) {
|
|
211
|
+
const id = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "agent";
|
|
212
|
+
try {
|
|
213
|
+
await writeFile(path.join(directory, "bundle", "src", "program.yaml"), `id: ${id}\nversion: 0.1.0\n`, {
|
|
214
|
+
encoding: "utf8",
|
|
215
|
+
flag: "wx",
|
|
216
|
+
});
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
if (error.code === "EEXIST")
|
|
221
|
+
return false;
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The runtime a NEW agent starts on: the one the user chose
|
|
227
|
+
* (`--runtime-version`, APOLLO_RUNTIME_VERSION, or the `.apollorc` of a
|
|
228
|
+
* checkout they stand in), else the newest published build.
|
|
229
|
+
*
|
|
230
|
+
* A chosen runtime is resolved the way `apollo runtime use` resolves it — a
|
|
231
|
+
* family, a label or an older patch lands on its family's current build — and
|
|
232
|
+
* REFUSED before anything is created when the catalog does not offer it or the
|
|
233
|
+
* gateway does not serve it: the agent's first version would be stamped with
|
|
234
|
+
* it, and its checkout could neither validate, push nor chat. A catalog that
|
|
235
|
+
* cannot be read never fails a command: the choice goes through as given, and
|
|
236
|
+
* the note says it was not checked.
|
|
237
|
+
*/
|
|
238
|
+
export async function runtimeForNewAgent(context, clients, options = {}) {
|
|
239
|
+
const requested = context.runtimeVersion?.trim();
|
|
240
|
+
const catalog = await resolveRuntimeVersion(clients.agentSettings);
|
|
241
|
+
if (!requested) {
|
|
242
|
+
if (!catalog.version) {
|
|
243
|
+
throw new ConfigError("No published runtime version is available to create the agent on.", "Check `apollo runtime list` and try again.");
|
|
244
|
+
}
|
|
245
|
+
return { version: catalog.version };
|
|
246
|
+
}
|
|
247
|
+
if (catalog.error !== undefined) {
|
|
248
|
+
return {
|
|
249
|
+
version: requested,
|
|
250
|
+
note: `The runtime catalog could not be read (${catalog.error}), so runtime ${requested} was used unchecked.`,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
// One way out for both refusals: the newest published build, or the list.
|
|
254
|
+
const instead = `${catalog.version
|
|
255
|
+
? `Leave --runtime-version out to create on ${catalog.version}, the newest published build`
|
|
256
|
+
: "Pick a runtime"}; \`apollo runtime list\` shows what is offered.`;
|
|
257
|
+
const match = matchRuntimeVersion(catalog.options, requested);
|
|
258
|
+
if (!match) {
|
|
259
|
+
throw new ConfigError(`Runtime ${requested} is not offered, so no agent was created.`, instead);
|
|
260
|
+
}
|
|
261
|
+
const version = match.latest_version;
|
|
262
|
+
const check = await checkRuntimeAvailability({ ...context, runtimeVersion: version }, clients, {
|
|
263
|
+
...options,
|
|
264
|
+
withoutCatalog: "probe",
|
|
265
|
+
});
|
|
266
|
+
if (check !== undefined && !check.available) {
|
|
267
|
+
const shown = match.display_name && match.display_name !== version ? `${version} (${match.display_name})` : version;
|
|
268
|
+
throw new CliError(`Runtime ${shown} is not served${check.engine ? ` — the gateway runs engine ${check.engine} for it` : ""}, so no agent was created on it.`, {
|
|
269
|
+
code: "RUNTIME_UNAVAILABLE",
|
|
270
|
+
exitCode: ExitCode.runtime,
|
|
271
|
+
suggestion: instead,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
version,
|
|
276
|
+
...(version === requested
|
|
277
|
+
? {}
|
|
278
|
+
: { note: `Runtime ${requested} resolves to ${version} (${match.display_name}), its current build — the agent starts on that.` }),
|
|
279
|
+
};
|
|
280
|
+
}
|
|
165
281
|
/**
|
|
166
282
|
* The engine build a fresh checkout pins — the runtime half of what
|
|
167
283
|
* `initialVersionTag` does for the agent's own version. Create and import
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hierarchy.js","sourceRoot":"","sources":["../../../src/services/hierarchy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EACL,eAAe,GAKhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,KAAK,UAAU,aAAa,CAC1B,OAAgB,EAChB,KAA8B;IAE9B,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,WAAW,CAAC,+CAA+C,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE;QACvC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,E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AC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,MAAM,IAAI,WAAW,CAAC,kCAAkC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAC1G,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;IACnE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAgB;IAChD,OAAO,aAAa,CAAC,OAAO,EAAE;QAC5B,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,SAAS;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Context } from "../config/index.js";
|
|
2
|
+
export interface PlaygroundTarget {
|
|
3
|
+
/** The branch to select (`id`) and the commit on it (`tag`). */
|
|
4
|
+
version?: {
|
|
5
|
+
id: string;
|
|
6
|
+
tag: string;
|
|
7
|
+
};
|
|
8
|
+
/** A conversation to open. */
|
|
9
|
+
threadId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The Playground link for this context, in the parameters its own share links
|
|
13
|
+
* carry (next-playground `controllers/bootstrap.ts`): `org` and `account` (the
|
|
14
|
+
* project) restore the workspace first, then `agent`, `version` — the
|
|
15
|
+
* selection key `<version id>@<commit tag>` — and `task`, a thread.
|
|
16
|
+
*/
|
|
17
|
+
export declare function playgroundLink(context: Pick<Context, "environment" | "orgId" | "projectId" | "agentId">, target?: PlaygroundTarget): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { environmentDefinition } from "../config/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The Playground link for this context, in the parameters its own share links
|
|
4
|
+
* carry (next-playground `controllers/bootstrap.ts`): `org` and `account` (the
|
|
5
|
+
* project) restore the workspace first, then `agent`, `version` — the
|
|
6
|
+
* selection key `<version id>@<commit tag>` — and `task`, a thread.
|
|
7
|
+
*/
|
|
8
|
+
export function playgroundLink(context, target = {}) {
|
|
9
|
+
const url = new URL("/", environmentDefinition(context.environment).playgroundUrl);
|
|
10
|
+
const params = url.searchParams;
|
|
11
|
+
if (context.orgId)
|
|
12
|
+
params.set("org", context.orgId);
|
|
13
|
+
if (context.projectId)
|
|
14
|
+
params.set("account", context.projectId);
|
|
15
|
+
if (context.agentId)
|
|
16
|
+
params.set("agent", context.agentId);
|
|
17
|
+
if (target.version)
|
|
18
|
+
params.set("version", `${target.version.id}@${target.version.tag}`);
|
|
19
|
+
if (target.threadId)
|
|
20
|
+
params.set("task", target.threadId);
|
|
21
|
+
return url.toString();
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=playground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playground.js","sourceRoot":"","sources":["../../../src/services/playground.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAgB,MAAM,oBAAoB,CAAC;AASzE;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAyE,EACzE,SAA2B,EAAE;IAE7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,qBAAqB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,CAAC;IACnF,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC;IAChC,IAAI,OAAO,CAAC,KAAK;QAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,OAAO,CAAC,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChE,IAAI,OAAO,CAAC,OAAO;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,OAAO;QAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACxF,IAAI,MAAM,CAAC,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { BuilderApiClient, MergeTreesResult } from "../api/builder-api.js";
|
|
15
15
|
import type { AgentVersion, ManagementClient } from "../api/management.js";
|
|
16
|
-
import { type FileDiff } from "../bundle/baseline.js";
|
|
17
16
|
import { type Relation } from "../bundle/lineage.js";
|
|
17
|
+
import { type ContentDiff } from "../bundle/patch.js";
|
|
18
18
|
import type { Context } from "../config/index.js";
|
|
19
19
|
/** `<checkout>/bundle/tmp/versions` — fetched copies live here, one
|
|
20
20
|
* directory per tag. `bundle/tmp` is scratch: no push carries it. */
|
|
@@ -40,14 +40,13 @@ export declare function fetchVersion(context: Context, management: ManagementCli
|
|
|
40
40
|
root?: string;
|
|
41
41
|
homeDir?: string;
|
|
42
42
|
}): Promise<FetchedVersion>;
|
|
43
|
-
/** `bundle/src
|
|
44
|
-
*
|
|
45
|
-
* bundle/src bundle/tmp/versions/<tag>` — the copy is on disk for that. */
|
|
43
|
+
/** A fetched version → `bundle/src/`, by path and by line, the same dialect
|
|
44
|
+
* as `apollo diff`. The copy stays on disk under `bundle/tmp/versions/<tag>`. */
|
|
46
45
|
export declare function diffAgainst(context: Context, management: ManagementClient, ref: string, options?: {
|
|
47
46
|
root?: string;
|
|
48
47
|
homeDir?: string;
|
|
49
48
|
}): Promise<{
|
|
50
|
-
diff:
|
|
49
|
+
diff: ContentDiff;
|
|
51
50
|
fetched: FetchedVersion;
|
|
52
51
|
}>;
|
|
53
52
|
export interface MergeFromResult {
|
|
@@ -84,5 +83,26 @@ export declare function mergeFrom(context: Context, clients: {
|
|
|
84
83
|
root?: string;
|
|
85
84
|
homeDir?: string;
|
|
86
85
|
}): Promise<MergeFromResult>;
|
|
86
|
+
export interface AbortedMerge {
|
|
87
|
+
/** The commit whose merge was undone. */
|
|
88
|
+
ref: string;
|
|
89
|
+
/** Put back to their text before the merge. */
|
|
90
|
+
restored: string[];
|
|
91
|
+
/** Created by the merge, deleted again. */
|
|
92
|
+
removed: string[];
|
|
93
|
+
/** The base the checkout is back on, when the merge had moved it. */
|
|
94
|
+
baselineRestored?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Undo the last `merge-from` (A2): every file it touched goes back to its
|
|
98
|
+
* text before, a file it created is deleted, and a base it moved moves back.
|
|
99
|
+
* Refused when a touched file changed since — unless `force` — and when the
|
|
100
|
+
* checkout was pushed or pulled since, which made the merge part of its base.
|
|
101
|
+
*/
|
|
102
|
+
export declare function abortMerge(context: Context, options?: {
|
|
103
|
+
force?: boolean;
|
|
104
|
+
root?: string;
|
|
105
|
+
homeDir?: string;
|
|
106
|
+
}): Promise<AbortedMerge>;
|
|
87
107
|
/** One neutral report of a merge — what came in, what needs a decision. */
|
|
88
108
|
export declare function describeMerge(merged: MergeFromResult): string;
|
|
@@ -11,14 +11,17 @@
|
|
|
11
11
|
* the registry's lineage), writing the merged results — a disputed region
|
|
12
12
|
* keeps the author's own text — with the decision spelled out.
|
|
13
13
|
*/
|
|
14
|
-
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
14
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
15
15
|
import { homedir } from "node:os";
|
|
16
16
|
import path from "node:path";
|
|
17
|
-
import {
|
|
17
|
+
import { captureBaseline, readBaseline, restoreBaseline, writeBaseline, } from "../bundle/baseline.js";
|
|
18
18
|
import { hashFiles, readProgramFiles } from "../bundle/files.js";
|
|
19
19
|
import { commonBase, tagParts } from "../bundle/lineage.js";
|
|
20
|
-
import {
|
|
20
|
+
import { resolveInside, writeBundleFiles } from "../bundle/materialize.js";
|
|
21
|
+
import { contentDiff } from "../bundle/patch.js";
|
|
22
|
+
import { ConfigError } from "../errors/index.js";
|
|
21
23
|
import { agentRoot, baselineCheckout, bundleSourceRoot, requireAgent, updateTag } from "./bundles.js";
|
|
24
|
+
import { readCommit } from "./content.js";
|
|
22
25
|
/** `<checkout>/bundle/tmp/versions` — fetched copies live here, one
|
|
23
26
|
* directory per tag. `bundle/tmp` is scratch: no push carries it. */
|
|
24
27
|
export function tmpVersionsRoot(context, root = agentRoot(context)) {
|
|
@@ -31,9 +34,7 @@ export function tmpVersionsRoot(context, root = agentRoot(context)) {
|
|
|
31
34
|
*/
|
|
32
35
|
export async function fetchVersion(context, management, ref, options = {}) {
|
|
33
36
|
const agentId = requireAgent(context);
|
|
34
|
-
const { version, tag } = await
|
|
35
|
-
const pull = await management.pullVersion(agentId, version.id, tag);
|
|
36
|
-
const files = bundleFiles(pull.bundle);
|
|
37
|
+
const { version, tag, files } = await readCommit(context, management, ref);
|
|
37
38
|
const dir = path.join(tmpVersionsRoot(context, options.root), tag);
|
|
38
39
|
await writeBundleFiles(dir, files);
|
|
39
40
|
const placed = await placeVersion(context, management, agentId, version, tag, options.homeDir, options.root);
|
|
@@ -67,13 +68,12 @@ async function placeVersion(context, management, agentId, version, tag, homeDir
|
|
|
67
68
|
const placed = commonBase({ ...ours, tag: mine }, { number: version.version_number, tag, parentTag: version.parent_version_tag ?? null }, lines);
|
|
68
69
|
return placed.base === undefined ? { relation: placed.relation } : placed;
|
|
69
70
|
}
|
|
70
|
-
/** `bundle/src
|
|
71
|
-
*
|
|
72
|
-
* bundle/src bundle/tmp/versions/<tag>` — the copy is on disk for that. */
|
|
71
|
+
/** A fetched version → `bundle/src/`, by path and by line, the same dialect
|
|
72
|
+
* as `apollo diff`. The copy stays on disk under `bundle/tmp/versions/<tag>`. */
|
|
73
73
|
export async function diffAgainst(context, management, ref, options = {}) {
|
|
74
74
|
const fetched = await fetchVersion(context, management, ref, options);
|
|
75
75
|
const current = await readProgramFiles(bundleSourceRoot(context, options.root));
|
|
76
|
-
return { diff:
|
|
76
|
+
return { diff: contentDiff(fetched.files, current.files), fetched };
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Bring `ref`'s changes into `bundle/src/`. Three-way over the save both
|
|
@@ -102,40 +102,62 @@ export async function mergeFrom(context, clients, ref, options = {}) {
|
|
|
102
102
|
...(base === undefined ? {} : { base }),
|
|
103
103
|
...(options.only && options.only.length > 0 ? { paths: options.only } : {}),
|
|
104
104
|
});
|
|
105
|
-
const written = [];
|
|
106
|
-
if (!options.dryRun) {
|
|
107
|
-
for (const relativePath of Object.keys(result.taken).sort()) {
|
|
108
|
-
const target = insideRoot(sourceRoot, relativePath);
|
|
109
|
-
const content = result.files[relativePath];
|
|
110
|
-
if (content === undefined) {
|
|
111
|
-
if (!(relativePath in current.files))
|
|
112
|
-
continue;
|
|
113
|
-
await rm(target, { force: true });
|
|
114
|
-
written.push(`D ${relativePath}`);
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
if (current.files[relativePath] === content)
|
|
118
|
-
continue;
|
|
119
|
-
await mkdir(path.dirname(target), { recursive: true });
|
|
120
|
-
await writeFile(target, content, "utf8");
|
|
121
|
-
written.push(`${relativePath in current.files ? "M" : "A"} ${relativePath}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
105
|
const resolved = options.resolved === true;
|
|
125
106
|
const narrowed = options.only !== undefined && options.only.length > 0;
|
|
126
107
|
const checkoutRoot = options.root ?? agentRoot(context);
|
|
108
|
+
const checkout = baselineCheckout(context, checkoutRoot);
|
|
127
109
|
const mine = fetched.relation === "same-line" && !narrowed ? await ownTag(context, agentId, homeDir, checkoutRoot) : undefined;
|
|
128
110
|
const newerOwnSave = mine ? tagParts(fetched.tag)[1] > tagParts(mine)[1] : false;
|
|
129
111
|
const decided = result.clean || resolved;
|
|
112
|
+
// A newer save of the checkout's own line, all of it in and decided: the
|
|
113
|
+
// tree now includes it, so the next push is based on it — the baseline and
|
|
114
|
+
// the binding move up.
|
|
115
|
+
const advances = !options.dryRun && newerOwnSave && decided;
|
|
116
|
+
const changes = [];
|
|
117
|
+
for (const relativePath of Object.keys(result.taken).sort()) {
|
|
118
|
+
const content = result.files[relativePath];
|
|
119
|
+
if (content === undefined) {
|
|
120
|
+
if (relativePath in current.files)
|
|
121
|
+
changes.push({ relativePath, content, row: `D ${relativePath}` });
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (current.files[relativePath] === content)
|
|
125
|
+
continue;
|
|
126
|
+
changes.push({ relativePath, content, row: `${relativePath in current.files ? "M" : "A"} ${relativePath}` });
|
|
127
|
+
}
|
|
128
|
+
const written = [];
|
|
130
129
|
let baselineAdvanced;
|
|
131
|
-
if (!options.dryRun
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
if (!options.dryRun) {
|
|
131
|
+
// The undo is on disk before the first file changes (A2): every file the
|
|
132
|
+
// merge touches as it was, and — when the base moves — the base too.
|
|
133
|
+
const before = await captureBaseline(homeDir, agentId, checkout);
|
|
134
|
+
await writeMergeSnapshot(checkoutRoot, {
|
|
135
|
+
ref: fetched.tag,
|
|
136
|
+
at: new Date().toISOString(),
|
|
137
|
+
base: advances ? fetched.tag : (before?.baseline.versionTag ?? null),
|
|
138
|
+
files: Object.fromEntries(changes.map(({ relativePath, content }) => [
|
|
139
|
+
relativePath,
|
|
140
|
+
{ before: current.files[relativePath] ?? null, after: content === undefined ? null : sha256(content) },
|
|
141
|
+
])),
|
|
142
|
+
...(advances && before ? { baseline: before } : {}),
|
|
143
|
+
...(advances && context.versionTag ? { bindingTag: context.versionTag } : {}),
|
|
144
|
+
});
|
|
145
|
+
for (const change of changes) {
|
|
146
|
+
const target = resolveInside(path.resolve(sourceRoot), change.relativePath);
|
|
147
|
+
if (change.content === undefined) {
|
|
148
|
+
await rm(target, { force: true });
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
152
|
+
await writeFile(target, change.content, "utf8");
|
|
153
|
+
}
|
|
154
|
+
written.push(change.row);
|
|
155
|
+
}
|
|
156
|
+
if (advances) {
|
|
157
|
+
await writeBaseline(homeDir, agentId, checkoutRoot, fetched.tag, fetched.files, undefined, before?.baseline.buildHashes ?? {});
|
|
158
|
+
await updateTag(context, fetched.tag);
|
|
159
|
+
baselineAdvanced = fetched.tag;
|
|
160
|
+
}
|
|
139
161
|
}
|
|
140
162
|
return {
|
|
141
163
|
fetched,
|
|
@@ -147,13 +169,73 @@ export async function mergeFrom(context, clients, ref, options = {}) {
|
|
|
147
169
|
...(baselineAdvanced ? { baselineAdvanced } : {}),
|
|
148
170
|
};
|
|
149
171
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
172
|
+
function mergeSnapshotPath(checkoutRoot) {
|
|
173
|
+
return path.join(checkoutRoot, "bundle", "tmp", "merge-backup.json");
|
|
174
|
+
}
|
|
175
|
+
async function writeMergeSnapshot(checkoutRoot, snapshot) {
|
|
176
|
+
const file = mergeSnapshotPath(checkoutRoot);
|
|
177
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
178
|
+
await writeFile(file, `${JSON.stringify(snapshot)}\n`, { encoding: "utf8", mode: 0o600 });
|
|
179
|
+
}
|
|
180
|
+
function sha256(text) {
|
|
181
|
+
return hashFiles({ text }).text ?? "";
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Undo the last `merge-from` (A2): every file it touched goes back to its
|
|
185
|
+
* text before, a file it created is deleted, and a base it moved moves back.
|
|
186
|
+
* Refused when a touched file changed since — unless `force` — and when the
|
|
187
|
+
* checkout was pushed or pulled since, which made the merge part of its base.
|
|
188
|
+
*/
|
|
189
|
+
export async function abortMerge(context, options = {}) {
|
|
190
|
+
const agentId = requireAgent(context);
|
|
191
|
+
const homeDir = options.homeDir ?? homedir();
|
|
192
|
+
const checkoutRoot = options.root ?? agentRoot(context);
|
|
193
|
+
const sourceRoot = bundleSourceRoot(context, options.root);
|
|
194
|
+
let snapshot;
|
|
195
|
+
try {
|
|
196
|
+
snapshot = JSON.parse(await readFile(mergeSnapshotPath(checkoutRoot), "utf8"));
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
if (error.code !== "ENOENT")
|
|
200
|
+
throw error;
|
|
201
|
+
throw new ConfigError("There is no merge to abort.", "`apollo merge-from` keeps an undo for its last merge; `apollo restore <file>` puts single files back.");
|
|
155
202
|
}
|
|
156
|
-
|
|
203
|
+
const base = (await readBaseline(homeDir, agentId, baselineCheckout(context, checkoutRoot)))?.versionTag ?? null;
|
|
204
|
+
if (base !== snapshot.base) {
|
|
205
|
+
throw new ConfigError(`The checkout moved from ${snapshot.base ?? "no base"} to ${base ?? "no base"} since ${snapshot.ref} was merged (a push or a pull) — the merge is part of it now.`, "`apollo restore <file> --source <commit>` takes single files back instead.");
|
|
206
|
+
}
|
|
207
|
+
const hashes = hashFiles((await readProgramFiles(sourceRoot)).files);
|
|
208
|
+
const edited = Object.entries(snapshot.files)
|
|
209
|
+
.filter(([relativePath, { after }]) => (hashes[relativePath] ?? null) !== after)
|
|
210
|
+
.map(([relativePath]) => relativePath);
|
|
211
|
+
if (edited.length > 0 && options.force !== true) {
|
|
212
|
+
throw new ConfigError(`Changed since the merge of ${snapshot.ref}: ${edited.join(", ")}.`, "`apollo merge-from --abort --force` puts them back anyway, and those edits are lost.");
|
|
213
|
+
}
|
|
214
|
+
const restored = [];
|
|
215
|
+
const removed = [];
|
|
216
|
+
for (const [relativePath, { before }] of Object.entries(snapshot.files).sort(([a], [b]) => a.localeCompare(b))) {
|
|
217
|
+
const target = resolveInside(path.resolve(sourceRoot), relativePath);
|
|
218
|
+
if (before === null) {
|
|
219
|
+
await rm(target, { force: true });
|
|
220
|
+
removed.push(relativePath);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
224
|
+
await writeFile(target, before, "utf8");
|
|
225
|
+
restored.push(relativePath);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (snapshot.baseline)
|
|
229
|
+
await restoreBaseline(homeDir, agentId, snapshot.baseline);
|
|
230
|
+
if (snapshot.bindingTag)
|
|
231
|
+
await updateTag(context, snapshot.bindingTag);
|
|
232
|
+
await rm(mergeSnapshotPath(checkoutRoot), { force: true });
|
|
233
|
+
return {
|
|
234
|
+
ref: snapshot.ref,
|
|
235
|
+
restored,
|
|
236
|
+
removed,
|
|
237
|
+
...(snapshot.baseline ? { baselineRestored: snapshot.baseline.baseline.versionTag } : {}),
|
|
238
|
+
};
|
|
157
239
|
}
|
|
158
240
|
/** One neutral report of a merge — what came in, what needs a decision. */
|
|
159
241
|
export function describeMerge(merged) {
|