@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { browserLogin } from "../api/identity.js";
|
|
3
3
|
import { readCredentials, readUserConfig, writeCredentials, writeUserConfig, } from "../config/index.js";
|
|
4
|
-
import { AuthError } from "../errors/index.js";
|
|
4
|
+
import { AuthError, ConfigError } from "../errors/index.js";
|
|
5
5
|
function claims(token) {
|
|
6
6
|
try {
|
|
7
7
|
const payload = token.split(".")[1];
|
|
@@ -80,4 +80,45 @@ export async function logout(context, homeDir = homedir()) {
|
|
|
80
80
|
}
|
|
81
81
|
await writeCredentials(homeDir, all);
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* A run on APOLLO_TOKEN has no saved session of its own: the saved login for
|
|
85
|
+
* this profile is another identity as far as this run is concerned, so a token
|
|
86
|
+
* this run is handed (an organization switch) is never written over it (S7).
|
|
87
|
+
*/
|
|
88
|
+
export function assertSavedSession(context, act) {
|
|
89
|
+
if (context.tokenSource !== "env")
|
|
90
|
+
return;
|
|
91
|
+
throw new ConfigError(`APOLLO_TOKEN is set, so ${act} has no saved session to change.`, "Unset APOLLO_TOKEN to change your saved login, or set APOLLO_TOKEN to a token for the organization you want.");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Who this run acts as — answered by identity, not read off the token. The
|
|
95
|
+
* one call refreshes a saved login the way every command does (or refuses an
|
|
96
|
+
* APOLLO_TOKEN the server no longer takes), so a session that answers here is
|
|
97
|
+
* one the next command can use.
|
|
98
|
+
*/
|
|
99
|
+
export async function whoami(context, identity, homeDir = homedir()) {
|
|
100
|
+
if (context.token === undefined) {
|
|
101
|
+
throw new AuthError(`Not logged in to ${context.environment} (profile "${context.profile}").`, "Run `apollo login`, or set APOLLO_TOKEN.");
|
|
102
|
+
}
|
|
103
|
+
const user = await identity.me();
|
|
104
|
+
const source = context.tokenSource ?? "credentials";
|
|
105
|
+
// A refresh during the call above rewrote the saved login: read it back, so
|
|
106
|
+
// the expiry shown is the one in use now.
|
|
107
|
+
const saved = source === "credentials"
|
|
108
|
+
? (await readCredentials(homeDir))[context.profile]?.[context.environment]
|
|
109
|
+
: undefined;
|
|
110
|
+
const token = claims(saved?.access_token ?? context.token);
|
|
111
|
+
return {
|
|
112
|
+
environment: context.environment,
|
|
113
|
+
profile: context.profile,
|
|
114
|
+
user_id: user._id ?? user.id ?? context.userId ?? null,
|
|
115
|
+
email: user.email ?? token.email ?? null,
|
|
116
|
+
organization_id: context.orgId ?? token.organizationId ?? null,
|
|
117
|
+
token_organization_id: token.organizationId ?? null,
|
|
118
|
+
project_id: context.projectId ?? null,
|
|
119
|
+
token_source: source,
|
|
120
|
+
expires_at: token.exp ? new Date(token.exp * 1_000).toISOString() : null,
|
|
121
|
+
refreshable: saved?.refresh_token !== undefined,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
83
124
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/services/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,YAAY,EAAyC,MAAM,oBAAoB,CAAC;AACzF,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,GAGhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/services/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,YAAY,EAAyC,MAAM,oBAAoB,CAAC;AACzF,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,GAGhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA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,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI;QACtD,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI;QACxC,eAAe,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,cAAc,IAAI,IAAI;QAC9D,qBAAqB,EAAE,KAAK,CAAC,cAAc,IAAI,IAAI;QACnD,UAAU,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;QACrC,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;QACxE,WAAW,EAAE,KAAK,EAAE,aAAa,KAAK,SAAS;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { type AgentVersion, type ManagementClient, type VersionPull, type Versio
|
|
|
3
3
|
import type { BuilderApiClient, BundleAudit, BundleFix, Certificate, EraCensus, OrphanCensus } from "../api/builder-api.js";
|
|
4
4
|
import type { RuntimeApiClient } from "../api/runtime-api.js";
|
|
5
5
|
import { type BaselineCheckout, type FileDiff } from "../bundle/baseline.js";
|
|
6
|
+
import { type ContentDiff } from "../bundle/patch.js";
|
|
6
7
|
import { type ValidationResult } from "../bundle/validate.js";
|
|
7
8
|
import { type Context, type ProjectBinding } from "../config/index.js";
|
|
8
9
|
import { type SkillTarget } from "../skills/install.js";
|
|
@@ -62,6 +63,8 @@ export declare function pullBundle(context: Context, clients: {
|
|
|
62
63
|
live?: string;
|
|
63
64
|
/** Secret files the pulled commit still carries on the server — never written. */
|
|
64
65
|
serverSecretFiles?: string[];
|
|
66
|
+
/** The engine build the pulled branch's newest commit was pushed for. */
|
|
67
|
+
recordedRuntime?: string;
|
|
65
68
|
}>;
|
|
66
69
|
export declare function importBundle(context: Context, clients: {
|
|
67
70
|
management: ManagementClient;
|
|
@@ -69,8 +72,12 @@ export declare function importBundle(context: Context, clients: {
|
|
|
69
72
|
}, agentId: string, destination: string, options?: {
|
|
70
73
|
tag?: string;
|
|
71
74
|
homeDir?: string;
|
|
72
|
-
/** The engine build to pin the new checkout to (see `runtime-version/`)
|
|
75
|
+
/** The engine build to pin the new checkout to (see `runtime-version/`):
|
|
76
|
+
* the fallback when the imported branch records none. */
|
|
73
77
|
runtimeVersion?: string;
|
|
78
|
+
/** `runtimeVersion` came from --runtime-version / APOLLO_RUNTIME_VERSION:
|
|
79
|
+
* it wins over the branch's own record. */
|
|
80
|
+
runtimeVersionExplicit?: boolean;
|
|
74
81
|
/** Injected for tests; used for the signed-URL build-file downloads. */
|
|
75
82
|
fetch?: typeof globalThis.fetch;
|
|
76
83
|
}): Promise<{
|
|
@@ -84,6 +91,36 @@ export declare function importBundle(context: Context, clients: {
|
|
|
84
91
|
/** Secret files the imported commit still carries on the server — never written. */
|
|
85
92
|
serverSecretFiles?: string[];
|
|
86
93
|
}>;
|
|
94
|
+
/** What `seedCheckout` put into a new agent's directory. */
|
|
95
|
+
export interface SeededCheckout {
|
|
96
|
+
/** The commit checked out. */
|
|
97
|
+
tag: string;
|
|
98
|
+
/** The commit's program files (secret files left out) — what the baseline records. */
|
|
99
|
+
files: Record<string, string>;
|
|
100
|
+
/** Program files written from the commit. */
|
|
101
|
+
written: string[];
|
|
102
|
+
/** Files the directory already held, left as they were: they read as changes against the commit. */
|
|
103
|
+
kept: string[];
|
|
104
|
+
/** Written only into an empty build area. */
|
|
105
|
+
build?: BuildAreaSync;
|
|
106
|
+
/** Secret files the commit still carries on the server — never written. */
|
|
107
|
+
serverSecretFiles?: string[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Check one commit out into the directory of an agent just created, with a
|
|
111
|
+
* baseline that records it — WITHOUT replacing anything the directory already
|
|
112
|
+
* holds: `agent create --dir` may name a folder with a program in it, so a
|
|
113
|
+
* file already there is kept and reads as a change against the commit, and
|
|
114
|
+
* nothing is removed. The build area is written only when it is empty; the
|
|
115
|
+
* baseline records the commit's build bundle either way.
|
|
116
|
+
*/
|
|
117
|
+
export declare function seedCheckout(context: Context, clients: {
|
|
118
|
+
management: ManagementClient;
|
|
119
|
+
agentSettings: AgentSettingsClient;
|
|
120
|
+
}, agentId: string, directory: string, tag: string, options?: {
|
|
121
|
+
homeDir?: string;
|
|
122
|
+
fetch?: typeof globalThis.fetch;
|
|
123
|
+
}): Promise<SeededCheckout>;
|
|
87
124
|
/** Skill packs a checkout gets unless the caller narrows or disables them. */
|
|
88
125
|
export declare const DEFAULT_SKILL_TARGETS: SkillTarget[];
|
|
89
126
|
/**
|
|
@@ -143,6 +180,8 @@ export interface PullCheckoutResult {
|
|
|
143
180
|
removed: string[];
|
|
144
181
|
/** Secret files the pulled commit still carries on the server — never written. */
|
|
145
182
|
serverSecretFiles?: string[];
|
|
183
|
+
/** The engine build the pulled branch's newest commit was pushed for. */
|
|
184
|
+
recordedRuntime?: string;
|
|
146
185
|
/** The build area sync, when the agent has a build bundle. */
|
|
147
186
|
build?: BuildAreaSync;
|
|
148
187
|
/** The commit customers get, when the pull followed `live` to its branch. */
|
|
@@ -195,7 +234,7 @@ export declare function localDiff(context: Context, root?: string, homeDir?: str
|
|
|
195
234
|
* hashes, so a remote build diff would download the whole bundle to say
|
|
196
235
|
* anything. `apollo pull` (whose dirty guard covers the area) is the
|
|
197
236
|
* honest tool there. */
|
|
198
|
-
export declare function remoteDiff(context: Context, management: ManagementClient, root?: string): Promise<
|
|
237
|
+
export declare function remoteDiff(context: Context, management: ManagementClient, root?: string): Promise<ContentDiff>;
|
|
199
238
|
/** Named for symmetry with `PullCheckoutResult`. */
|
|
200
239
|
export interface PushCheckoutResult {
|
|
201
240
|
/** The program lane (`bundle/src/**` vs the baseline). */
|
|
@@ -203,6 +242,8 @@ export interface PushCheckoutResult {
|
|
|
203
242
|
/** The build lane (`bundle/build/**` vs the baseline), bare relative paths. */
|
|
204
243
|
buildDiff: FileDiff;
|
|
205
244
|
push?: VersionPush;
|
|
245
|
+
/** The push's answer was lost, and its commit was confirmed on the branch. */
|
|
246
|
+
recovered?: boolean;
|
|
206
247
|
/** The commit customers still get, when the push landed on the branch it is on. */
|
|
207
248
|
live?: string;
|
|
208
249
|
/** The branch this push started, which the checkout now works on; `closed` is the bound branch when it took no commits. */
|
|
@@ -243,6 +284,16 @@ export interface PushCheckoutResult {
|
|
|
243
284
|
* formed and consistent. Every error here refused the push; warnings ride.
|
|
244
285
|
*/
|
|
245
286
|
bundle?: BundleAudit;
|
|
287
|
+
/**
|
|
288
|
+
* `--restamp` on an unchanged program: the runtime the branch recorded
|
|
289
|
+
* (`from`, null when none) and the pin it records now (`to`). `pushed` is
|
|
290
|
+
* false when the branch already recorded the pin, or on a dry run.
|
|
291
|
+
*/
|
|
292
|
+
restamp?: {
|
|
293
|
+
from: string | null;
|
|
294
|
+
to: string;
|
|
295
|
+
pushed: boolean;
|
|
296
|
+
};
|
|
246
297
|
}
|
|
247
298
|
/**
|
|
248
299
|
* Publish the checkout, both lanes: a changed program becomes a new agent
|
|
@@ -272,6 +323,12 @@ export declare function pushBundle(context: Context, clients: {
|
|
|
272
323
|
* based on — the second way out when the version moved (or any time
|
|
273
324
|
* the author wants a line of their own). A string names it. */
|
|
274
325
|
newVersion?: string | boolean;
|
|
326
|
+
/** Push even when that moves the branch to an older runtime family, or
|
|
327
|
+
* strips its runtime stamp (R6). */
|
|
328
|
+
allowRuntimeDowngrade?: boolean;
|
|
329
|
+
/** Commit the program even when it did not change, so the branch records
|
|
330
|
+
* this checkout's runtime pin (A6). */
|
|
331
|
+
restamp?: boolean;
|
|
275
332
|
}): Promise<PushCheckoutResult>;
|
|
276
333
|
export declare function validateProgramBundle(runtime: RuntimeApiClient, files: Record<string, string>,
|
|
277
334
|
/** The agent whose vault resolves the connections' secret names. */
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import { mkdir, unlink, writeFile } from "node:fs/promises";
|
|
2
3
|
import { homedir } from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import YAML from "yaml";
|
|
5
6
|
import { branchName, continuedName, findLiveVersion, isLiveRef, liveCommitTag, parseVersionTag, } from "../api/management.js";
|
|
7
|
+
import { downloadBytes } from "../api/download.js";
|
|
8
|
+
import { DOWNLOAD_CONCURRENCY } from "../api/timeouts.js";
|
|
6
9
|
import { diffHashes, diffHashMaps, isClean, readBaseline, writeBaseline, } from "../bundle/baseline.js";
|
|
7
10
|
import { CERTIFICATION_FILE, hashBuildFiles, readBuildFiles, writeBuildFiles, } from "../bundle/build-area.js";
|
|
8
11
|
import { hashFiles, readProgramFiles } from "../bundle/files.js";
|
|
9
|
-
import {
|
|
12
|
+
import { contentDiff } from "../bundle/patch.js";
|
|
13
|
+
import { assembleFlatBundle, bundleFileLayout, bundleFiles, bundleSecretFiles, resolveInside, withoutSecretBundleFiles, writeBundleFiles, } from "../bundle/materialize.js";
|
|
10
14
|
import { assertPushableBundle, assertValidProgram, mapRuntimeValidation, } from "../bundle/validate.js";
|
|
11
15
|
import { patchBinding, requireUserId, writeBinding, } from "../config/index.js";
|
|
12
|
-
import { ApiError, CliError, ConfigError, NotABranchError, ValidationError, versionMovedFrom, } from "../errors/index.js";
|
|
16
|
+
import { ApiError, CliError, ConfigError, NotABranchError, PushOutcomeUnknownError, RuntimeDowngradeError, ValidationError, versionMovedFrom, } from "../errors/index.js";
|
|
13
17
|
import { personName } from "../output/index.js";
|
|
18
|
+
import { compareRuntimeFamilies, familyOf } from "../runtime-version/index.js";
|
|
14
19
|
import { tagParts } from "../bundle/lineage.js";
|
|
15
20
|
import { checkoutSchemasDir, installSchemas } from "../schemas/install.js";
|
|
16
21
|
import { installAgentsPage } from "../skills/agents-page.js";
|
|
@@ -146,6 +151,75 @@ function buildProvenance(got, asked) {
|
|
|
146
151
|
* gave, and the caller reports a fallback rather than quietly writing
|
|
147
152
|
* material from another save into the checkout.
|
|
148
153
|
*/
|
|
154
|
+
/** A failure after which a write may or may not have landed: a timeout, a
|
|
155
|
+
* gateway 502/503/504, or fetch's own transport error. */
|
|
156
|
+
function isOutcomeUnknown(error) {
|
|
157
|
+
if (error instanceof CliError && error.code === "REQUEST_TIMEOUT")
|
|
158
|
+
return true;
|
|
159
|
+
if (error instanceof ApiError)
|
|
160
|
+
return error.status === 502 || error.status === 503 || error.status === 504;
|
|
161
|
+
return error instanceof TypeError;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* After a push whose answer was lost: its commit, when the branch's newest
|
|
165
|
+
* commit is this user's CLI push of exactly these files. Anything else —
|
|
166
|
+
* no new commit, someone else's, different files, or a lookup that fails
|
|
167
|
+
* too — is `undefined`: the caller reports the outcome as unknown rather
|
|
168
|
+
* than guess.
|
|
169
|
+
*/
|
|
170
|
+
async function findLandedPush(management, agentId, versionId, pushBase, actor, sent, runtimeVersion) {
|
|
171
|
+
try {
|
|
172
|
+
const { results } = await management.listRevisions(agentId, versionId, 1);
|
|
173
|
+
const newest = results[0];
|
|
174
|
+
if (newest === undefined || newest.version_tag === pushBase)
|
|
175
|
+
return undefined;
|
|
176
|
+
if (newest.created_by !== actor || newest.caller !== "cli")
|
|
177
|
+
return undefined;
|
|
178
|
+
// A re-stamp sends the files its base already has: the stamp is what
|
|
179
|
+
// tells this push's commit apart, wherever the listing reports it.
|
|
180
|
+
const stamped = newest.schema_stats?.runtime_version;
|
|
181
|
+
if (stamped !== undefined && stamped !== (runtimeVersion ?? null))
|
|
182
|
+
return undefined;
|
|
183
|
+
const landed = await management.pullVersion(agentId, versionId, newest.version_tag);
|
|
184
|
+
if (!sameHashes(hashFiles(bundleFiles(landed.bundle)), hashFiles(sent)))
|
|
185
|
+
return undefined;
|
|
186
|
+
return {
|
|
187
|
+
agent_id: agentId,
|
|
188
|
+
version_id: versionId,
|
|
189
|
+
new_version_revision_number: parseVersionTag(newest.version_tag)?.revision ?? 0,
|
|
190
|
+
new_version_tag: newest.version_tag,
|
|
191
|
+
revision_id: newest.id,
|
|
192
|
+
created_at: newest.created_at,
|
|
193
|
+
commit_message: newest.commit_message ?? null,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function sameHashes(left, right) {
|
|
201
|
+
const keys = Object.keys(left);
|
|
202
|
+
return keys.length === Object.keys(right).length && keys.every((key) => left[key] === right[key]);
|
|
203
|
+
}
|
|
204
|
+
/** Run `task` over `items`, at most `limit` at a time; the first failure
|
|
205
|
+
* stops new work and rejects. */
|
|
206
|
+
async function inPool(items, limit, task) {
|
|
207
|
+
let next = 0;
|
|
208
|
+
let failed = false;
|
|
209
|
+
const worker = async () => {
|
|
210
|
+
while (!failed && next < items.length) {
|
|
211
|
+
const item = items[next++];
|
|
212
|
+
try {
|
|
213
|
+
await task(item);
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
failed = true;
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));
|
|
222
|
+
}
|
|
149
223
|
async function downloadBuildBundle(agentSettings, agentId, fetchImpl, programVersionTag) {
|
|
150
224
|
let response;
|
|
151
225
|
try {
|
|
@@ -159,14 +233,24 @@ async function downloadBuildBundle(agentSettings, agentId, fetchImpl, programVer
|
|
|
159
233
|
throw error;
|
|
160
234
|
}
|
|
161
235
|
const entries = Object.entries(response.file_urls ?? {}).filter((entry) => typeof entry[1] === "string" && entry[1].length > 0);
|
|
236
|
+
// The hash agent-settings lists for each file, when the deployment sends it.
|
|
237
|
+
const expected = new Map((response.bundle.files ?? []).flatMap((file) => typeof file.sha256 === "string" && file.sha256 !== ""
|
|
238
|
+
? [[file.path, file.sha256.toLowerCase()]]
|
|
239
|
+
: []));
|
|
162
240
|
const files = {};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
241
|
+
// A few at a time, each under its own timeout (`downloadBytes`), and each
|
|
242
|
+
// checked against its listed hash — all before the caller writes anything.
|
|
243
|
+
await inPool(entries, DOWNLOAD_CONCURRENCY, async ([relativePath, signedUrl]) => {
|
|
244
|
+
const bytes = Buffer.from(await downloadBytes(signedUrl, { fetch: fetchImpl }));
|
|
245
|
+
const want = expected.get(relativePath);
|
|
246
|
+
if (want !== undefined && createHash("sha256").update(bytes).digest("hex") !== want) {
|
|
247
|
+
throw new CliError(`Build file "${relativePath}" does not match the checksum its bundle lists — nothing was written.`, {
|
|
248
|
+
code: "DOWNLOAD_INTEGRITY",
|
|
249
|
+
suggestion: "Re-run the command; if it happens again, the stored copy is damaged — report it.",
|
|
250
|
+
});
|
|
167
251
|
}
|
|
168
|
-
files[relativePath] =
|
|
169
|
-
})
|
|
252
|
+
files[relativePath] = bytes;
|
|
253
|
+
});
|
|
170
254
|
const pinned = response.bundle.program_version_tag ?? undefined;
|
|
171
255
|
return { version: response.bundle.version, files, ...(pinned ? { programVersionTag: pinned } : {}) };
|
|
172
256
|
}
|
|
@@ -237,10 +321,13 @@ export async function pullBundle(context, clients, options = {}) {
|
|
|
237
321
|
...(buildSync ? { build: buildSync } : {}),
|
|
238
322
|
...(target.live ? { live: target.live } : {}),
|
|
239
323
|
...(serverSecretFiles.length ? { serverSecretFiles } : {}),
|
|
324
|
+
...(target.version.blob_stats?.runtime_version
|
|
325
|
+
? { recordedRuntime: target.version.blob_stats.runtime_version }
|
|
326
|
+
: {}),
|
|
240
327
|
};
|
|
241
328
|
}
|
|
242
329
|
export async function importBundle(context, clients, agentId, destination, options = {}) {
|
|
243
|
-
const { tag
|
|
330
|
+
const { tag } = options;
|
|
244
331
|
const { management } = clients;
|
|
245
332
|
const homeDir = options.homeDir ?? homedir();
|
|
246
333
|
const agent = await management.getAgent(agentId);
|
|
@@ -261,6 +348,11 @@ export async function importBundle(context, clients, agentId, destination, optio
|
|
|
261
348
|
const serverSecretFiles = bundleSecretFiles(pull.bundle);
|
|
262
349
|
// What the result echoes: a secret the commit still holds never reaches output.
|
|
263
350
|
const pulled = { ...pull, bundle: withoutSecretBundleFiles(pull.bundle) };
|
|
351
|
+
// The checkout pins the engine the imported BRANCH was last pushed for: the
|
|
352
|
+
// agent-wide record is the live branch's, which another branch need not
|
|
353
|
+
// share (R6). An explicit --runtime-version / APOLLO_RUNTIME_VERSION wins.
|
|
354
|
+
const branchStamp = target.version.blob_stats?.runtime_version?.trim() || undefined;
|
|
355
|
+
const runtimeVersion = options.runtimeVersionExplicit === true ? options.runtimeVersion : (branchStamp ?? options.runtimeVersion);
|
|
264
356
|
const sourceRoot = bundleSourceRoot(context, destination);
|
|
265
357
|
await writeBundleFiles(sourceRoot, files);
|
|
266
358
|
const buildSync = remoteBuild
|
|
@@ -292,6 +384,54 @@ export async function importBundle(context, clients, agentId, destination, optio
|
|
|
292
384
|
...(serverSecretFiles.length ? { serverSecretFiles } : {}),
|
|
293
385
|
};
|
|
294
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* Check one commit out into the directory of an agent just created, with a
|
|
389
|
+
* baseline that records it — WITHOUT replacing anything the directory already
|
|
390
|
+
* holds: `agent create --dir` may name a folder with a program in it, so a
|
|
391
|
+
* file already there is kept and reads as a change against the commit, and
|
|
392
|
+
* nothing is removed. The build area is written only when it is empty; the
|
|
393
|
+
* baseline records the commit's build bundle either way.
|
|
394
|
+
*/
|
|
395
|
+
export async function seedCheckout(context, clients, agentId, directory, tag, options = {}) {
|
|
396
|
+
const { version } = await clients.management.resolveRef(agentId, tag);
|
|
397
|
+
const [pull, remoteBuild] = await Promise.all([
|
|
398
|
+
clients.management.pullVersion(agentId, version.id, tag),
|
|
399
|
+
downloadBuildBundle(clients.agentSettings, agentId, options.fetch ?? globalThis.fetch, tag),
|
|
400
|
+
]);
|
|
401
|
+
const files = bundleFiles(pull.bundle);
|
|
402
|
+
const serverSecretFiles = bundleSecretFiles(pull.bundle);
|
|
403
|
+
const sourceRoot = path.resolve(bundleSourceRoot(context, directory));
|
|
404
|
+
const local = (await readProgramFiles(sourceRoot)).files;
|
|
405
|
+
const written = [];
|
|
406
|
+
for (const relativePath of Object.keys(files).sort()) {
|
|
407
|
+
if (relativePath in local)
|
|
408
|
+
continue;
|
|
409
|
+
const target = resolveInside(sourceRoot, relativePath);
|
|
410
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
411
|
+
await writeFile(target, files[relativePath] ?? "", "utf8");
|
|
412
|
+
written.push(relativePath);
|
|
413
|
+
}
|
|
414
|
+
let build;
|
|
415
|
+
if (remoteBuild) {
|
|
416
|
+
const buildRoot = buildAreaRoot(sourceRoot);
|
|
417
|
+
if (Object.keys((await readBuildFiles(buildRoot)).files).length === 0) {
|
|
418
|
+
build = {
|
|
419
|
+
version: remoteBuild.version,
|
|
420
|
+
...(await writeBuildFiles(buildRoot, remoteBuild.files)),
|
|
421
|
+
...buildProvenance(remoteBuild.programVersionTag, pull.version_tag),
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
await writeBaseline(options.homeDir ?? homedir(), agentId, directory, pull.version_tag, files, bundleFileLayout(pull.bundle), remoteBuild ? hashBuildFiles(remoteBuild.files) : {});
|
|
426
|
+
return {
|
|
427
|
+
tag: pull.version_tag,
|
|
428
|
+
files,
|
|
429
|
+
written,
|
|
430
|
+
kept: Object.keys(local).sort(),
|
|
431
|
+
...(build ? { build } : {}),
|
|
432
|
+
...(serverSecretFiles.length ? { serverSecretFiles } : {}),
|
|
433
|
+
};
|
|
434
|
+
}
|
|
295
435
|
/** Skill packs a checkout gets unless the caller narrows or disables them. */
|
|
296
436
|
export const DEFAULT_SKILL_TARGETS = ["cursor", "claude"];
|
|
297
437
|
/**
|
|
@@ -490,7 +630,7 @@ export async function remoteDiff(context, management, root = bundleSourceRoot(co
|
|
|
490
630
|
const pull = await management.pullVersion(agentId, version.id);
|
|
491
631
|
const remote = bundleFiles(pull.bundle);
|
|
492
632
|
const current = await readProgramFiles(root);
|
|
493
|
-
return
|
|
633
|
+
return contentDiff(remote, current.files);
|
|
494
634
|
}
|
|
495
635
|
/** agent-settings enforces this per uploaded build file. */
|
|
496
636
|
const MAX_BUILD_FILE_BYTES = 5 * 1024 * 1024;
|
|
@@ -556,7 +696,23 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
556
696
|
const pinned = context.runtimeVersion
|
|
557
697
|
? { runtimeVersion: context.runtimeVersion }
|
|
558
698
|
: {};
|
|
559
|
-
|
|
699
|
+
// `--restamp` (A6): a branch records the runtime its newest commit was
|
|
700
|
+
// pushed for, and only a commit records it — so an unchanged program is
|
|
701
|
+
// committed again, under this checkout's pin. A changed program stamps
|
|
702
|
+
// the pin anyway; there is nothing extra to do.
|
|
703
|
+
let restamp;
|
|
704
|
+
if (options.restamp === true) {
|
|
705
|
+
const pin = context.runtimeVersion;
|
|
706
|
+
if (pin === undefined) {
|
|
707
|
+
throw new ConfigError("Nothing to re-stamp: this checkout has no runtime pin.", "`apollo runtime use <version>` pins one; `apollo push --restamp` then records it on the branch.");
|
|
708
|
+
}
|
|
709
|
+
if (isClean(diff)) {
|
|
710
|
+
const branch = await clients.management.resolveVersion(agentId, requireTag(context));
|
|
711
|
+
restamp = { from: branch.blob_stats?.runtime_version?.trim() || null, to: pin, pushed: false };
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const restampProgram = restamp !== undefined && restamp.from !== restamp.to;
|
|
715
|
+
if (options.dryRun || (isClean(diff) && isClean(buildDiff) && !restampProgram)) {
|
|
560
716
|
return {
|
|
561
717
|
diff,
|
|
562
718
|
buildDiff,
|
|
@@ -564,14 +720,16 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
564
720
|
bundle: bundleAudit,
|
|
565
721
|
...pinned,
|
|
566
722
|
...(validationLane === "builder" ? { validationLane } : {}),
|
|
723
|
+
...(restamp ? { restamp } : {}),
|
|
567
724
|
};
|
|
568
725
|
}
|
|
569
726
|
let push;
|
|
727
|
+
let recovered = false;
|
|
570
728
|
let live;
|
|
571
729
|
let newBranch;
|
|
572
730
|
let versionTag = baseline?.versionTag ?? requireTag(context);
|
|
573
731
|
let fileLayout = baseline?.fileLayout;
|
|
574
|
-
if (!isClean(diff)) {
|
|
732
|
+
if (!isClean(diff) || restampProgram) {
|
|
575
733
|
const baseTag = requireTag(context);
|
|
576
734
|
const [base, agent] = await Promise.all([
|
|
577
735
|
clients.management.resolveVersion(agentId, baseTag),
|
|
@@ -600,6 +758,20 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
600
758
|
// The branch the changes came from: the bound one, or the other branch
|
|
601
759
|
// whose commit a new version is cut from.
|
|
602
760
|
const from = basedOnThisLine ? base : await clients.management.resolveVersion(agentId, basedOn);
|
|
761
|
+
// The branch records the engine its newest commit was pushed for, and a
|
|
762
|
+
// push stamps this checkout's pin instead. An older family — or no pin at
|
|
763
|
+
// all — would silently move the branch's routing backwards (R6).
|
|
764
|
+
const recorded = from.blob_stats?.runtime_version?.trim() || undefined;
|
|
765
|
+
if (recorded !== undefined && options.allowRuntimeDowngrade !== true) {
|
|
766
|
+
const pin = context.runtimeVersion;
|
|
767
|
+
const family = familyOf(recorded);
|
|
768
|
+
if (pin === undefined) {
|
|
769
|
+
throw new RuntimeDowngradeError({ branch: branchName(from), recorded, ...(family ? { family } : {}) });
|
|
770
|
+
}
|
|
771
|
+
if ((compareRuntimeFamilies(recorded, pin) ?? 0) > 0) {
|
|
772
|
+
throw new RuntimeDowngradeError({ branch: branchName(from), recorded, pinned: pin, ...(family ? { family } : {}) });
|
|
773
|
+
}
|
|
774
|
+
}
|
|
603
775
|
const newVersionName = typeof options.newVersion === "string" && options.newVersion.trim()
|
|
604
776
|
? options.newVersion.trim()
|
|
605
777
|
: continuedName(from);
|
|
@@ -622,7 +794,8 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
622
794
|
// (flag > env > `.apollorc`) rides the push body as `runtime_version`,
|
|
623
795
|
// the same value the pre-flight validate above was routed to.
|
|
624
796
|
try {
|
|
625
|
-
push = await clients.management.pushVersion(agentId, draft.id, bundle, actor, options.commitMessage
|
|
797
|
+
push = await clients.management.pushVersion(agentId, draft.id, bundle, actor, options.commitMessage ??
|
|
798
|
+
(restampProgram && restamp ? `Re-stamp runtime ${restamp.from ?? "(none)"} -> ${restamp.to}` : undefined), context.runtimeVersion, pushBase);
|
|
626
799
|
}
|
|
627
800
|
catch (error) {
|
|
628
801
|
// Someone pushed after this checkout started: the refusal names the
|
|
@@ -630,7 +803,15 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
630
803
|
const moved = versionMovedFrom(error, { newVersionName, me: actor });
|
|
631
804
|
if (moved)
|
|
632
805
|
throw moved;
|
|
633
|
-
|
|
806
|
+
// No answer is not a no: the server can commit after the answer is lost
|
|
807
|
+
// (apollo-api's own upstream limit, a gateway 504, a dropped socket).
|
|
808
|
+
// Look at the branch before calling it a failure — and never push twice.
|
|
809
|
+
if (!isOutcomeUnknown(error))
|
|
810
|
+
throw error;
|
|
811
|
+
push = await findLandedPush(clients.management, agentId, draft.id, pushBase, actor, program.files, context.runtimeVersion);
|
|
812
|
+
if (push === undefined)
|
|
813
|
+
throw new PushOutcomeUnknownError(branchName(draft), error);
|
|
814
|
+
recovered = true;
|
|
634
815
|
}
|
|
635
816
|
versionTag = push.new_version_tag;
|
|
636
817
|
live = liveLeftBehind(agent, draft);
|
|
@@ -677,6 +858,7 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
677
858
|
diff,
|
|
678
859
|
buildDiff,
|
|
679
860
|
...(push ? { push } : {}),
|
|
861
|
+
...(recovered ? { recovered } : {}),
|
|
680
862
|
...(live ? { live } : {}),
|
|
681
863
|
...(newBranch ? { newBranch } : {}),
|
|
682
864
|
...(buildPush ? { buildPush } : {}),
|
|
@@ -684,6 +866,7 @@ export async function pushBundle(context, clients, options = {}) {
|
|
|
684
866
|
bundle: bundleAudit,
|
|
685
867
|
...pinned,
|
|
686
868
|
...(validationLane === "builder" ? { validationLane } : {}),
|
|
869
|
+
...(restamp ? { restamp: { ...restamp, pushed: restampProgram && push !== undefined } } : {}),
|
|
687
870
|
};
|
|
688
871
|
}
|
|
689
872
|
export async function validateProgramBundle(runtime, files,
|