From 753d33130bf5b02e4265ad1f2df503d4941b46ae Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Thu, 19 Nov 2026 16:52:41 -0800 Subject: [PATCH 01/12] chore(api): record generated baseline for build 0.1.19 --- .claude/skills/dedalus-cli-sdk/SKILL.md | 11 +- .github/workflows/release-please.yml | 102 +- .github/workflows/release-title-edit.yml | 138 +- .github/workflows/sdk-release.yml | 62 +- .gitignore | 1 + .release-please-manifest.json | 4 +- CHANGELOG.md | 227 - README.md | 33 +- SKILL.md | 11 +- VERSIONING.md | 7 +- api.md | 190 +- install.sh | 399 ++ man/dedalus-completion.1 | 20 +- man/dedalus-images-create.1 | 126 + man/dedalus-images-delete.1 | 102 + ...gs-reauthorize.1 => dedalus-images-list.1} | 31 +- man/dedalus-images-retrieve.1 | 102 + man/dedalus-images-update.1 | 108 + man/dedalus-images-uploads-create.1 | 112 + man/dedalus-login.1 | 7 +- man/dedalus-logout.1 | 6 +- man/dedalus-machines-autoresizing-retrieve.1 | 18 +- man/dedalus-machines-autoresizing-update.1 | 36 +- man/dedalus-machines-create.1 | 13 +- man/dedalus-machines-delete.1 | 13 +- man/dedalus-machines-executions-create.1 | 14 +- man/dedalus-machines-executions-delete.1 | 14 +- man/dedalus-machines-executions-events.1 | 14 +- man/dedalus-machines-executions-list.1 | 14 +- ...us-machines-executions-logs-create-token.1 | 14 +- ...edalus-machines-executions-logs-retrieve.1 | 14 +- man/dedalus-machines-executions-output.1 | 14 +- man/dedalus-machines-executions-retrieve.1 | 14 +- man/dedalus-machines-list.1 | 10 +- man/dedalus-machines-reboot.1 | 10 +- man/dedalus-machines-resize.1 | 110 + man/dedalus-machines-retrieve.1 | 10 +- man/dedalus-machines-sleep.1 | 10 +- man/dedalus-machines-ssh-create.1 | 14 +- man/dedalus-machines-ssh-delete.1 | 14 +- man/dedalus-machines-ssh-list.1 | 14 +- man/dedalus-machines-ssh-retrieve.1 | 14 +- man/dedalus-machines-update.1 | 22 +- man/dedalus-machines-wake.1 | 10 +- ...dalus-organization-autoresizing-retrieve.1 | 16 +- ...dedalus-organization-autoresizing-update.1 | 31 +- man/dedalus-uninstall.1 | 23 + man/dedalus-upgrade.1 | 32 + man/dedalus.1 | 82 +- package.json | 18 +- scalar-sdk.manifest.json | 4669 ++++++++++++----- src/cli/completions.ts | 6 +- src/cli/credentials.ts | 126 +- src/cli/keychain.ts | 166 +- src/cli/list.ts | 39 + src/cli/login.ts | 1350 ++++- src/cli/runtime.ts | 504 +- src/cli/upgrade.ts | 1353 +++++ src/commands/index.ts | 533 +- src/index.ts | 3 +- src/sdk/api-promise.ts | 43 +- src/sdk/client.ts | 427 +- src/sdk/core/pagination.ts | 11 +- src/sdk/internal/detect-platform.ts | 67 +- src/sdk/internal/headers.ts | 74 +- src/sdk/internal/qs/LICENSE.md | 13 - src/sdk/internal/qs/README.md | 3 - src/sdk/internal/qs/formats.ts | 10 - src/sdk/internal/qs/index.ts | 13 - src/sdk/internal/qs/stringify.ts | 384 -- src/sdk/internal/qs/types.ts | 71 - src/sdk/internal/qs/utils.ts | 265 - src/sdk/internal/utils/body.ts | 163 + src/sdk/internal/utils/log.ts | 193 +- src/sdk/internal/utils/query-string.ts | 160 + src/sdk/internal/utils/query.ts | 4 +- src/sdk/internal/utils/uuid7.ts | 29 + src/sdk/resources.ts | 14 +- src/sdk/resources/images.ts | 3 + src/sdk/resources/images/images.ts | 251 + src/sdk/resources/images/index.ts | 16 + src/sdk/resources/images/uploads.ts | 57 + src/sdk/resources/index.ts | 15 + src/sdk/resources/machines/autoresizing.ts | 77 +- .../machines/executions/executions.ts | 10 +- .../resources/machines/executions/index.ts | 8 +- src/sdk/resources/machines/executions/logs.ts | 53 - src/sdk/resources/machines/index.ts | 5 +- src/sdk/resources/machines/machines.ts | 210 +- .../resources/organization/autoresizing.ts | 57 +- src/sdk/version.ts | 2 +- tests/smoke-test.ts | 238 +- 92 files changed, 10936 insertions(+), 3190 deletions(-) delete mode 100644 CHANGELOG.md create mode 100755 install.sh create mode 100644 man/dedalus-images-create.1 create mode 100644 man/dedalus-images-delete.1 rename man/{dedalus-machines-executions-logs-reauthorize.1 => dedalus-images-list.1} (72%) create mode 100644 man/dedalus-images-retrieve.1 create mode 100644 man/dedalus-images-update.1 create mode 100644 man/dedalus-images-uploads-create.1 create mode 100644 man/dedalus-machines-resize.1 create mode 100644 man/dedalus-uninstall.1 create mode 100644 man/dedalus-upgrade.1 create mode 100644 src/cli/list.ts create mode 100644 src/cli/upgrade.ts delete mode 100644 src/sdk/internal/qs/LICENSE.md delete mode 100644 src/sdk/internal/qs/README.md delete mode 100644 src/sdk/internal/qs/formats.ts delete mode 100644 src/sdk/internal/qs/index.ts delete mode 100644 src/sdk/internal/qs/stringify.ts delete mode 100644 src/sdk/internal/qs/types.ts delete mode 100644 src/sdk/internal/qs/utils.ts create mode 100644 src/sdk/internal/utils/body.ts create mode 100644 src/sdk/internal/utils/query-string.ts create mode 100644 src/sdk/internal/utils/uuid7.ts create mode 100644 src/sdk/resources/images.ts create mode 100644 src/sdk/resources/images/images.ts create mode 100644 src/sdk/resources/images/index.ts create mode 100644 src/sdk/resources/images/uploads.ts diff --git a/.claude/skills/dedalus-cli-sdk/SKILL.md b/.claude/skills/dedalus-cli-sdk/SKILL.md index fd1e924..1cc6ce0 100644 --- a/.claude/skills/dedalus-cli-sdk/SKILL.md +++ b/.claude/skills/dedalus-cli-sdk/SKILL.md @@ -10,6 +10,10 @@ Generated CLI client for Dedalus API, published as `dedalus-cli`. Use the genera ## Install ```sh +# Install script — standalone binary for macOS and Linux, no Node.js required +curl -fsSL https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/install.sh | bash +# Installs into ~/.local/bin and puts it on PATH; set DEDALUS_INSTALL_DIR to choose another directory + # npm (requires Node.js) npm install -g dedalus-cli @@ -17,7 +21,7 @@ npm install -g dedalus-cli brew install dedalus-labs/tap/dedalus # Direct download — standalone binary, no Node.js required -curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz +curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz dedalus sudo mv dedalus /usr/local/bin/ # Windows — download and extract dedalus-windows-x64.zip, then add it to PATH @@ -28,8 +32,9 @@ sudo mv dedalus /usr/local/bin/ Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them: -- `--api-key` (env: `DEDALUS_API_KEY`) — Dedalus API key or short-lived delegated access token in Authorization: Bearer . +- `--api-key` (env: `DEDALUS_API_KEY`) — Dedalus API key or short-lived delegated access token in `Authorization: Bearer `. - `--x-api-key` (env: `DEDALUS_X_API_KEY`) — Dedalus API key. Alternative to Bearer token. +- `--browser-token` (env: `DEDALUS_BROWSER_TOKEN`) — Credential for the BrowserAuth scheme. ## Calling operations @@ -37,7 +42,7 @@ Provide credentials using the options below. Environment variables are read auto dedalus [resource] [command] [flags] dedalus machines create \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --autosleep '300s' \ --memory-mib '4096' \ --storage-gib '10' \ diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 9001871..e440638 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -51,18 +51,44 @@ jobs: # version bump and changelog must also land back on scalar-next, or the next # release PR would propose this release again. A real merge (never a plain # commit push) so a squash- or rebase-merged release PR syncs just as well; the - # non-conventional message keeps the sync commit out of future changelogs. Plain - # (non-force) push on purpose: losing a race against a concurrent regeneration - # push fails loudly here, and the platform's next sync re-converges. + # non-conventional message keeps the sync commit out of future changelogs. + # + # The Scalar platform merges main into scalar-next itself when the release + # PR merges, so this step routinely races it. The sync is done once the release commit + # is an ancestor of scalar-next, whoever merged it, so that is checked before every + # attempt. A rejected push retries from a fresh fetch rather than failing the release + # run. Plain (non-force) push on purpose: a concurrent regeneration push is never + # discarded, and a sync that still cannot land after the retries fails loudly. - name: Sync release back to scalar-next if: ${{ steps.release.outputs.release_created == 'true' }} + env: + RELEASE_SHA: ${{ steps.release.outputs.sha }} + RELEASE_TAG: ${{ steps.release.outputs.tag_name }} run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git fetch origin scalar-next - git checkout -B scalar-next origin/scalar-next - git merge --no-edit -m "Sync release ${{ steps.release.outputs.tag_name }} back to scalar-next" "${{ steps.release.outputs.sha }}" - git push origin scalar-next + # Explicit `|| return 1`s because `set -e` does not apply inside a function called + # as a condition, and a failed merge must never fall through to a no-op push. + sync_release() { + git fetch origin scalar-next || return 1 + if git merge-base --is-ancestor "$RELEASE_SHA" origin/scalar-next; then + echo "$RELEASE_TAG is already on scalar-next." + return 0 + fi + git checkout -B scalar-next origin/scalar-next || return 1 + if ! git merge --no-edit -m "Sync release $RELEASE_TAG back to scalar-next" "$RELEASE_SHA"; then + git merge --abort + return 1 + fi + git push origin scalar-next + } + for attempt in 1 2 3; do + if sync_release; then exit 0; fi + echo "Attempt $attempt of 3 to sync $RELEASE_TAG back to scalar-next failed." + if [ "$attempt" -lt 3 ]; then sleep $((attempt * 5)); fi + done + echo "::error::Could not sync $RELEASE_TAG back to scalar-next after 3 attempts." + exit 1 publish: needs: release-please # `!cancelled()` keeps publishing even when the back-sync to the integration branch @@ -121,34 +147,66 @@ jobs: # TypeScript directly, and going through `dist/` would only add the emitted ESM specifier # rewriting as a failure mode between the source and the shipped binary. # + # Each target compiles into its own `compile-out//` directory rather than straight + # into an archive, so anything that has to touch an executable can run as a step between this + # one and packaging — code signing, when it is configured — and the archive is always built + # from whatever those steps left behind. + - name: Compile standalone binaries + run: | + rm -rf compile-out + for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do + mkdir -p "compile-out/${target}" + case "$target" in + windows-*) + bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/${target}/dedalus.exe" + ;; + *) + bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/${target}/dedalus" + ;; + esac + done # Asset names carry no version: the release tag in the download path already does, and a # stable file name is what makes `releases/latest/download/` resolve, so install # instructions can point at "latest" without being rewritten every release. - - name: Compile standalone binaries + # + # Each tarball carries the generated man pages beside the executable, so Homebrew — and anyone + # unpacking the download — installs `man dedalus` too rather than only the npm package doing + # so. Windows has no `man`, so its zip stays the executable alone. + # + # They are copied in here rather than at compile time so that what any signing step above saw + # — and, when notarization is on, what was uploaded to Apple, which zips these directories + # whole — is the executables alone. + - name: Package release archives run: | ROOT="$PWD" mkdir -p release-binaries for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do - rm -rf compile-out && mkdir -p compile-out case "$target" in windows-*) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus.exe" - (cd compile-out && zip -q "$ROOT/release-binaries/dedalus-${target}.zip" "dedalus.exe") + (cd "compile-out/${target}" && zip -q "$ROOT/release-binaries/dedalus-${target}.zip" "dedalus.exe") ;; *) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus" - tar -czf "release-binaries/dedalus-${target}.tar.gz" -C compile-out "dedalus" + cp -R "man" "compile-out/${target}/man" + tar -czf "release-binaries/dedalus-${target}.tar.gz" -C "compile-out/${target}" "dedalus" "man" ;; esac done rm -rf compile-out + cp install.sh release-binaries/install.sh + # One checksum file covering every archive, so anything that downloads one can verify what it + # fetched before running it — `upgrade` refuses to replace the executable without it. Run from + # inside the directory so each line names the bare asset file name, which is the name the + # download URL ends in, rather than `release-binaries/…`; the `sed` then strips the `./` that + # globbing leaves on each name. `checksums.txt` does not end up checksumming itself: the shell + # expands the `./*` glob before it performs the redirection that creates the file. + (cd release-binaries && sha256sum ./* > checksums.txt && sed -i 's| \./| |' checksums.txt) - name: Attach binaries to the release run: gh release upload "v${PKG_VERSION}" release-binaries/* --clobber env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update Homebrew tap env: - HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN || secrets.HOMEBREW_TAP_GITHUB_TOKEN }} run: | # Reads back the archives the preceding asset step just uploaded. That step runs # `gh release upload` on the ambient GITHUB_TOKEN, which can only write releases in @@ -161,12 +219,15 @@ jobs: mkdir -p tap/Formula # Each archive holds a single `bun build --compile` executable with the Bun runtime and # every dependency embedded, so the formula declares no `depends_on` and installs the - # binary as-is — `brew install` no longer pulls Node in as a dependency. + # binary as-is — `brew install` no longer pulls Node in as a dependency. The archive's man + # pages go into `man1`, and completion scripts are generated from the installed binary + # itself, so both always match the version installed. # # The formula file is lowercase even when the command it installs is not: Homebrew resolves # `brew install //` to `Formula/.rb`, and that lookup is case-sensitive # on Linux. The `bin.install` below still installs the command under its own spelling. - cat > "tap/Formula/dedalus.rb" <<'EOF' + PACKAGE="tap/Formula/dedalus.rb" + cat > "$PACKAGE" <<'EOF' class Dedalus < Formula desc "The official CLI for Dedalus." homepage "https://docs.dedaluslabs.ai" @@ -196,14 +257,15 @@ jobs: def install bin.install "dedalus" + man1.install Dir["man/*.1"] + generate_completions_from_executable(bin/"dedalus", "completion") end test do - system "#{bin}/dedalus", "--help" + system bin/"dedalus", "--help" end end EOF - FORMULA="tap/Formula/dedalus.rb" # Homebrew resolves one url/sha256 pair per platform at install time, but the formula is a # single file, so every platform the tap supports has to be pinned on every release. for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64; do @@ -214,9 +276,9 @@ jobs: # pair, so the loop stays driven by the target list instead of a hand-written sed per # platform that can silently fall out of step with the formula above. TOKEN="$(echo "$target" | tr "a-z-" "A-Z_")" - sed -i -e "s|__URL_${TOKEN}__|$BASE_URL/$ASSET|" -e "s|__SHA_${TOKEN}__|$SHA256|" "$FORMULA" + sed -i -e "s|__URL_${TOKEN}__|$BASE_URL/$ASSET|" -e "s|__SHA_${TOKEN}__|$SHA256|" "$PACKAGE" done - sed -i -e "s|__VERSION__|$PKG_VERSION|" "$FORMULA" + sed -i -e "s|__VERSION__|$PKG_VERSION|" "$PACKAGE" cd tap git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/release-title-edit.yml b/.github/workflows/release-title-edit.yml index c836f65..08b0ba4 100644 --- a/.github/workflows/release-title-edit.yml +++ b/.github/workflows/release-title-edit.yml @@ -2,14 +2,17 @@ name: Release PR Version on: # `edited` is not one of the default pull_request types, but it is the point of this - # workflow: retitling the release PR is how a maintainer picks an exact version. The - # other types keep the consistency check attached to the PR as it evolves. + # workflow: retitling the release PR is how a maintainer picks an exact version, and the + # check has to re-run on the new title. The other types keep the consistency check attached + # to the PR as it evolves. pull_request: types: [opened, reopened, edited, synchronize] -# Read-only by default; only the job that pushes the Release-As commit widens this. +# Read-only: the check reads the committed version, and polls the pull request while it waits +# for a re-render. permissions: contents: read + pull-requests: read jobs: version-consistency: @@ -25,30 +28,39 @@ jobs: # typo'd into the title still reaches the script and fails there, rather than falling out # of the guard and leaving no check at all — a missing check is not a failing one, and this # is the check the release PR's footer tells maintainers to wait for before merging. - # - # It is also what keeps the workflow from failing silently if the platform ever opens - # release PRs from a different account: the bridge below stops firing, but this check still - # runs, the retitled version and the committed one disagree, and it turns red. The merge is - # blocked loudly instead of releasing the old version. if: >- ${{ github.event.pull_request.base.ref == 'main' && startsWith(github.event.pull_request.title, 'release: ') }} runs-on: ubuntu-latest + # Bounds the wait below with room to spare; a re-render normally lands within a minute. + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # The version committed on the PR head is what merging would actually release. ref: ${{ github.event.pull_request.head.sha }} - # Fails while the title version and the committed version disagree — the window between - # a maintainer's retitle and the platform re-rendering the PR from it. Without this a - # merge in that window would tag a release whose own files self-report the old version, - # and a title release-please cannot parse would silently cut no release at all. + # A retitle is applied by the Scalar platform, which pushes a Release-As commit to the + # integration branch and re-renders the release PR at that version. Until it lands, the + # title and the committed version disagree, and a merge in that window would tag a release + # whose own files self-report the old version. + # + # So this waits rather than failing: the check stays pending, which blocks a merge just as + # a failure would where the check is required, but does not flash red on every retitle. It + # passes once the title and the committed version agree, and hands over once the head + # moves, since the re-render's push starts a run of its own on the new head. It never + # passes while the title still disagrees, even a newer title: the run started for that + # edit judges it, and a pass here would sit beside it on the same head. Only a re-render + # that never arrives, or a title that is not a version at all, fails it. - name: Compare the title version with the committed version env: # The title is human input, so it is bound through the environment (never # interpolated into the script) and matched against a strict semver pattern # before it is read. PR_TITLE: ${{ github.event.pull_request.title }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPOSITORY: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} run: | pattern='^release: ((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$' if [[ ! "$PR_TITLE" =~ $pattern ]]; then @@ -57,87 +69,25 @@ jobs: fi title_version="${BASH_REMATCH[1]}" manifest_version="$(jq -r '.["."]' .release-please-manifest.json)" - if [[ "$title_version" != "$manifest_version" ]]; then - echo "::error::Release PR title says $title_version but the pull request is versioned $manifest_version. Wait for the release PR to be re-rendered at $title_version before merging." - exit 1 - fi - echo "Release PR title and committed version agree on $title_version." - - apply-title-version: - name: Apply edited release version - # A human retitle of the open release PR is bridged into the canonical explicit-version - # mechanism (a Release-As commit on scalar-next, which the platform re-renders the - # release PR from). `changes.title` is only set when the title itself changed, and bot - # senders are ignored so the platform's own retitles cannot bounce back into another - # commit. - # - # Both signals are required here, unlike the read-only check above, and each covers what the - # other cannot. The author, because this job pushes with `contents: write` and a title is - # free text — anyone able to open a pull request against main could otherwise - # name a version and have it committed to scalar-next. `user.login` is set by GitHub when - # the pull request is opened and cannot be forged by whoever edits the title afterwards. - # The title, because those accounts open pull requests other than release PRs, and retitling - # one of those must not push a release. - # - # One login per platform deployment, since a repo generated by staging carries staging's - # app. Parenthesised because the group is ANDed with the title clause below: without the - # parens that `&&` would bind to the last login alone, letting the other accounts push a - # release off any title. Listed rather than matched on the shared `scalar-docs` stem — a - # prefix test would also admit any future `scalar-docs-*[bot]`, including someone else's. - if: >- - ${{ github.event.action == 'edited' - && github.event.changes.title != null - && github.event.sender.type != 'Bot' - && github.event.pull_request.state == 'open' - && github.event.pull_request.base.ref == 'main' - && (github.event.pull_request.user.login == 'scalar-docs[bot]' - || github.event.pull_request.user.login == 'scalar-docs-staging[bot]' - || github.event.pull_request.user.login == 'scalar-docs-development[bot]') - && startsWith(github.event.pull_request.title, 'release: ') }} - # One bridge run at a time per pull request, newest retitle wins. Two retitles in quick - # succession (a version typo corrected seconds later) would otherwise start two runs that - # both read the version committed on the PR head, both get past the no-op guard, and both - # push — and since each fetches scalar-next immediately before committing, the second - # push fast-forwards instead of failing. release-please honours the newest Release-As - # footer, so the release would land on whichever run happened to push last, not on the - # title the maintainer actually left behind. - concurrency: - group: release-title-edit-${{ github.event.pull_request.number }} - cancel-in-progress: true - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - # The PR head, so the version the pull request currently carries can be read before - # deciding whether anything needs to change. - ref: ${{ github.event.pull_request.head.sha }} - - name: Push a Release-As commit for the edited version - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - set -euo pipefail - pattern='^release: ((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$' - if [[ ! "$PR_TITLE" =~ $pattern ]]; then - echo "::error::Release PR title must be \"release: X.Y.Z\" with a full semver version, got: $PR_TITLE" - exit 1 - fi - # Only ever a validated semver from here on, so it is safe in a commit message. - version="${BASH_REMATCH[1]}" - manifest_version="$(jq -r '.["."]' .release-please-manifest.json)" - # The re-rendered PR is retitled to the version it now carries; stopping here keeps - # that from producing an endless chain of Release-As commits. - if [[ "$version" == "$manifest_version" ]]; then - echo "This release PR already carries $version; nothing to do." + if [[ "$title_version" == "$manifest_version" ]]; then + echo "Release PR title and committed version agree on $title_version." exit 0 fi - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git fetch origin scalar-next - git checkout -B scalar-next origin/scalar-next - git commit --allow-empty -m "chore: release $version" -m "Release-As: $version" - # Plain (non-force) push: losing a race against a regeneration push fails loudly - # rather than discarding it, and the retitle can simply be repeated. - git push origin scalar-next - echo "Pushed Release-As: $version to scalar-next. The release PR will be re-rendered at that version." + echo "Release PR title says $title_version but the pull request is versioned $manifest_version. Waiting for it to be re-rendered at $title_version." + # Up to ten minutes: 60 polls, 10 seconds apart. + for _ in $(seq 60); do + sleep 10 + # A failed read is retried on the next poll rather than failing the check. + current="$(gh api "repos/$REPOSITORY/pulls/$PR_NUMBER" --jq '[.head.sha, .title] | @tsv')" || continue + IFS=$'\t' read -r current_sha current_title <<< "$current" + if [[ "$current_sha" != "$HEAD_SHA" ]]; then + echo "The release PR has a new head; the run for that push checks it." + exit 0 + fi + if [[ "$current_title" =~ $pattern && "${BASH_REMATCH[1]}" == "$manifest_version" ]]; then + echo "Release PR title and committed version agree on $manifest_version." + exit 0 + fi + done + echo "::error::Release PR title says $title_version but the pull request is still versioned $manifest_version after 10 minutes. Rebuild the SDK from the Scalar dashboard to re-render it." + exit 1 diff --git a/.github/workflows/sdk-release.yml b/.github/workflows/sdk-release.yml index 1bcd06d..9869a30 100644 --- a/.github/workflows/sdk-release.yml +++ b/.github/workflows/sdk-release.yml @@ -54,34 +54,66 @@ jobs: # TypeScript directly, and going through `dist/` would only add the emitted ESM specifier # rewriting as a failure mode between the source and the shipped binary. # + # Each target compiles into its own `compile-out//` directory rather than straight + # into an archive, so anything that has to touch an executable can run as a step between this + # one and packaging — code signing, when it is configured — and the archive is always built + # from whatever those steps left behind. + - name: Compile standalone binaries + run: | + rm -rf compile-out + for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do + mkdir -p "compile-out/${target}" + case "$target" in + windows-*) + bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/${target}/dedalus.exe" + ;; + *) + bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/${target}/dedalus" + ;; + esac + done # Asset names carry no version: the release tag in the download path already does, and a # stable file name is what makes `releases/latest/download/` resolve, so install # instructions can point at "latest" without being rewritten every release. - - name: Compile standalone binaries + # + # Each tarball carries the generated man pages beside the executable, so Homebrew — and anyone + # unpacking the download — installs `man dedalus` too rather than only the npm package doing + # so. Windows has no `man`, so its zip stays the executable alone. + # + # They are copied in here rather than at compile time so that what any signing step above saw + # — and, when notarization is on, what was uploaded to Apple, which zips these directories + # whole — is the executables alone. + - name: Package release archives run: | ROOT="$PWD" mkdir -p release-binaries for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do - rm -rf compile-out && mkdir -p compile-out case "$target" in windows-*) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus.exe" - (cd compile-out && zip -q "$ROOT/release-binaries/dedalus-${target}.zip" "dedalus.exe") + (cd "compile-out/${target}" && zip -q "$ROOT/release-binaries/dedalus-${target}.zip" "dedalus.exe") ;; *) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus" - tar -czf "release-binaries/dedalus-${target}.tar.gz" -C compile-out "dedalus" + cp -R "man" "compile-out/${target}/man" + tar -czf "release-binaries/dedalus-${target}.tar.gz" -C "compile-out/${target}" "dedalus" "man" ;; esac done rm -rf compile-out + cp install.sh release-binaries/install.sh + # One checksum file covering every archive, so anything that downloads one can verify what it + # fetched before running it — `upgrade` refuses to replace the executable without it. Run from + # inside the directory so each line names the bare asset file name, which is the name the + # download URL ends in, rather than `release-binaries/…`; the `sed` then strips the `./` that + # globbing leaves on each name. `checksums.txt` does not end up checksumming itself: the shell + # expands the `./*` glob before it performs the redirection that creates the file. + (cd release-binaries && sha256sum ./* > checksums.txt && sed -i 's| \./| |' checksums.txt) - name: Attach binaries to the release run: gh release upload "v${PKG_VERSION}" release-binaries/* --clobber env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update Homebrew tap env: - HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN || secrets.HOMEBREW_TAP_GITHUB_TOKEN }} run: | # Reads back the archives the preceding asset step just uploaded. That step runs # `gh release upload` on the ambient GITHUB_TOKEN, which can only write releases in @@ -94,12 +126,15 @@ jobs: mkdir -p tap/Formula # Each archive holds a single `bun build --compile` executable with the Bun runtime and # every dependency embedded, so the formula declares no `depends_on` and installs the - # binary as-is — `brew install` no longer pulls Node in as a dependency. + # binary as-is — `brew install` no longer pulls Node in as a dependency. The archive's man + # pages go into `man1`, and completion scripts are generated from the installed binary + # itself, so both always match the version installed. # # The formula file is lowercase even when the command it installs is not: Homebrew resolves # `brew install //` to `Formula/.rb`, and that lookup is case-sensitive # on Linux. The `bin.install` below still installs the command under its own spelling. - cat > "tap/Formula/dedalus.rb" <<'EOF' + PACKAGE="tap/Formula/dedalus.rb" + cat > "$PACKAGE" <<'EOF' class Dedalus < Formula desc "The official CLI for Dedalus." homepage "https://docs.dedaluslabs.ai" @@ -129,14 +164,15 @@ jobs: def install bin.install "dedalus" + man1.install Dir["man/*.1"] + generate_completions_from_executable(bin/"dedalus", "completion") end test do - system "#{bin}/dedalus", "--help" + system bin/"dedalus", "--help" end end EOF - FORMULA="tap/Formula/dedalus.rb" # Homebrew resolves one url/sha256 pair per platform at install time, but the formula is a # single file, so every platform the tap supports has to be pinned on every release. for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64; do @@ -147,9 +183,9 @@ jobs: # pair, so the loop stays driven by the target list instead of a hand-written sed per # platform that can silently fall out of step with the formula above. TOKEN="$(echo "$target" | tr "a-z-" "A-Z_")" - sed -i -e "s|__URL_${TOKEN}__|$BASE_URL/$ASSET|" -e "s|__SHA_${TOKEN}__|$SHA256|" "$FORMULA" + sed -i -e "s|__URL_${TOKEN}__|$BASE_URL/$ASSET|" -e "s|__SHA_${TOKEN}__|$SHA256|" "$PACKAGE" done - sed -i -e "s|__VERSION__|$PKG_VERSION|" "$FORMULA" + sed -i -e "s|__VERSION__|$PKG_VERSION|" "$PACKAGE" cd tap git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" diff --git a/.gitignore b/.gitignore index b4fb308..fd0d28f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node_modules/ .env .env.* /*.tar.gz +/apple-codesign-*/ /compile-out/ /release-binaries/ /tap/ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35a..466df71 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" -} \ No newline at end of file + ".": "0.1.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index d989661..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,227 +0,0 @@ -# Changelog - -## 0.5.0 (2026-07-10) - -Full Changelog: [v0.4.0...v0.5.0](https://github.com/dedalus-labs/dedalus-cli/compare/v0.4.0...v0.5.0) - -### Features - -* **cli:** add self-update command ([#23](https://github.com/dedalus-labs/dedalus-cli/issues/23)) ([732a207](https://github.com/dedalus-labs/dedalus-cli/commit/732a20710b4749ea2aabc1dc2700142ddbb5013c)) - -## 0.4.0 (2026-05-12) - -Full Changelog: [v0.3.0...v0.4.0](https://github.com/dedalus-labs/dedalus-cli/compare/v0.3.0...v0.4.0) - -### Features - -* **api:** add usage endpoints/autosleep ([63a1582](https://github.com/dedalus-labs/dedalus-cli/commit/63a15826b4878cab2efd0c6f7bb225c093ee5dd9)) - -## 0.3.0 (2026-05-12) - -Full Changelog: [v0.2.2...v0.3.0](https://github.com/dedalus-labs/dedalus-cli/compare/v0.2.2...v0.3.0) - -### Features - -* **api:** add org usage endpoints, remove ssh command/install scripts, update machines API ([f842f29](https://github.com/dedalus-labs/dedalus-cli/commit/f842f2964d052ab0dae8382f38a2f67fc001a368)) -* **cli:** re-nest colon-flattened subresource commands ([#19](https://github.com/dedalus-labs/dedalus-cli/issues/19)) ([8ea656f](https://github.com/dedalus-labs/dedalus-cli/commit/8ea656f61fb442191facbe14bde0e49d31b630b1)) -* support passing path and query params over stdin ([489489f](https://github.com/dedalus-labs/dedalus-cli/commit/489489fd3b0dac53c3c00beeb6e9586d719ae467)) - - -### Bug Fixes - -* flags for nullable body scalar fields are strictly typed ([9de27f3](https://github.com/dedalus-labs/dedalus-cli/commit/9de27f38d039b110aa5620f0ca835de8421b5eda)) - - -### Chores - -* **internal:** codegen related update ([b70e352](https://github.com/dedalus-labs/dedalus-cli/commit/b70e35215e8e9d154835099d800fed21d2460663)) -* redact api-key headers in debug logs ([f274129](https://github.com/dedalus-labs/dedalus-cli/commit/f27412952a2a9e0983a68e86ad5ede9cae75011d)) - -## 0.2.2 (2026-04-29) - -Full Changelog: [v0.2.1...v0.2.2](https://github.com/dedalus-labs/dedalus-cli/compare/v0.2.1...v0.2.2) - -### Chores - -* drop stale dedalus-go v0.1.0 custom-code pin ([f6646d2](https://github.com/dedalus-labs/dedalus-cli/commit/f6646d2614ca8eb8bea5f7a2da8bbb77b48681ae)) - -## 0.2.1 (2026-04-29) - -Full Changelog: [v0.2.0...v0.2.1](https://github.com/dedalus-labs/dedalus-cli/compare/v0.2.0...v0.2.1) - -### Bug Fixes - -* **cli:** correctly load zsh autocompletion ([53e9ec6](https://github.com/dedalus-labs/dedalus-cli/commit/53e9ec62582857ca55d3c7d14fb68caf8812f76a)) - -## 0.2.0 (2026-04-22) - -Full Changelog: [v0.1.0...v0.2.0](https://github.com/dedalus-labs/dedalus-cli/compare/v0.1.0...v0.2.0) - -### Features - -* allow `-` as value representing stdin to binary-only file parameters in CLIs ([7da15e2](https://github.com/dedalus-labs/dedalus-cli/commit/7da15e2f6c1d715fc55e26fa2bd7be95eba5ff0e)) -* better error message if scheme forgotten in CLI `*_BASE_URL`/`--base-url` ([5edec04](https://github.com/dedalus-labs/dedalus-cli/commit/5edec044b3dda53824fa2981ffe94b557fc3ce65)) -* binary-only parameters become CLI flags that take filenames only ([0875d6c](https://github.com/dedalus-labs/dedalus-cli/commit/0875d6c6e2426509185f56022f763b2927b07af2)) -* **cli:** add `--raw-output`/`-r` option to print raw (non-JSON) strings ([d7201c6](https://github.com/dedalus-labs/dedalus-cli/commit/d7201c60f8794ec1c0fe6fcfdd85ece68996c7f9)) -* **cli:** alias parameters in data with `x-stainless-cli-data-alias` ([5a62637](https://github.com/dedalus-labs/dedalus-cli/commit/5a6263723604bb1a35fbc53c5f99e7fd7fd0463a)) -* **cli:** send filename and content type when reading input from files ([21ec6dd](https://github.com/dedalus-labs/dedalus-cli/commit/21ec6dd8f92d9feafd9e43abd08f9f9fddddf64a)) - - -### Bug Fixes - -* fall back to main branch if linking fails in CI ([87613ec](https://github.com/dedalus-labs/dedalus-cli/commit/87613ecfe5030a1a76be6dcfdb29161ff58a2550)) -* fix for failing to drop invalid module replace in link script ([547c3e1](https://github.com/dedalus-labs/dedalus-cli/commit/547c3e146cf035cee1b466a85a06529c0117edf2)) -* fix quoting typo ([575418c](https://github.com/dedalus-labs/dedalus-cli/commit/575418c4b4a58aa2496fef880d038c59da9e7fb8)) - - -### Chores - -* add documentation for ./scripts/link ([6d33e1a](https://github.com/dedalus-labs/dedalus-cli/commit/6d33e1af76dc27b3c70c252b1d28894050b0a7dc)) -* add install.ps1 for Windows ([#14](https://github.com/dedalus-labs/dedalus-cli/issues/14)) ([bcc4657](https://github.com/dedalus-labs/dedalus-cli/commit/bcc46570a2f7da106880f864936e0e95bf0cb52b)) -* **ci:** add github env support for goreleaser ([158e705](https://github.com/dedalus-labs/dedalus-cli/commit/158e705d900c2cda1e52b8984e821044a7ac38fe)) -* **ci:** remove release-doctor workflow ([2a1a9d8](https://github.com/dedalus-labs/dedalus-cli/commit/2a1a9d8c0b94a6c06c2ab828c1c8a6fbf1382f39)) -* **ci:** support manually triggering release workflow ([cf0bd76](https://github.com/dedalus-labs/dedalus-cli/commit/cf0bd764b2563d4ab838a99c6ebbf1c45b7ae3e3)) -* **cli:** additional test cases for `ShowJSONIterator` ([c64d07c](https://github.com/dedalus-labs/dedalus-cli/commit/c64d07ce2e2819b489ee60e500379bb3d3b4fc67)) -* **cli:** default to jsonl format ([4a34328](https://github.com/dedalus-labs/dedalus-cli/commit/4a3432861ff1ba54f4d1b13d7481d9bef18ceb49)) -* **cli:** fall back to JSON when using default "explore" with non-TTY ([3b62e8d](https://github.com/dedalus-labs/dedalus-cli/commit/3b62e8d1b6b6305b4cb36aec45abf4f88d3b6a2c)) -* **cli:** let `--format raw` be used in conjunction with `--transform` ([c913d27](https://github.com/dedalus-labs/dedalus-cli/commit/c913d2739ca2f58b5498e7aea3b644b4068a1fe8)) -* **cli:** switch long lists of positional args over to param structs ([86bdc85](https://github.com/dedalus-labs/dedalus-cli/commit/86bdc85c82d6f81d2d0614cb7e705b55ece80fe7)) -* **cli:** use `ShowJSONOpts` as argument to `formatJSON` instead of many positionals ([a19782c](https://github.com/dedalus-labs/dedalus-cli/commit/a19782cd7fed5d41883ed7800b6d2c4c0bde7ced)) -* **internal:** more robust bootstrap script ([6fbf8f5](https://github.com/dedalus-labs/dedalus-cli/commit/6fbf8f509d44d42ad50ccc7cb59b62d443ff6a7e)) -* mark all CLI-related tests in Go with `t.Parallel()` ([7d1a565](https://github.com/dedalus-labs/dedalus-cli/commit/7d1a565862ae3190b48e40ff892073eca20a5480)) -* modify CLI tests to inject stdout so mutating `os.Stdout` isn't necessary ([6073189](https://github.com/dedalus-labs/dedalus-cli/commit/6073189d85a64ac3d53c0f8b08899a2b617740b8)) -* switch some CLI Go tests from `os.Chdir` to `t.Chdir` ([ba52bbe](https://github.com/dedalus-labs/dedalus-cli/commit/ba52bbea1667ea208f169c8b1b768e714ad3eeb7)) -* **tests:** bump steady to v0.22.1 ([544f575](https://github.com/dedalus-labs/dedalus-cli/commit/544f575622b41ceb09a9491a1c28898e09142757)) - -## 0.1.0 (2026-04-02) - -Full Changelog: [v0.0.4...v0.1.0](https://github.com/dedalus-labs/dedalus-cli/compare/v0.0.4...v0.1.0) - -### Features - -* **api:** add sleep & wake methods ([1fac358](https://github.com/dedalus-labs/dedalus-cli/commit/1fac358baa8165f7f27ee2de287c5d40f6b34149)) - - -### Chores - -* **deps:** bump dedalus-go to v0.1.0 ([#12](https://github.com/dedalus-labs/dedalus-cli/issues/12)) ([e167131](https://github.com/dedalus-labs/dedalus-cli/commit/e167131e75828424fd144682754314b3731d13c5)) - -## 0.0.4 (2026-04-01) - -Full Changelog: [v0.0.3...v0.0.4](https://github.com/dedalus-labs/dedalus-cli/compare/v0.0.3...v0.0.4) - -### Features - -* set CLI flag constant values automatically where `x-stainless-const` is set ([d1a4106](https://github.com/dedalus-labs/dedalus-cli/commit/d1a4106fd2f001b4c178a49050a30504528c74ee)) - - -### Bug Fixes - -* fix for off-by-one error in pagination logic ([2eec67c](https://github.com/dedalus-labs/dedalus-cli/commit/2eec67c81e2d195c52e97c2d885d57bb3456ccdc)) -* handle empty data set using `--format explore` ([bfa5c16](https://github.com/dedalus-labs/dedalus-cli/commit/bfa5c16f7fadd9c6e85818815780ab9dac2fcc7b)) -* **ssh:** update ssh command for workspace-to-machine rename ([#10](https://github.com/dedalus-labs/dedalus-cli/issues/10)) ([7de7907](https://github.com/dedalus-labs/dedalus-cli/commit/7de7907e81bd678226d2b717ca684d632ce8db02)) -* use `RawJSON` when iterating items with `--format explore` in the CLI ([2963002](https://github.com/dedalus-labs/dedalus-cli/commit/296300221e8cf98a27bc927f044aacff4d73f5d9)) - - -### Chores - -* **api:** refresh codegen ([2b89c22](https://github.com/dedalus-labs/dedalus-cli/commit/2b89c22a7da48e6def715c9c3e273d9aea9fbb19)) -* **api:** rename workspaces to machines ([837411d](https://github.com/dedalus-labs/dedalus-cli/commit/837411d95bc147f00eb5e42f99f420e506752e6b)) -* **internal:** update multipart form array serialization ([a9a88ea](https://github.com/dedalus-labs/dedalus-cli/commit/a9a88ead67668ed1c2fdbb4b523dac9597a71d67)) -* omit full usage information when missing required CLI parameters ([8f88284](https://github.com/dedalus-labs/dedalus-cli/commit/8f88284f411c79bed22083d8322a3b9ef5d5faf0)) -* **tests:** bump steady to v0.20.1 ([d4a2e39](https://github.com/dedalus-labs/dedalus-cli/commit/d4a2e3908e4ec8e7bcca15b68d258dc692a178ee)) -* **tests:** bump steady to v0.20.2 ([1aa9e71](https://github.com/dedalus-labs/dedalus-cli/commit/1aa9e718c5d1ab377ed240d15d3027393880feec)) - -## 0.0.3 (2026-03-25) - -Full Changelog: [v0.0.2...v0.0.3](https://github.com/dedalus-labs/dedalus-cli/compare/v0.0.2...v0.0.3) - -### Bug Fixes - -* **api:** remove ssh command, rename stream-status to watch, drop wake-if-needed ([6c435f3](https://github.com/dedalus-labs/dedalus-cli/commit/6c435f3110f58e2b00f88a4618af66e19f4655ea)) -* **ssh:** remove deprecated wake_if_needed field, tidy deps ([982a108](https://github.com/dedalus-labs/dedalus-cli/commit/982a108033a4bee055187538c7f660db0246d7ef)) - - -### Chores - -* **ci:** skip lint on metadata-only changes ([421e8ad](https://github.com/dedalus-labs/dedalus-cli/commit/421e8ad850603793988df632dbb69db695894d56)) -* **internal:** codegen related update ([40bf2f7](https://github.com/dedalus-labs/dedalus-cli/commit/40bf2f75287c9661956079d19d99d9df152a6260)) -* **tests:** bump steady to v0.19.7 ([b60170b](https://github.com/dedalus-labs/dedalus-cli/commit/b60170b9f684e1ca711164495ebc302228336954)) - -## 0.0.2 (2026-03-23) - -Full Changelog: [v0.0.2...v0.0.2](https://github.com/dedalus-labs/dedalus-cli/compare/v0.0.2...v0.0.2) - -### Features - -* add default description for enum CLI flags without an explicit description ([c1794a0](https://github.com/dedalus-labs/dedalus-cli/commit/c1794a04c9d918b68a9c7f9d1c2226e0ce806830)) -* **api:** stable beta ([6e60912](https://github.com/dedalus-labs/dedalus-cli/commit/6e60912f712588b7e92f697809423b93d47cc8c2)) -* **ssh:** add ephemeral certificate SSH helper ([80069fa](https://github.com/dedalus-labs/dedalus-cli/commit/80069fad14b33673812488a8bc10e3f9a2bf08e6)) - - -### Bug Fixes - -* **api:** add stream-status to workspaces, remove ssh, migrate to steady ([47e0da2](https://github.com/dedalus-labs/dedalus-cli/commit/47e0da24a8f412ef57a0f2e048fbe7ec3569734f)) -* **api:** update flags ([52f718e](https://github.com/dedalus-labs/dedalus-cli/commit/52f718e5fa572db767c8697d8e7ababe6992ffc5)) -* avoid reading from stdin unless request body is form encoded or json ([522880b](https://github.com/dedalus-labs/dedalus-cli/commit/522880bc900f99d3be158f708491a517af46e81b)) -* better support passing client args in any position ([bb63352](https://github.com/dedalus-labs/dedalus-cli/commit/bb633524509e083e78807bf1b652280528bb41b5)) -* cli no longer hangs when stdin is attached to a pipe with empty input ([2407337](https://github.com/dedalus-labs/dedalus-cli/commit/2407337d6735e5745f4b418090109d4b80b46fc9)) -* improve linking behavior when developing on a branch not in the Go SDK ([69e4687](https://github.com/dedalus-labs/dedalus-cli/commit/69e468741b4d3abe8e710e047fb08633157ffdd2)) -* improved workflow for developing on branches ([9b81964](https://github.com/dedalus-labs/dedalus-cli/commit/9b81964097fab54a63bdf1b46a4bd3f556d6b8d3)) -* no longer require an API key when building on production repos ([02e3fa0](https://github.com/dedalus-labs/dedalus-cli/commit/02e3fa04b9c2d6229a0dee3218e5900b6cf4ae33)) -* **ssh:** add ephemeral certificate SSH helper ([#2](https://github.com/dedalus-labs/dedalus-cli/issues/2)) ([ce03f86](https://github.com/dedalus-labs/dedalus-cli/commit/ce03f86f59032c24a916fc47c102f5d8ce9500ec)) -* **ssh:** align types with dedalus-go SDK ([#4](https://github.com/dedalus-labs/dedalus-cli/issues/4)) ([75391d4](https://github.com/dedalus-labs/dedalus-cli/commit/75391d43a3f9491a2bff328f4b1ae5d5ce390e60)) - - -### Chores - -* add curl install script ([#6](https://github.com/dedalus-labs/dedalus-cli/issues/6)) ([2059194](https://github.com/dedalus-labs/dedalus-cli/commit/2059194992347690c1800282de0cc9730cf5c3dc)) -* **api:** update homebrew tap and code samples ([654e2de](https://github.com/dedalus-labs/dedalus-cli/commit/654e2de50b0f85b285b4932e0238a95d48d07d1a)) -* **internal:** tweak CI branches ([e8ef06a](https://github.com/dedalus-labs/dedalus-cli/commit/e8ef06ad15bcd56236656eae8b6f54587a989025)) -* **internal:** update gitignore ([596fc86](https://github.com/dedalus-labs/dedalus-cli/commit/596fc86aa50ed8f8746315a9fb6bba13c033ad93)) -* **tests:** bump steady to v0.19.4 ([a0028a5](https://github.com/dedalus-labs/dedalus-cli/commit/a0028a5b8d86175fe0e27c8944d9a3c79a26a71b)) -* **tests:** bump steady to v0.19.5 ([938cce6](https://github.com/dedalus-labs/dedalus-cli/commit/938cce6410f6c941751494d770726a9d8d581e72)) -* **tests:** bump steady to v0.19.6 ([4049dfc](https://github.com/dedalus-labs/dedalus-cli/commit/4049dfcd751f49d72966efcc3c42869a6a63d857)) - - -### Refactors - -* **tests:** switch from prism to steady ([a5a9877](https://github.com/dedalus-labs/dedalus-cli/commit/a5a98771bd92763cf690d2e737a52350029fc257)) - -## 0.0.2 (2026-03-18) - -Full Changelog: [v0.0.1...v0.0.2](https://github.com/dedalus-labs/dedalus-cli/compare/v0.0.1...v0.0.2) - -### Bug Fixes - -* improve linking behavior when developing on a branch not in the Go SDK ([69e4687](https://github.com/dedalus-labs/dedalus-cli/commit/69e468741b4d3abe8e710e047fb08633157ffdd2)) -* **ssh:** align types with dedalus-go SDK ([#4](https://github.com/dedalus-labs/dedalus-cli/issues/4)) ([75391d4](https://github.com/dedalus-labs/dedalus-cli/commit/75391d43a3f9491a2bff328f4b1ae5d5ce390e60)) - - -### Chores - -* **api:** update homebrew tap and code samples ([654e2de](https://github.com/dedalus-labs/dedalus-cli/commit/654e2de50b0f85b285b4932e0238a95d48d07d1a)) - -## 0.0.1 (2026-03-18) - -Full Changelog: [v0.0.1...v0.0.1](https://github.com/dedalus-labs/dedalus-cli/compare/v0.0.1...v0.0.1) - -### Features - -* **api:** stable beta ([6e60912](https://github.com/dedalus-labs/dedalus-cli/commit/6e60912f712588b7e92f697809423b93d47cc8c2)) -* **ssh:** add ephemeral certificate SSH helper ([80069fa](https://github.com/dedalus-labs/dedalus-cli/commit/80069fad14b33673812488a8bc10e3f9a2bf08e6)) - - -### Bug Fixes - -* **api:** update flags ([52f718e](https://github.com/dedalus-labs/dedalus-cli/commit/52f718e5fa572db767c8697d8e7ababe6992ffc5)) -* avoid reading from stdin unless request body is form encoded or json ([522880b](https://github.com/dedalus-labs/dedalus-cli/commit/522880bc900f99d3be158f708491a517af46e81b)) -* better support passing client args in any position ([bb63352](https://github.com/dedalus-labs/dedalus-cli/commit/bb633524509e083e78807bf1b652280528bb41b5)) -* improved workflow for developing on branches ([9b81964](https://github.com/dedalus-labs/dedalus-cli/commit/9b81964097fab54a63bdf1b46a4bd3f556d6b8d3)) -* no longer require an API key when building on production repos ([02e3fa0](https://github.com/dedalus-labs/dedalus-cli/commit/02e3fa04b9c2d6229a0dee3218e5900b6cf4ae33)) -* **ssh:** add ephemeral certificate SSH helper ([#2](https://github.com/dedalus-labs/dedalus-cli/issues/2)) ([ce03f86](https://github.com/dedalus-labs/dedalus-cli/commit/ce03f86f59032c24a916fc47c102f5d8ce9500ec)) - - -### Chores - -* **internal:** tweak CI branches ([e8ef06a](https://github.com/dedalus-labs/dedalus-cli/commit/e8ef06ad15bcd56236656eae8b6f54587a989025)) diff --git a/README.md b/README.md index fe850d7..b95deec 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The full API of this library can be found in [api.md](./api.md). - [Signing In](#signing-in) - [File Arguments](#file-arguments) - [Shell Completion](#shell-completion) +- [Upgrading](#upgrading) - [Manual Pages](#manual-pages) - [Authentication](#authentication) - [Errors](#errors) @@ -29,6 +30,10 @@ The full API of this library can be found in [api.md](./api.md). ## Installation ```sh +# Install script — standalone binary for macOS and Linux, no Node.js required +curl -fsSL https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/install.sh | bash +# Installs into ~/.local/bin and puts it on PATH; set DEDALUS_INSTALL_DIR to choose another directory + # npm (requires Node.js) npm install -g dedalus-cli @@ -36,7 +41,7 @@ npm install -g dedalus-cli brew install dedalus-labs/tap/dedalus # Direct download — standalone binary, no Node.js required -curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz +curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz dedalus sudo mv dedalus /usr/local/bin/ # Windows — download and extract dedalus-windows-x64.zip, then add it to PATH @@ -51,7 +56,7 @@ sudo mv dedalus /usr/local/bin/ dedalus [resource] [command] [flags] dedalus machines create \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --autosleep '300s' \ --memory-mib '4096' \ --storage-gib '10' \ @@ -66,7 +71,7 @@ See the [API reference](./api.md) for every available operation. ## Signing In -`dedalus login` signs you in and saves the credential for later commands, so it does not have to be passed every time. It goes into your operating system's credential store — the system keyring on Linux, Credential Manager on Windows — and falls back to a file in your state directory, readable only by you, when no such store is available. On macOS it is always that file, because the system's own tool accepts a password only on its command line, where other processes could read it. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. `dedalus logout` forgets it. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. Sign-in methods: api-key, x-api-key. Pass `--flow ` to pick one without being asked. +`dedalus login` signs you in and saves the credential for later commands, so it does not have to be passed every time. It goes into your operating system's credential store — the Keychain on macOS, the system keyring on Linux, Credential Manager on Windows — and falls back to a file in your state directory, readable only by you, when no such store is available. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. `dedalus logout` forgets it. It also asks the provider to revoke a saved OAuth token when a revocation endpoint is known. The local copy is removed first, so if the provider cannot be reached the credential is still gone from this machine; the failure is printed as a warning and the command still succeeds. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. Sign-in methods: api-key, x-api-key, oauth-browser. Pass `--flow ` to pick one without being asked. ```sh dedalus login @@ -107,6 +112,20 @@ dedalus completion fish | source
+## Upgrading + +`dedalus upgrade` installs the latest release. When dedalus was installed through a package manager — Homebrew or npm — it runs that manager's own upgrade instead of replacing files the manager owns. An install made by the install script is replaced in place, with no `sudo`; running the script again does the same. `dedalus upgrade --check` reports the latest version without installing it, and `dedalus uninstall` says how to remove this installation. dedalus also checks for a newer release at most once a day, and mentions it on stderr when one exists. The check is skipped entirely when output is redirected, when `CI` is set, and under `sudo`; set `DEDALUS_NO_UPDATE_NOTIFIER` or `NO_UPDATE_NOTIFIER` to turn it off everywhere. + +```sh +dedalus upgrade --check +dedalus upgrade + +# Never contact GitHub to check for a newer release +export DEDALUS_NO_UPDATE_NOTIFIER=1 +``` + +
+ ## Manual Pages Installing the package globally also installs man pages. `man dedalus` lists every command, and each command has its own page named after the command with spaces and `:` replaced by `-`. @@ -124,13 +143,15 @@ Pass credentials to the generated client constructor. Environment variables are | Option | Type | Default | Description | | --- | --- | --- | --- | -| `--api-key` | `string \| provider` | - | Dedalus API key or short-lived delegated access token in Authorization: Bearer . Defaults to DEDALUS_API_KEY. | -| `--x-api-key` | `string \| provider` | - | Dedalus API key. Alternative to Bearer token. Defaults to DEDALUS_X_API_KEY. | +| `--api-key` | `` | - | Dedalus API key or short-lived delegated access token in `Authorization: Bearer `. Defaults to DEDALUS_API_KEY. | +| `--x-api-key` | `` | - | Dedalus API key. Alternative to Bearer token. Defaults to DEDALUS_X_API_KEY. | +| `--browser-token` | `` | - | Credential for the BrowserAuth scheme. Defaults to DEDALUS_BROWSER_TOKEN. | Declared schemes: - `ApiKeyAuth` API key in header `x-api-key` - `BearerAuth` bearer token +- `BrowserAuth` OAuth2/OpenID Connect
@@ -138,7 +159,7 @@ Declared schemes: Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. -Documented error statuses: `401`, `403`, `409`, `429`, `503`, `default`. +Documented error statuses: `400`, `401`, `402`, `403`, `404`, `409`, `422`, `429`, `500`, `503`, `504`, `default`.
diff --git a/SKILL.md b/SKILL.md index 0babfdb..b7fa701 100644 --- a/SKILL.md +++ b/SKILL.md @@ -10,6 +10,10 @@ Generated CLI client for Dedalus API, published as `dedalus-cli`. Use the genera ## Install ```sh +# Install script — standalone binary for macOS and Linux, no Node.js required +curl -fsSL https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/install.sh | bash +# Installs into ~/.local/bin and puts it on PATH; set DEDALUS_INSTALL_DIR to choose another directory + # npm (requires Node.js) npm install -g dedalus-cli @@ -17,7 +21,7 @@ npm install -g dedalus-cli brew install dedalus-labs/tap/dedalus # Direct download — standalone binary, no Node.js required -curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz +curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz dedalus sudo mv dedalus /usr/local/bin/ # Windows — download and extract dedalus-windows-x64.zip, then add it to PATH @@ -28,8 +32,9 @@ sudo mv dedalus /usr/local/bin/ Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them: -- `--api-key` (env: `DEDALUS_API_KEY`) — Dedalus API key or short-lived delegated access token in Authorization: Bearer . +- `--api-key` (env: `DEDALUS_API_KEY`) — Dedalus API key or short-lived delegated access token in `Authorization: Bearer `. - `--x-api-key` (env: `DEDALUS_X_API_KEY`) — Dedalus API key. Alternative to Bearer token. +- `--browser-token` (env: `DEDALUS_BROWSER_TOKEN`) — Credential for the BrowserAuth scheme. ## Calling operations @@ -37,7 +42,7 @@ Provide credentials using the options below. Environment variables are read auto dedalus [resource] [command] [flags] dedalus machines create \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --autosleep '300s' \ --memory-mib '4096' \ --storage-gib '10' \ diff --git a/VERSIONING.md b/VERSIONING.md index f9cf7dd..dcde77a 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -36,12 +36,13 @@ not have picked — **edit the release PR title** to the version you want: release: 1.0.0 ``` -The `Release PR version` check turns red as soon as you save, because the version in the +The `Release PR version` check goes pending as soon as you save, because the version in the title no longer matches the version committed in the PR. The Scalar platform then re-renders the release PR at your version (changelog, manifest, and every version-bearing file), the title comes back as `release: 1.0.0`, and the check turns green. **Wait for it to be green before merging** — merging in between would tag a release whose own files still carry the -old version. +old version. The check only turns red if the title is not a full semver version, or if the +re-render has not arrived within 10 minutes. The git-native equivalent, if you would rather not touch the PR: push an empty commit with a `Release-As` footer to `scalar-next`. This is exactly what the title edit does for you. @@ -95,6 +96,6 @@ Releases work without this; it closes a window where one can go out at the wrong - **If this repository uses auto-merge, make the `Release PR version` check a required status check.** Auto-merge merges as soon as the checks that are *required* go green, with no - human present — so a check that is not required but still red at that moment stops + human present — so a check that is not required but still pending at that moment stops nothing, which is exactly the window between retitling a release PR and the platform re-rendering it. diff --git a/api.md b/api.md index 7103b9b..c75bc10 100644 --- a/api.md +++ b/api.md @@ -13,6 +13,7 @@ Complete reference of every operation, grouped by resource. See [the README](./R - [Sleep a running machine](#sleep-a-running-machine) - [Wake a sleeping machine](#wake-a-sleeping-machine) - [Reboot a machine with fresh memory](#reboot-a-machine-with-fresh-memory) + - [Resize machine](#resize-machine) - [`Machines Ssh`](#machines-ssh) - [List SSH sessions](#list-ssh-sessions) - [Create SSH session](#create-ssh-session) @@ -27,29 +28,36 @@ Complete reference of every operation, grouped by resource. See [the README](./R - [List execution events](#list-execution-events) - [`Machines Executions Logs`](#machines-executions-logs) - [Get execution log status](#get-execution-log-status) - - [Reauthorize execution log publication](#reauthorize-execution-log-publication) - [Create execution log read token](#create-execution-log-read-token) - [`Machines Autoresizing`](#machines-autoresizing) - - [Read this machine's RAM autoresizing settings](#read-this-machines-ram-autoresizing-settings) - - [Set this machine's RAM autoresizing settings](#set-this-machines-ram-autoresizing-settings) + - [Read this machine's autoresizing settings](#read-this-machines-autoresizing-settings) + - [Set this machine's autoresizing settings](#set-this-machines-autoresizing-settings) - [`Organization`](#organization) - [`Organization Autoresizing`](#organization-autoresizing) - - [Read organization RAM autoresizing policy](#read-organization-ram-autoresizing-policy) - - [Set organization RAM autoresizing policy](#set-organization-ram-autoresizing-policy) + - [Read organization autoresizing policy](#read-organization-autoresizing-policy) + - [Set organization autoresizing policy](#set-organization-autoresizing-policy) +- [`Images`](#images) + - [List image IDs owned by the authenticated organization](#list-image-ids-owned-by-the-authenticated-organization) + - [Register an immutable OCI image for preparation](#register-an-immutable-oci-image-for-preparation) + - [Read preparation status for an organization-owned image](#read-preparation-status-for-an-organization-owned-image) + - [Rename an organization-owned image](#rename-an-organization-owned-image) + - [Delete an organization-owned image](#delete-an-organization-owned-image) + - [`Images Uploads`](#images-uploads) + - [Reserve an immutable Docker image archive upload](#reserve-an-immutable-docker-image-archive-upload) ## `Machines` ### List machines ```sh -dedalus machines list --x-api-key "$DEDALUS_X_API_KEY" --max-items 10 +dedalus machines list --browser-token "$DEDALUS_BROWSER_TOKEN" --max-items 10 ``` ### Create machine ```sh dedalus machines create \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --autosleep '300s' \ --memory-mib '4096' \ --storage-gib '10' \ @@ -60,15 +68,17 @@ dedalus machines create \ ```sh dedalus machines retrieve \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` ### Update machine +Changes settings such as autosleep. + ```sh dedalus machines update \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` @@ -76,7 +86,7 @@ dedalus machines update \ ```sh dedalus machines delete \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` @@ -84,7 +94,7 @@ dedalus machines delete \ ```sh dedalus machines sleep \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` @@ -92,7 +102,7 @@ dedalus machines sleep \ ```sh dedalus machines wake \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` @@ -102,7 +112,17 @@ Checkpoints files and replaces the runtime. The machine ID and filesystem are pr ```sh dedalus machines reboot \ - --x-api-key "$DEDALUS_X_API_KEY" \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' +``` + +### Resize machine + +Wakes a sleeping Machine, then waits up to 30 seconds for the host to confirm CPU and RAM. Returns the Machine with its confirmed size. After RESIZE_TIMEOUT, repeat the same request and Idempotency-Key to wait again. + +```sh +dedalus machines resize \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` @@ -111,8 +131,8 @@ dedalus machines reboot \ #### List SSH sessions ```sh -dedalus machines:ssh list \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines ssh list \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --max-items 10 ``` @@ -120,8 +140,8 @@ dedalus machines:ssh list \ #### Create SSH session ```sh -dedalus machines:ssh create \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines ssh create \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --public-key '' ``` @@ -129,8 +149,8 @@ dedalus machines:ssh create \ #### Get SSH session ```sh -dedalus machines:ssh retrieve \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines ssh retrieve \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --session-id 'session_id' ``` @@ -138,8 +158,8 @@ dedalus machines:ssh retrieve \ #### Delete SSH session ```sh -dedalus machines:ssh delete \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines ssh delete \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --session-id 'session_id' ``` @@ -149,8 +169,8 @@ dedalus machines:ssh delete \ #### List executions ```sh -dedalus machines:executions list \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions list \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --max-items 10 ``` @@ -158,8 +178,8 @@ dedalus machines:executions list \ #### Create execution ```sh -dedalus machines:executions create \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions create \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --command '[""]' ``` @@ -167,8 +187,8 @@ dedalus machines:executions create \ #### Get execution ```sh -dedalus machines:executions retrieve \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions retrieve \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --execution-id 'execution_id' ``` @@ -176,8 +196,8 @@ dedalus machines:executions retrieve \ #### Delete execution ```sh -dedalus machines:executions delete \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions delete \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --execution-id 'execution_id' ``` @@ -185,8 +205,8 @@ dedalus machines:executions delete \ #### Get execution output ```sh -dedalus machines:executions output \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions output \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --execution-id 'execution_id' ``` @@ -194,8 +214,8 @@ dedalus machines:executions output \ #### List execution events ```sh -dedalus machines:executions events \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions events \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --execution-id 'execution_id' \ --max-items 10 @@ -206,17 +226,8 @@ dedalus machines:executions events \ ##### Get execution log status ```sh -dedalus machines:executions:logs retrieve \ - --x-api-key "$DEDALUS_X_API_KEY" \ - --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ - --execution-id 'execution_id' -``` - -##### Reauthorize execution log publication - -```sh -dedalus machines:executions:logs reauthorize \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions logs retrieve \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --execution-id 'execution_id' ``` @@ -224,43 +235,106 @@ dedalus machines:executions:logs reauthorize \ ##### Create execution log read token ```sh -dedalus machines:executions:logs create-token \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines executions logs create-token \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ --execution-id 'execution_id' ``` ### `Machines Autoresizing` -#### Read this machine's RAM autoresizing settings +#### Read this machine's autoresizing settings ```sh -dedalus machines:autoresizing retrieve \ - --x-api-key "$DEDALUS_X_API_KEY" \ +dedalus machines autoresizing retrieve \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` -#### Set this machine's RAM autoresizing settings +#### Set this machine's autoresizing settings + +Changes RAM, CPU or both for this machine. An absent resource keeps its setting. ```sh -dedalus machines:autoresizing update \ - --x-api-key "$DEDALUS_X_API_KEY" \ - --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ - --enabled +dedalus machines autoresizing update \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` ## `Organization` ### `Organization Autoresizing` -#### Read organization RAM autoresizing policy +#### Read organization autoresizing policy + +```sh +dedalus organization autoresizing retrieve --browser-token "$DEDALUS_BROWSER_TOKEN" +``` + +#### Set organization autoresizing policy + +Changes defaults copied to new Machines. Existing Machines retain their own policy. + +```sh +dedalus organization autoresizing update --browser-token "$DEDALUS_BROWSER_TOKEN" +``` + +## `Images` + +### List image IDs owned by the authenticated organization + +Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. + +```sh +dedalus images list --browser-token "$DEDALUS_BROWSER_TOKEN" --limit '100' +``` + +### Register an immutable OCI image for preparation + +Requires an entitled organization and linux/amd64 on the current fleet. Acceptance queues preparation; only a ready image can launch a machine. Private registry credentials are not yet supported. + +```sh +dedalus images create \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --platform 'linux/amd64' \ + --source '{"kind":""}' +``` + +### Read preparation status for an organization-owned image + +A preparing image reports its stage, the worker's last step and an estimated percent of the whole preparation. A failed image names the cause: IMAGE_OS_UNSUPPORTED, IMAGE_SOURCE_INVALID, IMAGE_SOURCE_NOT_FOUND and IMAGE_SOURCE_UNAUTHORIZED describe the image or its reference and are final; IMAGE_SOURCE_UNAVAILABLE, IMAGE_REGISTRY_UNREACHABLE, IMAGE_REGISTRY_RATE_LIMITED, IMAGE_ARCHIVE_UNAVAILABLE and IMAGE_EXECUTION_FAILED describe this attempt and are retryable with a new idempotency key. + +```sh +dedalus images retrieve --browser-token "$DEDALUS_BROWSER_TOKEN" --image-id 'image_id' +``` + +### Rename an organization-owned image + +Changes only the name. The image's source, platform and state are immutable. ```sh -dedalus organization:autoresizing retrieve --x-api-key "$DEDALUS_X_API_KEY" +dedalus images update \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --image-id 'image_id' \ + --name '' ``` -#### Set organization RAM autoresizing policy +### Delete an organization-owned image + +The image can create no new Machine and no longer counts against the organization's image limit. Machines already running from it keep working. The image stays readable, and deleting it again returns the same image. + +```sh +dedalus images delete --browser-token "$DEDALUS_BROWSER_TOKEN" --image-id 'image_id' +``` + +### `Images Uploads` + +#### Reserve an immutable Docker image archive upload ```sh -dedalus organization:autoresizing update --x-api-key "$DEDALUS_X_API_KEY" --enabled +dedalus images uploads create \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --platform '' \ + --sha256 '' \ + --size-bytes '0' ``` diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..fef8b52 --- /dev/null +++ b/install.sh @@ -0,0 +1,399 @@ +#!/bin/sh +# Generated by the Scalar SDK Generator. Edits here are overwritten on the next generation. +# +# Installs the standalone dedalus executable from this project's GitHub releases: +# +# curl -fsSL https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/install.sh | bash +# +# Re-running it upgrades an existing install in place, and so does `dedalus upgrade`: both download +# the archive built for this machine, verify it against the release's `checksums.txt`, and replace +# the executable with one atomic rename. +# +# Options, read from the environment, or the version as the first argument (`| bash -s -- 1.2.3`): +# DEDALUS_VERSION release to install, such as 1.2.3 (default: the latest release) +# DEDALUS_INSTALL_DIR directory to install into (default: $HOME/.local/bin) +# DEDALUS_NO_MODIFY_PATH set to leave shell startup files alone and print the PATH line instead +# +# When the install directory is not on PATH, the script adds it for new shells by appending one line to +# the startup file of your shell (zsh's .zshrc, ~/.bashrc, the login file bash reads on macOS, fish's +# conf.d, or ~/.profile for other POSIX shells), and says which file it changed. +# +# POSIX sh rather than bash, so `| sh` works as well as `| bash` on a system with no bash at all. +set -eu + +BIN='dedalus' +REPO='dedalus-labs/dedalus-cli' + +# Everything runs from `main`, called on the script's last line. A download cut off partway leaves the +# shell holding a function it never reaches the call for, so a truncated script does nothing rather +# than running whichever commands happened to arrive. +main() { + version="${1:-${DEDALUS_VERSION:-latest}}" + install_dir="${DEDALUS_INSTALL_DIR:-${HOME:?HOME is not set; set DEDALUS_INSTALL_DIR instead}/.local/bin}" + + target="$(detect_target)" + asset="${BIN}-${target}.tar.gz" + if [ "$version" = latest ]; then + base="https://github.com/${REPO}/releases/latest/download" + else + # Release tags carry a `v`; accept the version with or without one. + base="https://github.com/${REPO}/releases/download/v${version#v}" + fi + + staging="$(mktemp -d "${TMPDIR:-/tmp}/${BIN}-install.XXXXXX")" + pending='' + # An interrupt exits rather than resuming, so the EXIT trap is the one place the cleanup runs — and it + # covers the file staged in the install directory too, so a failure between staging and the rename + # does not leave an executable dotfile on PATH. + trap 'rm -rf "$staging"; [ -z "$pending" ] || rm -f "$pending"' EXIT + # HUP too: dash runs no EXIT trap when killed by a signal it does not trap, and closing the terminal + # mid-install sends HUP. + trap 'exit 1' HUP INT TERM + + say "Downloading ${asset}" + fetch "${base}/${asset}" "${staging}/${asset}" + fetch "${base}/checksums.txt" "${staging}/checksums.txt" + + # The same verification `upgrade` performs, so the first install is held to the bar every later one + # is. An archive the release publishes no checksum for is refused, not installed unverified. + # + # The two downloads above resolve `latest` independently, so a release landing between them pairs one + # release's archive with the next one's checksums. That fails here rather than installing anything, + # which is the outcome to want — but "checksum mismatch" on its own reads as a compromised download, + # so the `latest` case says that re-running is the fix. + retry='' + [ "$version" != latest ] || retry='; if a new release landed mid-install, re-running installs it' + expected="$(awk -v name="$asset" '$2 == name { print $1 }' "${staging}/checksums.txt")" + [ -n "$expected" ] || fail "the release publishes no checksum for ${asset}${retry}" + actual="$(sha256 "${staging}/${asset}")" + [ "$actual" = "$expected" ] || + fail "checksum mismatch for ${asset} (expected ${expected}, got ${actual})${retry}" + + tar -xzf "${staging}/${asset}" -C "$staging" + [ -f "${staging}/${BIN}" ] || fail "${asset} did not contain the expected ${BIN} executable" + + mkdir -p "$install_dir" + # Staged inside the install directory so the final `mv` is a rename within one filesystem: atomic, + # and safe over a copy of the command that is running right now. Created by `mktemp`, which refuses + # an existing name, rather than at a predictable one: `cp` and `chmod` follow a symlink, so under + # `sudo` into a group-writable directory a link planted at a guessable name would choose a file for + # root to overwrite. + pending="$(mktemp "${install_dir}/.${BIN}.install.XXXXXX")" + cat "${staging}/${BIN}" >"$pending" + chmod 755 "$pending" + + # Run before it replaces anything, so a build this machine cannot execute — a 32-bit userland on a + # 64-bit kernel reports a 64-bit `uname -m` — fails here and leaves a working install untouched. + installed="$("$pending" --version 2>/dev/null)" || + fail "the downloaded ${BIN} does not run on this machine ($(uname -s) $(uname -m)); nothing was changed" + mv -f "$pending" "${install_dir}/${BIN}" + pending='' + + say "Installed ${BIN}${installed:+ ${installed}} to ${install_dir}/${BIN}" + setup_path "$install_dir" +} + +# Prints a progress line on stderr, keeping stdout free for anything piping this script's output. +say() { + printf '%s\n' "$*" >&2 +} + +# Reports a failure and stops. +fail() { + printf 'error: %s\n' "$*" >&2 + exit 1 +} + +# Maps this machine onto the release asset suffix the release step packs: `-`. +detect_target() { + case "$(uname -s)" in + Darwin) os=darwin ;; + Linux) os=linux ;; + *) fail "no ${BIN} release is published for $(uname -s); on Windows, download ${BIN}-windows-x64.zip from https://github.com/${REPO}/releases/latest" ;; + esac + case "$(uname -m)" in + x86_64 | amd64) arch=x64 ;; + arm64 | aarch64) arch=arm64 ;; + *) fail "no ${BIN} release is published for $(uname -m)" ;; + esac + # A shell running under Rosetta reports x86_64 on Apple Silicon. The native build is the one to + # install there: it is faster, and it does not stop working if Rosetta is removed. + if [ "$os" = darwin ] && [ "$arch" = x64 ] && [ "$(sysctl -n sysctl.proc_translated 2>/dev/null || true)" = 1 ]; then + arch=arm64 + fi + # The Linux builds link against glibc, so on a musl system (Alpine) the executable would install + # and then fail to start. Said up front instead. + if [ "$os" = linux ] && ldd --version 2>&1 | grep -qi musl; then + fail "the ${BIN} Linux release is built for glibc and does not run on musl; install the npm package instead" + fi + printf '%s-%s\n' "$os" "$arch" +} + +# Downloads a URL to a file with curl, or wget where curl is missing. Fails on an HTTP error rather +# than saving the error page as the archive. +# +# Pinned to HTTPS, and `-L` is why that matters: the URL this is given is always `https://`, but a +# redirect decides the scheme of the *next* hop, so without the pin a redirect could walk the download +# down to plain HTTP and the checksum would then be verifying whatever that answered. `--proto '=https'` +# refuses any other scheme at any hop and `--tlsv1.2` sets a floor; `--https-only` is wget's spelling +# of the same thing. Both are long-standing options, so neither narrows which machines can install. +fetch() { + if command -v curl >/dev/null 2>&1; then + curl -fsSL --proto '=https' --tlsv1.2 --retry 3 -o "$2" "$1" || fail "could not download $1" + elif command -v wget >/dev/null 2>&1; then + wget -q --https-only -O "$2" "$1" || fail "could not download $1" + else + fail "curl or wget is required to download ${BIN}" + fi +} + +# SHA-256 of a file: `sha256sum` on Linux, `shasum` on macOS. +sha256() { + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "$1" | awk '{ print $1 }' + elif command -v shasum >/dev/null 2>&1; then + shasum -a 256 "$1" | awk '{ print $1 }' + else + fail "sha256sum or shasum is required to verify the download" + fi +} + +# Puts the install directory on PATH for every new shell when it is not on PATH already, so the command +# works by name straight after installing: one guarded line appended to the startup file of the user's +# shell, the way most `curl | sh` installers do it. When that is unwanted or unsafe, it says which check +# declined and what to do instead. When the directory is on PATH already, this only names any other copy +# of the command that would run instead of this one. +setup_path() { + dir="$1" + # A trailing slash names the same directory as a PATH entry without one, so it must not read as missing. + while [ "${dir%/}" != "$dir" ] && [ "$dir" != / ]; do dir="${dir%/}"; done + # The real location too, since that is what a line written by an earlier run names. + real='' + case "$dir" in /*) real="$(cd -P -- "$dir" 2>/dev/null && pwd -P)" || real='' ;; esac + + for entry in "$dir" "$real"; do + [ -n "$entry" ] || continue + case ":${PATH}:" in + *":${entry}:"*) + found="$(command -v "$BIN" 2>/dev/null || true)" + if [ -n "$found" ] && [ "$found" != "${dir}/${BIN}" ] && [ "$found" != "${real}/${BIN}" ]; then + say "note: ${found} comes first on PATH, so \`${BIN}\` still runs that copy" + fi + return 0 + ;; + esac + done + + shell_name="${SHELL:-}" + shell_name="${shell_name##*/}" + profile="$(shell_profile "$shell_name")" + # `~/.profile` is read by login shells only, which a new terminal window is not on Linux; macOS + # terminals open login shells, so a new one is enough there. + reload='Open a new terminal' + case "$profile" in */.profile) [ "$(uname -s)" = Darwin ] || reload='Log out and back in' ;; esac + # Whether the directory itself is safe to put on PATH, decided before anything else so that the line is + # never offered for pasting when it is not — whichever check ends up declining. `advice` replaces the + # paste-ready line where pasting it would be wrong: a relative entry that follows the current + # directory, a path a shell would parse, or a directory other accounts can change, where the line + # would create the exposure these checks exist to prevent. + unsafe='' + advice='' + entry='' + # Root with another user's home directory — `sudo` keeps HOME on some systems, as do `su` and `doas` — + # would find that user's startup file, and a root-owned line in it would outlive this install; that + # user's directories would also all read as foreign to root. Who owns HOME decides it, not how root got + # here: `sudo -i`, or a `sudo` that resets HOME to /root, leaves root in a home of its own, which is + # treated like any other account, as is a container build. + borrowed='' + if [ "$(id -u)" = 0 ] && [ -n "${HOME:-}" ] && + [ -z "$(find "${HOME}/." -prune -user 0 -print 2>/dev/null)" ]; then + borrowed=yes + fi + case "$dir" in + /*) ;; + *) + unsafe='the path is relative' + advice='Set DEDALUS_INSTALL_DIR to an absolute path and run this script again.' + ;; + esac + if [ -n "$unsafe" ]; then + : + elif [ -z "$real" ]; then + unsafe="${dir} could not be resolved" + advice='Check that the directory exists and that you can enter it.' + elif ! entry="$(path_entry "$real")"; then + unsafe="${real} holds a character that cannot be written safely into a startup file" + advice='Install into a directory whose path holds only letters, digits and / . _ + @ -, or add it to PATH yourself, quoted for your shell.' + elif [ -n "$borrowed" ]; then + # Not judged, so no line is offered either; the advice below depends on why the script declined. + : + elif ! path_dir_is_private "$real"; then + unsafe="${real}, or a directory above it, can be changed by another account" + advice='Install into a directory only you can change instead, such as the default $HOME/.local/bin.' + fi + + # Each check that declines names itself, so the user knows what to change. + why='' + if [ -n "${DEDALUS_NO_MODIFY_PATH:-}" ]; then + why='DEDALUS_NO_MODIFY_PATH is set' + elif [ -z "$profile" ]; then + why="it does not know the startup file for ${shell_name:-your shell}" + elif [ -n "$borrowed" ]; then + why="it is running as root with another user's home directory" + elif [ -n "$unsafe" ]; then + why="$unsafe" + fi + # A directory root did not judge gets no line to paste. Only when root was the reason does running as + # the home directory's owner get the line added; otherwise it only gets the directory checked. + if [ -n "$borrowed" ] && [ -z "$advice" ]; then + case "$why" in + *'as root'*) advice='Run this script again as the owner of your home directory (without sudo, su or doas) to have it add the directory to PATH.' ;; + *) advice='Run this script as the owner of your home directory (without sudo, su or doas) to have the directory checked.' ;; + esac + # Under the borrowed home, this run may have just created the directory as root, and then that re-run + # could not install into it. Only there: a directory elsewhere, such as a system one under /opt, was + # never the home owner's to give back. The owner's name comes from `ls` and the path is the checked + # entry, so both print safely; an owner name outside the usual characters is left out rather than + # printed into a command. + owner="$(ls -ld "${HOME}/." 2>/dev/null | awk '{ print $3 }')" + case "$owner" in '' | *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-]*) owner='' ;; esac + case "$entry" in '$HOME/'*) ;; *) owner='' ;; esac + if [ -n "$owner" ] && [ -z "$(find "${real}/." -prune -user "$owner" -print 2>/dev/null)" ]; then + advice="${advice} The directory belongs to root now, so first give it back with: sudo chown -R ${owner} \"${entry}\"" + fi + fi + + # What to run in the current terminal, which no startup file reaches until the next shell starts. Built + # from the checked entry, never the path as given, so a pasted or run line names what was verified. + if [ "$shell_name" = fish ]; then + now="set -gx PATH \"${entry}\" \$PATH" + else + now="export PATH=\"${entry}:\$PATH\"" + fi + + say "" + if [ -z "$why" ]; then + # The line names the real location: that is the path the checks above verified, so no symlink along + # the given path can later be pointed somewhere else. + line="$(path_line "$shell_name" "$entry")" + # Matched on the exact line, so re-running the script adds nothing. stderr is redirected before the + # append below so a file that cannot be opened fails quietly into the message after it. + if grep -qsF -- "$line" "$profile"; then + say "${profile} already puts ${dir} on PATH. ${reload}, or run this to use ${BIN} in this one:" + say " ${now}" + return 0 + fi + if mkdir -p "$(dirname "$profile")" 2>/dev/null && + printf '\n# Added by the %s installer\n%s\n' "$BIN" "$line" 2>/dev/null >>"$profile"; then + say "Added ${dir} to PATH in ${profile}. ${reload}, or run this to use ${BIN} in this one:" + say " ${now}" + return 0 + fi + why="${profile} could not be written" + fi + + say "${dir} is not on your PATH, and this script did not add it: ${why}." + if [ -n "$advice" ]; then + say "$advice" + else + say "Add it by appending this line to ${profile:-your shell profile}:" + say " ${now}" + fi +} + +# The startup file the user's shell reads in every new terminal, or nothing without a home directory to +# find it in. Bash on macOS opens login shells, which read only the first of `.bash_profile`, +# `.bash_login` and `.profile` that exists — creating `.bash_profile` beside an existing `.profile` +# would silently stop `.profile` being read — so it appends to whichever is there already. Fish gets a +# file of its own in `conf.d`, which it reads without any edit to the user's `config.fish`. A shell +# not listed here — csh, nu, xonsh, yash — reads none of these files and speaks another syntax, so it gets +# nothing and the line is only printed. +shell_profile() { + [ -n "${HOME:-}" ] || return 0 + case "$1" in + zsh) + # A relative ZDOTDIR would name a file under whatever directory the script runs in. + config="${ZDOTDIR:-}" + case "$config" in /*) ;; *) config="$HOME" ;; esac + printf '%s\n' "${config}/.zshrc" + ;; + fish) + config="${XDG_CONFIG_HOME:-}" + case "$config" in /*) ;; *) config="${HOME}/.config" ;; esac + printf '%s\n' "${config}/fish/conf.d/${BIN}.fish" + ;; + bash) + if [ "$(uname -s)" = Darwin ]; then + for file in .bash_profile .bash_login .profile; do + if [ -f "${HOME}/${file}" ]; then + printf '%s\n' "${HOME}/${file}" + return 0 + fi + done + printf '%s\n' "${HOME}/.bash_profile" + else + printf '%s\n' "${HOME}/.bashrc" + fi + ;; + sh | dash | ash | ksh | mksh) printf '%s\n' "${HOME}/.profile" ;; + esac +} + +# The directory as the startup-file line spells it, or a failure when it cannot be written safely. The +# line runs in every shell the user opens from now on, so the directory must hold no colon, which would +# split it into two PATH entries, and the part written out literally must be made only of characters that +# mean nothing inside double quotes in sh or fish; anything else is printed for the user to add instead. +# Under the home directory it is written as `$HOME/...`, which the shell expands rather than parses, so +# the home directory itself is exempt from the allowlist and the line survives the home directory +# moving. Letters are spelled out because some locales collate ranges differently. +path_entry() { + case "$1" in + *:*) return 1 ;; + esac + literal="$1" + prefix='' + home="$(cd -P -- "${HOME:-/nonexistent}" 2>/dev/null && pwd -P)" || home='' + if [ -n "$home" ] && [ "$home" != / ]; then + case "$1" in + "${home}"/*) + literal="${1#"${home}"/}" + prefix='$HOME/' + ;; + esac + fi + case "$literal" in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/._+@-]*) return 1 ;; + esac + printf '%s\n' "${prefix}${literal}" +} + +# Whether a real (symlink-free) directory and every directory above it belong to the user or root and +# are closed to everyone else. The line puts the directory ahead of the system ones on PATH for good, so +# an account that could write into it, or rename it away inside a parent it can write to, could plant a +# `sudo` or `ls` the user then runs. That rules out anything under `/tmp` too: sticky or not, once a +# cleaner removes the directory any account can create it again. Group-writable is allowed because +# user-private groups make that the default on some distributions. A `find` that fails counts as not +# private, so the fallback is the printed line. +path_dir_is_private() { + uid="$(id -u)" || return 1 + current="$1" + while :; do + trusted="$(find "${current}/." -prune \( -user "$uid" -o -user 0 \) ! -perm -0002 -print 2>/dev/null)" || + return 1 + [ -n "$trusted" ] || return 1 + [ "$current" != / ] || return 0 + current="$(dirname "$current")" + done +} + +# The line that puts a directory on PATH. It checks PATH first, so a nested shell, or a startup file read +# twice, does not stack up copies of the same entry. +path_line() { + if [ "$1" = fish ]; then + printf '%s\n' "contains -- \"${2}\" \$PATH; or set -gx PATH \"${2}\" \$PATH" + else + printf '%s\n' "case \":\${PATH}:\" in *\":${2}:\"*) ;; *) export PATH=\"${2}:\${PATH}\" ;; esac" + fi +} + +main "$@" diff --git a/man/dedalus-completion.1 b/man/dedalus-completion.1 index 03e21ef..7a6f6a1 100644 --- a/man/dedalus-completion.1 +++ b/man/dedalus-completion.1 @@ -27,27 +27,9 @@ dedalus completion fish | source The command completed successfully. .TP \fB1\fR -The request failed for an unclassified reason. Reported as error. +The command failed. The reason is reported on standard error. .TP \fB2\fR The command was invoked incorrectly (missing or invalid arguments). -.TP -\fB10\fR -Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. -.TP -\fB11\fR -The requested resource does not exist (HTTP 404). Reported as not\-found. -.TP -\fB12\fR -The request was rate limited (HTTP 429). Reported as rate\-limited. -.TP -\fB13\fR -The request was rejected (any other HTTP 4xx). Reported as client\-error. -.TP -\fB14\fR -The API failed to handle the request (HTTP 5xx). Reported as server\-error. -.TP -\fB15\fR -The API could not be reached, or the request timed out. Reported as connection\-error. .SH "SEE ALSO" .BR dedalus (1) diff --git a/man/dedalus-images-create.1 b/man/dedalus-images-create.1 new file mode 100644 index 0000000..9160f18 --- /dev/null +++ b/man/dedalus-images-create.1 @@ -0,0 +1,126 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-IMAGES\-CREATE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-images\-create \- Register an immutable OCI image for preparation +.SH "SYNOPSIS" +.B dedalus images create +\fB\-\-platform\fR \fI\fR \fB\-\-source\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Requires an entitled organization and linux/amd64 on the current fleet. Acceptance queues preparation; only a ready image can launch a machine. Private registry credentials are not yet supported. +.SH "OPTIONS" +.TP +\fB\-\-credential\-ref\fR \fI\fR +The credential\-ref body parameter. +.TP +\fB\-\-name\fR \fI\fR +A label people use to tell images apart. Programs use the image ID. +.TP +\fB\-\-platform\fR \fI\fR +The platform body parameter. Required. +.TP +\fB\-\-source\fR \fI\fR +The source body parameter. Required. +.TP +\fB\-\-source.kind\fR \fI\fR +The source.kind body parameter. +.TP +\fB\-\-source.reference\fR \fI\fR +The source.reference body parameter. +.TP +\fB\-\-source.sha256\fR \fI\fR +The source.sha256 body parameter. +.TP +\fB\-\-source.upload\-id\fR \fI\fR +The source.upload\-id body parameter. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus images create \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-platform 'linux/amd64' \e + \-\-source '{"kind":""}' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-images-delete.1 b/man/dedalus-images-delete.1 new file mode 100644 index 0000000..c375d34 --- /dev/null +++ b/man/dedalus-images-delete.1 @@ -0,0 +1,102 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-IMAGES\-DELETE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-images\-delete \- Delete an organization\-owned image +.SH "SYNOPSIS" +.B dedalus images delete +\fB\-\-image\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +The image can create no new Machine and no longer counts against the organization's image limit. Machines already running from it keep working. The image stays readable, and deleting it again returns the same image. +.SH "OPTIONS" +.TP +\fB\-\-image\-id\fR \fI\fR +The image\-id path parameter. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus images delete \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \-\-image\-id 'image_id' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-executions-logs-reauthorize.1 b/man/dedalus-images-list.1 similarity index 72% rename from man/dedalus-machines-executions-logs-reauthorize.1 rename to man/dedalus-images-list.1 index d854293..1ea9466 100644 --- a/man/dedalus-machines-executions-logs-reauthorize.1 +++ b/man/dedalus-images-list.1 @@ -1,19 +1,19 @@ .\" File generated from our OpenAPI spec by Scalar. Do not edit. -.TH "DEDALUS\-MACHINES\-EXECUTIONS\-LOGS\-REAUTHORIZE" "1" "" "dedalus" "Dedalus Manual" +.TH "DEDALUS\-IMAGES\-LIST" "1" "" "dedalus" "Dedalus Manual" .SH "NAME" -dedalus\-machines\-executions\-logs\-reauthorize \- Reauthorize execution log publication +dedalus\-images\-list \- List image IDs owned by the authenticated organization .SH "SYNOPSIS" -.B dedalus machines:executions:logs reauthorize -\fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] +.B dedalus images list +[\fIoptions\fR] .SH "DESCRIPTION" -Reauthorize execution log publication +Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. .SH "OPTIONS" .TP -\fB\-\-machine\-id\fR \fI\fR -Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +\fB\-\-limit\fR \fI\fR +The limit query parameter. .TP -\fB\-\-execution\-id\fR \fI\fR -The execution\-id path parameter. Required. +\fB\-\-cursor\fR \fI\fR +The cursor query parameter. .TP \fB\-\-base\-url\fR \fI\fR Override the base URL for API requests. @@ -43,21 +43,21 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions:logs reauthorize \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e - \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e - \-\-execution\-id 'execution_id' +dedalus images list \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \-\-limit '100' .fi .RE .SH "ENVIRONMENT" @@ -68,6 +68,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-images-retrieve.1 b/man/dedalus-images-retrieve.1 new file mode 100644 index 0000000..1807efc --- /dev/null +++ b/man/dedalus-images-retrieve.1 @@ -0,0 +1,102 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-IMAGES\-RETRIEVE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-images\-retrieve \- Read preparation status for an organization\-owned image +.SH "SYNOPSIS" +.B dedalus images retrieve +\fB\-\-image\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +A preparing image reports its stage, the worker's last step and an estimated percent of the whole preparation. A failed image names the cause: IMAGE_OS_UNSUPPORTED, IMAGE_SOURCE_INVALID, IMAGE_SOURCE_NOT_FOUND and IMAGE_SOURCE_UNAUTHORIZED describe the image or its reference and are final; IMAGE_SOURCE_UNAVAILABLE, IMAGE_REGISTRY_UNREACHABLE, IMAGE_REGISTRY_RATE_LIMITED, IMAGE_ARCHIVE_UNAVAILABLE and IMAGE_EXECUTION_FAILED describe this attempt and are retryable with a new idempotency key. +.SH "OPTIONS" +.TP +\fB\-\-image\-id\fR \fI\fR +The image\-id path parameter. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus images retrieve \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \-\-image\-id 'image_id' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-images-update.1 b/man/dedalus-images-update.1 new file mode 100644 index 0000000..6a86490 --- /dev/null +++ b/man/dedalus-images-update.1 @@ -0,0 +1,108 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-IMAGES\-UPDATE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-images\-update \- Rename an organization\-owned image +.SH "SYNOPSIS" +.B dedalus images update +\fB\-\-image\-id\fR \fI\fR \fB\-\-name\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Changes only the name. The image's source, platform and state are immutable. +.SH "OPTIONS" +.TP +\fB\-\-image\-id\fR \fI\fR +The image\-id path parameter. Required. +.TP +\fB\-\-name\fR \fI\fR +The new label, or null to clear it. No other field can change. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus images update \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-image\-id 'image_id' \e + \-\-name '' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-images-uploads-create.1 b/man/dedalus-images-uploads-create.1 new file mode 100644 index 0000000..8a6c1e3 --- /dev/null +++ b/man/dedalus-images-uploads-create.1 @@ -0,0 +1,112 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-IMAGES\-UPLOADS\-CREATE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-images\-uploads\-create \- Reserve an immutable Docker image archive upload +.SH "SYNOPSIS" +.B dedalus images uploads create +\fB\-\-platform\fR \fI\fR \fB\-\-sha256\fR \fI\fR \fB\-\-size\-bytes\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Reserve an immutable Docker image archive upload +.SH "OPTIONS" +.TP +\fB\-\-platform\fR \fI\fR +The platform body parameter. Required. +.TP +\fB\-\-sha256\fR \fI\fR +The sha256 body parameter. Required. +.TP +\fB\-\-size\-bytes\fR \fI\fR +The size\-bytes body parameter. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus images uploads create \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-platform '' \e + \-\-sha256 '' \e + \-\-size\-bytes '0' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-login.1 b/man/dedalus-login.1 index 1858106..f57d8e5 100644 --- a/man/dedalus-login.1 +++ b/man/dedalus-login.1 @@ -6,11 +6,11 @@ dedalus\-login \- sign in and save credentials .B dedalus login [\fB\-\-flow\fR \fIname\fR] [\fB\-\-base\-url\fR \fIurl\fR] .SH "DESCRIPTION" -Obtains a credential and saves it so later commands do not have to carry one. It goes into your operating system's credential store \- the system keyring on Linux, Credential Manager on Windows \- and falls back to a file in your state directory, readable only by you, when no such store is available. On macOS it is always that file, because the system's own tool accepts a password only on its command line, where other processes could read it. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. +Obtains a credential and saves it so later commands do not have to carry one. It goes into your operating system's credential store \- the Keychain on macOS, the system keyring on Linux, Credential Manager on Windows \- and falls back to a file in your state directory, readable only by you, when no such store is available. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. .SH "OPTIONS" .TP \fB\-\-flow\fR \fIname\fR -Sign\-in flow to use, skipping the prompt. One of: api\-key, x\-api\-key. +Sign\-in flow to use, skipping the prompt. One of: api\-key, x\-api\-key, oauth\-browser. .TP \fB\-\-base\-url\fR \fIurl\fR Sign in against this base URL instead of the default. @@ -21,6 +21,9 @@ Enter your access token. .TP \fBx\-api\-key\fR Enter your API key. +.TP +\fBoauth\-browser\fR +Sign in with a browser (OAuth authorization code). .SH "EXAMPLES" .PP .RS 4 diff --git a/man/dedalus-logout.1 b/man/dedalus-logout.1 index f299333..85f9cef 100644 --- a/man/dedalus-logout.1 +++ b/man/dedalus-logout.1 @@ -6,14 +6,14 @@ dedalus\-logout \- forget saved credentials .B dedalus logout [\fB\-\-all\fR] [\fB\-\-base\-url\fR \fIurl\fR] .SH "DESCRIPTION" -Removes the credentials saved for one base URL, or for every base URL. Nothing else is affected: a credential supplied through a flag or an environment variable is not stored here and keeps working. +Removes the credentials saved for one base URL, or for every base URL. A credential supplied through a flag or an environment variable is not stored here, so it is not removed. It also asks the provider to revoke a saved OAuth token when a revocation endpoint is known. The local copy is removed first, so if the provider cannot be reached the credential is still gone from this machine; the failure is printed as a warning and the command still succeeds. .SH "OPTIONS" .TP \fB\-\-all\fR -Forget every saved credential, for every base URL. +Forget every saved credential, for every base URL. Cannot be combined with \-\-base\-url, which names one. .TP \fB\-\-base\-url\fR \fIurl\fR -Forget the credentials saved for this base URL. +Forget the credentials saved for this base URL. Cannot be combined with \-\-all. .SH "EXIT STATUS" .TP \fB0\fR diff --git a/man/dedalus-machines-autoresizing-retrieve.1 b/man/dedalus-machines-autoresizing-retrieve.1 index 6f26c10..bac433f 100644 --- a/man/dedalus-machines-autoresizing-retrieve.1 +++ b/man/dedalus-machines-autoresizing-retrieve.1 @@ -1,12 +1,12 @@ .\" File generated from our OpenAPI spec by Scalar. Do not edit. .TH "DEDALUS\-MACHINES\-AUTORESIZING\-RETRIEVE" "1" "" "dedalus" "Dedalus Manual" .SH "NAME" -dedalus\-machines\-autoresizing\-retrieve \- Read this machine's RAM autoresizing settings +dedalus\-machines\-autoresizing\-retrieve \- Read this machine's autoresizing settings .SH "SYNOPSIS" -.B dedalus machines:autoresizing retrieve +.B dedalus machines autoresizing retrieve \fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" -Read this machine's RAM autoresizing settings +Read this machine's autoresizing settings .SH "OPTIONS" .TP \fB\-\-machine\-id\fR \fI\fR @@ -40,19 +40,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:autoresizing retrieve \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines autoresizing retrieve \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -64,6 +67,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-autoresizing-update.1 b/man/dedalus-machines-autoresizing-update.1 index 25f34a6..4f1c3bb 100644 --- a/man/dedalus-machines-autoresizing-update.1 +++ b/man/dedalus-machines-autoresizing-update.1 @@ -1,19 +1,28 @@ .\" File generated from our OpenAPI spec by Scalar. Do not edit. .TH "DEDALUS\-MACHINES\-AUTORESIZING\-UPDATE" "1" "" "dedalus" "Dedalus Manual" .SH "NAME" -dedalus\-machines\-autoresizing\-update \- Set this machine's RAM autoresizing settings +dedalus\-machines\-autoresizing\-update \- Set this machine's autoresizing settings .SH "SYNOPSIS" -.B dedalus machines:autoresizing update -\fB\-\-machine\-id\fR \fI\fR \fB\-\-enabled\fR [\fIoptions\fR] +.B dedalus machines autoresizing update +\fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" -Set this machine's RAM autoresizing settings +Changes RAM, CPU or both for this machine. An absent resource keeps its setting. .SH "OPTIONS" .TP \fB\-\-machine\-id\fR \fI\fR Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. .TP -\fB\-\-enabled\fR -The enabled body parameter. Required. +\fB\-\-cpu\fR \fI\fR +The cpu body parameter. +.TP +\fB\-\-cpu\-max\-vcpu\fR \fI\fR +The cpu\-max\-vcpu body parameter. +.TP +\fB\-\-memory\fR \fI\fR +The memory body parameter. +.TP +\fB\-\-memory\-max\-mib\fR \fI\fR +The memory\-max\-mib body parameter. .TP \fB\-\-base\-url\fR \fI\fR Override the base URL for API requests. @@ -43,21 +52,23 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:autoresizing update \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e - \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e - \-\-enabled +dedalus machines autoresizing update \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE .SH "ENVIRONMENT" @@ -68,6 +79,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-create.1 b/man/dedalus-machines-create.1 index 47a86d4..b9e03ae 100644 --- a/man/dedalus-machines-create.1 +++ b/man/dedalus-machines-create.1 @@ -12,6 +12,9 @@ Create machine \fB\-\-autosleep\fR \fI\fR Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. .TP +\fB\-\-image\-id\fR \fI\fR +Organization\-owned ready custom image ID. Requires Pro. Omit for the platform default. +.TP \fB\-\-memory\-mib\fR \fI\fR Memory in MiB. .TP @@ -49,11 +52,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -61,7 +67,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines create \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-autosleep '300s' \e \-\-memory\-mib '4096' \e \-\-storage\-gib '10' \e @@ -76,6 +82,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-delete.1 b/man/dedalus-machines-delete.1 index 0e2d23a..c961579 100644 --- a/man/dedalus-machines-delete.1 +++ b/man/dedalus-machines-delete.1 @@ -12,6 +12,9 @@ Destroy machine \fB\-\-machine\-id\fR \fI\fR Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. .TP +\fB\-\-force\fR +Destroy from the last published filesystem checkpoint without publishing the Machine's remaining writes, whether the Machine is running or failed. Unpublished file writes are lost. The default publishes them first, and waits while it cannot. +.TP \fB\-\-base\-url\fR \fI\fR Override the base URL for API requests. .TP @@ -40,11 +43,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -52,7 +58,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines delete \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -64,6 +70,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-create.1 b/man/dedalus-machines-executions-create.1 index c489ada..663fbd1 100644 --- a/man/dedalus-machines-executions-create.1 +++ b/man/dedalus-machines-executions-create.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-create \- Create execution .SH "SYNOPSIS" -.B dedalus machines:executions create +.B dedalus machines executions create \fB\-\-machine\-id\fR \fI\fR \fB\-\-command\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Create execution @@ -55,19 +55,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions create \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions create \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-command '[""]' .fi @@ -80,6 +83,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-delete.1 b/man/dedalus-machines-executions-delete.1 index 750f0cf..c7d0c8d 100644 --- a/man/dedalus-machines-executions-delete.1 +++ b/man/dedalus-machines-executions-delete.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-delete \- Delete execution .SH "SYNOPSIS" -.B dedalus machines:executions delete +.B dedalus machines executions delete \fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Delete execution @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions delete \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions delete \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-execution\-id 'execution_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-events.1 b/man/dedalus-machines-executions-events.1 index 6fd107a..bbb9a3b 100644 --- a/man/dedalus-machines-executions-events.1 +++ b/man/dedalus-machines-executions-events.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-events \- List execution events .SH "SYNOPSIS" -.B dedalus machines:executions events +.B dedalus machines executions events \fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" List execution events @@ -52,19 +52,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions events \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions events \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-execution\-id 'execution_id' \e \-\-max\-items 10 @@ -78,6 +81,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-list.1 b/man/dedalus-machines-executions-list.1 index e4f693f..21e24ae 100644 --- a/man/dedalus-machines-executions-list.1 +++ b/man/dedalus-machines-executions-list.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-list \- List executions .SH "SYNOPSIS" -.B dedalus machines:executions list +.B dedalus machines executions list \fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" List executions @@ -49,19 +49,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions list \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions list \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-max\-items 10 .fi @@ -74,6 +77,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-logs-create-token.1 b/man/dedalus-machines-executions-logs-create-token.1 index 46ebb72..5768346 100644 --- a/man/dedalus-machines-executions-logs-create-token.1 +++ b/man/dedalus-machines-executions-logs-create-token.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-logs\-create\-token \- Create execution log read token .SH "SYNOPSIS" -.B dedalus machines:executions:logs create\-token +.B dedalus machines executions logs create\-token \fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Create execution log read token @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions:logs create\-token \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions logs create\-token \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-execution\-id 'execution_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-logs-retrieve.1 b/man/dedalus-machines-executions-logs-retrieve.1 index 7581589..80f1ad2 100644 --- a/man/dedalus-machines-executions-logs-retrieve.1 +++ b/man/dedalus-machines-executions-logs-retrieve.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-logs\-retrieve \- Get execution log status .SH "SYNOPSIS" -.B dedalus machines:executions:logs retrieve +.B dedalus machines executions logs retrieve \fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Get execution log status @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions:logs retrieve \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions logs retrieve \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-execution\-id 'execution_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-output.1 b/man/dedalus-machines-executions-output.1 index 7c184a8..bccd8b8 100644 --- a/man/dedalus-machines-executions-output.1 +++ b/man/dedalus-machines-executions-output.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-output \- Get execution output .SH "SYNOPSIS" -.B dedalus machines:executions output +.B dedalus machines executions output \fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Get execution output @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions output \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions output \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-execution\-id 'execution_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-executions-retrieve.1 b/man/dedalus-machines-executions-retrieve.1 index 3c7c650..d6c3aea 100644 --- a/man/dedalus-machines-executions-retrieve.1 +++ b/man/dedalus-machines-executions-retrieve.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-executions\-retrieve \- Get execution .SH "SYNOPSIS" -.B dedalus machines:executions retrieve +.B dedalus machines executions retrieve \fB\-\-machine\-id\fR \fI\fR \fB\-\-execution\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Get execution @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:executions retrieve \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines executions retrieve \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-execution\-id 'execution_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-list.1 b/man/dedalus-machines-list.1 index 80eeb41..e047928 100644 --- a/man/dedalus-machines-list.1 +++ b/man/dedalus-machines-list.1 @@ -46,18 +46,21 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines list \-\-x\-api\-key "$DEDALUS_X_API_KEY" \-\-max\-items 10 +dedalus machines list \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \-\-max\-items 10 .fi .RE .SH "ENVIRONMENT" @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-reboot.1 b/man/dedalus-machines-reboot.1 index 00af3f9..1cbdb9a 100644 --- a/man/dedalus-machines-reboot.1 +++ b/man/dedalus-machines-reboot.1 @@ -43,11 +43,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -55,7 +58,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines reboot \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -67,6 +70,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-resize.1 b/man/dedalus-machines-resize.1 new file mode 100644 index 0000000..f3080da --- /dev/null +++ b/man/dedalus-machines-resize.1 @@ -0,0 +1,110 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-RESIZE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-resize \- Resize machine +.SH "SYNOPSIS" +.B dedalus machines resize +\fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Wakes a sleeping Machine, then waits up to 30 seconds for the host to confirm CPU and RAM. Returns the Machine with its confirmed size. After RESIZE_TIMEOUT, repeat the same request and Idempotency\-Key to wait again. +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-memory\-mib\fR \fI\fR +RAM in MiB. +.TP +\fB\-\-vcpu\fR \fI\fR +CPU in 0.25\-vCPU steps. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines resize \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-retrieve.1 b/man/dedalus-machines-retrieve.1 index 8b84b2b..c3300c5 100644 --- a/man/dedalus-machines-retrieve.1 +++ b/man/dedalus-machines-retrieve.1 @@ -40,11 +40,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -52,7 +55,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines retrieve \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -64,6 +67,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-sleep.1 b/man/dedalus-machines-sleep.1 index 1107870..745d490 100644 --- a/man/dedalus-machines-sleep.1 +++ b/man/dedalus-machines-sleep.1 @@ -40,11 +40,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -52,7 +55,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines sleep \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -64,6 +67,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-ssh-create.1 b/man/dedalus-machines-ssh-create.1 index 717a49f..599daec 100644 --- a/man/dedalus-machines-ssh-create.1 +++ b/man/dedalus-machines-ssh-create.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-ssh\-create \- Create SSH session .SH "SYNOPSIS" -.B dedalus machines:ssh create +.B dedalus machines ssh create \fB\-\-machine\-id\fR \fI\fR \fB\-\-public\-key\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Create SSH session @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:ssh create \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines ssh create \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-public\-key '' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-ssh-delete.1 b/man/dedalus-machines-ssh-delete.1 index f9f4c12..3a03507 100644 --- a/man/dedalus-machines-ssh-delete.1 +++ b/man/dedalus-machines-ssh-delete.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-ssh\-delete \- Delete SSH session .SH "SYNOPSIS" -.B dedalus machines:ssh delete +.B dedalus machines ssh delete \fB\-\-machine\-id\fR \fI\fR \fB\-\-session\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Delete SSH session @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:ssh delete \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines ssh delete \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-session\-id 'session_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-ssh-list.1 b/man/dedalus-machines-ssh-list.1 index f8674a2..cbf7481 100644 --- a/man/dedalus-machines-ssh-list.1 +++ b/man/dedalus-machines-ssh-list.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-ssh\-list \- List SSH sessions .SH "SYNOPSIS" -.B dedalus machines:ssh list +.B dedalus machines ssh list \fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" List SSH sessions @@ -49,19 +49,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:ssh list \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines ssh list \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-max\-items 10 .fi @@ -74,6 +77,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-ssh-retrieve.1 b/man/dedalus-machines-ssh-retrieve.1 index dbbaaec..6afac56 100644 --- a/man/dedalus-machines-ssh-retrieve.1 +++ b/man/dedalus-machines-ssh-retrieve.1 @@ -3,7 +3,7 @@ .SH "NAME" dedalus\-machines\-ssh\-retrieve \- Get SSH session .SH "SYNOPSIS" -.B dedalus machines:ssh retrieve +.B dedalus machines ssh retrieve \fB\-\-machine\-id\fR \fI\fR \fB\-\-session\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" Get SSH session @@ -43,19 +43,22 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus machines:ssh retrieve \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e +dedalus machines ssh retrieve \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e \-\-session\-id 'session_id' .fi @@ -68,6 +71,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-update.1 b/man/dedalus-machines-update.1 index 5d5fc86..81c8dcf 100644 --- a/man/dedalus-machines-update.1 +++ b/man/dedalus-machines-update.1 @@ -6,23 +6,17 @@ dedalus\-machines\-update \- Update machine .B dedalus machines update \fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] .SH "DESCRIPTION" -Update machine +Changes settings such as autosleep. .SH "OPTIONS" .TP \fB\-\-machine\-id\fR \fI\fR Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. .TP \fB\-\-autosleep\fR \fI\fR -Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. -.TP -\fB\-\-memory\-mib\fR \fI\fR -Memory in MiB. +The autosleep body parameter. .TP \fB\-\-storage\-gib\fR \fI\fR -Storage in GiB. -.TP -\fB\-\-vcpu\fR \fI\fR -CPU in vCPUs. +The storage\-gib body parameter. .TP \fB\-\-base\-url\fR \fI\fR Override the base URL for API requests. @@ -52,11 +46,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -64,7 +61,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines update \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -76,6 +73,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-machines-wake.1 b/man/dedalus-machines-wake.1 index 45ad842..031cc5f 100644 --- a/man/dedalus-machines-wake.1 +++ b/man/dedalus-machines-wake.1 @@ -40,11 +40,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" @@ -52,7 +55,7 @@ Optional organization assertion. Must match the organization identified by the A .RS 4 .nf dedalus machines wake \e - \-\-x\-api\-key "$DEDALUS_X_API_KEY" \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' .fi .RE @@ -64,6 +67,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-organization-autoresizing-retrieve.1 b/man/dedalus-organization-autoresizing-retrieve.1 index c555dec..1d61491 100644 --- a/man/dedalus-organization-autoresizing-retrieve.1 +++ b/man/dedalus-organization-autoresizing-retrieve.1 @@ -1,12 +1,12 @@ .\" File generated from our OpenAPI spec by Scalar. Do not edit. .TH "DEDALUS\-ORGANIZATION\-AUTORESIZING\-RETRIEVE" "1" "" "dedalus" "Dedalus Manual" .SH "NAME" -dedalus\-organization\-autoresizing\-retrieve \- Read organization RAM autoresizing policy +dedalus\-organization\-autoresizing\-retrieve \- Read organization autoresizing policy .SH "SYNOPSIS" -.B dedalus organization:autoresizing retrieve +.B dedalus organization autoresizing retrieve [\fIoptions\fR] .SH "DESCRIPTION" -Read organization RAM autoresizing policy +Read organization autoresizing policy .SH "OPTIONS" .TP \fB\-\-base\-url\fR \fI\fR @@ -37,18 +37,21 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus organization:autoresizing retrieve \-\-x\-api\-key "$DEDALUS_X_API_KEY" +dedalus organization autoresizing retrieve \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" .fi .RE .SH "ENVIRONMENT" @@ -59,6 +62,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-organization-autoresizing-update.1 b/man/dedalus-organization-autoresizing-update.1 index 0e2c6b6..f5156af 100644 --- a/man/dedalus-organization-autoresizing-update.1 +++ b/man/dedalus-organization-autoresizing-update.1 @@ -1,16 +1,25 @@ .\" File generated from our OpenAPI spec by Scalar. Do not edit. .TH "DEDALUS\-ORGANIZATION\-AUTORESIZING\-UPDATE" "1" "" "dedalus" "Dedalus Manual" .SH "NAME" -dedalus\-organization\-autoresizing\-update \- Set organization RAM autoresizing policy +dedalus\-organization\-autoresizing\-update \- Set organization autoresizing policy .SH "SYNOPSIS" -.B dedalus organization:autoresizing update -\fB\-\-enabled\fR [\fIoptions\fR] +.B dedalus organization autoresizing update +[\fIoptions\fR] .SH "DESCRIPTION" -Set organization RAM autoresizing policy +Changes defaults copied to new Machines. Existing Machines retain their own policy. .SH "OPTIONS" .TP -\fB\-\-enabled\fR -Allow automatic RAM increases for all organization machines. Disabling preserves applied RAM and already admitted resizes. Required. +\fB\-\-cpu\fR \fI\fR +The cpu body parameter. +.TP +\fB\-\-cpu\-max\-vcpu\fR \fI\fR +The cpu\-max\-vcpu body parameter. +.TP +\fB\-\-memory\fR \fI\fR +The memory body parameter. +.TP +\fB\-\-memory\-max\-mib\fR \fI\fR +The memory\-max\-mib body parameter. .TP \fB\-\-base\-url\fR \fI\fR Override the base URL for API requests. @@ -40,18 +49,21 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "EXAMPLES" .PP .RS 4 .nf -dedalus organization:autoresizing update \-\-x\-api\-key "$DEDALUS_X_API_KEY" \-\-enabled +dedalus organization autoresizing update \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" .fi .RE .SH "ENVIRONMENT" @@ -62,6 +74,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/man/dedalus-uninstall.1 b/man/dedalus-uninstall.1 new file mode 100644 index 0000000..05d9733 --- /dev/null +++ b/man/dedalus-uninstall.1 @@ -0,0 +1,23 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-UNINSTALL" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-uninstall \- report how to remove this dedalus installation +.SH "SYNOPSIS" +.B dedalus uninstall +.SH "DESCRIPTION" +Prints how to remove this installation of dedalus, chosen from how the running executable was installed: the owning package manager's own removal command where one owns it, and the path to delete otherwise. +.PP +Deliberately reports rather than removes. Deleting files a package manager owns leaves that manager's database inconsistent, and a command that deletes its own executable cannot report what happened if the deletion half\-succeeds. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The command failed. The reason is reported on standard error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.SH "SEE ALSO" +.BR dedalus (1), +.BR dedalus\-upgrade (1) diff --git a/man/dedalus-upgrade.1 b/man/dedalus-upgrade.1 new file mode 100644 index 0000000..4717c61 --- /dev/null +++ b/man/dedalus-upgrade.1 @@ -0,0 +1,32 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-UPGRADE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-upgrade \- upgrade dedalus to the latest release +.SH "SYNOPSIS" +.B dedalus upgrade +[\fB\-\-check\fR] +.SH "DESCRIPTION" +Replaces this dedalus executable with the latest published release, after verifying the download against the checksums published alongside it. +.PP +When dedalus was installed through a package manager (Homebrew or npm) nothing is replaced. That manager owns the installed files, and overwriting them leaves its database describing a file that is no longer there, so the command runs the manager's own upgrade command instead, with its output on this terminal. +.PP +dedalus also checks for a newer release at most once a day and mentions one on standard error. That check is skipped when either standard output or standard error is not a terminal, when CI is set, when running under sudo, and when NO_UPDATE_NOTIFIER or DEDALUS_NO_UPDATE_NOTIFIER is set in the environment. +.SH "OPTIONS" +.TP +\fB\-\-check\fR +Report the installed and latest versions and exit, without installing anything. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The command failed. The reason is reported on standard error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.PP +When dedalus cannot perform the upgrade itself it prints what to run instead and exits 0, having changed nothing: a project dependency, a cache such as npx, an executable it does not own, or a package manager whose own program it cannot locate. A manager it does run exits 1 if it cannot be started or if it fails, and so does a Homebrew upgrade that leaves an older version installed than the latest release. Run dedalus upgrade \-\-check first to learn whether a newer release exists. +.SH "SEE ALSO" +.BR dedalus (1), +.BR dedalus\-uninstall (1) diff --git a/man/dedalus.1 b/man/dedalus.1 index 389e5db..37d0e74 100644 --- a/man/dedalus.1 +++ b/man/dedalus.1 @@ -8,7 +8,7 @@ dedalus \- command line interface for the Dedalus REST API .SH "DESCRIPTION" dedalus calls the Dedalus REST API from the command line. Commands are grouped by resource, and every command prints its result to standard output in the configured format. .PP -Controlplane API for Dedalus Cloud Services (DCS). +Create, run, and manage Dedalus Machines. .SH "GLOBAL OPTIONS" .TP \fB\-\-base\-url\fR \fI\fR @@ -39,11 +39,14 @@ Print transformed string values without JSON quotes. Enable SDK debug logging on standard error. .TP \fB\-\-api\-key\fR \fI\fR -Dedalus API key or short\-lived delegated access token in Authorization: Bearer . Can also be set with the DEDALUS_API_KEY environment variable. +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP \fB\-\-x\-api\-key\fR \fI\fR Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. .TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP \fB\-\-dedalus\-org\-id\fR \fI\fR Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. .SH "COMMANDS" @@ -72,56 +75,74 @@ Wake a sleeping machine. See dedalus\-machines\-wake(1). \fBdedalus machines reboot\fR Reboot a machine with fresh memory. See dedalus\-machines\-reboot(1). .TP -\fBdedalus machines:ssh list\fR +\fBdedalus machines resize\fR +Resize machine. See dedalus\-machines\-resize(1). +.TP +\fBdedalus machines ssh list\fR List SSH sessions. See dedalus\-machines\-ssh\-list(1). .TP -\fBdedalus machines:ssh create\fR +\fBdedalus machines ssh create\fR Create SSH session. See dedalus\-machines\-ssh\-create(1). .TP -\fBdedalus machines:ssh retrieve\fR +\fBdedalus machines ssh retrieve\fR Get SSH session. See dedalus\-machines\-ssh\-retrieve(1). .TP -\fBdedalus machines:ssh delete\fR +\fBdedalus machines ssh delete\fR Delete SSH session. See dedalus\-machines\-ssh\-delete(1). .TP -\fBdedalus machines:executions list\fR +\fBdedalus machines executions list\fR List executions. See dedalus\-machines\-executions\-list(1). .TP -\fBdedalus machines:executions create\fR +\fBdedalus machines executions create\fR Create execution. See dedalus\-machines\-executions\-create(1). .TP -\fBdedalus machines:executions retrieve\fR +\fBdedalus machines executions retrieve\fR Get execution. See dedalus\-machines\-executions\-retrieve(1). .TP -\fBdedalus machines:executions delete\fR +\fBdedalus machines executions delete\fR Delete execution. See dedalus\-machines\-executions\-delete(1). .TP -\fBdedalus machines:executions output\fR +\fBdedalus machines executions output\fR Get execution output. See dedalus\-machines\-executions\-output(1). .TP -\fBdedalus machines:executions events\fR +\fBdedalus machines executions events\fR List execution events. See dedalus\-machines\-executions\-events(1). .TP -\fBdedalus machines:executions:logs retrieve\fR +\fBdedalus machines executions logs retrieve\fR Get execution log status. See dedalus\-machines\-executions\-logs\-retrieve(1). .TP -\fBdedalus machines:executions:logs reauthorize\fR -Reauthorize execution log publication. See dedalus\-machines\-executions\-logs\-reauthorize(1). -.TP -\fBdedalus machines:executions:logs create\-token\fR +\fBdedalus machines executions logs create\-token\fR Create execution log read token. See dedalus\-machines\-executions\-logs\-create\-token(1). .TP -\fBdedalus machines:autoresizing retrieve\fR -Read this machine's RAM autoresizing settings. See dedalus\-machines\-autoresizing\-retrieve(1). +\fBdedalus machines autoresizing retrieve\fR +Read this machine's autoresizing settings. See dedalus\-machines\-autoresizing\-retrieve(1). +.TP +\fBdedalus machines autoresizing update\fR +Set this machine's autoresizing settings. See dedalus\-machines\-autoresizing\-update(1). +.TP +\fBdedalus organization autoresizing retrieve\fR +Read organization autoresizing policy. See dedalus\-organization\-autoresizing\-retrieve(1). +.TP +\fBdedalus organization autoresizing update\fR +Set organization autoresizing policy. See dedalus\-organization\-autoresizing\-update(1). .TP -\fBdedalus machines:autoresizing update\fR -Set this machine's RAM autoresizing settings. See dedalus\-machines\-autoresizing\-update(1). +\fBdedalus images list\fR +List image IDs owned by the authenticated organization. See dedalus\-images\-list(1). .TP -\fBdedalus organization:autoresizing retrieve\fR -Read organization RAM autoresizing policy. See dedalus\-organization\-autoresizing\-retrieve(1). +\fBdedalus images create\fR +Register an immutable OCI image for preparation. See dedalus\-images\-create(1). .TP -\fBdedalus organization:autoresizing update\fR -Set organization RAM autoresizing policy. See dedalus\-organization\-autoresizing\-update(1). +\fBdedalus images retrieve\fR +Read preparation status for an organization\-owned image. See dedalus\-images\-retrieve(1). +.TP +\fBdedalus images update\fR +Rename an organization\-owned image. See dedalus\-images\-update(1). +.TP +\fBdedalus images delete\fR +Delete an organization\-owned image. See dedalus\-images\-delete(1). +.TP +\fBdedalus images uploads create\fR +Reserve an immutable Docker image archive upload. See dedalus\-images\-uploads\-create(1). .TP \fBdedalus completion\fR Print a shell completion script. See dedalus\-completion(1). @@ -130,7 +151,13 @@ Print a shell completion script. See dedalus\-completion(1). Sign in and save credentials for later commands. See dedalus\-login(1). .TP \fBdedalus logout\fR -Forget saved credentials. See dedalus\-logout(1). +Forget saved credentials, and revoke them if the provider supports it. See dedalus\-logout(1). +.TP +\fBdedalus upgrade\fR +Upgrade to the latest release, through the package manager that owns this installation when one does. See dedalus\-upgrade(1). +.TP +\fBdedalus uninstall\fR +Print how to remove this installation. See dedalus\-uninstall(1). .SH "FILE ARGUMENTS" Any command flag or credential reads its value from a file when the value begins with @. A flag shown with a value uploads a file and takes its path with or without the @. The global options above are read exactly as written. .PP @@ -160,6 +187,9 @@ Fallback for \-\-api\-key when the flag is not passed. \fBDEDALUS_X_API_KEY\fR Fallback for \-\-x\-api\-key when the flag is not passed. .TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP \fBDEDALUS_ORG_ID\fR Fallback for \-\-dedalus\-org\-id when the flag is not passed. .SH "EXIT STATUS" diff --git a/package.json b/package.json index 19d6b21..b9c5f02 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,16 @@ { "name": "dedalus-cli", "version": "0.1.0", - "description": "Controlplane API for Dedalus Cloud Services (DCS).", + "description": "Create, run, and manage Dedalus Machines.", "author": "Dedalus", "repository": { "type": "git", "url": "git+https://github.com/dedalus-labs/dedalus-cli.git" }, + "bugs": { + "url": "https://github.com/dedalus-labs/dedalus-cli/issues" + }, + "homepage": "https://github.com/dedalus-labs/dedalus-cli", "type": "module", "bin": { "dedalus": "./dist/esm/bin.js" @@ -41,6 +45,7 @@ "./man/dedalus-machines-sleep.1", "./man/dedalus-machines-wake.1", "./man/dedalus-machines-reboot.1", + "./man/dedalus-machines-resize.1", "./man/dedalus-machines-ssh-list.1", "./man/dedalus-machines-ssh-create.1", "./man/dedalus-machines-ssh-retrieve.1", @@ -52,13 +57,20 @@ "./man/dedalus-machines-executions-output.1", "./man/dedalus-machines-executions-events.1", "./man/dedalus-machines-executions-logs-retrieve.1", - "./man/dedalus-machines-executions-logs-reauthorize.1", "./man/dedalus-machines-executions-logs-create-token.1", "./man/dedalus-machines-autoresizing-retrieve.1", "./man/dedalus-machines-autoresizing-update.1", "./man/dedalus-organization-autoresizing-retrieve.1", "./man/dedalus-organization-autoresizing-update.1", - "./man/dedalus-completion.1" + "./man/dedalus-images-list.1", + "./man/dedalus-images-create.1", + "./man/dedalus-images-retrieve.1", + "./man/dedalus-images-update.1", + "./man/dedalus-images-delete.1", + "./man/dedalus-images-uploads-create.1", + "./man/dedalus-completion.1", + "./man/dedalus-upgrade.1", + "./man/dedalus-uninstall.1" ], "scripts": { "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node scripts/finalize-build.mjs", diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index 0bcba7b..affc8a1 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -1,7 +1,7 @@ { "name": "Dedalus", "slug": "dedalus", - "generatorVersion": "0.33.3", + "generatorVersion": "0.38.0", "servers": [ "https://dcs.dedaluslabs.ai" ], @@ -13,7 +13,8 @@ ], "auth": [ "apiKey", - "bearer" + "bearer", + "oauth2" ], "authDetails": [ { @@ -26,10 +27,69 @@ "kind": "bearer", "id": "BearerAuth", "bearerFormat": "Dedalus API key or delegated access token" + }, + { + "kind": "oauth2", + "id": "BrowserAuth", + "flows": [ + { + "kind": "authorizationCode", + "authorizationUrl": "https://clerk.dedaluslabs.ai/oauth/authorize", + "tokenUrl": "https://clerk.dedaluslabs.ai/oauth/token", + "refreshUrl": "https://clerk.dedaluslabs.ai/oauth/token", + "scopes": [ + "offline_access", + "user:org:read" + ] + } + ] } ], "clientHeaderParams": [], "schemas": [ + { + "name": "archive_request", + "source": "archive_request", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "platform", + "publicName": "platform", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "sha256", + "publicName": "sha256", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "size_bytes", + "publicName": "size_bytes", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + } + ], + "additionalProperties": false + } + }, { "name": "artifact_ref", "source": "artifact_ref", @@ -62,6 +122,295 @@ "additionalProperties": false } }, + { + "name": "autoresize_block", + "source": "autoresize_block", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "blocked_at", + "publicName": "blocked_at", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "blocked_reason", + "publicName": "blocked_reason", + "required": false, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "MACHINE_GROWTH_LIMIT_REACHED", + "MACHINE_TIER_SHAPE_EXCEEDED", + "MACHINE_QUOTA_EXCEEDED", + "MACHINE_MEMORY_ABOVE_LIMIT", + "ASSIGNED_HOST_CAPACITY_CONFLICT", + "MACHINE_PLACEMENT_EXHAUSTED", + "MACHINE_RESIZE_UNAVAILABLE", + "MACHINE_SHAPE_UNSUPPORTED" + ], + "names": [ + "MachineGrowthLimitReached", + "MachineTierShapeExceeded", + "MachineQuotaExceeded", + "MachineMemoryAboveLimit", + "AssignedHostCapacityConflict", + "MachinePlacementExhausted", + "MachineResizeUnavailable", + "MachineShapeUnsupported" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + } + } + ], + "additionalProperties": false + } + }, + { + "name": "policy", + "source": "policy", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "cpu", + "publicName": "cpu", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "autoresizing_switch" + } + }, + { + "name": "cpu_limit_source", + "publicName": "cpu_limit_source", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "plan", + "configured", + "platform" + ], + "names": [ + "Plan", + "Configured", + "Platform" + ], + "deprecations": [ + false, + false, + false + ] + } + }, + { + "name": "cpu_max_vcpu", + "publicName": "cpu_max_vcpu", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "number", + "format": "double" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "effective_cpu_max_vcpu", + "publicName": "effective_cpu_max_vcpu", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number", + "format": "double" + } + }, + { + "name": "effective_memory_max_mib", + "publicName": "effective_memory_max_mib", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "enabled", + "publicName": "enabled", + "required": true, + "deprecated": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "memory", + "publicName": "memory", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "autoresizing_switch" + } + }, + { + "name": "memory_limit_source", + "publicName": "memory_limit_source", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "plan", + "configured", + "platform" + ], + "names": [ + "Plan", + "Configured", + "Platform" + ], + "deprecations": [ + false, + false, + false + ] + } + }, + { + "name": "memory_max_mib", + "publicName": "memory_max_mib", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "integer", + "format": "int64" + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false + } + }, + { + "name": "autoresizing_update", + "source": "autoresizing_update", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "cpu", + "publicName": "cpu", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "autoresizing_switch" + } + }, + { + "name": "cpu_max_vcpu", + "publicName": "cpu_max_vcpu", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "number", + "format": "double", + "validation": { + "minimum": 0.25, + "multipleOf": 0.25 + } + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "memory", + "publicName": "memory", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "autoresizing_switch" + } + }, + { + "name": "memory_max_mib", + "publicName": "memory_max_mib", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "integer", + "format": "int64", + "validation": { + "minimum": 256 + } + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false + } + }, { "name": "execution_create_params", "source": "execution_create_params", @@ -162,16 +511,30 @@ } }, { - "name": "memory_mib", - "publicName": "memory_mib", + "name": "image_id", + "publicName": "image_id", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64", + "type": "string", "validation": { - "exclusiveMinimum": 0 + "pattern": "^\\S+$", + "minLength": 1 + } + } + }, + { + "name": "memory_mib", + "publicName": "memory_mib", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64", + "validation": { + "exclusiveMinimum": 0 } } }, @@ -270,6 +633,76 @@ "additionalProperties": false } }, + { + "name": "error", + "source": "error", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "details", + "publicName": "details", + "required": false, + "deprecated": false, + "type": { + "kind": "record", + "value": { + "kind": "primitive", + "type": "string" + }, + "propertyNames": { + "kind": "primitive", + "type": "string" + } + } + }, + { + "name": "error_code", + "publicName": "error_code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "retry_after_ms", + "publicName": "retry_after_ms", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "retryable", + "publicName": "retryable", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "additionalProperties": false + } + }, { "name": "error_model", "source": "error_model", @@ -636,16 +1069,6 @@ "name": "machine_execution_log_capture" } }, - { - "name": "code", - "publicName": "code", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" - } - }, { "name": "execution_id", "publicName": "execution_id", @@ -656,16 +1079,6 @@ "type": "string" } }, - { - "name": "publication", - "publicName": "publication", - "required": false, - "deprecated": false, - "type": { - "kind": "ref", - "name": "publication" - } - }, { "name": "stream_id", "publicName": "stream_id", @@ -764,6 +1177,50 @@ "additionalProperties": false } }, + { + "name": "execution_progress", + "source": "execution_progress", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "completed", + "publicName": "completed", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "step", + "publicName": "step", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "total", + "publicName": "total", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + } + ], + "additionalProperties": false + } + }, { "name": "execution", "source": "execution", @@ -1076,136 +1533,70 @@ } }, { - "name": "machine", - "source": "machine", + "name": "execution_upload", + "source": "execution_upload", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "autosleep_seconds", - "publicName": "autosleep_seconds", - "required": true, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64", - "validation": { - "minimum": 0, - "maximum": 9223372036 - } - } - }, - { - "name": "desired_state", - "publicName": "desired_state", - "required": true, - "deprecated": false, - "type": { - "kind": "enum", - "values": [ - "running", - "sleeping", - "destroyed" - ], - "names": [ - "Running", - "Sleeping", - "Destroyed" - ], - "deprecations": [ - false, - false, - false - ] - } - }, - { - "name": "machine_id", - "publicName": "machine_id", + "name": "expires_at", + "publicName": "expires_at", "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string", - "format": "uuid" - } - }, - { - "name": "memory_mib", - "publicName": "memory_mib", - "required": true, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" + "format": "date-time" } }, { - "name": "phase", - "publicName": "phase", + "name": "headers", + "publicName": "headers", "required": true, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "accepted", - "placement_pending", - "starting", - "running", - "stopping", - "sleeping", - "destroying", - "destroyed", - "failed" - ], - "names": [ - "Accepted", - "PlacementPending", - "Starting", - "Running", - "Stopping", - "Sleeping", - "Destroying", - "Destroyed", - "Failed" - ], - "deprecations": [ - false, - false, - false, - false, - false, - false, - false, - false, - false - ] + "kind": "record", + "value": { + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + }, + { + "kind": "null" + } + ] + }, + "propertyNames": { + "kind": "primitive", + "type": "string" + } } }, { - "name": "storage_gib", - "publicName": "storage_gib", + "name": "method", + "publicName": "method", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "vcpu", - "publicName": "vcpu", + "name": "url", + "publicName": "url", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "number", - "format": "double" + "type": "string" } } ], @@ -1213,102 +1604,201 @@ } }, { - "name": "lifecycle_status", - "source": "lifecycle_status", + "name": "image_list", + "source": "image_list", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "last_error", - "publicName": "last_error", - "required": false, + "name": "image_ids", + "publicName": "image_ids", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "last_progress_at", - "publicName": "last_progress_at", - "required": true, + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "next_cursor", + "publicName": "next_cursor", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string", - "format": "date-time" + "type": "string" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "lifecycle_autoresize", + "source": "lifecycle_autoresize", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "last_transition_at", - "publicName": "last_transition_at", + "name": "cpu", + "publicName": "cpu", "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string", - "format": "date-time" + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "autoresize_block" + }, + { + "kind": "null" + } + ] } }, { - "name": "memory_assigned_mib", - "publicName": "memory_assigned_mib", - "required": false, + "name": "memory", + "publicName": "memory", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "autoresize_block" + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false + } + }, + { + "name": "machine", + "source": "machine", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "autosleep_seconds", + "publicName": "autosleep_seconds", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "integer", "format": "int64", "validation": { - "minimum": 1 + "minimum": 0, + "maximum": 9223372036 } } }, { - "name": "memory_configured_mib", - "publicName": "memory_configured_mib", + "name": "desired_state", + "publicName": "desired_state", "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "integer", - "format": "int64", - "validation": { - "minimum": 1 - } + "kind": "enum", + "values": [ + "running", + "sleeping", + "destroyed" + ], + "names": [ + "Running", + "Sleeping", + "Destroyed" + ], + "deprecations": [ + false, + false, + false + ] } }, { - "name": "memory_last_autoresized_at", - "publicName": "memory_last_autoresized_at", - "required": false, + "name": "machine_id", + "publicName": "machine_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string", - "format": "date-time" + "format": "uuid" } }, { - "name": "memory_resize_state", - "publicName": "memory_resize_state", - "required": false, + "name": "memory_mib", + "publicName": "memory_mib", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "phase", + "publicName": "phase", + "required": true, "deprecated": false, "type": { "kind": "enum", "values": [ - "stable", - "error", - "pending_capacity" + "accepted", + "placement_pending", + "starting", + "running", + "stopping", + "sleeping", + "destroying", + "destroyed", + "failed" ], "names": [ - "Stable", - "Error", - "PendingCapacity" + "Accepted", + "PlacementPending", + "Starting", + "Running", + "Stopping", + "Sleeping", + "Destroying", + "Destroyed", + "Failed" ], "deprecations": [ + false, + false, + false, + false, + false, + false, false, false, false @@ -1316,17 +1806,79 @@ } }, { - "name": "memory_target_mib", - "publicName": "memory_target_mib", - "required": false, + "name": "storage_gib", + "publicName": "storage_gib", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "integer", - "format": "int64", - "validation": { - "minimum": 1 - } + "format": "int64" + } + }, + { + "name": "vcpu", + "publicName": "vcpu", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number", + "format": "double" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "lifecycle_status", + "source": "lifecycle_status", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "autoresize", + "publicName": "autoresize", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "lifecycle_autoresize" + } + }, + { + "name": "last_error", + "publicName": "last_error", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "last_progress_at", + "publicName": "last_progress_at", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "last_transition_at", + "publicName": "last_transition_at", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" } }, { @@ -1797,21 +2349,32 @@ } }, { - "name": "policy", - "source": "policy", + "name": "update_params", + "source": "update_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "enabled", - "publicName": "enabled", - "required": true, + "name": "autosleep", + "publicName": "autosleep", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "boolean" + "type": "string" + } + }, + { + "name": "storage_gib", + "publicName": "storage_gib", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" } } ], @@ -1819,53 +2382,92 @@ } }, { - "name": "settings", - "source": "settings", + "name": "preparation_context", + "source": "preparation_context", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "enabled", - "publicName": "enabled", + "name": "percent", + "publicName": "percent", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "boolean" + "type": "integer", + "format": "int64" } - } - ], - "additionalProperties": false - } - }, - { - "name": "public_path_segment", - "source": "public_path_segment", + }, + { + "name": "progress", + "publicName": "progress", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "execution_progress" + } + }, + { + "name": "stage", + "publicName": "stage", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "public_image_rename_input_body", + "source": "public_image_rename_input_body", "publicAliases": [], "deprecated": false, "type": { - "kind": "primitive", - "type": "string", - "validation": { - "pattern": "^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$", - "minLength": 1, - "maxLength": 253 - } + "kind": "object", + "properties": [ + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 128 + } + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false } }, { - "name": "publication", - "source": "publication", + "name": "public_image_submit_input_body", + "source": "public_image_submit_input_body", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "code", - "publicName": "code", + "name": "credential_ref", + "publicName": "credential_ref", "required": false, "deprecated": false, "type": { @@ -1874,60 +2476,68 @@ } }, { - "name": "complete", - "publicName": "complete", - "required": true, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "boolean" - } - }, - { - "name": "queued_messages", - "publicName": "queued_messages", - "required": true, + "name": "name", + "publicName": "name", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64", + "type": "string", "validation": { - "minimum": 0 + "maxLength": 128 } } }, { - "name": "state", - "publicName": "state", + "name": "platform", + "publicName": "platform", "required": true, "deprecated": false, "type": { "kind": "enum", "values": [ - "active", - "finishing", - "failed", - "closed" + "linux/amd64", + "linux/arm64" ], "names": [ - "Active", - "Finishing", - "Failed", - "Closed" + "LinuxAmd64", + "LinuxArm64" ], "deprecations": [ - false, - false, false, false ] } + }, + { + "name": "source", + "publicName": "source", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "source" + } } ], "additionalProperties": false } }, + { + "name": "public_path_segment", + "source": "public_path_segment", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$", + "minLength": 1, + "maxLength": 253 + } + } + }, { "name": "read_token", "source": "read_token", @@ -2001,6 +2611,183 @@ "additionalProperties": false } }, + { + "name": "image", + "source": "image", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "context", + "publicName": "context", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "preparation_context" + } + }, + { + "name": "created_at", + "publicName": "created_at", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "error", + "publicName": "error", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "error" + } + }, + { + "name": "image_id", + "publicName": "image_id", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "platform", + "publicName": "platform", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "reason", + "publicName": "reason", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "source", + "publicName": "source", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "source" + } + }, + { + "name": "state", + "publicName": "state", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "reservation", + "source": "reservation", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "source", + "publicName": "source", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "source" + } + }, + { + "name": "upload", + "publicName": "upload", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "execution_upload" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "resize_machine_request", + "source": "resize_machine_request", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "memory_mib", + "publicName": "memory_mib", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "vcpu", + "publicName": "vcpu", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number", + "format": "double" + } + } + ], + "additionalProperties": false + } + }, { "name": "ssh_connection", "source": "ssh_connection", @@ -2298,17 +3085,17 @@ } }, { - "name": "update_params", - "source": "update_params", + "name": "source", + "source": "source", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "autosleep", - "publicName": "autosleep", - "required": false, + "name": "kind", + "publicName": "kind", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -2316,42 +3103,60 @@ } }, { - "name": "memory_mib", - "publicName": "memory_mib", + "name": "reference", + "publicName": "reference", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "storage_gib", - "publicName": "storage_gib", + "name": "sha256", + "publicName": "sha256", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "vcpu", - "publicName": "vcpu", + "name": "upload_id", + "publicName": "upload_id", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "number", - "format": "double" + "type": "string" } } ], "additionalProperties": false } }, + { + "name": "autoresizing_switch", + "source": "autoresizing_switch", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "on", + "off" + ], + "names": [ + "On", + "Off" + ], + "deprecations": [ + false, + false + ] + } + }, { "name": "CreateResponseHeaders", "source": "CreateResponseHeaders", @@ -3887,13 +4692,23 @@ } }, { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "ResizeResponseHeaders", + "source": "ResizeResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ + { + "name": "ETag", + "publicName": "ETag", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, { "name": "Idempotency-Key", "publicName": "Idempotency-Key", @@ -3903,14 +4718,42 @@ "kind": "primitive", "type": "string" } + }, + { + "name": "Location", + "publicName": "Location", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } } ], "additionalProperties": false } }, { - "name": "CreateStatus401ResponseHeaders", - "source": "CreateStatus401ResponseHeaders", + "name": "ResizeStatus400ResponseHeaders", + "source": "ResizeStatus400ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3931,8 +4774,8 @@ } }, { - "name": "CreateStatus403ResponseHeaders", - "source": "CreateStatus403ResponseHeaders", + "name": "ResizeStatus401ResponseHeaders", + "source": "ResizeStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3953,8 +4796,8 @@ } }, { - "name": "CreateStatus409ResponseHeaders", - "source": "CreateStatus409ResponseHeaders", + "name": "ResizeStatus402ResponseHeaders", + "source": "ResizeStatus402ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3975,8 +4818,8 @@ } }, { - "name": "CreateStatus429ResponseHeaders", - "source": "CreateStatus429ResponseHeaders", + "name": "ResizeStatus403ResponseHeaders", + "source": "ResizeStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3997,8 +4840,8 @@ } }, { - "name": "CreateStatus503ResponseHeaders", - "source": "CreateStatus503ResponseHeaders", + "name": "ResizeStatus404ResponseHeaders", + "source": "ResizeStatus404ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4019,8 +4862,140 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "ResizeStatus409ResponseHeaders", + "source": "ResizeStatus409ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus422ResponseHeaders", + "source": "ResizeStatus422ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus429ResponseHeaders", + "source": "ResizeStatus429ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus500ResponseHeaders", + "source": "ResizeStatus500ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus503ResponseHeaders", + "source": "ResizeStatus503ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus504ResponseHeaders", + "source": "ResizeStatus504ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatusdefaultResponseHeaders", + "source": "ResizeStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4035,6 +5010,26 @@ "kind": "primitive", "type": "string" } + }, + { + "name": "Retry-After", + "publicName": "Retry-After", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "x-should-retry", + "publicName": "x-should-retry", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } } ], "additionalProperties": false @@ -4195,16 +5190,16 @@ } }, { - "name": "RetrieveResponseHeaders", - "source": "RetrieveResponseHeaders", + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Cache-Control", - "publicName": "Cache-Control", + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", "required": false, "deprecated": false, "type": { @@ -4217,16 +5212,38 @@ } }, { - "name": "ReauthorizeResponseHeaders", - "source": "ReauthorizeResponseHeaders", + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Cache-Control", - "publicName": "Cache-Control", + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", "required": false, "deprecated": false, "type": { @@ -4234,97 +5251,1238 @@ "type": "string" } } - ], - "additionalProperties": false - } - }, - { - "name": "CreateTokenResponseHeaders", - "source": "CreateTokenResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "Cache-Control", - "publicName": "Cache-Control", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "RetrieveResponseHeaders", + "source": "RetrieveResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Cache-Control", + "publicName": "Cache-Control", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateTokenResponseHeaders", + "source": "CreateTokenResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Cache-Control", + "publicName": "Cache-Control", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + } + ], + "resources": [ + "machines", + "machines.ssh", + "machines.executions", + "machines.executions.logs", + "machines.autoresizing", + "organization", + "organization.autoresizing", + "images", + "images.uploads" + ], + "publicResources": [ + "machines", + "machines.ssh", + "machines.executions", + "machines.executions.logs", + "machines.autoresizing", + "organization", + "organization.autoresizing", + "images", + "images.uploads" + ], + "operations": [ + { + "resource": "machines", + "publicResource": "machines", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/machines", + "pathParams": [], + "publicPathParams": [], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineListParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_list", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "model": { + "name": "error_model", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "machine_list_item", + "publicAliases": [] + } + }, + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/machines", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "autosleep", + "image_id", + "memory_mib", + "storage_gib", + "vcpu" + ], + "publicBodyParams": [ + "autosleep", + "image_id", + "memory_mib", + "storage_gib", + "vcpu" + ], + "bodyParamDetails": [ + { + "name": "autosleep", + "required": false + }, + { + "name": "image_id", + "required": false + }, + { + "name": "memory_mib", + "required": false + }, + { + "name": "storage_gib", + "required": false + }, + { + "name": "vcpu", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "model": { + "name": "error_model", + "publicAliases": [] + }, + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_detail_response", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "RetrieveResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "model": { + "name": "error_model", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "autosleep", + "storage_gib" + ], + "publicBodyParams": [ + "autosleep", + "storage_gib" + ], + "bodyParamDetails": [ + { + "name": "autosleep", + "required": false + }, + { + "name": "storage_gib", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "UpdateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "model": { + "name": "error_model", + "publicAliases": [] + }, + "headersModel": { + "name": "UpdateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [ + "force" + ], + "publicQueryParams": [ + "force" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [ + { + "name": "force", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineDeleteParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "DeleteResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" } + ], + "model": { + "name": "error_model", + "publicAliases": [] + }, + "headersModel": { + "name": "DeleteStatusdefaultResponseHeaders", + "publicAliases": [] } - ], - "additionalProperties": false - } - } - ], - "resources": [ - "machines", - "machines.ssh", - "machines.executions", - "machines.executions.logs", - "machines.autoresizing", - "organization", - "organization.autoresizing" - ], - "publicResources": [ - "machines", - "machines.ssh", - "machines.executions", - "machines.executions.logs", - "machines.autoresizing", - "organization", - "organization.autoresizing" - ], - "operations": [ + } + ], + "responseLinks": [], + "transport": "http" + }, { "resource": "machines", "publicResource": "machines", - "operation": "list", - "publicOperation": "list", + "operation": "sleep", + "publicOperation": "sleep", "deprecated": false, - "method": "GET", - "path": "/v1/machines", - "pathParams": [], - "publicPathParams": [], - "queryParams": [ - "limit", - "cursor" + "method": "POST", + "path": "/v1/machines/{machine_id}/sleep", + "pathParams": [ + "machine_id" ], - "publicQueryParams": [ - "limit", - "cursor" + "publicPathParams": [ + "machine_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false - }, + "pathParamDetails": [ { - "name": "cursor", - "required": false, - "style": "form", + "name": "machine_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineListParams" + "publicName": "MachineSleepParams" }, "response": { "status": "200", @@ -4338,7 +6496,11 @@ ] }, "responseModel": { - "name": "machine_list", + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "SleepResponseHeaders", "publicAliases": [] }, "result": { @@ -4346,6 +6508,7 @@ "errorStatuses": [ "401", "403", + "409", "429", "503", "default" @@ -4361,7 +6524,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "SleepStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -4372,7 +6539,26 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "SleepStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus409ResponseHeaders", + "publicAliases": [] + } }, { "status": "429", @@ -4383,7 +6569,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "SleepStatus429ResponseHeaders", + "publicAliases": [] + } }, { "status": "503", @@ -4394,7 +6584,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "SleepStatus503ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", @@ -4409,96 +6603,53 @@ "model": { "name": "error_model", "publicAliases": [] + }, + "headersModel": { + "name": "SleepStatusdefaultResponseHeaders", + "publicAliases": [] } } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "machine_list_item", - "publicAliases": [] - } - }, "transport": "http" }, { "resource": "machines", "publicResource": "machines", - "operation": "create", - "publicOperation": "create", + "operation": "wake", + "publicOperation": "wake", "deprecated": false, "method": "POST", - "path": "/v1/machines", - "pathParams": [], - "publicPathParams": [], + "path": "/v1/machines/{machine_id}/wake", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "autosleep", - "memory_mib", - "storage_gib", - "vcpu" - ], - "publicBodyParams": [ - "autosleep", - "memory_mib", - "storage_gib", - "vcpu" - ], - "bodyParamDetails": [ - { - "name": "autosleep", - "required": false - }, - { - "name": "memory_mib", - "required": false - }, - { - "name": "storage_gib", - "required": false - }, + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ { - "name": "vcpu", - "required": false + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false } ], - "publicPositionalParams": [], - "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineCreateParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "MachineWakeParams" }, "response": { "status": "200", @@ -4516,7 +6667,7 @@ "publicAliases": [] }, "responseHeadersModel": { - "name": "CreateResponseHeaders", + "name": "WakeResponseHeaders", "publicAliases": [] }, "result": { @@ -4542,7 +6693,7 @@ } ], "headersModel": { - "name": "CreateStatus401ResponseHeaders", + "name": "WakeStatus401ResponseHeaders", "publicAliases": [] } }, @@ -4557,7 +6708,7 @@ } ], "headersModel": { - "name": "CreateStatus403ResponseHeaders", + "name": "WakeStatus403ResponseHeaders", "publicAliases": [] } }, @@ -4572,7 +6723,7 @@ } ], "headersModel": { - "name": "CreateStatus409ResponseHeaders", + "name": "WakeStatus409ResponseHeaders", "publicAliases": [] } }, @@ -4587,7 +6738,7 @@ } ], "headersModel": { - "name": "CreateStatus429ResponseHeaders", + "name": "WakeStatus429ResponseHeaders", "publicAliases": [] } }, @@ -4602,7 +6753,7 @@ } ], "headersModel": { - "name": "CreateStatus503ResponseHeaders", + "name": "WakeStatus503ResponseHeaders", "publicAliases": [] } }, @@ -4621,7 +6772,7 @@ "publicAliases": [] }, "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", + "name": "WakeStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -4632,19 +6783,23 @@ { "resource": "machines", "publicResource": "machines", - "operation": "retrieve", - "publicOperation": "retrieve", + "operation": "reboot", + "publicOperation": "reboot", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}", + "method": "POST", + "path": "/v1/machines/{machine_id}/reboot", "pathParams": [ "machine_id" ], "publicPathParams": [ "machine_id" ], - "queryParams": [], - "publicQueryParams": [], + "queryParams": [ + "force" + ], + "publicQueryParams": [ + "force" + ], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -4659,13 +6814,20 @@ "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "force", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineRetrieveParams" + "publicName": "MachineRebootParams" }, "response": { "status": "200", @@ -4679,11 +6841,11 @@ ] }, "responseModel": { - "name": "machine_detail_response", + "name": "machine", "publicAliases": [] }, "responseHeadersModel": { - "name": "RetrieveResponseHeaders", + "name": "RebootResponseHeaders", "publicAliases": [] }, "result": { @@ -4691,6 +6853,7 @@ "errorStatuses": [ "401", "403", + "409", "429", "503", "default" @@ -4706,7 +6869,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -4717,7 +6884,26 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus409ResponseHeaders", + "publicAliases": [] + } }, { "status": "429", @@ -4728,7 +6914,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus429ResponseHeaders", + "publicAliases": [] + } }, { "status": "503", @@ -4739,7 +6929,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "RebootStatus503ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", @@ -4754,6 +6948,10 @@ "model": { "name": "error_model", "publicAliases": [] + }, + "headersModel": { + "name": "RebootStatusdefaultResponseHeaders", + "publicAliases": [] } } ], @@ -4763,11 +6961,11 @@ { "resource": "machines", "publicResource": "machines", - "operation": "update", - "publicOperation": "update", + "operation": "resize", + "publicOperation": "resize", "deprecated": false, - "method": "PATCH", - "path": "/v1/machines/{machine_id}", + "method": "POST", + "path": "/v1/machines/{machine_id}/resize", "pathParams": [ "machine_id" ], @@ -4779,30 +6977,18 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "autosleep", "memory_mib", - "storage_gib", "vcpu" ], "publicBodyParams": [ - "autosleep", "memory_mib", - "storage_gib", "vcpu" ], "bodyParamDetails": [ - { - "name": "autosleep", - "required": false - }, { "name": "memory_mib", "required": false }, - { - "name": "storage_gib", - "required": false - }, { "name": "vcpu", "required": false @@ -4823,7 +7009,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineUpdateParams" + "publicName": "MachineResizeParams" }, "requestBody": { "contentType": "application/json", @@ -4850,25 +7036,46 @@ ] }, "responseModel": { - "name": "machine", + "name": "machine_detail_response", "publicAliases": [] }, "responseHeadersModel": { - "name": "UpdateResponseHeaders", + "name": "ResizeResponseHeaders", "publicAliases": [] }, "result": { "successStatus": "200", "errorStatuses": [ + "400", "401", + "402", "403", + "404", "409", + "422", "429", + "500", "503", + "504", "default" ] }, "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus400ResponseHeaders", + "publicAliases": [] + } + }, { "status": "401", "contentType": "application/json", @@ -4880,7 +7087,22 @@ } ], "headersModel": { - "name": "UpdateStatus401ResponseHeaders", + "name": "ResizeStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "402", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus402ResponseHeaders", "publicAliases": [] } }, @@ -4895,7 +7117,22 @@ } ], "headersModel": { - "name": "UpdateStatus403ResponseHeaders", + "name": "ResizeStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus404ResponseHeaders", "publicAliases": [] } }, @@ -4910,7 +7147,22 @@ } ], "headersModel": { - "name": "UpdateStatus409ResponseHeaders", + "name": "ResizeStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus422ResponseHeaders", "publicAliases": [] } }, @@ -4925,7 +7177,22 @@ } ], "headersModel": { - "name": "UpdateStatus429ResponseHeaders", + "name": "ResizeStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus500ResponseHeaders", "publicAliases": [] } }, @@ -4940,26 +7207,41 @@ } ], "headersModel": { - "name": "UpdateStatus503ResponseHeaders", + "name": "ResizeStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "504", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus504ResponseHeaders", "publicAliases": [] } }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] }, "headersModel": { - "name": "UpdateStatusdefaultResponseHeaders", + "name": "ResizeStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -4968,21 +7250,27 @@ "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "list", + "publicOperation": "list", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}", + "method": "GET", + "path": "/v1/machines/{machine_id}/ssh", "pathParams": [ "machine_id" ], "publicPathParams": [ "machine_id" ], - "queryParams": [], - "publicQueryParams": [], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -4997,13 +7285,26 @@ "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineDeleteParams" + "publicName": "SshListParams" }, "response": { "status": "200", @@ -5017,11 +7318,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "DeleteResponseHeaders", + "name": "ssh_session_list", "publicAliases": [] }, "result": { @@ -5029,7 +7326,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -5045,29 +7341,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus401ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "DeleteStatus403ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "409", + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -5075,11 +7352,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -5090,11 +7363,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -5105,11 +7374,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -5124,24 +7389,38 @@ "model": { "name": "error_model", "publicAliases": [] - }, - "headersModel": { - "name": "DeleteStatusdefaultResponseHeaders", - "publicAliases": [] } } ], "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "ssh_session", + "publicAliases": [] + } + }, "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "sleep", - "publicOperation": "sleep", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "create", + "publicOperation": "create", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/sleep", + "path": "/v1/machines/{machine_id}/ssh", "pathParams": [ "machine_id" ], @@ -5152,9 +7431,18 @@ "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "public_key" + ], + "publicBodyParams": [ + "public_key" + ], + "bodyParamDetails": [ + { + "name": "public_key", + "required": true + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -5170,7 +7458,20 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineSleepParams" + "publicName": "SshCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -5184,11 +7485,11 @@ ] }, "responseModel": { - "name": "machine", + "name": "ssh_session", "publicAliases": [] }, "responseHeadersModel": { - "name": "SleepResponseHeaders", + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { @@ -5214,7 +7515,7 @@ } ], "headersModel": { - "name": "SleepStatus401ResponseHeaders", + "name": "CreateStatus401ResponseHeaders", "publicAliases": [] } }, @@ -5229,7 +7530,7 @@ } ], "headersModel": { - "name": "SleepStatus403ResponseHeaders", + "name": "CreateStatus403ResponseHeaders", "publicAliases": [] } }, @@ -5244,7 +7545,7 @@ } ], "headersModel": { - "name": "SleepStatus409ResponseHeaders", + "name": "CreateStatus409ResponseHeaders", "publicAliases": [] } }, @@ -5259,7 +7560,7 @@ } ], "headersModel": { - "name": "SleepStatus429ResponseHeaders", + "name": "CreateStatus429ResponseHeaders", "publicAliases": [] } }, @@ -5274,7 +7575,7 @@ } ], "headersModel": { - "name": "SleepStatus503ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", "publicAliases": [] } }, @@ -5293,7 +7594,7 @@ "publicAliases": [] }, "headersModel": { - "name": "SleepStatusdefaultResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -5302,18 +7603,20 @@ "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "wake", - "publicOperation": "wake", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/wake", + "method": "GET", + "path": "/v1/machines/{machine_id}/ssh/{session_id}", "pathParams": [ - "machine_id" + "machine_id", + "session_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "session_id" ], "queryParams": [], "publicQueryParams": [], @@ -5329,6 +7632,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "session_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -5337,7 +7646,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineWakeParams" + "publicName": "SshRetrieveParams" }, "response": { "status": "200", @@ -5351,11 +7660,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "WakeResponseHeaders", + "name": "ssh_session", "publicAliases": [] }, "result": { @@ -5363,7 +7668,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -5379,11 +7683,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -5394,26 +7694,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "WakeStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -5424,11 +7705,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -5439,11 +7716,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -5458,10 +7731,6 @@ "model": { "name": "error_model", "publicAliases": [] - }, - "headersModel": { - "name": "WakeStatusdefaultResponseHeaders", - "publicAliases": [] } } ], @@ -5469,25 +7738,23 @@ "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "reboot", - "publicOperation": "reboot", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/reboot", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ssh/{session_id}", "pathParams": [ - "machine_id" + "machine_id", + "session_id" ], "publicPathParams": [ - "machine_id" - ], - "queryParams": [ - "force" - ], - "publicQueryParams": [ - "force" + "machine_id", + "session_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -5500,22 +7767,21 @@ "required": true, "style": "simple", "explode": false - } - ], - "queryParamDetails": [ + }, { - "name": "force", - "required": false, - "style": "form", + "name": "session_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineRebootParams" + "publicName": "SshDeleteParams" }, "response": { "status": "200", @@ -5529,11 +7795,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RebootResponseHeaders", + "name": "ssh_session", "publicAliases": [] }, "result": { @@ -5541,7 +7803,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -5557,11 +7818,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -5572,41 +7829,18 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "RebootStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", "contentType": "application/json", "encoding": "json", "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "RebootStatus429ResponseHeaders", - "publicAliases": [] - } + { + "contentType": "application/json", + "encoding": "json" + } + ] }, { "status": "503", @@ -5617,11 +7851,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -5636,10 +7866,6 @@ "model": { "name": "error_model", "publicAliases": [] - }, - "headersModel": { - "name": "RebootStatusdefaultResponseHeaders", - "publicAliases": [] } } ], @@ -5647,13 +7873,13 @@ "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", + "resource": "machines.executions", + "publicResource": "machines.executions", "operation": "list", "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/ssh", + "path": "/v1/machines/{machine_id}/executions", "pathParams": [ "machine_id" ], @@ -5701,7 +7927,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshListParams" + "publicName": "ExecutionListParams" }, "response": { "status": "200", @@ -5715,7 +7941,7 @@ ] }, "responseModel": { - "name": "ssh_session_list", + "name": "execution_list", "publicAliases": [] }, "result": { @@ -5804,20 +8030,20 @@ "requestLocation": "query", "responseLocation": "body", "itemModel": { - "name": "ssh_session", + "name": "execution", "publicAliases": [] } }, "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", + "resource": "machines.executions", + "publicResource": "machines.executions", "operation": "create", "publicOperation": "create", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/ssh", + "path": "/v1/machines/{machine_id}/executions", "pathParams": [ "machine_id" ], @@ -5829,15 +8055,39 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "public_key" + "command", + "cwd", + "env", + "stdin", + "timeout_ms" ], "publicBodyParams": [ - "public_key" + "command", + "cwd", + "env", + "stdin", + "timeout_ms" ], "bodyParamDetails": [ { - "name": "public_key", + "name": "command", "required": true + }, + { + "name": "cwd", + "required": false + }, + { + "name": "env", + "required": false + }, + { + "name": "stdin", + "required": false + }, + { + "name": "timeout_ms", + "required": false } ], "publicPositionalParams": [], @@ -5855,7 +8105,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshCreateParams" + "publicName": "ExecutionCreateParams" }, "requestBody": { "contentType": "application/json", @@ -5882,7 +8132,7 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "execution", "publicAliases": [] }, "responseHeadersModel": { @@ -6000,20 +8250,20 @@ "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", + "resource": "machines.executions", + "publicResource": "machines.executions", "operation": "retrieve", "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "path": "/v1/machines/{machine_id}/executions/{execution_id}", "pathParams": [ "machine_id", - "session_id" + "execution_id" ], "publicPathParams": [ "machine_id", - "session_id" + "execution_id" ], "queryParams": [], "publicQueryParams": [], @@ -6031,7 +8281,7 @@ "explode": false }, { - "name": "session_id", + "name": "execution_id", "required": true, "style": "simple", "explode": false @@ -6043,7 +8293,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshRetrieveParams" + "publicName": "ExecutionRetrieveParams" }, "response": { "status": "200", @@ -6057,7 +8307,7 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "execution", "publicAliases": [] }, "result": { @@ -6135,20 +8385,20 @@ "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", + "resource": "machines.executions", + "publicResource": "machines.executions", "operation": "delete", "publicOperation": "delete", "deprecated": false, "method": "DELETE", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "path": "/v1/machines/{machine_id}/executions/{execution_id}", "pathParams": [ "machine_id", - "session_id" + "execution_id" ], "publicPathParams": [ "machine_id", - "session_id" + "execution_id" ], "queryParams": [], "publicQueryParams": [], @@ -6166,7 +8416,7 @@ "explode": false }, { - "name": "session_id", + "name": "execution_id", "required": true, "style": "simple", "explode": false @@ -6178,7 +8428,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshDeleteParams" + "publicName": "ExecutionDeleteParams" }, "response": { "status": "200", @@ -6192,7 +8442,7 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "execution", "publicAliases": [] }, "result": { @@ -6272,16 +8522,153 @@ { "resource": "machines.executions", "publicResource": "machines.executions", - "operation": "list", - "publicOperation": "list", + "operation": "output", + "publicOperation": "output", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ExecutionOutputParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "execution_output", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "model": { + "name": "error_model", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "events", + "publicOperation": "events", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", + "pathParams": [ + "machine_id", + "execution_id" + ], + "publicPathParams": [ + "machine_id", + "execution_id" ], "queryParams": [ "limit", @@ -6303,6 +8690,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [ @@ -6324,7 +8717,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionListParams" + "publicName": "ExecutionEventsParams" }, "response": { "status": "200", @@ -6338,7 +8731,7 @@ ] }, "responseModel": { - "name": "execution_list", + "name": "execution_events", "publicAliases": [] }, "result": { @@ -6427,66 +8820,35 @@ "requestLocation": "query", "responseLocation": "body", "itemModel": { - "name": "execution", + "name": "execution_event", "publicAliases": [] } }, "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "create", - "publicOperation": "create", + "resource": "machines.executions.logs", + "publicResource": "machines.executions.logs", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/executions", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "command", - "cwd", - "env", - "stdin", - "timeout_ms" - ], - "publicBodyParams": [ - "command", - "cwd", - "env", - "stdin", - "timeout_ms" - ], - "bodyParamDetails": [ - { - "name": "command", - "required": true - }, - { - "name": "cwd", - "required": false - }, - { - "name": "env", - "required": false - }, - { - "name": "stdin", - "required": false - }, - { - "name": "timeout_ms", - "required": false - } - ], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], "publicPositionalParams": [], "pathParamDetails": [ { @@ -6494,6 +8856,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -6502,20 +8870,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionCreateParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "LogRetrieveParams" }, "response": { "status": "200", @@ -6529,11 +8884,11 @@ ] }, "responseModel": { - "name": "execution", + "name": "status", "publicAliases": [] }, "responseHeadersModel": { - "name": "CreateResponseHeaders", + "name": "RetrieveResponseHeaders", "publicAliases": [] }, "result": { @@ -6541,9 +8896,6 @@ "errorStatuses": [ "401", "403", - "409", - "429", - "503", "default" ] }, @@ -6557,11 +8909,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6572,56 +8920,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus409ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus429ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6636,10 +8935,6 @@ "model": { "name": "error_model", "publicAliases": [] - }, - "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", - "publicAliases": [] } } ], @@ -6647,13 +8942,13 @@ "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.executions.logs", + "publicResource": "machines.executions.logs", + "operation": "createToken", + "publicOperation": "createToken", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", + "method": "POST", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", "pathParams": [ "machine_id", "execution_id" @@ -6690,7 +8985,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionRetrieveParams" + "publicName": "LogCreateTokenParams" }, "response": { "status": "200", @@ -6704,7 +8999,11 @@ ] }, "responseModel": { - "name": "execution", + "name": "read_token", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateTokenResponseHeaders", "publicAliases": [] }, "result": { @@ -6712,8 +9011,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -6740,28 +9037,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -6782,20 +9057,18 @@ "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.autoresizing", + "publicResource": "machines.autoresizing", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", + "method": "GET", + "path": "/v1/machines/{machine_id}/autoresizing", "pathParams": [ - "machine_id", - "execution_id" + "machine_id" ], "publicPathParams": [ - "machine_id", - "execution_id" + "machine_id" ], "queryParams": [], "publicQueryParams": [], @@ -6811,12 +9084,6 @@ "required": true, "style": "simple", "explode": false - }, - { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false } ], "queryParamDetails": [], @@ -6825,7 +9092,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionDeleteParams" + "publicName": "AutoresizingRetrieveParams" }, "response": { "status": "200", @@ -6837,46 +9104,22 @@ "encoding": "json" } ] - }, - "responseModel": { - "name": "execution", - "publicAliases": [] - }, - "result": { - "successStatus": "200", - "errorStatuses": [ - "401", - "403", - "429", - "503", - "default" - ] - }, - "errorResponses": [ - { - "status": "401", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, + }, + "responseModel": { + "name": "policy", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "default" + ] + }, + "errorResponses": [ { - "status": "429", + "status": "401", "contentType": "application/json", "encoding": "json", "contents": [ @@ -6887,7 +9130,7 @@ ] }, { - "status": "503", + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -6917,28 +9160,53 @@ "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "output", - "publicOperation": "output", + "resource": "machines.autoresizing", + "publicResource": "machines.autoresizing", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", + "method": "PATCH", + "path": "/v1/machines/{machine_id}/autoresizing", "pathParams": [ - "machine_id", - "execution_id" + "machine_id" ], "publicPathParams": [ - "machine_id", - "execution_id" + "machine_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "publicBodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "bodyParamDetails": [ + { + "name": "cpu", + "required": false + }, + { + "name": "cpu_max_vcpu", + "required": false + }, + { + "name": "memory", + "required": false + }, + { + "name": "memory_max_mib", + "required": false + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -6946,12 +9214,6 @@ "required": true, "style": "simple", "explode": false - }, - { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false } ], "queryParamDetails": [], @@ -6960,7 +9222,20 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionOutputParams" + "publicName": "AutoresizingUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -6974,7 +9249,7 @@ ] }, "responseModel": { - "name": "execution_output", + "name": "policy", "publicAliases": [] }, "result": { @@ -6982,8 +9257,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -7010,28 +9283,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -7052,70 +9303,29 @@ "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "events", - "publicOperation": "events", + "resource": "organization.autoresizing", + "publicResource": "organization.autoresizing", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", - "pathParams": [ - "machine_id", - "execution_id" - ], - "publicPathParams": [ - "machine_id", - "execution_id" - ], - "queryParams": [ - "limit", - "cursor" - ], - "publicQueryParams": [ - "limit", - "cursor" - ], + "path": "/v1/organization/autoresizing", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false - }, - { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false - } - ], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false - }, - { - "name": "cursor", - "required": false, - "style": "form", - "explode": false - } - ], + "pathParamDetails": [], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], - "paramsModel": { - "publicName": "ExecutionEventsParams" - }, "response": { "status": "200", "contentType": "application/json", @@ -7128,7 +9338,7 @@ ] }, "responseModel": { - "name": "execution_events", + "name": "policy", "publicAliases": [] }, "result": { @@ -7136,8 +9346,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -7164,28 +9372,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -7203,71 +9389,74 @@ } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "execution_event", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "organization.autoresizing", + "publicResource": "organization.autoresizing", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", - "pathParams": [ - "machine_id", - "execution_id" - ], - "publicPathParams": [ - "machine_id", - "execution_id" - ], + "method": "PATCH", + "path": "/v1/organization/autoresizing", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [ + "bodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "publicBodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "bodyParamDetails": [ { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false + "name": "cpu", + "required": false }, { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false + "name": "cpu_max_vcpu", + "required": false + }, + { + "name": "memory", + "required": false + }, + { + "name": "memory_max_mib", + "required": false } ], + "publicPositionalParams": [], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "LogRetrieveParams" + "publicName": "AutoresizingUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -7281,11 +9470,7 @@ ] }, "responseModel": { - "name": "status", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RetrieveResponseHeaders", + "name": "policy", "publicAliases": [] }, "result": { @@ -7339,50 +9524,51 @@ "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", - "operation": "reauthorize", - "publicOperation": "reauthorize", + "resource": "images", + "publicResource": "images", + "operation": "list", + "publicOperation": "list", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/reauthorize", - "pathParams": [ - "machine_id", - "execution_id" + "method": "GET", + "path": "/v1/images", + "pathParams": [], + "publicPathParams": [], + "queryParams": [ + "limit", + "cursor" ], - "publicPathParams": [ - "machine_id", - "execution_id" + "publicQueryParams": [ + "limit", + "cursor" ], - "queryParams": [], - "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [ + "pathParamDetails": [], + "queryParamDetails": [ { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false + "name": "limit", + "required": false, + "style": "form", + "explode": false, + "defaultValue": 100 }, { - "name": "execution_id", - "required": true, - "style": "simple", + "name": "cursor", + "required": false, + "style": "form", "explode": false } ], - "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "LogReauthorizeParams" + "publicName": "ImageListParams" }, "response": { "status": "200", @@ -7396,11 +9582,7 @@ ] }, "responseModel": { - "name": "status", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "ReauthorizeResponseHeaders", + "name": "image_list", "publicAliases": [] }, "result": { @@ -7436,16 +9618,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -7454,53 +9636,74 @@ "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", - "operation": "createToken", - "publicOperation": "createToken", + "resource": "images", + "publicResource": "images", + "operation": "create", + "publicOperation": "create", "deprecated": false, "method": "POST", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", - "pathParams": [ - "machine_id", - "execution_id" - ], - "publicPathParams": [ - "machine_id", - "execution_id" - ], + "path": "/v1/images", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [ + "bodyParams": [ + "credential_ref", + "name", + "platform", + "source" + ], + "publicBodyParams": [ + "credential_ref", + "name", + "platform", + "source" + ], + "bodyParamDetails": [ { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false + "name": "credential_ref", + "required": false }, { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false + "name": "name", + "required": false + }, + { + "name": "platform", + "required": true + }, + { + "name": "source", + "required": true } ], + "publicPositionalParams": [], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "LogCreateTokenParams" + "publicName": "ImageCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { - "status": "200", + "status": "202", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7511,15 +9714,15 @@ ] }, "responseModel": { - "name": "read_token", + "name": "image", "publicAliases": [] }, "responseHeadersModel": { - "name": "CreateTokenResponseHeaders", + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { - "successStatus": "200", + "successStatus": "202", "errorStatuses": [ "401", "403", @@ -7536,7 +9739,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -7547,20 +9754,28 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", + "publicAliases": [] + }, + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -7569,18 +9784,18 @@ "transport": "http" }, { - "resource": "machines.autoresizing", - "publicResource": "machines.autoresizing", + "resource": "images", + "publicResource": "images", "operation": "retrieve", "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/autoresizing", + "path": "/v1/images/{image_id}", "pathParams": [ - "machine_id" + "image_id" ], "publicPathParams": [ - "machine_id" + "image_id" ], "queryParams": [], "publicQueryParams": [], @@ -7592,7 +9807,7 @@ "publicPositionalParams": [], "pathParamDetails": [ { - "name": "machine_id", + "name": "image_id", "required": true, "style": "simple", "explode": false @@ -7604,7 +9819,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingRetrieveParams" + "publicName": "ImageRetrieveParams" }, "response": { "status": "200", @@ -7618,7 +9833,7 @@ ] }, "responseModel": { - "name": "settings", + "name": "image", "publicAliases": [] }, "result": { @@ -7654,16 +9869,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -7672,39 +9887,39 @@ "transport": "http" }, { - "resource": "machines.autoresizing", - "publicResource": "machines.autoresizing", + "resource": "images", + "publicResource": "images", "operation": "update", "publicOperation": "update", "deprecated": false, - "method": "PUT", - "path": "/v1/machines/{machine_id}/autoresizing", + "method": "PATCH", + "path": "/v1/images/{image_id}", "pathParams": [ - "machine_id" + "image_id" ], "publicPathParams": [ - "machine_id" + "image_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "enabled" + "name" ], "publicBodyParams": [ - "enabled" + "name" ], "bodyParamDetails": [ { - "name": "enabled", + "name": "name", "required": true } ], "publicPositionalParams": [], "pathParamDetails": [ { - "name": "machine_id", + "name": "image_id", "required": true, "style": "simple", "explode": false @@ -7716,7 +9931,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingUpdateParams" + "publicName": "ImageUpdateParams" }, "requestBody": { "contentType": "application/json", @@ -7743,7 +9958,7 @@ ] }, "responseModel": { - "name": "settings", + "name": "image", "publicAliases": [] }, "result": { @@ -7779,16 +9994,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -7797,15 +10012,19 @@ "transport": "http" }, { - "resource": "organization.autoresizing", - "publicResource": "organization.autoresizing", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "images", + "publicResource": "images", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "GET", - "path": "/v1/organization/autoresizing", - "pathParams": [], - "publicPathParams": [], + "method": "DELETE", + "path": "/v1/images/{image_id}", + "pathParams": [ + "image_id" + ], + "publicPathParams": [ + "image_id" + ], "queryParams": [], "publicQueryParams": [], "headerParams": [], @@ -7814,12 +10033,22 @@ "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [], + "pathParamDetails": [ + { + "name": "image_id", + "required": true, + "style": "simple", + "explode": false + } + ], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], + "paramsModel": { + "publicName": "ImageDeleteParams" + }, "response": { "status": "200", "contentType": "application/json", @@ -7832,7 +10061,7 @@ ] }, "responseModel": { - "name": "policy", + "name": "image", "publicAliases": [] }, "result": { @@ -7868,16 +10097,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -7886,13 +10115,13 @@ "transport": "http" }, { - "resource": "organization.autoresizing", - "publicResource": "organization.autoresizing", - "operation": "update", - "publicOperation": "update", + "resource": "images.uploads", + "publicResource": "images.uploads", + "operation": "create", + "publicOperation": "create", "deprecated": false, - "method": "PUT", - "path": "/v1/organization/autoresizing", + "method": "POST", + "path": "/v1/images/uploads", "pathParams": [], "publicPathParams": [], "queryParams": [], @@ -7900,14 +10129,26 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "enabled" + "platform", + "sha256", + "size_bytes" ], "publicBodyParams": [ - "enabled" + "platform", + "sha256", + "size_bytes" ], "bodyParamDetails": [ { - "name": "enabled", + "name": "platform", + "required": true + }, + { + "name": "sha256", + "required": true + }, + { + "name": "size_bytes", "required": true } ], @@ -7919,7 +10160,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingUpdateParams" + "publicName": "UploadCreateParams" }, "requestBody": { "contentType": "application/json", @@ -7946,7 +10187,11 @@ ] }, "responseModel": { - "name": "policy", + "name": "reservation", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { @@ -7967,7 +10212,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -7978,20 +10227,28 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", + "publicAliases": [] + }, + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } diff --git a/src/cli/completions.ts b/src/cli/completions.ts index 396b06c..e14e5bd 100644 --- a/src/cli/completions.ts +++ b/src/cli/completions.ts @@ -4,12 +4,12 @@ // built from. `dedalus completion ` prints one of them. const bash = - "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines:ssh'|'machines:ssh list'|'machines:ssh create'|'machines:ssh retrieve'|'machines:ssh delete'|'machines:executions'|'machines:executions list'|'machines:executions create'|'machines:executions retrieve'|'machines:executions delete'|'machines:executions output'|'machines:executions events'|'machines:executions:logs'|'machines:executions:logs retrieve'|'machines:executions:logs reauthorize'|'machines:executions:logs create-token'|'machines:autoresizing'|'machines:autoresizing retrieve'|'machines:autoresizing update'|'organization:autoresizing'|'organization:autoresizing retrieve'|'organization:autoresizing update'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_path_flag() {\n return 1\n}\n\n__dedalus_completion() {\n local cur prev node candidate words line index\n COMPREPLY=()\n cur=\"${COMP_WORDS[COMP_CWORD]}\"\n prev=''\n if (( COMP_CWORD > 0 )); then prev=\"${COMP_WORDS[COMP_CWORD-1]}\"; fi\n node=''\n for (( index = 1; index < COMP_CWORD; index++ )); do\n case \"${COMP_WORDS[index]}\" in\n -*) continue ;;\n esac\n if [ -z \"$node\" ]; then\n candidate=\"${COMP_WORDS[index]}\"\n else\n candidate=\"$node ${COMP_WORDS[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then node=\"$candidate\"; fi\n done\n\n case \"$node\" in\n '') words='machines machines:ssh machines:executions machines:executions:logs machines:autoresizing organization:autoresizing login logout completion help --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --version --help' ;;\n 'completion') words='bash zsh fish --help' ;;\n 'machines') words='list create retrieve update delete sleep wake reboot --help' ;;\n 'machines list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines create') words='--autosleep --memory-mib --storage-gib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines update') words='--machine-id --autosleep --memory-mib --storage-gib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines delete') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines sleep') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines wake') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines reboot') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:ssh') words='list create retrieve delete --help' ;;\n 'machines:ssh list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:ssh create') words='--machine-id --public-key --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:ssh retrieve') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:ssh delete') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions') words='list create retrieve delete output events --help' ;;\n 'machines:executions list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions create') words='--machine-id --command --cwd --env --stdin --timeout-ms --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions delete') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions output') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions events') words='--machine-id --execution-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions:logs') words='retrieve reauthorize create-token --help' ;;\n 'machines:executions:logs retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions:logs reauthorize') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:executions:logs create-token') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:autoresizing') words='retrieve update --help' ;;\n 'machines:autoresizing retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'machines:autoresizing update') words='--machine-id --enabled --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'organization:autoresizing') words='retrieve update --help' ;;\n 'organization:autoresizing retrieve') words='--base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'organization:autoresizing update') words='--enabled --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --dedalus-org-id --help' ;;\n 'login') words='--base-url --flow --help' ;;\n 'logout') words='--base-url --all --help' ;;\n *) words='' ;;\n esac\n\n if __dedalus_path_flag \"$node $prev\"; then\n compopt -o filenames 2>/dev/null\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -f -- \"$cur\")\n return\n fi\n\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -W \"$words\" -- \"$cur\")\n}\n\ncomplete -F __dedalus_completion 'dedalus'\n"; + "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_path_flag() {\n return 1\n}\n\n__dedalus_completion() {\n local cur prev node candidate words line index\n COMPREPLY=()\n cur=\"${COMP_WORDS[COMP_CWORD]}\"\n prev=''\n if (( COMP_CWORD > 0 )); then prev=\"${COMP_WORDS[COMP_CWORD-1]}\"; fi\n node=''\n for (( index = 1; index < COMP_CWORD; index++ )); do\n case \"${COMP_WORDS[index]}\" in\n -*) continue ;;\n esac\n if [ -z \"$node\" ]; then\n candidate=\"${COMP_WORDS[index]}\"\n else\n candidate=\"$node ${COMP_WORDS[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then node=\"$candidate\"; fi\n done\n\n case \"$node\" in\n '') words='machines organization images login logout completion upgrade uninstall help --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --version --help' ;;\n 'completion') words='bash zsh fish --help' ;;\n 'upgrade') words='--check --help' ;;\n 'uninstall') words='--help' ;;\n 'machines') words='list create retrieve update delete sleep wake reboot resize ssh executions autoresizing --help' ;;\n 'machines list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines create') words='--autosleep --image-id --memory-mib --storage-gib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines update') words='--machine-id --autosleep --storage-gib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines delete') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines sleep') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines wake') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines reboot') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines resize') words='--machine-id --memory-mib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh') words='list create retrieve delete --help' ;;\n 'machines ssh list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh create') words='--machine-id --public-key --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh retrieve') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh delete') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions') words='list create retrieve delete output events logs --help' ;;\n 'machines executions list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions create') words='--machine-id --command --cwd --env --stdin --timeout-ms --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions delete') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions output') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions events') words='--machine-id --execution-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs') words='retrieve create-token --help' ;;\n 'machines executions logs retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs create-token') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing') words='retrieve update --help' ;;\n 'machines autoresizing retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing update') words='--machine-id --cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization') words='autoresizing --help' ;;\n 'organization autoresizing') words='retrieve update --help' ;;\n 'organization autoresizing retrieve') words='--base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization autoresizing update') words='--cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images') words='list create retrieve update delete uploads --help' ;;\n 'images list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images create') words='--credential-ref --name --platform --source --source.kind --source.reference --source.sha256 --source.upload-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images retrieve') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images update') words='--image-id --name --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images delete') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images uploads') words='create --help' ;;\n 'images uploads create') words='--platform --sha256 --size-bytes --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'login') words='--base-url --flow --help' ;;\n 'logout') words='--base-url --all --help' ;;\n *) words='' ;;\n esac\n\n if __dedalus_path_flag \"$node $prev\"; then\n compopt -o filenames 2>/dev/null\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -f -- \"$cur\")\n return\n fi\n\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -W \"$words\" -- \"$cur\")\n}\n\ncomplete -F __dedalus_completion 'dedalus'\n"; const zsh = - "#compdef dedalus\n# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines:ssh'|'machines:ssh list'|'machines:ssh create'|'machines:ssh retrieve'|'machines:ssh delete'|'machines:executions'|'machines:executions list'|'machines:executions create'|'machines:executions retrieve'|'machines:executions delete'|'machines:executions output'|'machines:executions events'|'machines:executions:logs'|'machines:executions:logs retrieve'|'machines:executions:logs reauthorize'|'machines:executions:logs create-token'|'machines:autoresizing'|'machines:autoresizing retrieve'|'machines:autoresizing update'|'organization:autoresizing'|'organization:autoresizing retrieve'|'organization:autoresizing update'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_completion() {\n local node candidate\n local -a subcommands options\n local -i index matched\n node=''\n matched=1\n for (( index = 2; index < CURRENT; index++ )); do\n case ${words[index]} in\n -*) continue ;;\n esac\n if [[ -z $node ]]; then\n candidate=${words[index]}\n else\n candidate=\"$node ${words[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then\n node=$candidate\n matched=$index\n fi\n done\n\n subcommands=()\n options=()\n case \"$node\" in\n '')\n subcommands=('machines:machines commands' 'machines\\:ssh:machines\\:ssh commands' 'machines\\:executions:machines\\:executions commands' 'machines\\:executions\\:logs:machines\\:executions\\:logs commands' 'machines\\:autoresizing:machines\\:autoresizing commands' 'organization\\:autoresizing:organization\\:autoresizing commands' 'login:Sign in and save credentials for later commands' 'logout:Forget saved credentials' 'completion:Print a shell completion script' 'help:Show help for a command')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--version[Print the CLI version]' '--help[Show help for this command]')\n ;;\n 'completion')\n subcommands=('bash:Print a bash completion script' 'zsh:Print a zsh completion script' 'fish:Print a fish completion script')\n options=('--help[Show help for this command]')\n ;;\n 'machines')\n subcommands=('list:List machines' 'create:Create machine' 'retrieve:Get machine' 'update:Update machine' 'delete:Destroy machine' 'sleep:Sleep a running machine' 'wake:Wake a sleeping machine' 'reboot:Reboot a machine with fresh memory')\n options=('--help[Show help for this command]')\n ;;\n 'machines list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines create')\n options=('--autosleep[Idle window before autosleep]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--autosleep[Idle window before autosleep]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines sleep')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines wake')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines reboot')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Recover from the last committed filesystem checkpoint without guest cooperation]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:ssh')\n subcommands=('list:List SSH sessions' 'create:Create SSH session' 'retrieve:Get SSH session' 'delete:Delete SSH session')\n options=('--help[Show help for this command]')\n ;;\n 'machines:ssh list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:ssh create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--public-key[The public-key body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:ssh retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:ssh delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions')\n subcommands=('list:List executions' 'create:Create execution' 'retrieve:Get execution' 'delete:Delete execution' 'output:Get execution output' 'events:List execution events')\n options=('--help[Show help for this command]')\n ;;\n 'machines:executions list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--command[The command body parameter]:value:' '--cwd[The cwd body parameter]:value:' '--env[The env body parameter]:value:' '--stdin[The stdin body parameter]:value:' '--timeout-ms[The timeout-ms body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions output')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions events')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions:logs')\n subcommands=('retrieve:Get execution log status' 'reauthorize:Reauthorize execution log publication' 'create-token:Create execution log read token')\n options=('--help[Show help for this command]')\n ;;\n 'machines:executions:logs retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions:logs reauthorize')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:executions:logs create-token')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:autoresizing')\n subcommands=('retrieve:Read this machine'\\''s RAM autoresizing settings' 'update:Set this machine'\\''s RAM autoresizing settings')\n options=('--help[Show help for this command]')\n ;;\n 'machines:autoresizing retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines:autoresizing update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--enabled[The enabled body parameter]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization:autoresizing')\n subcommands=('retrieve:Read organization RAM autoresizing policy' 'update:Set organization RAM autoresizing policy')\n options=('--help[Show help for this command]')\n ;;\n 'organization:autoresizing retrieve')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization:autoresizing update')\n options=('--enabled[Allow automatic RAM increases for all organization machines]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in Authorization\\: Bearer ]:value:' '--x-api-key[Dedalus API key]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'login')\n options=('--base-url[Sign in against this base URL instead of the default]:value:' '--flow[Sign-in flow to use\\: api-key, x-api-key]:value:' '--help[Show help for this command]')\n ;;\n 'logout')\n options=('--base-url[Forget the credentials saved for this base URL]:value:' '--all[Forget every saved credential, for every base URL]' '--help[Show help for this command]')\n ;;\n esac\n\n words=( \"$words[1]\" \"${(@)words[matched+1,-1]}\" )\n (( CURRENT -= matched - 1 ))\n\n (( ${#options} )) && _arguments -s -S $options\n (( ${#subcommands} )) && _describe -t commands 'command' subcommands\n}\n\nif [[ ${zsh_eval_context[-1]} == loadautofunc ]]; then\n __dedalus_completion \"$@\"\nelse\n compdef __dedalus_completion 'dedalus'\nfi\n"; + "#compdef dedalus\n# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_completion() {\n local node candidate\n local -a subcommands options\n local -i index matched\n node=''\n matched=1\n for (( index = 2; index < CURRENT; index++ )); do\n case ${words[index]} in\n -*) continue ;;\n esac\n if [[ -z $node ]]; then\n candidate=${words[index]}\n else\n candidate=\"$node ${words[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then\n node=$candidate\n matched=$index\n fi\n done\n\n subcommands=()\n options=()\n case \"$node\" in\n '')\n subcommands=('machines:machines commands' 'organization:organization commands' 'images:images commands' 'login:Sign in and save credentials for later commands' 'logout:Forget saved credentials, and revoke them if the provider supports it' 'completion:Print a shell completion script' 'upgrade:Upgrade to the latest release' 'uninstall:Show how to remove this installation' 'help:Show help for a command')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--version[Print the CLI version]' '--help[Show help for this command]')\n ;;\n 'completion')\n subcommands=('bash:Print a bash completion script' 'zsh:Print a zsh completion script' 'fish:Print a fish completion script')\n options=('--help[Show help for this command]')\n ;;\n 'upgrade')\n options=('--check[Report the latest version without installing it]' '--help[Show help for this command]')\n ;;\n 'uninstall')\n options=('--help[Show help for this command]')\n ;;\n 'machines')\n subcommands=('list:List machines' 'create:Create machine' 'retrieve:Get machine' 'update:Update machine' 'delete:Destroy machine' 'sleep:Sleep a running machine' 'wake:Wake a sleeping machine' 'reboot:Reboot a machine with fresh memory' 'resize:Resize machine' 'ssh:ssh commands' 'executions:executions commands' 'autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines create')\n options=('--autosleep[Idle window before autosleep]:value:' '--image-id[Organization-owned ready custom image ID]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--autosleep[The autosleep body parameter]:value:' '--storage-gib[The storage-gib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Destroy from the last published filesystem checkpoint without publishing the Machine'\\''s remaining...]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines sleep')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines wake')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines reboot')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Recover from the last committed filesystem checkpoint without guest cooperation]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines resize')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--memory-mib[RAM in MiB]:value:' '--vcpu[CPU in 0.25-vCPU steps]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh')\n subcommands=('list:List SSH sessions' 'create:Create SSH session' 'retrieve:Get SSH session' 'delete:Delete SSH session')\n options=('--help[Show help for this command]')\n ;;\n 'machines ssh list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--public-key[The public-key body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions')\n subcommands=('list:List executions' 'create:Create execution' 'retrieve:Get execution' 'delete:Delete execution' 'output:Get execution output' 'events:List execution events' 'logs:logs commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--command[The command body parameter]:value:' '--cwd[The cwd body parameter]:value:' '--env[The env body parameter]:value:' '--stdin[The stdin body parameter]:value:' '--timeout-ms[The timeout-ms body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions output')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions events')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs')\n subcommands=('retrieve:Get execution log status' 'create-token:Create execution log read token')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions logs retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs create-token')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing')\n subcommands=('retrieve:Read this machine'\\''s autoresizing settings' 'update:Set this machine'\\''s autoresizing settings')\n options=('--help[Show help for this command]')\n ;;\n 'machines autoresizing retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization')\n subcommands=('autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing')\n subcommands=('retrieve:Read organization autoresizing policy' 'update:Set organization autoresizing policy')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing retrieve')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization autoresizing update')\n options=('--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images')\n subcommands=('list:List image IDs owned by the authenticated organization' 'create:Register an immutable OCI image for preparation' 'retrieve:Read preparation status for an organization-owned image' 'update:Rename an organization-owned image' 'delete:Delete an organization-owned image' 'uploads:uploads commands')\n options=('--help[Show help for this command]')\n ;;\n 'images list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images create')\n options=('--credential-ref[The credential-ref body parameter]:value:' '--name[A label people use to tell images apart]:value:' '--platform[The platform body parameter]:value:' '--source[The source body parameter]:value:' '--source.kind[The source.kind body parameter]:value:' '--source.reference[The source.reference body parameter]:value:' '--source.sha256[The source.sha256 body parameter]:value:' '--source.upload-id[The source.upload-id body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images retrieve')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images update')\n options=('--image-id[The image-id path parameter]:value:' '--name[The new label, or null to clear it]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images delete')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images uploads')\n subcommands=('create:Reserve an immutable Docker image archive upload')\n options=('--help[Show help for this command]')\n ;;\n 'images uploads create')\n options=('--platform[The platform body parameter]:value:' '--sha256[The sha256 body parameter]:value:' '--size-bytes[The size-bytes body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'login')\n options=('--base-url[Sign in against this base URL instead of the default]:value:' '--flow[Sign-in flow to use\\: api-key, x-api-key, oauth-browser]:value:' '--help[Show help for this command]')\n ;;\n 'logout')\n options=('--base-url[Forget the credentials saved for this base URL (not with --all)]:value:' '--all[Forget every saved credential, for every base URL]' '--help[Show help for this command]')\n ;;\n esac\n\n words=( \"$words[1]\" \"${(@)words[matched+1,-1]}\" )\n (( CURRENT -= matched - 1 ))\n\n (( ${#options} )) && _arguments -s -S $options\n (( ${#subcommands} )) && _describe -t commands 'command' subcommands\n}\n\nif [[ ${zsh_eval_context[-1]} == loadautofunc ]]; then\n __dedalus_completion \"$@\"\nelse\n compdef __dedalus_completion 'dedalus'\nfi\n"; const fish = - "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\nset -g __dedalus_paths 'completion' 'machines' 'machines list' 'machines create' 'machines retrieve' 'machines update' 'machines delete' 'machines sleep' 'machines wake' 'machines reboot' 'machines:ssh' 'machines:ssh list' 'machines:ssh create' 'machines:ssh retrieve' 'machines:ssh delete' 'machines:executions' 'machines:executions list' 'machines:executions create' 'machines:executions retrieve' 'machines:executions delete' 'machines:executions output' 'machines:executions events' 'machines:executions:logs' 'machines:executions:logs retrieve' 'machines:executions:logs reauthorize' 'machines:executions:logs create-token' 'machines:autoresizing' 'machines:autoresizing retrieve' 'machines:autoresizing update' 'organization:autoresizing' 'organization:autoresizing retrieve' 'organization:autoresizing update' 'login' 'logout'\n\nfunction __dedalus_path\n set -l path ''\n set -l tokens (commandline -opc)\n for token in $tokens[2..-1]\n if string match -q -- '-*' $token\n continue\n end\n set -l candidate\n if test -z \"$path\"\n set candidate $token\n else\n set candidate \"$path $token\"\n end\n if contains -- $candidate $__dedalus_paths\n set path $candidate\n end\n end\n echo $path\nend\n\nfunction __dedalus_at --argument-names index\n set -l current (__dedalus_path)\n if test \"$index\" -eq 0\n test -z \"$current\"\n else\n test \"$current\" = \"$__dedalus_paths[$index]\"\n end\nend\n\ncomplete -c 'dedalus' -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines' -d 'machines commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines:ssh' -d 'machines:ssh commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines:executions' -d 'machines:executions commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines:executions:logs' -d 'machines:executions:logs commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines:autoresizing' -d 'machines:autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'organization:autoresizing' -d 'organization:autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'login' -d 'Sign in and save credentials for later commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'logout' -d 'Forget saved credentials'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'completion' -d 'Print a shell completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'help' -d 'Show help for a command'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'version' -d 'Print the CLI version'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'bash' -d 'Print a bash completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'zsh' -d 'Print a zsh completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'fish' -d 'Print a fish completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'list' -d 'List machines'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'create' -d 'Create machine'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'retrieve' -d 'Get machine'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'update' -d 'Update machine'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'delete' -d 'Destroy machine'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'sleep' -d 'Sleep a running machine'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'wake' -d 'Wake a sleeping machine'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -a 'reboot' -d 'Reboot a machine with fresh memory'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'force' -d 'Recover from the last committed filesystem checkpoint without guest cooperation'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -a 'list' -d 'List SSH sessions'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -a 'create' -d 'Create SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -a 'retrieve' -d 'Get SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -a 'delete' -d 'Delete SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'public-key' -d 'The public-key body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -a 'list' -d 'List executions'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -a 'create' -d 'Create execution'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -a 'retrieve' -d 'Get execution'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -a 'delete' -d 'Delete execution'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -a 'output' -d 'Get execution output'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -a 'events' -d 'List execution events'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'command' -d 'The command body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'cwd' -d 'The cwd body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'env' -d 'The env body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'stdin' -d 'The stdin body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout-ms' -d 'The timeout-ms body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -a 'retrieve' -d 'Get execution log status'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -a 'reauthorize' -d 'Reauthorize execution log publication'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -a 'create-token' -d 'Create execution log read token'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -a 'retrieve' -d 'Read this machine\\'s RAM autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -a 'update' -d 'Set this machine\\'s RAM autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'enabled' -d 'The enabled body parameter'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -a 'retrieve' -d 'Read organization RAM autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -a 'update' -d 'Set organization RAM autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'enabled' -d 'Allow automatic RAM increases for all organization machines'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in Authorization: Bearer ' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'base-url' -d 'Sign in against this base URL instead of the default' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'flow' -d 'Sign-in flow to use: api-key, x-api-key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'base-url' -d 'Forget the credentials saved for this base URL' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'all' -d 'Forget every saved credential, for every base URL'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'help' -d 'Show help for this command'\n"; + "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\nset -g __dedalus_paths 'completion' 'upgrade' 'uninstall' 'machines' 'machines list' 'machines create' 'machines retrieve' 'machines update' 'machines delete' 'machines sleep' 'machines wake' 'machines reboot' 'machines resize' 'machines ssh' 'machines ssh list' 'machines ssh create' 'machines ssh retrieve' 'machines ssh delete' 'machines executions' 'machines executions list' 'machines executions create' 'machines executions retrieve' 'machines executions delete' 'machines executions output' 'machines executions events' 'machines executions logs' 'machines executions logs retrieve' 'machines executions logs create-token' 'machines autoresizing' 'machines autoresizing retrieve' 'machines autoresizing update' 'organization' 'organization autoresizing' 'organization autoresizing retrieve' 'organization autoresizing update' 'images' 'images list' 'images create' 'images retrieve' 'images update' 'images delete' 'images uploads' 'images uploads create' 'login' 'logout'\n\nfunction __dedalus_path\n set -l path ''\n set -l tokens (commandline -opc)\n for token in $tokens[2..-1]\n if string match -q -- '-*' $token\n continue\n end\n set -l candidate\n if test -z \"$path\"\n set candidate $token\n else\n set candidate \"$path $token\"\n end\n if contains -- $candidate $__dedalus_paths\n set path $candidate\n end\n end\n echo $path\nend\n\nfunction __dedalus_at --argument-names index\n set -l current (__dedalus_path)\n if test \"$index\" -eq 0\n test -z \"$current\"\n else\n test \"$current\" = \"$__dedalus_paths[$index]\"\n end\nend\n\ncomplete -c 'dedalus' -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines' -d 'machines commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'organization' -d 'organization commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'images' -d 'images commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'login' -d 'Sign in and save credentials for later commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'logout' -d 'Forget saved credentials, and revoke them if the provider supports it'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'completion' -d 'Print a shell completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'upgrade' -d 'Upgrade to the latest release'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'uninstall' -d 'Show how to remove this installation'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'help' -d 'Show help for a command'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'version' -d 'Print the CLI version'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'bash' -d 'Print a bash completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'zsh' -d 'Print a zsh completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'fish' -d 'Print a fish completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'check' -d 'Report the latest version without installing it'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'list' -d 'List machines'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'create' -d 'Create machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'retrieve' -d 'Get machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'update' -d 'Update machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'delete' -d 'Destroy machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'sleep' -d 'Sleep a running machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'wake' -d 'Wake a sleeping machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'reboot' -d 'Reboot a machine with fresh memory'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'resize' -d 'Resize machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ssh' -d 'ssh commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'executions' -d 'executions commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'image-id' -d 'Organization-owned ready custom image ID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'autosleep' -d 'The autosleep body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'storage-gib' -d 'The storage-gib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'force' -d 'Destroy from the last published filesystem checkpoint without publishing the Machine\\'s remaining...'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'force' -d 'Recover from the last committed filesystem checkpoint without guest cooperation'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'memory-mib' -d 'RAM in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'vcpu' -d 'CPU in 0.25-vCPU steps' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'list' -d 'List SSH sessions'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'create' -d 'Create SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'retrieve' -d 'Get SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'delete' -d 'Delete SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'public-key' -d 'The public-key body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'list' -d 'List executions'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'create' -d 'Create execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'retrieve' -d 'Get execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'delete' -d 'Delete execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'output' -d 'Get execution output'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'events' -d 'List execution events'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'logs' -d 'logs commands'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'command' -d 'The command body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'cwd' -d 'The cwd body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'env' -d 'The env body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'stdin' -d 'The stdin body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout-ms' -d 'The timeout-ms body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'retrieve' -d 'Get execution log status'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'create-token' -d 'Create execution log read token'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'retrieve' -d 'Read this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'update' -d 'Set this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -a 'retrieve' -d 'Read organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -a 'update' -d 'Set organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'list' -d 'List image IDs owned by the authenticated organization'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'create' -d 'Register an immutable OCI image for preparation'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'retrieve' -d 'Read preparation status for an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'update' -d 'Rename an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'delete' -d 'Delete an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'uploads' -d 'uploads commands'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'credential-ref' -d 'The credential-ref body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'name' -d 'A label people use to tell images apart' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source' -d 'The source body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.kind' -d 'The source.kind body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.reference' -d 'The source.reference body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.sha256' -d 'The source.sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.upload-id' -d 'The source.upload-id body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'name' -d 'The new label, or null to clear it' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -a 'create' -d 'Reserve an immutable Docker image archive upload'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'sha256' -d 'The sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'size-bytes' -d 'The size-bytes body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'base-url' -d 'Sign in against this base URL instead of the default' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'flow' -d 'Sign-in flow to use: api-key, x-api-key, oauth-browser' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'base-url' -d 'Forget the credentials saved for this base URL (not with --all)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'all' -d 'Forget every saved credential, for every base URL'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'help' -d 'Show help for this command'\n"; export const completions = { bash, zsh, fish } as const; diff --git a/src/cli/credentials.ts b/src/cli/credentials.ts index c0cef08..53419b2 100644 --- a/src/cli/credentials.ts +++ b/src/cli/credentials.ts @@ -40,6 +40,13 @@ export type StoredOAuth = { /** Legacy refresh endpoint field emitted before `refreshUrl` was kept separately. */ readonly tokenUrl?: string; readonly clientId?: string; + /** + * The RFC 7009 endpoint `logout` revokes this token at, resolved when the token was issued. + * + * Kept with the token rather than read from the build at sign-out, so the endpoint that issued it + * is the one asked to revoke it — not whatever a later regeneration names. + */ + readonly revocationUrl?: string; }; /** Credentials stored for one base URL, keyed by client-option name. */ @@ -336,6 +343,7 @@ export const storeDescription = (location: CredentialStoreLocation, backend: Sto const osStoreName = (): string => { if (process.platform === 'win32') return 'Windows Credential Manager'; + if (process.platform === 'darwin') return 'macOS Keychain'; return 'system keyring'; }; @@ -386,14 +394,23 @@ const readProfileResult = ( } const read = keychainRead(location.storeName, key); if (read.secret === undefined) return { profile: {}, unreadable: read.unavailable }; + return { profile: parseSecret(read.secret), unreadable: false }; +}; + +/** + * A keychain item's JSON, as a profile. + * + * An item this cannot parse is treated as absent, for the same reason a corrupt file is: one + * `login` again beats taking out every command that needed no credential. + */ +const parseSecret = (secret: string): StoredProfile => { try { - const parsed: unknown = JSON.parse(read.secret); - if (parsed && typeof parsed === 'object') return { profile: parsed as StoredProfile, unreadable: false }; + const parsed: unknown = JSON.parse(secret); + if (parsed && typeof parsed === 'object') return parsed as StoredProfile; } catch { - // An item this cannot parse is treated as absent, for the same reason a corrupt file is: one - // `login` again beats taking out every command that needed no credential. + // Absent; see above. } - return { profile: {}, unreadable: false }; + return {}; }; /** The file entry for one profile: the credential itself, or the marker saying where it really is. */ @@ -519,7 +536,7 @@ const warnings: string[] = []; * prose with the JSON document `--format-error json` puts on that same stream. Only `login` and * `logout` drain this, so a warning reaches the one place a user is already reading sentences. */ -const warn = (message: string): void => { +export const warn = (message: string): void => { if (!warnings.includes(message)) warnings.push(message); }; @@ -554,16 +571,25 @@ const withoutMarker = (profile: StoredProfile): StoredProfile => ({ }); /** - * Removes one stored profile, reporting what became of it. + * Removes one stored profile, reporting what became of it and what it held. * * A secret the OS store will not give up fails the whole removal rather than being written off. * `readProfile` looks the OS store up by key and never through the index, so dropping the index * entry while the secret stays behind would leave a credential that still authenticates every * command — and that `logout --all`, which enumerates the index, could no longer even find. + * + * `held` is the removed profile's content, read before its secret goes so `logout` can revoke its + * tokens afterwards; it is empty when nothing was removed or `readHeld` is false (see + * {@link heldProfile}). */ -export const deleteProfile = (location: CredentialStoreLocation, key: string): 'removed' | 'absent' => +export const deleteProfile = ( + location: CredentialStoreLocation, + key: string, + readHeld: boolean, +): { readonly outcome: 'removed' | 'absent'; readonly held: HeldProfile } => withStoreLock(location, () => { const entry = indexEntry(location, key); + const held = heldProfile(location, key, readHeld); if (entry.backend === 'keychain') { const outcome = removeSecret(location, key); if (outcome === 'kept') { @@ -577,49 +603,107 @@ export const deleteProfile = (location: CredentialStoreLocation, key: string): ' } } const store = readStore(location); - if (!Object.prototype.hasOwnProperty.call(store.profiles, key)) return 'absent'; + if (!Object.prototype.hasOwnProperty.call(store.profiles, key)) { + return { outcome: 'absent', held: { profile: {}, unreadable: false } }; + } const profiles = { ...store.profiles }; delete profiles[key]; writeStore(location, { version: STORE_VERSION, profiles }); - return 'removed'; + return { outcome: 'removed', held }; }); +/** What a removed profile held, so `logout` can revoke its tokens once the local copy is gone. */ +export type HeldProfile = { + readonly profile: StoredProfile; + /** + * The index points at the OS store but the read came back empty, so what the profile held — and + * whether any of it could be revoked — is unknown. `logout` says so rather than staying silent. + */ + readonly unreadable: boolean; +}; + +/** One profile `logout --all` removed, keyed by the base URL it was filed under. */ +export type RemovedProfile = { readonly key: string; readonly held: HeldProfile }; + /** - * Forgets everything, in both places. + * What a profile holds, read for `logout` inside the lock that is about to remove it. + * + * `logout` revokes what it removes, and once the secret is gone there is nothing left to read it + * from. Reading under the removal's own lock, rather than before taking it, means a sign-in that + * landed in between is the credential revoked — not the one it had already replaced. + * + * It reads wherever the index says the secret is, whatever the configured backend — unlike + * `readProfileResult`, which will not *send* a file-held secret under `keychain` or look in the + * OS store under `file`. Revoking is the opposite of using a credential: a token left in the file + * by an earlier build is still live at its provider, and this removal is the last chance to end it. + * + * `readHeld` is false for a CLI with no OAuth sign-in: nothing it stores can be revoked, so it + * skips the read, which under the keychain backend is one more helper spawn per profile. + */ +const heldProfile = (location: CredentialStoreLocation, key: string, readHeld: boolean): HeldProfile => { + if (!readHeld) return { profile: {}, unreadable: false }; + const entry = indexEntry(location, key); + if (entry.backend !== 'keychain') return { profile: withoutMarker(entry), unreadable: false }; + refreshStoreLock(location); + const read = keychainRead(location.storeName, key); + const profile = read.secret === undefined ? {} : withoutMarker(parseSecret(read.secret)); + // The index says the OS store holds a secret here, so an empty answer is not "nothing to revoke": + // the helper would not answer (a helper that fails looks the same as one with no such item) or + // the item went by hand. Either way a token may still be live, and `logout` has to say so. + return { profile, unreadable: Object.keys(profile).length === 0 }; +}; + +/** + * Forgets everything, in both places, returning what was removed so `logout --all` can revoke it. * * The keychain items go one by one, taken from the index, before the index itself does: deleting the * file first would strand the secrets in the OS store with nothing left pointing at them — invisible * to this CLI and never cleaned up. + * + * A secret the OS store would not give up is reported through `failure` rather than thrown, so the + * profiles that *were* removed still reach revocation before the command fails. */ -export const clearAll = (location: CredentialStoreLocation): void => { - const kept = withStoreLock(location, () => { +export const clearAll = ( + location: CredentialStoreLocation, + readHeld: boolean, +): { readonly removed: readonly RemovedProfile[]; readonly failure?: string } => { + const { kept, removed } = withStoreLock(location, () => { // The keychain clears and the index rewrite share one lock with login. It can hold the lock for // several helper calls, but that is preferable to acknowledging a logout that strands a secret. const entries = Object.entries(readStore(location).profiles); const outcomes = entries.map( ([key, profile]) => - [key, profile?.backend === 'keychain' ? removeSecret(location, key) : 'removed'] as const, + [ + key, + heldProfile(location, key, readHeld), + profile?.backend === 'keychain' ? removeSecret(location, key) : 'removed', + ] as const, ); - const kept = outcomes.filter(([, outcome]) => outcome === 'kept').map(([key]) => key); - if (outcomes.some(([, outcome]) => outcome === 'unconfirmed')) { + const kept = outcomes.filter(([, , outcome]) => outcome === 'kept').map(([key]) => key); + if (outcomes.some(([, , outcome]) => outcome === 'unconfirmed')) { warn('Your ' + osStoreName() + ' may still hold credentials this could not remove.'); } const remaining = entries.filter(([key]) => kept.includes(key)); if (remaining.length === 0) deleteStore(location); else writeStore(location, { version: STORE_VERSION, profiles: Object.fromEntries(remaining) }); - return kept; + const removed = outcomes + .filter(([, , outcome]) => outcome !== 'kept') + .map(([key, held]): RemovedProfile => ({ key, held })); + return { kept, removed }; }); - if (kept.length === 0) return; + if (kept.length === 0) return { removed }; // The index entry is the only record of which base URLs have a secret in the OS store, so one // still holding a retrievable secret keeps its entry: dropping it would strand the credential // there — still live, and invisible to this CLI for good. - throw new Error( - 'Could not remove every credential from your ' + + return { + removed, + failure: + 'Could not remove every credential from your ' + osStoreName() + '; ' + String(kept.length) + ' still there.', - ); + }; }; /** Writes one profile into the on-disk store while the caller holds the credential-store lock. */ diff --git a/src/cli/keychain.ts b/src/cli/keychain.ts index 1220803..3b08309 100644 --- a/src/cli/keychain.ts +++ b/src/cli/keychain.ts @@ -1,6 +1,30 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. import { spawnSync } from 'node:child_process'; +import { accessSync, constants as fsConstants, statSync } from 'node:fs'; +import { delimiter, isAbsolute, join } from 'node:path'; + +/** + * The absolute path of the executable `name` on `PATH`, or `undefined` when there is none. + * + * Only absolute `PATH` entries are searched. An empty entry stands for the current directory and a + * relative one is resolved against it, so letting the system search them would let a checked-out + * repository supply a `secret-tool` of its own — which is then handed the profile's secret. The + * spawn gets the absolute path this returns, never the bare name. + */ +export const resolveOnPath = (name: string): string | undefined => { + for (const dir of (process.env['PATH'] ?? '').split(delimiter)) { + if (!dir || !isAbsolute(dir)) continue; + const candidate = join(dir, name); + try { + accessSync(candidate, fsConstants.X_OK); + if (statSync(candidate).isFile()) return candidate; + } catch { + // Not here, or not executable; the next entry may have it. + } + } + return undefined; +}; /** * One platform's credential helper, as the three commands this needs from it. @@ -24,6 +48,29 @@ type KeychainHelper = { * has already taken standard input for the script. */ readonly script?: (mode: 'lookup' | 'store' | 'clear') => string; + /** + * Builds the whole of standard input for a helper that reads its command there, secret included. + * + * `undefined` refuses the operation before anything is spawned. That is how a request that cannot + * be written onto the helper's command line exactly — too long, or carrying a character the line + * cannot hold — fails instead of reaching the helper garbled. + */ + readonly input?: ( + mode: 'lookup' | 'store' | 'clear', + service: string, + account: string, + secret?: string, + ) => string | undefined; + /** Turns what a lookup printed back into the secret, undoing whatever `input` encoded. */ + readonly decode?: (stored: string) => string; + /** + * Whether a non-zero exit status is the helper answering "no such item". + * + * Without this, every non-zero exit is read that way. A helper that can tell a missing item from a + * store it could not open says which status is which, so a locked store is not mistaken for an + * empty one by a caller about to merge into what it read. + */ + readonly notFound?: (status: number) => boolean; }; /** @@ -49,15 +96,16 @@ export const windowsPowerShell = (): string => * goes through the environment instead, which on Windows one process cannot read from another * without debug privileges, unlike a command line. * - * macOS is deliberately absent. `security add-generic-password` takes the password only as the - * argument to `-w`; with no value there it is a usage error, and with a value the secret is in the - * command line. It has no standard-input form and no interactive mode this can drive safely, so a - * Mac gets the `0600` file — the same place the widely used CLIs that do not ship a native helper - * binary keep theirs. + * macOS's `security add-generic-password` takes the password only as the argument to `-w`, so it is + * never run with one. `security -i` reads whole commands from standard input instead, and the store + * goes through that: the secret sits on a line of stdin rather than in any process's argv. See + * {@link securityStoreCommand} for what that line has to survive. */ const HELPERS: Readonly> = { // Linux: the freedesktop Secret Service, which GNOME Keyring and KWallet both implement. - // A bare command name is safe here: only Windows resolves one against the working directory. + // Linux has no fixed place for it, so whatever comes first on `PATH` answers — but `run` + // resolves it to an absolute path through the absolute `PATH` entries alone (see + // {@link resolveOnPath}); Windows and macOS, which do have a fixed place, use it directly. linux: { file: 'secret-tool', lookup: (service, account) => ['lookup', 'service', service, 'account', account], @@ -73,11 +121,91 @@ const HELPERS: Readonly> = { clear: () => ['-NoProfile', '-NonInteractive', '-Command', '-'], script: (mode) => windowsScript(mode), }, + // macOS: the user's default keychain, through the `security` tool every Mac ships. Spawned by + // absolute path, unlike `secret-tool`: a Mac always has it at `/usr/bin/security`, where SIP keeps + // it Apple's, while a bare name resolves through `PATH` — and Homebrew's user-writable + // `/opt/homebrew/bin` or a project's `node_modules/.bin` usually sits ahead of `/usr/bin`, so a + // stray `security` there would be handed the whole profile. It is also the binary the items it + // writes trust, which is what lets every install read them without a prompt. Only the store runs + // interactively; a lookup and a clear carry nothing but the service and account, which are no more + // secret here than on Linux. + darwin: { + file: '/usr/bin/security', + lookup: (service, account) => ['find-generic-password', '-s', service, '-a', account, '-w'], + store: () => ['-i'], + clear: (service, account) => ['delete-generic-password', '-s', service, '-a', account], + input: (mode, service, account, secret) => + mode === 'store' && secret !== undefined ? securityStoreCommand(service, account, secret) : '', + decode: (stored) => + stored.startsWith(SECURITY_SECRET_PREFIX) + ? Buffer.from(stored.slice(SECURITY_SECRET_PREFIX.length), 'base64').toString('utf8') + : stored, + // `security` exits with the low byte of the OSStatus it hit, and errSecItemNotFound (-25300) + // comes out as 44. Anything else — a locked keychain over ssh is errSecInteractionNotAllowed, + // 36 — means the keychain could not be asked, not that it has nothing under this key. + notFound: (status) => status === 44, + }, }; /** Whether this platform has a credential helper the CLI can drive at all. */ export const keychainSupported = (): boolean => HELPERS[process.platform] !== undefined; +/** + * Marks a secret stored base64-encoded, so a lookup knows to decode it. + * + * `security find-generic-password -w` prints a password containing any byte that is not printable + * ASCII as hex instead, with nothing to say it did. A profile with one non-ASCII character in it + * would then come back as a hex string — not JSON, so the stored credential would be unreadable. + * Base64 is printable throughout, so it always comes back exactly as written. + */ +const SECURITY_SECRET_PREFIX = 'base64:'; + +/** + * The longest command line `security -i` reads whole, newline included. + * + * It reads each line into a 4096-byte buffer, and a line that does not fit is not rejected: the + * rest is read as the *next* command. Staying well inside the buffer is the only safe answer, and a + * profile that cannot fit fails the store, which `auto` turns into the file. + */ +const SECURITY_LINE_LIMIT = 4000; + +/** + * Quotes one argument for `security -i`. + * + * Its line parser is not a shell. Inside double quotes a backslash escapes the next character and + * the closing quote ends the argument, and nothing else is special — no variables, no globbing, and + * no joining of adjacent quoted pieces, so the shell trick of `'...'"'"'...'` would split one + * argument into three. Escaping every backslash and double quote is therefore complete. + */ +const securityQuote = (value: string): string => '"' + value.replace(/[\\"]/gu, '\\$&') + '"'; + +/** + * The single `add-generic-password` line that stores one secret through `security -i`. + * + * `-U` updates an existing item in place, so signing in again replaces the credential rather than + * failing on a duplicate. The service and account are quoted rather than encoded, so the item reads + * the same in Keychain Access as the lookup and clear that address it in argv. A control character + * in either is refused: a newline would end the command early and start another, and a NUL ends the + * argument where C reads it. The base URL key never carries one in practice; refusing it keeps a + * hostile `--base-url` from writing a second command. + */ +const securityStoreCommand = (service: string, account: string, secret: string): string | undefined => { + if (/[\u0000-\u001f\u007f]/u.test(service + account)) return undefined; + const encoded = SECURITY_SECRET_PREFIX + Buffer.from(secret, 'utf8').toString('base64'); + const line = + [ + 'add-generic-password', + '-U', + '-s', + securityQuote(service), + '-a', + securityQuote(account), + '-w', + securityQuote(encoded), + ].join(' ') + '\n'; + return Buffer.byteLength(line, 'utf8') <= SECURITY_LINE_LIMIT ? line : undefined; +}; + /** * PowerShell for one Credential Manager operation. * @@ -134,8 +262,10 @@ export const keychainRead = ( const result = run('lookup', service, account); // `secret-tool` terminates its output with a newline the stored value never had; `security` // does the same. Nothing this stores is meant to end in one, so a single trailing newline comes off. - if (result.ok) return { secret: result.stdout.replace(/\n$/u, ''), unavailable: false }; - return { unavailable: result.unavailable }; + if (!result.ok) return { unavailable: result.unavailable }; + const stored = result.stdout.replace(/\n$/u, ''); + const decode = HELPERS[process.platform]?.decode; + return { secret: decode ? decode(stored) : stored, unavailable: false }; }; /** Reads one secret back, or `undefined` when the helper has no such item (or cannot run). */ @@ -162,12 +292,18 @@ const run = ( ): { readonly ok: boolean; readonly stdout: string; readonly unavailable: boolean } => { const helper = HELPERS[process.platform]; if (!helper) return { ok: false, stdout: '', unavailable: true }; + // Missing from every absolute `PATH` entry is the same as missing: the fallback, not a bare-name + // spawn that would search the relative entries this skipped. + const file = isAbsolute(helper.file) ? helper.file : resolveOnPath(helper.file); + if (!file) return { ok: false, stdout: '', unavailable: true }; const script = helper.script?.(mode); // A scripted helper consumes the whole of standard input as its script, so its secret travels in - // the environment beside the service and account; a direct helper takes the secret on stdin. - const input = script ?? secret ?? ''; + // the environment beside the service and account; a direct helper takes the secret on stdin, and + // an interactive one takes it inside the command it reads there. + const input = helper.input ? helper.input(mode, service, account, secret) : (script ?? secret ?? ''); + if (input === undefined) return { ok: false, stdout: '', unavailable: false }; try { - const result = spawnSync(helper.file, [...helper[mode](service, account)], { + const result = spawnSync(file, [...helper[mode](service, account)], { input, encoding: 'utf8', // A helper that blocks — a locked keychain putting up a dialog, a Secret Service with no @@ -182,9 +318,13 @@ const run = ( }); // A spawn that reports an `error` never delivered the question — the helper is missing, or the // timeout above fired. A non-zero status is the helper answering, which for a lookup or a clear - // is how every implementation spells "no such item". + // is how every implementation spells "no such item" — and, for a helper that also has a status + // for "could not open the store", only that one status means it. if (result.error) return { ok: false, stdout: '', unavailable: true }; - if (result.status !== 0) return { ok: false, stdout: '', unavailable: false }; + if (result.status !== 0) { + const unavailable = helper.notFound !== undefined && !helper.notFound(result.status ?? -1); + return { ok: false, stdout: '', unavailable }; + } return { ok: true, stdout: result.stdout ?? '', unavailable: false }; } catch { // ENOENT for a helper this machine does not have is the common case, and it is not an error: diff --git a/src/cli/list.ts b/src/cli/list.ts new file mode 100644 index 0000000..8a9db96 --- /dev/null +++ b/src/cli/list.ts @@ -0,0 +1,39 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +/** + * Cuts a line to the terminal's width. + * + * A row that wrapped would occupy two of them, and the picker's redraw counts rows rather than + * measuring them, so one wrapped label would put every following frame a line out of place. + */ +export const clip = (text: string, width: number): string => + text.length <= width ? text : text.slice(0, Math.max(0, width - 3)) + '...'; + +export type ListRowOptions = { + // Terminal width to cut the row to. + readonly columns: number; + // Marks the row with `> ` and colours it; the picker moves this with the arrow keys, and a + // static list uses it for the entry a bare invocation would pick. + readonly selected?: boolean; + // Whether the destination is a terminal. Escapes are written only then, so a redirected list + // is the same text without them. + readonly color?: boolean; +}; + +/** + * Renders one row: a two-column marker, the label, then the detail dimmed behind it. + * + * The detail carries what tells otherwise-identical labels apart — a flow name for the picker, a + * base URL for the environments list — so it is on every row rather than only the marked one, and + * dimmed so the labels still read as the list. A row too narrow to hold it is emitted as plain + * clipped text instead: the dimming would otherwise wrap a fragment whose closing bracket the clip + * has already removed. + */ +export const listRow = (label: string, detail: string, options: ListRowOptions): string => { + const head = (options.selected ? '> ' : ' ') + label; + const tail = detail ? ' ' + detail : ''; + const plain = clip(head + tail, options.columns); + if (!options.color) return plain; + const row = plain === head + tail ? head + '\u001b[2m' + tail + '\u001b[22m' : plain; + return options.selected ? '\u001b[36m' + row + '\u001b[39m' : row; +}; diff --git a/src/cli/login.ts b/src/cli/login.ts index 0bf9030..42d2ec7 100644 --- a/src/cli/login.ts +++ b/src/cli/login.ts @@ -8,6 +8,7 @@ import { stderr as processStderr, stdin as processStdin } from 'node:process'; import { type CredentialStoreLocation, + type HeldProfile, type StoredOAuth, type StoredProfile, clearAll, @@ -16,9 +17,17 @@ import { readProfile, refreshProfile, storeDescription, + warn, writeProfile, } from './credentials'; -import { windowsPowerShell } from './keychain'; +import { resolveOnPath, windowsPowerShell } from './keychain'; +import { clip, listRow } from './list'; + +/** Which API an OAuth token is for. Mirrors the emitter's `CliOauthTargetDefinition`. */ +export type CliOauthTargetDefinition = { + readonly resource?: readonly string[]; + readonly audience?: string; +}; /** One way `login` can obtain a credential. Mirrors the emitter's `CliAuthMethodDefinition`. */ export type CliAuthMethodDefinition = { @@ -27,7 +36,7 @@ export type CliAuthMethodDefinition = { } & ( | { readonly kind: 'token'; readonly clientKey: string; readonly prompt: string } | { readonly kind: 'basic'; readonly usernameKey: string; readonly passwordKey: string } - | { + | (CliOauthTargetDefinition & { readonly kind: 'oauth'; readonly grant: 'authorizationCode'; readonly clientKey: string; @@ -37,8 +46,13 @@ export type CliAuthMethodDefinition = { readonly scopes: readonly string[]; readonly clientId: string; readonly redirectPort: number; - } - | { + readonly revocationUrl?: string; + /** RFC 8414 metadata read after sign-in for its `revocation_endpoint`; see {@link metadataRevocation}. */ + readonly revocationMetadataUrl?: string; + /** Issuer the redirect's `iss` must name (RFC 9207); absent means an `iss` is not checked. */ + readonly issuer?: string; + }) + | (CliOauthTargetDefinition & { readonly kind: 'oauth'; readonly grant: 'clientCredentials' | 'password'; readonly clientKey: string; @@ -46,18 +60,34 @@ export type CliAuthMethodDefinition = { readonly refreshUrl: string; readonly scopes: readonly string[]; readonly clientId?: string; - } - | { + readonly revocationUrl?: string; + readonly revocationMetadataUrl?: string; + /** Configured issuer the revocation metadata's `issuer` must match. */ + readonly issuer?: string; + }) + | (CliOauthTargetDefinition & { readonly kind: 'oauth'; readonly grant: 'deviceAuthorization'; readonly clientKey: string; - readonly deviceAuthorizationUrl: string; - readonly tokenUrl: string; - readonly refreshUrl: string; readonly scopes: readonly string[]; readonly clientId?: string; - } - | { + readonly revocationUrl?: string; + } & ( + | { + readonly deviceAuthorizationUrl: string; + readonly tokenUrl: string; + readonly refreshUrl: string; + readonly revocationMetadataUrl?: string; + readonly issuer?: string; + } + | { + /** RFC 8414 metadata the endpoints are read from at sign-in, for a flow that names none. */ + readonly metadataUrl: string; + /** Configured issuer the metadata's `issuer` must match; absent trusts the one its URL names. */ + readonly issuer?: string; + } + )) + | (CliOauthTargetDefinition & { readonly kind: 'oauth'; readonly grant: 'openIdConnect'; readonly clientKey: string; @@ -65,7 +95,10 @@ export type CliAuthMethodDefinition = { readonly scopes: readonly string[]; readonly clientId: string; readonly redirectPort: number; - } + readonly revocationUrl?: string; + /** Configured issuer the discovered one must match; absent trusts the one discovery verifies. */ + readonly issuer?: string; + }) ); /** Everything `login` and `logout` need. Mirrors the emitter's `CliAuthDefinition`. */ @@ -78,14 +111,24 @@ export type CliAuthDefinition = { readonly baseUrlEnv: string; readonly backend: 'auto' | 'keychain' | 'file'; readonly defaultBaseUrl: string; + /** Named environments and the URL each sends requests to; absent when there is no `--environment`. */ + readonly environments?: readonly { readonly name: string; readonly url: string }[]; readonly requirements: readonly (readonly string[])[]; readonly envByKey: Readonly>; readonly methods: readonly CliAuthMethodDefinition[]; + /** Publisher logo for the browser sign-in page; absent means the page shows none. */ + readonly logo?: string; }; /** How long the browser flow waits for the redirect before giving the terminal back. */ const BROWSER_FLOW_TIMEOUT_MS = 300000; +/** + * How long the browser flow waits for its answered pages to finish sending before closing the + * listener. Loopback delivers a page in milliseconds; this only bounds a browser that stops reading. + */ +const RESPONSE_FLUSH_TIMEOUT_MS = 2000; + /** The one path the loopback listener answers as a redirect; it is what `redirect_uri` registers. */ const REDIRECT_PATH = '/callback'; @@ -110,6 +153,17 @@ const DEVICE_FLOW_TIMEOUT_MS = 300000; const TOKEN_REQUEST_TIMEOUT_MS = 30000; const TOKEN_RESPONSE_LIMIT = 65536; +/** + * Deadline for each token revocation `logout` sends, and for the metadata read `login` makes only to + * learn where those go. + * + * Short because the sign-out has already happened by then — the local copy is gone — so the user is + * waiting only on a courtesy to the provider, and an endpoint that never answers must not hold the + * terminal for the full token-request deadline, once per token. The sign-in read is optional in the + * same way: its grant has succeeded, and the token is not saved until the read returns. + */ +const REVOCATION_TIMEOUT_MS = 5000; + /** Refresh this far ahead of expiry so a token cannot lapse between the check and the request. */ const REFRESH_LEEWAY_MS = 60000; @@ -126,6 +180,16 @@ const REFRESH_LEEWAY_MS = 60000; */ const SILENT_REFRESH_TIMEOUT_MS = 5000; +/** + * How far past its `exp` an ID token is still accepted, to absorb clock drift between this machine + * and the provider. + * + * OpenID Connect Core leaves the allowance to the client. Five minutes is the customary figure: a + * token the provider minted seconds ago is not refused because a laptop's clock runs slow, and a + * token that genuinely expired is still refused long before it could be useful to a replay. + */ +const ID_TOKEN_CLOCK_SKEW_MS = 300000; + /** Lifetime assumed for a token whose endpoint did not state one. See {@link oauthMetadata}. */ const ASSUMED_TOKEN_LIFETIME_S = 3600; @@ -139,6 +203,9 @@ const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '::1', '[::1]']); */ const DEVICE_POLL_FLOOR_MS = 200; +/** The grant type RFC 8628 registers, sent on each poll and looked for in server metadata. */ +const DEVICE_CODE_GRANT = 'urn:ietf:params:oauth:grant-type:device_code'; + const storeLocation = (auth: CliAuthDefinition): CredentialStoreLocation => ({ storeName: auth.storeName, storeEnv: auth.storeEnv, @@ -162,11 +229,17 @@ const methodKeys = (method: CliAuthMethodDefinition): readonly string[] => * * The alternative closest to complete is the one named: it is the cheapest way out for the user, * and listing every unmet alternative would describe choices the API treats as interchangeable. + * + * `loginCommand` names the environment this `login` selected, when it selected one. The credential + * just saved is filed under that environment's URL, so a hint naming the bare command would file + * the next one under the default environment instead, and the pair would never meet. A sign-in made + * with `--base-url` selects no environment and gets the bare command, as the request hints do. */ const outstandingRequirement = ( auth: CliAuthDefinition, location: CredentialStoreLocation, key: string, + loginCommand: string, ): string | undefined => { if (auth.requirements.length === 0) return undefined; // The store *and* the environment, because that is what the request path counts. `applyStoredCredentials` @@ -195,7 +268,7 @@ const outstandingRequirement = ( runnable.push(method); } if (runnable.length === 0) return 'Requests here also need another credential this CLI cannot obtain.'; - const commands = runnable.map((method) => auth.loginCommand + ' --flow ' + method.name); + const commands = runnable.map((method) => loginCommand + ' --flow ' + method.name); return ( 'Requests here also need ' + (runnable.length === 1 ? 'one more credential' : String(runnable.length) + ' more credentials') + @@ -210,16 +283,20 @@ const outstandingRequirement = ( * * Every prompt is written to standard error, so the confirmation this returns is the only thing on * standard output and `login` stays usable in a pipeline. + * + * `loginCommand` is the sign-in command for the environment this one selected (the bare command + * when none was); it names the next step when the API needs a further credential. */ export const runLogin = async ( auth: CliAuthDefinition, baseUrl: string, flow: string | undefined, + loginCommand: string, ): Promise => { const method = await chooseMethod(auth, flow); const location = storeLocation(auth); const key = profileKey(baseUrl); - const captured = await captureCredentials(method, baseUrl); + const captured = await captureCredentials(method, baseUrl, auth.logo); // Where it landed is reported by the write itself rather than predicted, so under `auto` the // line a user reads names the store the credential actually went into. The write merges this // captured result inside its lock, because a browser grant can sit for minutes before it arrives. @@ -232,23 +309,292 @@ export const runLogin = async ( '. Credentials saved to ' + storeDescription(location, backend) + '.'; - const outstanding = outstandingRequirement(auth, location, key); + const outstanding = outstandingRequirement(auth, location, key, loginCommand); return outstanding ? line + '\n' + outstanding : line; }; -/** Forgets stored credentials, returning the line to print. */ -export const runLogout = (auth: CliAuthDefinition, baseUrl: string, all: boolean): string => { +/** + * Forgets stored credentials and revokes their OAuth tokens, returning the line to print. + * + * The local copy goes first, under the store lock, and only then is the provider asked to revoke. + * That order is what makes an interrupted or offline `logout` safe: whatever happens on the + * network, nothing is left on disk, and the refresh path's conditional write will not bring a + * deleted profile back. Revocation is best effort — a failure is a warning, never a failed logout, + * because the user asked to be signed out here and that part has already succeeded. + */ +export const runLogout = async (auth: CliAuthDefinition, baseUrl: string, all: boolean): Promise => { const location = storeLocation(auth); + // Only an OAuth sign-in stores anything revocable, so a CLI without one skips reading what a + // profile held and signs out exactly as it did before revocation existed. + const revocable = auth.methods.some((method) => method.kind === 'oauth'); if (all) { - clearAll(location); + const { removed, failure } = clearAll(location, revocable); + // Every profile's revocation runs at once, so a host that never answers costs its own timeout + // rather than one per host. Warnings are raised afterwards, in store order, so the output does + // not depend on which server answered first. + const outcomes = await Promise.all( + removed.map(({ key, held }) => { + const base = profileBase(auth, key); + return revokeHeld(auth, base, base, held); + }), + ); + for (const message of outcomes.flat()) warn(message); + if (failure) throw new Error(failure); return 'Signed out everywhere.'; } const key = profileKey(baseUrl); - const outcome = deleteProfile(location, key); - if (outcome === 'removed') return 'Signed out of ' + safeText(baseUrl || 'the API') + '.'; - return 'No stored credentials for ' + safeText(baseUrl || 'the API') + '.'; + const { outcome, held } = deleteProfile(location, key, revocable); + // Named without any `user:password@` it carries, in the warnings and the result line alike, so + // the two still name the host the same way. + const shown = withoutCredentials(baseUrl); + for (const message of await revokeHeld(auth, baseUrl, shown, held)) warn(message); + if (outcome === 'removed') return 'Signed out of ' + safeText(shown || 'the API') + '.'; + return 'No stored credentials for ' + safeText(shown || 'the API') + '.'; +}; + +/** + * The base URL a profile key stands for, for `logout --all`, which knows a profile only by its key. + * + * A profile with no stored revocation endpoint falls back to the configured one, resolved against + * the base URL as sign-in resolves its endpoints. The key drops a trailing slash, which moves where + * a path-relative endpoint lands (`oauth/revoke` beside `https://api.example.com/v1/` is under + * `/v1/`, beside the key it is not), so a base URL this run knows that files under this key is + * used when there is one: the base-URL environment variable if it is still set, the configured + * default, or an environment URL. The variable comes first because sign-in prefers it to the + * default, which matters when the two differ only in a trailing slash and so share a key. Only a + * sign-in under a `--base-url` or a variable since unset falls back to the key. + * + * Credentials in the base URL are dropped, as `profileKey` drops them: the result is printed in + * warnings, and an endpoint resolved against it would carry them into a request `fetch` refuses. + */ +const profileBase = (auth: CliAuthDefinition, key: string): string => { + if (key === 'default') return ''; + const known = [ + (auth.baseUrlEnv ? process.env[auth.baseUrlEnv] : undefined)?.trim(), + auth.defaultBaseUrl, + ...(auth.environments ?? []).map((environment) => environment.url), + ]; + const base = known.find((url) => url && profileKey(url) === key); + return base ? withoutCredentials(base) : key; +}; + +/** A URL with any `user:password@` removed, or the value unchanged when it does not parse. */ +const withoutCredentials = (raw: string): string => { + try { + const url = new URL(raw); + // Rewritten only when there is something to drop: serializing adds a trailing slash to a bare + // origin, which would change how every warning names the host. + if (!url.username && !url.password) return raw; + url.username = ''; + url.password = ''; + return url.toString(); + } catch { + return raw; + } +}; + +/** + * The revocation endpoint to keep for a token, or `undefined` for a local-only sign-out. + * + * Each candidate is resolved against `base` exactly as the token endpoint is, and the first one on + * the same origin as the endpoint that issued the token wins. `revocationUrl` is one value for + * every OAuth scheme in the CLI, so without that check a token from one provider would be posted + * to another's revocation endpoint. The discovered endpoint is held to the same rule: every + * provider that advertises one serves it beside its token endpoint, and a sign-out that stays + * local is a smaller loss than a token sent somewhere that did not issue it. + */ +const revocationEndpoint = ( + candidates: readonly (string | undefined)[], + tokenUrl: string | undefined, + base: string, +): string | undefined => { + const issuer = tokenUrl ? urlOrigin(tokenUrl, base) : undefined; + if (!issuer) return undefined; + for (const candidate of candidates) { + const resolved = storedEndpoint(candidate, base); + if (resolved && urlOrigin(resolved, '') === issuer) return resolved; + } + return undefined; +}; + +/** A URL's origin, or `undefined` when it cannot be parsed or has none (an opaque `null` origin). */ +const urlOrigin = (raw: string, base: string): string | undefined => { + try { + const origin = new URL(raw, base || undefined).origin; + return origin === 'null' ? undefined : origin; + } catch { + return undefined; + } +}; + +/** + * Revokes what one removed profile held, returning the warnings to raise. + * + * Each warning names the base URL, because under `logout --all` that is the only way to tell which + * sign-in may still be live at its provider. `label` is the one the success line prints for a + * single `logout`, so the two lines name the host the same way. `base` is what a fallback + * endpoint resolves against: the base URL a single `logout` was given, or {@link profileBase}. + */ +const revokeHeld = async ( + auth: CliAuthDefinition, + base: string, + label: string, + held: HeldProfile, +): Promise => { + const where = 'Signed out of ' + safeText(label || 'the API') + ' locally, but '; + if (held.unreadable) { + // Said only where this build could have revoked something: a configured endpoint, or a + // provider whose published metadata (OpenID Connect discovery or RFC 8414) may name one. + // Anywhere else revocation never happens, and the keyring warning the removal already raised + // covers what is left to say. + const couldRevoke = auth.methods.some( + (method) => + method.kind === 'oauth' && + (method.revocationUrl !== undefined || + method.grant === 'openIdConnect' || + 'metadataUrl' in method || + ('revocationMetadataUrl' in method && method.revocationMetadataUrl !== undefined)), + ); + if (!couldRevoke) return []; + return [ + where + + 'the saved credentials could not be read back, so no OAuth token in them was revoked at the provider.', + ]; + } + return revokeProfile(auth, base, held.profile, where); +}; + +/** + * Revokes every OAuth token one removed profile held (RFC 7009), returning the warnings to raise. + * + * API keys and Basic credentials have nothing to revoke, so only entries with OAuth metadata are + * considered. The endpoint is the one stored at sign-in; a profile that stored none falls back to + * the one this build is configured with (see {@link fallbackRevocation}). With neither, the + * sign-out stays local, as it always was. `where` opens every warning. + */ +const revokeProfile = async ( + auth: CliAuthDefinition, + base: string, + profile: StoredProfile, + where: string, +): Promise => { + const messages: string[] = []; + for (const [clientKey, meta] of Object.entries(profile.oauth ?? {})) { + // Same guard as `storedCredentials`: the store is parsed without checking the shape beneath. + if (!meta || typeof meta !== 'object') continue; + const endpoint = meta.revocationUrl ?? fallbackRevocation(auth, clientKey, meta, base); + if (!endpoint) continue; + const accessToken = profile.credentials?.[clientKey]; + // Refresh token first: on most servers revoking it ends the whole grant, access tokens included, + // so it is the one that matters if only one call gets through. + const tokens = [ + ...(meta.refreshToken ? [{ token: meta.refreshToken, hint: 'refresh_token' as const }] : []), + ...(accessToken ? [{ token: accessToken, hint: 'access_token' as const }] : []), + ]; + if (tokens.length === 0) continue; + let url: URL; + try { + // Checked here rather than at sign-in: this is the request that carries a token, and failing + // a login over an endpoint only `logout` uses would cost the user the sign-in itself. + url = requireSecureUrl(endpoint, base, 'revocation endpoint'); + } catch (error) { + messages.push(where + 'the token was not revoked. ' + errorMessage(error)); + continue; + } + try { + let refreshRevoked = false; + for (const { token, hint } of tokens) { + await revokeToken(url, token, hint, meta.clientId, refreshRevoked); + if (hint === 'refresh_token') refreshRevoked = true; + } + } catch (error) { + // One failure ends this profile's revocation rather than trying the next token: an endpoint + // that has just timed out or refused is unlikely to do otherwise a second later, and each try + // costs the user up to `REVOCATION_TIMEOUT_MS`. + messages.push(where + safeText(url.host) + ' could not revoke the token. ' + errorMessage(error)); + } + } + return messages; }; +/** + * The configured revocation endpoint for a profile that stored none, or `undefined` to stay local. + * + * Reached by every profile that stored none: one saved before revocation existed, one whose + * sign-in had nothing configured — so a `revocationUrl` a later build adds still reaches it — and + * one whose sign-in rejected the configured endpoint. That last needs no mark of its own: the + * checks below are sign-in's rule, so the endpoint it rejected is rejected here too, and only a + * build whose configuration was since corrected revokes it. + * + * The endpoint, resolved against `base`, has to pass two origin checks. One is against the + * profile's saved refresh endpoint, the only endpoint an older profile recorded. The other is + * sign-in's own rule against the token endpoint, so a build never revokes an old sign-in somewhere + * it would refuse for a new one — a provider can serve refresh from another host than the one + * that issues tokens. A profile does not record which grant produced it, and every grant of one + * scheme shares its key, so the token endpoint of each of those grants has to pass. An OpenID + * Connect grant, or a device grant reading RFC 8414 metadata, learns its token endpoint at sign-in + * and saved that same URL as the refresh endpoint, so the first check covers it. + */ +const fallbackRevocation = ( + auth: CliAuthDefinition, + clientKey: string, + meta: StoredOAuth, + base: string, +): string | undefined => { + const grants = auth.methods.filter( + (method): method is Extract => + method.kind === 'oauth' && method.clientKey === clientKey, + ); + // One configured value covers every OAuth method, so any grant that carries it names it. + const configured = grants.find((method) => method.revocationUrl)?.revocationUrl; + const endpoint = revocationEndpoint([configured], meta.refreshUrl ?? meta.tokenUrl, base); + if (!endpoint) return undefined; + // OpenID Connect and device sign-in from metadata learn their token endpoint at sign-in and saved + // it as the refresh endpoint, which the check above already covers. + const issuedHere = grants.every( + (method) => + !('tokenUrl' in method) || revocationEndpoint([configured], method.tokenUrl, base) !== undefined, + ); + return issuedHere ? endpoint : undefined; +}; + +/** + * Sends one RFC 7009 revocation request, throwing a printable reason when it did not succeed. + * + * Only the client id goes with the token: the CLI keeps no client secret, so a provider that + * requires confidential-client authentication here — typical for tokens from the client-credentials + * grant — refuses, and that surfaces as the warning rather than as anything the CLI could fix. + */ +const revokeToken = async ( + url: URL, + token: string, + hint: 'refresh_token' | 'access_token', + clientId: string | undefined, + refreshRevoked: boolean, +): Promise => { + const { response, text } = await postForToken( + url, + { token, token_type_hint: hint, ...(clientId ? { client_id: clientId } : {}) }, + REVOCATION_TIMEOUT_MS, + 'revocation endpoint', + ); + // Section 2.2: a 200 is the answer for an invalid or already-revoked token too, so success says + // nothing about the token's prior state and needs nothing checked beyond the status. + if (response.ok) return; + const payload = parseJson(text); + // Section 2.2.1 lets a server that only revokes refresh tokens answer this for an access token. + // When this call already revoked the refresh token, that ended the grant and there is nothing to + // report. With no refresh token (a client-credentials grant never gets one) the access token is + // the whole grant and is still live, so the refusal is a failure like any other. + if (hint === 'access_token' && refreshRevoked && payload?.['error'] === 'unsupported_token_type') return; + throw new Error( + 'The revocation endpoint rejected the request' + tokenErrorDetail(payload, response.status), + ); +}; + +/** The message of a caught value, which every throw in this module makes an `Error` with safe text. */ +const errorMessage = (error: unknown): string => (error instanceof Error ? error.message : String(error)); + /** * Stored credentials for one base URL, keyed by client-option name. * @@ -281,6 +627,12 @@ export const storedCredentials = async ( // credentials refreshable after an upgrade while new entries preserve a distinct refresh URL. const refreshUrl = meta.refreshUrl ?? meta.tokenUrl; if (!needsRefresh(meta) || !meta.refreshToken || !refreshUrl) continue; + // The target API is read from this CLI's own definition for the key, not from the stored entry, + // which never held it: it is configuration rather than something a sign-in produced, so the + // refresh follows the CLI the user is running now. A key belongs to exactly one security scheme + // (the emitter gives each scheme its own option name), and every OAuth method of that scheme + // carries the scheme's one value, so the first is as good as any. + const target = auth.methods.find((method) => method.kind === 'oauth' && method.clientKey === clientKey); try { const token = await exchangeToken( refreshUrl, @@ -289,6 +641,7 @@ export const storedCredentials = async ( grant_type: 'refresh_token', refresh_token: meta.refreshToken, ...(meta.clientId ? { client_id: meta.clientId } : {}), + ...(target?.kind === 'oauth' ? targetParams(target) : {}), }, SILENT_REFRESH_TIMEOUT_MS, ); @@ -297,7 +650,9 @@ export const storedCredentials = async ( // must not be undone by the token it produced. See `refreshProfile`. refreshProfile(location, key, { credentials: { [clientKey]: token.accessToken }, - oauth: { [clientKey]: oauthMetadata(token, refreshUrl, meta.clientId, meta.refreshToken) }, + oauth: { + [clientKey]: oauthMetadata(token, refreshUrl, meta.clientId, meta.refreshToken, meta.revocationUrl), + }, }); } catch { // Deliberately silent; see this function's doc comment. @@ -342,6 +697,7 @@ const chooseMethod = async ( const captureCredentials = async ( method: CliAuthMethodDefinition, baseUrl: string, + logo: string | undefined, ): Promise => { if (method.kind === 'token') { const value = await promptSecret(method.prompt); @@ -355,10 +711,10 @@ const captureCredentials = async ( if (!password) throw new UsageError('No password entered; nothing was saved.'); return { credentials: { [method.usernameKey]: username, [method.passwordKey]: password } }; } - const { token, clientId, refreshUrl } = await runOauthFlow(method, baseUrl); + const { token, clientId, refreshUrl, revocationUrl } = await runOauthFlow(method, baseUrl, logo); return { credentials: { [method.clientKey]: token.accessToken }, - oauth: { [method.clientKey]: oauthMetadata(token, refreshUrl, clientId, undefined) }, + oauth: { [method.clientKey]: oauthMetadata(token, refreshUrl, clientId, undefined, revocationUrl) }, }; }; @@ -367,6 +723,7 @@ const oauthMetadata = ( refreshUrl: string, clientId: string | undefined, previousRefreshToken: string | undefined, + revocationUrl: string | undefined, ): StoredOAuth => { // A refresh response may legitimately omit `refresh_token`, which means "keep using the one you // have" rather than "you no longer have one"; dropping it would turn every refresh into the last. @@ -382,6 +739,8 @@ const oauthMetadata = ( ...(lifetime === undefined ? {} : { expiresAt: Date.now() + lifetime * 1000 }), refreshUrl, ...(clientId ? { clientId } : {}), + // Carried through every refresh too, so a token renewed in place is still revoked where it was issued. + ...(revocationUrl ? { revocationUrl } : {}), }; }; @@ -391,17 +750,96 @@ type TokenResponse = { readonly refreshToken?: string; /** Lifetime in seconds, as the token endpoint reported it. */ readonly expiresIn?: number; + /** OpenID Connect ID token, when the endpoint returned one; checked by the OIDC flow, never stored. */ + readonly idToken?: string; }; +/** + * Runs one OAuth grant and picks the revocation endpoint to store beside its token. + * + * OpenID Connect picks its own, since only discovery names its token endpoint; every other grant is + * decided here, after the grant succeeded. The configured endpoint comes first, then whatever the + * scheme's RFC 8414 metadata advertises — read during a device sign-in that took its endpoints from + * there, otherwise read now by {@link metadataRevocation} — and both are held to the origin of the + * token endpoint that issued the token. + */ const runOauthFlow = async ( method: Extract, baseUrl: string, + logo: string | undefined, +): Promise => { + if (method.grant === 'openIdConnect') return openIdConnectFlow(method, baseUrl, logo); + const result = await runTokenGrant(method, baseUrl, logo); + // A device sign-in from metadata names no token endpoint up front; the one it discovered is the + // refresh endpoint it returned. + const tokenUrl = 'tokenUrl' in method ? method.tokenUrl : result.refreshUrl; + const discovered = result.revocationUrl + ? { revocationUrl: result.revocationUrl } + : await metadataRevocation(method, tokenUrl, baseUrl); + return { + ...result, + revocationUrl: signInRevocation(method.revocationUrl, discovered, tokenUrl, baseUrl), + }; +}; + +/** + * The revocation endpoint a scheme's RFC 8414 metadata advertises, read once a grant has succeeded. + * + * Read only when the configured endpoint does not already qualify, so a sign-in the config covers + * costs no round trip. It passes the same issuer checks as a device sign-in from that metadata. + * Unlike that sign-in, nothing but revocation depends on it, so a failed read never fails the + * sign-in: it warns, since `logout` will then only forget the token locally, and the user should + * hear so at the one point they are watching — {@link signInRevocation} says so, with the reason + * returned here, in the one warning it raises. For the same reason it gets the revocation request's + * short deadline rather than a token request's: the grant has already succeeded, its token is not + * saved until this returns, and a provider that never answers must not hold that up. + */ +const metadataRevocation = async ( + method: Exclude, { grant: 'openIdConnect' }>, + tokenUrl: string, + baseUrl: string, +): Promise<{ readonly revocationUrl?: string | undefined; readonly failure?: string }> => { + if (!('revocationMetadataUrl' in method) || !method.revocationMetadataUrl) return {}; + if (revocationEndpoint([method.revocationUrl], tokenUrl, baseUrl) !== undefined) return {}; + try { + const { payload, issuerUrl } = await readAuthorizationServerMetadata( + { metadataUrl: method.revocationMetadataUrl, issuer: method.issuer }, + baseUrl, + REVOCATION_TIMEOUT_MS, + ); + return { revocationUrl: advertisedRevocation(payload, issuerUrl) }; + } catch (error) { + return { failure: errorMessage(error) }; + } +}; + +/** + * A metadata document's `revocation_endpoint` (RFC 8414 section 2), resolved against its verified + * issuer, or `undefined` when it names none. + * + * Optional, and only `logout` uses it, so a missing or odd one is left out rather than failing the + * sign-in, and its HTTPS check waits for the revocation itself. + */ +const advertisedRevocation = ( + payload: Readonly>, + issuerUrl: URL, +): string | undefined => { + const advertised = payload['revocation_endpoint']; + return typeof advertised === 'string' && advertised + ? storedEndpoint(advertised, issuerUrl.toString()) + : undefined; +}; + +/** Runs a grant whose token endpoint the document names, returning the token and how to refresh it. */ +const runTokenGrant = async ( + method: Exclude, { grant: 'openIdConnect' }>, + baseUrl: string, + logo: string | undefined, ): Promise => { if (method.grant === 'authorizationCode') { - const result = await authorizationCodeFlow(method, baseUrl); + const result = await authorizationCodeFlow(method, baseUrl, logo); return { ...result, refreshUrl: method.refreshUrl }; } - if (method.grant === 'openIdConnect') return openIdConnectFlow(method, baseUrl); if (method.grant === 'deviceAuthorization') return deviceAuthorizationFlow(method, baseUrl); if (method.grant === 'clientCredentials') { const clientId = method.clientId ?? (await promptLine('Client id: ')); @@ -413,6 +851,7 @@ const runOauthFlow = async ( client_id: clientId, client_secret: clientSecret, ...scopeParam(method.scopes), + ...targetParams(method), }); return { token, clientId, refreshUrl: method.refreshUrl }; } @@ -432,17 +871,87 @@ const runOauthFlow = async ( password, ...(clientId ? { client_id: clientId } : {}), ...scopeParam(method.scopes), + ...targetParams(method), }); // Persisted so the refresh exchange can send the same client id the grant was made with; a blank // answer stores nothing, which is what an absent one already did. return { token, clientId: clientId || undefined, refreshUrl: method.refreshUrl }; }; -/** OAuth result plus the endpoint needed later to refresh a persisted token. */ +/** OAuth result plus the endpoints needed later to refresh and to revoke a persisted token. */ type OAuthFlowResult = { readonly token: TokenResponse; readonly clientId: string | undefined; readonly refreshUrl: string; + /** + * Absolute revocation endpoint: the one decided for the token by {@link runOauthFlow}, or, from a + * device sign-in that read RFC 8414 metadata, the one that metadata advertised for it to decide on. + */ + readonly revocationUrl?: string | undefined; +}; + +/** + * Resolves an endpoint against the base URL it applies to, for storing beside the token. + * + * Deliberately not `requireSecureUrl`: nothing is sent to a revocation endpoint at sign-in, so a + * bad one must not cost the user the sign-in. `logout` checks it before a token goes out. An + * unparseable value yields `undefined`, so it is never stored; a configured one is reported at + * sign-in by {@link signInRevocation}, and a discovered one is optional and simply left out. + */ +const storedEndpoint = (raw: string | undefined, base: string): string | undefined => { + if (!raw) return undefined; + try { + const url = new URL(raw, base || undefined); + // A relative endpoint inherits credentials from a `https://user:pass@host/` base. Kept, they + // would sit in the store beside the token and make `fetch` refuse every revocation request. + url.username = ''; + url.password = ''; + return url.toString(); + } catch { + return undefined; + } +}; + +/** + * The revocation endpoint to store with a token that sign-in has just obtained. + * + * Runs only once the grant succeeded, because it can warn, and a failed `login` drains warnings + * too. It warns when the configured endpoint cannot be used — unparseable, or off the token + * endpoint's origin — and nothing else qualified either, since `logout` will then only forget + * this sign-in locally, and the user should hear so while the configuration can still be fixed. + * + * It also warns when the provider's metadata could not be read for one, with nothing configured + * or alongside the configured endpoint's own reason, so both causes reach the user in one warning: + * each alone would point at only half of why `logout` will not revoke. + * + * Nothing stored means `logout` falls back to the configured endpoint under this same rule (see + * {@link fallbackRevocation}), so a rejected endpoint stays rejected there. + */ +const signInRevocation = ( + configured: string | undefined, + discovered: { readonly revocationUrl?: string | undefined; readonly failure?: string }, + tokenUrl: string, + baseUrl: string, +): string | undefined => { + const chosen = revocationEndpoint([configured, discovered.revocationUrl], tokenUrl, baseUrl); + if (chosen !== undefined) return chosen; + const metadataReason = discovered.failure ? ' ' + discovered.failure : ''; + if (!configured) { + if (discovered.failure) warn('Logout will not revoke this sign-in at the provider.' + metadataReason); + return undefined; + } + const revocationOrigin = urlOrigin(configured, baseUrl); + const issuerOrigin = urlOrigin(tokenUrl, baseUrl); + warn( + (revocationOrigin === undefined || issuerOrigin === undefined + ? 'The configured revocation endpoint is not a usable URL, so logout will not revoke this sign-in at the provider.' + : 'The configured revocation endpoint ' + + safeText(revocationOrigin) + + " is not on the token endpoint's origin " + + safeText(issuerOrigin) + + ', so logout will not revoke this sign-in at the provider.') + metadataReason, + ); + return undefined; }; /** @@ -457,14 +966,16 @@ const deviceAuthorizationFlow = async ( method: Extract, baseUrl: string, ): Promise => { + // Discovered before the client id is asked for, so a provider that cannot run this grant fails + // the sign-in before the user has been asked to type anything. + const endpoints = 'metadataUrl' in method ? await discoverDeviceEndpoints(method, baseUrl) : method; const clientId = method.clientId ?? (await promptLine('Client id: ')); if (!clientId) throw new UsageError('No client id entered; nothing was saved.'); - const device = await requestDeviceAuthorization( - method.deviceAuthorizationUrl, - baseUrl, - clientId, - method.scopes, - ); + const device = await requestDeviceAuthorization(endpoints.deviceAuthorizationUrl, baseUrl, { + client_id: clientId, + ...scopeParam(method.scopes), + ...targetParams(method), + }); processStderr.write( 'To sign in, visit:\n\n ' + device.verificationUrl + @@ -472,18 +983,127 @@ const deviceAuthorizationFlow = async ( '\n\nWaiting for authorization...\n', ); return { - token: await pollDeviceToken(method.tokenUrl, baseUrl, clientId, device), + token: await pollDeviceToken( + endpoints.tokenUrl, + baseUrl, + { client_id: clientId, ...targetParams(method) }, + device, + ), clientId, - refreshUrl: method.refreshUrl, + refreshUrl: endpoints.refreshUrl, + // From the metadata the endpoints came from, so revocation costs no second read of it. + ...('revocationUrl' in endpoints && endpoints.revocationUrl + ? { revocationUrl: endpoints.revocationUrl } + : {}), + }; +}; + +/** + * Reads the device grant's endpoints from the authorization server's RFC 8414 metadata. + * + * Both come back absolute, resolved against the verified issuer, so the polls and every later + * refresh go to the provider that published them rather than to the API host. + */ +const discoverDeviceEndpoints = async ( + method: { readonly metadataUrl: string; readonly issuer?: string }, + baseUrl: string, +): Promise<{ + readonly deviceAuthorizationUrl: string; + readonly tokenUrl: string; + readonly refreshUrl: string; + readonly revocationUrl?: string; +}> => { + const label = AUTHORIZATION_SERVER_METADATA; + const { payload, issuerUrl } = await readAuthorizationServerMetadata(method, baseUrl); + // RFC 8414 defaults an omitted `grant_types_supported` to the code and implicit grants, but + // providers that do run this grant routinely leave the list out, so only a list that is present + // and leaves the grant out is taken as a refusal. The endpoint below is the signal that counts. + const grants = payload['grant_types_supported']; + if (Array.isArray(grants) && !grants.includes(DEVICE_CODE_GRANT)) { + throw new Error('The ' + label + ' does not list the device authorization grant as supported.'); + } + const deviceAuthorizationUrl = payload['device_authorization_endpoint']; + const tokenUrl = payload['token_endpoint']; + if (typeof deviceAuthorizationUrl !== 'string' || !deviceAuthorizationUrl) { + throw new Error('The ' + label + ' names no device authorization endpoint.'); + } + if (typeof tokenUrl !== 'string' || !tokenUrl) + throw new Error('The ' + label + ' names no token endpoint.'); + const token = requireSecureUrl(tokenUrl, issuerUrl.toString(), 'token endpoint').toString(); + const revocationUrl = advertisedRevocation(payload, issuerUrl); + return { + deviceAuthorizationUrl: requireSecureUrl( + deviceAuthorizationUrl, + issuerUrl.toString(), + 'device authorization endpoint', + ).toString(), + tokenUrl: token, + refreshUrl: token, + ...(revocationUrl ? { revocationUrl } : {}), }; }; -/** Discovers OpenID Connect endpoints, then uses the same PKCE flow as a declared authorization code grant. */ +const AUTHORIZATION_SERVER_METADATA = 'authorization server metadata'; + +/** + * Reads a scheme's RFC 8414 metadata and holds it to its issuer: the one its URL was built from + * (section 3.3), and the configured issuer when there is one. + * + * Shared by device sign-in, which takes its endpoints from the document, and by revocation, which + * takes only `revocation_endpoint`, so the two cannot disagree about which documents to trust. + */ +const readAuthorizationServerMetadata = async ( + method: { readonly metadataUrl: string; readonly issuer?: string | undefined }, + baseUrl: string, + timeoutMs?: number, +): Promise<{ readonly payload: Record; readonly issuerUrl: URL }> => { + const label = AUTHORIZATION_SERVER_METADATA; + const { payload, issuer, issuerUrl } = await readServerMetadata( + method.metadataUrl, + baseUrl, + { document: label, issuer: 'authorization server issuer' }, + metadataIssuer, + timeoutMs, + ); + if (method.issuer !== undefined && !sameIssuer(issuer, method.issuer)) { + throw new Error( + 'The ' + + label + + ' is issued by ' + + safeText(issuer) + + ', not the configured issuer ' + + safeText(method.issuer) + + '.', + ); + } + return { payload, issuerUrl }; +}; + +/** + * Discovers OpenID Connect endpoints, then uses the same PKCE flow as a declared authorization code + * grant — holding the redirect's `iss` and the ID token to the issuer discovery verified. + */ const openIdConnectFlow = async ( method: Extract, baseUrl: string, + logo: string | undefined, ): Promise => { const endpoints = await discoverOpenIdConnect(method.discoveryUrl, baseUrl); + // A configured issuer is the publisher saying which provider this CLI signs in with. Discovery + // only proves the document agrees with the URL it came from, and that URL is spec-derived, so a + // document that points somewhere else is refused here rather than trusted for the rest of the flow. + if (method.issuer !== undefined && !sameIssuer(endpoints.issuer, method.issuer)) { + throw new Error( + 'The OpenID Connect discovery document is issued by ' + + safeText(endpoints.issuer) + + ', not the configured issuer ' + + safeText(method.issuer) + + '.', + ); + } + // Same randomness as `state`. `state` ties the redirect to this process; the nonce ties the ID + // token to it, so a token minted for some other sign-in cannot be replayed into this one. + const nonce = base64Url(randomBytes(16)); const result = await authorizationCodeFlow( { ...method, @@ -491,15 +1111,156 @@ const openIdConnectFlow = async ( authorizationUrl: endpoints.authorizationUrl, tokenUrl: endpoints.tokenUrl, refreshUrl: endpoints.tokenUrl, + issuer: endpoints.issuer, + }, + baseUrl, + logo, + { + // Discovery always yields an issuer to compare a received `iss` with, but only a configured + // issuer or the provider's own advertisement makes a *missing* one a failure: RFC 9207 lets a + // server that never promised the parameter leave it out. + issRequired: method.issuer !== undefined || endpoints.issParameterSupported, + nonce, + // Run inside the code flow, while the browser is still waiting on its page, so a refused ID + // token is what the browser is told about too. It also runs before `login` writes anything: + // a token that fails is not stored, and neither is the access token that arrived beside it. + verify: (token) => { + if (token.idToken !== undefined) { + verifyIdToken(token.idToken, { issuer: endpoints.issuer, clientId: method.clientId, nonce }); + } + }, }, + ); + // A configured endpoint wins over the discovered one when it sits beside the token endpoint + // discovery named; the discovered one was already resolved against the issuer. + const revocationUrl = signInRevocation( + method.revocationUrl, + { revocationUrl: endpoints.revocationUrl }, + endpoints.tokenUrl, baseUrl, ); - return { ...result, refreshUrl: endpoints.tokenUrl }; + return { ...result, refreshUrl: endpoints.tokenUrl, revocationUrl }; }; +/** + * Checks the claims of an ID token the token endpoint returned, per OpenID Connect Core 3.1.3.7. + * + * The signature is deliberately not verified. Section 3.1.3.7 lets TLS server validation stand in + * for it when the token is received directly from the token endpoint — which is the only way this + * flow receives one: `exchangeToken` refuses a plain-HTTP endpoint off loopback and follows no + * redirects. Verifying it anyway would mean fetching and caching the provider's JWKS and + * implementing each signing algorithm, in a runtime that ships with no dependencies. The claims are + * what bind the token to this sign-in, and those are checked in full. + */ +const verifyIdToken = ( + idToken: string, + expected: { readonly issuer: string; readonly clientId: string; readonly nonce: string }, +): void => { + const claims = idTokenClaims(idToken); + const issuer = claims['iss']; + if (typeof issuer !== 'string' || !sameIssuer(issuer, expected.issuer)) { + throw new Error( + 'The ID token was issued by ' + + (typeof issuer === 'string' ? safeText(issuer) || 'an empty issuer' : 'no issuer') + + ', but this sign-in expected ' + + safeText(expected.issuer) + + '.', + ); + } + const audience = claims['aud']; + const audiences = typeof audience === 'string' ? [audience] : Array.isArray(audience) ? audience : []; + if (!audiences.includes(expected.clientId)) { + throw new Error('The ID token is not addressed to this client (' + safeText(expected.clientId) + ').'); + } + // With more than one audience, `azp` names the party the token was actually issued to; without + // it, a token minted for another client that merely lists this one could be passed off as ours. + // A present `azp` is held to the client id even for a single audience, as the spec recommends. + const party = claims['azp']; + if ((audiences.length > 1 || party !== undefined) && party !== expected.clientId) { + throw new Error( + party === undefined + ? 'The ID token lists several audiences but names no authorized party (azp).' + : 'The ID token was issued to another authorized party (azp) than this client.', + ); + } + const expiry = claims['exp']; + if (typeof expiry !== 'number' || !Number.isFinite(expiry)) { + throw new Error('The ID token has no usable expiry.'); + } + if (expiry * 1000 + ID_TOKEN_CLOCK_SKEW_MS <= Date.now()) { + throw new Error('The ID token has expired.'); + } + const nonce = claims['nonce']; + if (typeof nonce !== 'string' || !sameToken(nonce, expected.nonce)) { + throw new Error( + 'The ID token does not carry the nonce this sign-in sent, so it may belong to another sign-in.', + ); + } +}; + +/** + * Decodes the payload of a compact-serialized JWT into its claims, refusing anything malformed. + * + * Strict about the alphabet because Node's base64url decoder is not: it skips characters it does + * not recognise, so a mangled segment would otherwise decode into *something* rather than fail. + */ +const idTokenClaims = (idToken: string): Record => { + const malformed = new Error('The token endpoint returned a malformed ID token.'); + const segments = idToken.split('.'); + const payload = segments[1]; + if (segments.length !== 3 || !payload || !/^[A-Za-z0-9_-]+$/u.test(payload)) throw malformed; + let claims: unknown; + try { + claims = JSON.parse(Buffer.from(payload, 'base64url').toString('utf8')); + } catch { + throw malformed; + } + if (!claims || typeof claims !== 'object' || Array.isArray(claims)) throw malformed; + return claims as Record; +}; + +/** + * Fields for a grant request: a form body or an authorization URL's query. + * + * An array value repeats its key rather than being joined, because that is how RFC 8707 spells more + * than one resource indicator — `resource=a&resource=b`, never `resource=a,b`. + */ +type GrantParams = Readonly>; + +/** The `scope` parameter, left off entirely when there is nothing to request. */ const scopeParam = (scopes: readonly string[]): Record => scopes.length > 0 ? { scope: scopes.join(' ') } : {}; +/** + * The parameters naming which API a token is for, spread into every request a grant makes. + * + * Every one — the authorization URL, the device authorization request, each token-endpoint call and + * the refresh — because providers differ in where they read it: some bind it to the authorization + * and check the token request against it, others look only at the token endpoint, and a request + * without it can come back with a token for a different API. Kept in one place so no grant can be + * written without it. Both are absent unless configured, which leaves an unconfigured CLI's + * requests exactly as they were. + */ +const targetParams = (target: CliOauthTargetDefinition): GrantParams => ({ + ...(target.resource && target.resource.length > 0 ? { resource: target.resource } : {}), + ...(target.audience ? { audience: target.audience } : {}), +}); + +/** + * Writes grant fields into a query or form, one entry per value. + * + * Each key is cleared first, so a field replaces whatever the authorization URL already carried + * under that name — the same outcome `searchParams.set` gives a single value — while a list still + * repeats its key. + */ +const writeParams = (params: URLSearchParams, fields: GrantParams): URLSearchParams => { + for (const [key, value] of Object.entries(fields)) { + params.delete(key); + for (const entry of typeof value === 'string' ? [value] : value) params.append(key, entry); + } + return params; +}; + type DeviceAuthorization = { readonly deviceCode: string; readonly verificationUrl: string; @@ -508,15 +1269,19 @@ type DeviceAuthorization = { readonly intervalMs: number; }; -/** Starts a device grant and validates the response before anything is printed to the terminal. */ +/** + * Starts a device grant and validates the response before anything is printed to the terminal. + * + * `fields` is the whole request body — the client id, the scope and the target API — so the caller + * that knows the method decides what the grant asks for. + */ const requestDeviceAuthorization = async ( endpoint: string, baseUrl: string, - clientId: string, - scopes: readonly string[], + fields: GrantParams, ): Promise => { const url = requireSecureUrl(endpoint, baseUrl, 'device authorization endpoint'); - const { response, text } = await postForToken(url, { client_id: clientId, ...scopeParam(scopes) }); + const { response, text } = await postForToken(url, fields); const payload = parseJson(text); if (!response.ok) { throw new Error( @@ -561,11 +1326,15 @@ const requestDeviceAuthorization = async ( }; }; -/** Polls the token endpoint until the user authorizes, declines, or the device code expires. */ +/** + * Polls the token endpoint until the user authorizes, declines, or the device code expires. + * + * `fields` carries the client id and the target API, sent on every poll beside the device code. + */ const pollDeviceToken = async ( endpoint: string, baseUrl: string, - clientId: string, + fields: GrantParams, device: DeviceAuthorization, ): Promise => { const url = requireSecureUrl(endpoint, baseUrl, 'token endpoint'); @@ -574,9 +1343,9 @@ const pollDeviceToken = async ( await waitFor(Math.min(intervalMs, Math.max(0, device.expiresAt - Date.now()))); if (Date.now() >= device.expiresAt) break; const { response, text } = await postForToken(url, { - grant_type: 'urn:ietf:params:oauth:grant-type:device_code', + grant_type: DEVICE_CODE_GRANT, device_code: device.deviceCode, - client_id: clientId, + ...fields, }); const payload = parseJson(text); if (response.ok) return tokenResponse(payload); @@ -619,38 +1388,99 @@ const discoveryIssuer = (url: URL): string | undefined => const sameIssuer = (left: string, right: string): boolean => left.replace(/\/+$/u, '') === right.replace(/\/+$/u, ''); -/** Fetches the OpenID Provider configuration and keeps only the two endpoints PKCE needs. */ -const discoverOpenIdConnect = async ( - discoveryUrl: string, +/** The well-known name RFC 8414 registers for an OAuth authorization server's metadata. */ +const OAUTH_METADATA_PATH = '/.well-known/oauth-authorization-server'; + +/** + * The issuer an RFC 8414 metadata URL was built from, or `undefined` when its spelling does not say. + * + * RFC 8414 section 3.1 *inserts* the well-known path between the host and the issuer's own path + * (`https://as.example/.well-known/oauth-authorization-server/tenant` for the issuer + * `https://as.example/tenant`), and section 5 uses the same insertion for an OpenID Connect + * configuration. OpenID Connect Discovery appends instead, so that spelling is accepted as well. + */ +const metadataIssuer = (url: URL): string | undefined => { + for (const wellKnown of [OAUTH_METADATA_PATH, OPENID_CONFIGURATION_PATH]) { + if (url.pathname === wellKnown || url.pathname.startsWith(wellKnown + '/')) { + return url.origin + url.pathname.slice(wellKnown.length); + } + } + return discoveryIssuer(url); +}; + +/** + * Fetches an authorization server's published metadata and verifies who published it. + * + * Both OpenID Connect Discovery (section 4.3) and RFC 8414 (section 3.3) require the document's + * `issuer` to be the one its URL was built from. It is the check that keeps a provider from naming + * somebody else's endpoints: without it the sign-in sends the user, and then the code or device + * grant it obtains, wherever an untrusted document says. A URL whose spelling names no issuer is + * held to its origin instead, which still pins the answer to the host that was asked. + */ +const readServerMetadata = async ( + metadataUrl: string, baseUrl: string, -): Promise<{ readonly authorizationUrl: string; readonly tokenUrl: string }> => { - const url = requireSecureUrl(discoveryUrl, baseUrl, 'OpenID Connect discovery document'); - const { response, text } = await getJson(url, 'OpenID Connect discovery document'); + labels: { readonly document: string; readonly issuer: string }, + issuerFor: (url: URL) => string | undefined, + timeoutMs?: number, +): Promise<{ + readonly payload: Record; + readonly issuer: string; + readonly issuerUrl: URL; +}> => { + const url = requireSecureUrl(metadataUrl, baseUrl, labels.document); + const { response, text } = await getJson(url, labels.document, timeoutMs); const payload = parseJson(text); if (!response.ok) { throw new Error( - 'The OpenID Connect discovery document could not be read' + tokenErrorDetail(payload, response.status), + 'The ' + labels.document + ' could not be read' + tokenErrorDetail(payload, response.status), ); } - // Section 4.3 requires the returned issuer to be the one the URL was built from. It is the check - // that keeps a provider from naming somebody else's endpoints: without it this grant sends the - // user's browser, and then the authorization code, wherever an untrusted document says. const issuer = payload?.['issuer']; - if (typeof issuer !== 'string' || !issuer) { - throw new Error('The OpenID Connect discovery document named no issuer.'); + if (!payload || typeof issuer !== 'string' || !issuer) { + throw new Error('The ' + labels.document + ' named no issuer.'); } - const expected = discoveryIssuer(url); - const issuerUrl = requireSecureUrl(issuer, '', 'OpenID Connect issuer'); + const expected = issuerFor(url); + const issuerUrl = requireSecureUrl(issuer, '', labels.issuer); const matches = expected === undefined ? issuerUrl.origin === url.origin : sameIssuer(issuer, expected); if (!matches) { throw new Error( - 'The OpenID Connect discovery document is issued by ' + + 'The ' + + labels.document + + ' is issued by ' + safeText(issuer) + ', which is not the provider it was fetched from.', ); } - const authorizationUrl = payload?.['authorization_endpoint']; - const tokenUrl = payload?.['token_endpoint']; + return { payload, issuer, issuerUrl }; +}; + +/** + * Fetches the OpenID Provider configuration and keeps what the browser flow needs: the two + * endpoints PKCE uses, the issuer the document was verified to come from, and whether the provider + * promises RFC 9207's `iss` on its redirects — plus the revocation endpoint `logout` uses when + * the provider advertises one. + */ +const discoverOpenIdConnect = async ( + discoveryUrl: string, + baseUrl: string, +): Promise<{ + readonly authorizationUrl: string; + readonly tokenUrl: string; + readonly issuer: string; + readonly issParameterSupported: boolean; + readonly revocationUrl?: string; +}> => { + // Held to the appended spelling alone, which is the derivation the compiler's + // `Config/OidcIssuerMismatch` check mirrors at generation time. + const { payload, issuer, issuerUrl } = await readServerMetadata( + discoveryUrl, + baseUrl, + { document: 'OpenID Connect discovery document', issuer: 'OpenID Connect issuer' }, + discoveryIssuer, + ); + const authorizationUrl = payload['authorization_endpoint']; + const tokenUrl = payload['token_endpoint']; if (typeof authorizationUrl !== 'string' || typeof tokenUrl !== 'string') { throw new Error( 'The OpenID Connect discovery document returned no usable authorization and token endpoints.', @@ -659,6 +1489,7 @@ const discoverOpenIdConnect = async ( // Resolved against the issuer, never the API base URL: a relative `/authorize` belongs to the // provider that answered, and resolving it against the API would point the browser — and the code // exchange after it — at the API host instead. + const revocationUrl = advertisedRevocation(payload, issuerUrl); return { authorizationUrl: requireSecureUrl( authorizationUrl, @@ -666,6 +1497,9 @@ const discoverOpenIdConnect = async ( 'OpenID Connect authorization endpoint', ).toString(), tokenUrl: requireSecureUrl(tokenUrl, issuerUrl.toString(), 'OpenID Connect token endpoint').toString(), + ...(revocationUrl ? { revocationUrl } : {}), + issuer, + issParameterSupported: payload?.['authorization_response_iss_parameter_supported'] === true, }; }; @@ -676,10 +1510,28 @@ const discoverOpenIdConnect = async ( * being redeemed by anything but this process. The redirect listens on 127.0.0.1 rather than a * public interface, and the authorization URL is printed before the browser is opened so a headless * or remote shell can still complete the flow by hand. + * + * `options.issRequired` makes an `iss`-less redirect a failure; it defaults to whether an issuer + * is known at all, which for this grant means one was configured. `options.nonce` is sent on the + * authorize request, and only OpenID Connect sends one, since only it returns an ID token to hold + * the nonce to. `options.verify` checks the exchanged token and throws to refuse it. + * + * The browser's request for the redirect is answered only after the code exchange and `verify`, + * so it never shows "Signed in" for a token this flow goes on to refuse. (Saving the credential + * comes later, in `runLogin`; a store that then refuses the write is reported in the terminal.) + * The wait is bounded by the token request's own timeout. Afterwards no redirect is held any more, + * and the listener is closed only once every answered response has finished sending — or its + * browser has gone — or `RESPONSE_FLUSH_TIMEOUT_MS` has passed. */ const authorizationCodeFlow = async ( method: Extract, baseUrl: string, + logo: string | undefined, + options: { + readonly issRequired?: boolean; + readonly nonce?: string; + readonly verify?: (token: TokenResponse) => void; + } = {}, ): Promise<{ readonly token: TokenResponse; readonly clientId: string | undefined }> => { const clientId = method.clientId; if (!clientId || !method.authorizationUrl) throw new Error('This flow needs a configured OAuth client id.'); @@ -708,7 +1560,15 @@ const authorizationCodeFlow = async ( } throw error; }); - const redirect = awaitRedirect(server, state, REDIRECT_PATH); + const listener: RedirectListener = { answered: [], closing: false }; + const redirect = awaitRedirect( + server, + state, + REDIRECT_PATH, + logo, + { expected: method.issuer, required: options.issRequired ?? method.issuer !== undefined }, + listener, + ); const redirectUri = 'http://127.0.0.1:' + String(port) + REDIRECT_PATH; try { authorizeUrl.searchParams.set('response_type', 'code'); @@ -717,26 +1577,64 @@ const authorizationCodeFlow = async ( authorizeUrl.searchParams.set('state', state); authorizeUrl.searchParams.set('code_challenge', challenge); authorizeUrl.searchParams.set('code_challenge_method', 'S256'); + if (options.nonce !== undefined) authorizeUrl.searchParams.set('nonce', options.nonce); if (method.scopes.length > 0) authorizeUrl.searchParams.set('scope', method.scopes.join(' ')); + writeParams(authorizeUrl.searchParams, targetParams(method)); const target = authorizeUrl.toString(); processStderr.write( 'Opening your browser to sign in. If it does not open, visit:\n\n ' + target + '\n\n', ); openBrowser(target); - const code = await withTimeout( + const { code, respond } = await withTimeout( redirect, BROWSER_FLOW_TIMEOUT_MS, 'Timed out waiting for the browser redirect.', ); - const token = await exchangeToken(method.tokenUrl, baseUrl, { - grant_type: 'authorization_code', - code, - redirect_uri: redirectUri, - client_id: clientId, - code_verifier: verifier, - }); - return { token, clientId }; + // `respond` answers the held browser request once and ignores later calls, so the `finally` + // below can answer it with a failure on any path that got here without answering it. + try { + let token: TokenResponse; + try { + token = await exchangeToken(method.tokenUrl, baseUrl, { + grant_type: 'authorization_code', + code, + redirect_uri: redirectUri, + client_id: clientId, + code_verifier: verifier, + ...targetParams(method), + }); + } catch (error) { + respond( + 'Sign-in failed', + 'Your provider did not issue a credential. Return to your terminal for details.', + false, + ); + throw error; + } + options.verify?.(token); + respond('Signed in', 'You can close this window and return to your terminal.', true); + return { token, clientId }; + } finally { + respond( + 'Sign-in could not be verified', + 'The credential your provider issued did not match this sign-in. Return to your terminal for details.', + false, + ); + } } finally { + // From here on a redirect is answered at once with the neutral page and never held, so nothing + // that arrives during the wait below is left for nobody to answer — a redirect landing after the + // browser wait timed out included. + listener.closing = true; + // Answered pages are waited for before any socket is destroyed: `closeAllConnections` cancels + // writes still queued on a socket, and a page carrying a large publisher logo takes more than one + // write to send, so closing straight after `end()` could leave the browser a blank or truncated + // page. Bounded, so a browser that stops reading cannot hold the terminal. + // + // `server.close()` comes after the wait, not before it: since Node 19 it also closes every + // connection with no request in progress, and a connection whose response has been ended but not + // yet flushed counts as one — so closing first cut off exactly the pages this wait protects. + await drainAnswered(listener.answered, RESPONSE_FLUSH_TIMEOUT_MS); server.close(); // Belt and braces with the `connection: close` above: a connection opened but never used (a // browser preconnecting to the redirect host) is not covered by that header and would keep the @@ -745,19 +1643,61 @@ const authorizationCodeFlow = async ( } }; +/** What the browser flow shares with its loopback request handler. */ +type RedirectListener = { + /** One entry per response written, settling once it has been sent or its browser has gone. */ + readonly answered: Promise[]; + /** Set when the flow is finishing: every later redirect gets the neutral page at once. */ + closing: boolean; +}; + +/** + * Waits, up to `ms` in all, for every answered response — including any answered while waiting. + * + * Re-reads the list after each batch because the listener keeps accepting until it is closed, and a + * response written during the wait is just as liable to be cut off as one written before it. + */ +const drainAnswered = async (answered: readonly Promise[], ms: number): Promise => { + const deadline = Date.now() + ms; + let waited = 0; + while (waited < answered.length && Date.now() < deadline) { + const batch = answered.slice(waited); + waited = answered.length; + await settledWithin(Promise.all(batch), deadline - Date.now()); + } +}; + +/** + * Resolves once `promise` settles or `ms` have passed, whichever is first, and never rejects. + * + * The timer is cleared when the promise wins, so a finished wait leaves nothing pending that would + * keep the process alive. + */ +const settledWithin = (promise: Promise, ms: number): Promise => + new Promise((resolve) => { + const timer = setTimeout(resolve, ms); + const done = (): void => { + clearTimeout(timer); + resolve(); + }; + promise.then(done, done); + }); + /** * The style for the one page a generated CLI ever puts in front of a browser. * - * Every colour is a token on `:root` so the palette can be restyled in one block, and each is - * redefined under `prefers-color-scheme: dark` rather than being left to the browser. + * Laid out after the Scalar dashboard's own sign-in confirmation: the publisher's logo centred a + * little above the fold, then a one-line heading with its icon, then a muted line of detail — no + * card, no accent colour. Every colour is a token on `:root` so the palette can be restyled in one + * block. * * The font stack names Inter first and then falls back to the system UI face. Naming it is free * where it is already installed and costs nothing where it is not — what it must never do is * *fetch* it, for the same reason the rest of this page is inline. */ const PAGE_STYLE = - // Values taken from the Scalar dashboard's own theme: `--scalar-background-1/2`, - // `--scalar-color-1/2`, `--scalar-border-color` and the semantic green and red, per mode. + // Values taken from the Scalar dashboard's own theme: `--scalar-background-1` and + // `--scalar-color-1/2`, per mode. // // `light-dark()` rather than a `prefers-color-scheme` block, so each token states its light and // dark value together and the palette can be read as pairs. It resolves against the @@ -765,51 +1705,72 @@ const PAGE_STYLE = // // Where the function is not understood (before Firefox 120, Chrome 123, Safari 17.5) every token // is invalid at computed-value time and the properties using them fall back to their initial - // values — black on white, with an unstyled icon and no card border. Plain, still legible, and - // still saying the sign-in worked, which is the page's whole job. + // values — black on white. Plain, still legible, and still saying the sign-in worked, which is the + // page's whole job. ':root{color-scheme:light dark;' + '--bg:light-dark(#fff,#0f0f0f);' + - '--card:light-dark(#f6f6f6,#1a1a1a);' + '--fg:light-dark(#1b1b1b,#e7e7e7);' + - '--muted:light-dark(#757575,#a4a4a4);' + - '--line:light-dark(#dfdfdf,#2d2d2d);' + - '--ok:light-dark(#069061,#00b648);' + - '--err:light-dark(#ef0006,#dc1b19)}' + + '--muted:light-dark(#757575,#a4a4a4)}' + '*{box-sizing:border-box}' + - 'body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg);color:var(--fg);' + + // The dashboard's auth layout: content starts 15% of the way down the viewport in a 380px column. + 'body{margin:0;padding:15vh 48px 48px;background:var(--bg);color:var(--fg);' + // Mirrors `--scalar-font`, which also leads with Inter and falls back to the system UI face. - 'font:16px/1.6 Inter,ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}' + - // `--scalar-radius` is 3px and `--scalar-radius-lg` doubles it; 6px is that, spelled literally - // because the page carries no token indirection of its own. - '.card{width:100%;max-width:23rem;padding:40px 32px;text-align:center;background:var(--card);' + - 'border:1px solid var(--line);border-radius:6px}' + - 'svg{width:38px;height:38px}' + - // `--scalar-bold` is 600, which is what the dashboard's own headings use. - 'h1{margin:20px 0 8px;font-size:18px;font-weight:600;letter-spacing:-.01em}' + - 'p{margin:0;color:var(--muted);font-size:14px}'; + 'font:14px/1.5 Inter,ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}' + + 'main{max-width:380px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}' + + // 32px tall like the dashboard's mark, but width left to the image: a publisher's logo is as + // often a wordmark as a square icon. The 16px margin plus the 8px gap is the dashboard's 24px. + '.logo{display:block;height:32px;max-width:100%;margin-bottom:16px;object-fit:contain}' + + // `text-lg` at regular weight, as the dashboard sets it, with a 20px icon beside it. + 'h1{margin:0;display:flex;align-items:center;justify-content:center;gap:8px;font-size:16px;font-weight:400;line-height:24px}' + + 'h1 svg{flex:none;width:20px;height:20px}' + + // `text-sm` in `--scalar-color-2`. + 'p{margin:0;color:var(--muted);font-size:13px;line-height:20px}'; /** - * The tab icon, as the same mark the page shows. + * The page's two marks, as Phosphor's light-weight `sign-in` and `warning` glyphs on a 256 grid — + * the icons the dashboard's own confirmation and failure screens use. * - * A data URI rather than a file, so the browser never requests `/favicon.ico` from the loopback - * listener — which would otherwise answer a 404 to a request it only receives because the page - * declared no icon. + * Phosphor Icons, Copyright (c) 2020 Phosphor Icons, MIT License (https://github.com/phosphor-icons/core). + */ +const SIGNED_IN_ICON = + 'M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z'; +const WARNING_ICON = + 'M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z'; + +/** + * Escapes a value for a double-quoted HTML attribute. * - * Deliberately a status mark and not a vendor logo: this page is served by every generated CLI, so - * an icon identifying the SDK's *author* would put one company's branding on another's sign-in. + * The logo arrives through the generator's own filter, which admits only an `https` URL or an image + * `data:` URI, but an SVG `data:` URI can legally carry quotes and angle brackets. Escaping here is + * lossless — the parser decodes the entities back before the URL is read — so the attribute cannot + * be closed early whatever the filter let through. + */ +const escapeAttribute = (value: string): string => + value.replace(/&/gu, '&').replace(/"/gu, '"').replace(//gu, '>'); + +/** + * The tab icon: the publisher's logo when one is configured, otherwise the page's own mark. + * + * Always declared, so the browser never requests `/favicon.ico` from the loopback listener — which + * would otherwise answer a 404 to a request it only receives because the page declared no icon. * - * The colours are the dark-mode pair, which read against a light and a dark tab strip alike; - * `light-dark()` is no use here because the SVG is a separate document with no `color-scheme` of - * its own. Only `#`, `<` and `>` are escaped, which is all a data URI in an attribute needs, and - * the SVG quotes its attributes with apostrophes so the `href` can keep the double quotes. + * The fallback is deliberately a status mark and not a vendor logo: this page is served by every + * generated CLI, so a default icon identifying the SDK's *generator* would put one company's + * branding on another's sign-in. + * + * The fallback's colours are a green and a red that read against a light and a dark tab strip + * alike; `light-dark()` is no use here because the SVG is a separate document with no + * `color-scheme` of its own. Only `#`, `<` and `>` are escaped, which is all a data URI in an + * attribute needs, and the SVG quotes its attributes with apostrophes so the `href` can keep the + * double quotes. */ -const favicon = (mark: string, ok: boolean): string => { +const favicon = (icon: string, ok: boolean, logo: string | undefined): string => { + if (logo) return ''; const svg = - "" + - ""; return ( '' + '' + - favicon(mark, ok) + + '' + + favicon(icon, ok, logo) + '' + heading + '
' + - '

' + - '

' + heading + '

' + detail + - '

' + '

' ); }; +/** The code a redirect carried, and the one-shot answer to the browser request still waiting on it. */ +type HeldRedirect = { + readonly code: string; + readonly respond: (heading: string, detail: string, ok: boolean) => void; +}; + /** - * Resolves with the authorization code the redirect carries. + * Resolves with the authorization code the redirect carries, holding the browser's request open. + * + * A redirect that fails a check here is answered at once. One that passes is left waiting, and the + * caller answers it through `respond` once the rest of the sign-in has succeeded or failed. * * Anything that is not the redirect — a browser probing `/favicon.ico`, a stray request to the * port — is answered 404 and ignored, so it cannot resolve or reject the wait. The `state` is * compared in constant time and rejected on mismatch, which is what ties the redirect back to the - * request this process started. + * request this process started; the `iss` is then held to `issuer` (see {@link redirectIssuerProblem}). */ const awaitRedirect = ( server: ReturnType, state: string, path: string, -): Promise => - new Promise((resolve, reject) => { + logo: string | undefined, + issuer: RedirectIssuer, + listener: RedirectListener, +): Promise => + new Promise((resolve, reject) => { + // Set once a redirect has resolved or rejected this wait. A later redirect — the user reloading + // the tab while the first is still held — can change nothing, but it still deserves an answer: + // left unanswered it would hang until the listener closed and then show an empty-response error. + let settled = false; server.on('request', (request, response) => { const url = new URL(request.url ?? '/', 'http://127.0.0.1'); const params = url.searchParams; + // Listened for as soon as the request arrives, not when it is answered: a held redirect whose + // browser gives up while the code is exchanged (a reload, a closed tab) has already fired its + // `'close'` by the time it is answered, and a listener added then would never hear it — + // leaving the flow to wait out `RESPONSE_FLUSH_TIMEOUT_MS` for a page nobody will read. + const closed = new Promise((done) => response.once('close', () => done())); const send = (status: number, type: string, body: string): void => { // `connection: close` rather than the default keep-alive: `server.close()` waits for open // connections, and a browser holding one would leave the CLI running after it had signed in. response.writeHead(status, { 'content-type': type + '; charset=utf-8', connection: 'close' }); + listener.answered.push(closed); response.end(body); }; const finish = (status: number, heading: string, detail: string, ok: boolean): void => { - send(status, 'text/html', redirectPage(heading, detail, ok)); + send(status, 'text/html', redirectPage(heading, detail, ok, logo)); }; // The path is part of what was registered as `redirect_uri`, so anything else is not the // redirect however it is decorated. Checked alongside the parameters rather than instead of @@ -890,6 +1875,16 @@ const awaitRedirect = ( send(404, 'text/plain', 'Not found.\n'); return; } + if (settled || listener.closing) { + finish( + 409, + 'Return to your terminal', + 'This sign-in has already been received. Your terminal shows how it ended.', + false, + ); + return; + } + settled = true; if (!sameToken(params.get('state') ?? '', state)) { // Ends the sign-in rather than waiting for a better redirect. A request that reaches here is // on the registered path and carries a `code` or an `error`, which makes it the provider's @@ -906,6 +1901,20 @@ const awaitRedirect = ( reject(new Error('The browser redirect did not match this sign-in attempt.')); return; } + // Checked before the `error` branch as well as the code: RFC 9207 puts `iss` on error + // responses too, and an error page from a server that is not the expected one is no more its + // provider's word than a code is. + const issuerProblem = redirectIssuerProblem(params.get('iss'), issuer); + if (issuerProblem) { + finish( + 400, + 'Sign-in could not be verified', + 'This response did not come from the provider your terminal expected. Return to your terminal and try again.', + false, + ); + reject(new Error(issuerProblem)); + return; + } const failure = params.get('error'); if (failure) { finish( @@ -928,12 +1937,55 @@ const awaitRedirect = ( reject(new Error('The browser redirect carried no authorization code.')); return; } - finish(200, 'Signed in', 'You can close this window and return to your terminal.', true); - resolve(code); + let responded = false; + resolve({ + code, + respond: (heading, detail, ok) => { + if (responded) return; + responded = true; + finish(ok ? 200 : 400, heading, detail, ok); + }, + }); }); server.on('error', reject); }); +/** The issuer a browser redirect is held to, and whether it must name one at all. */ +type RedirectIssuer = { readonly expected: string | undefined; readonly required: boolean }; + +/** + * Why a redirect's `iss` parameter (RFC 9207) is unacceptable, or `undefined` when it is fine. + * + * This is the mix-up-attack defence. `state` proves the redirect answers this process's request, + * but not which authorization server sent it: a CLI that trusts more than one provider can have its + * browser steered through an attacker's, and would then redeem the code that server handed back at + * the honest provider's token endpoint — or hand an honest code to the attacker's. Naming the issuer + * on the redirect, and refusing one that is not the server this sign-in began with, closes that + * before the code is exchanged anywhere. + * + * With no expected issuer — a plain OAuth scheme and none configured — a received `iss` is + * ignored: there is nothing to compare it with, so it can neither confirm nor refute the sender, + * and refusing it would break every provider that sends one to clients that never asked. + */ +const redirectIssuerProblem = (received: string | null, issuer: RedirectIssuer): string | undefined => { + if (issuer.expected === undefined) return undefined; + if (received === null) { + return issuer.required + ? 'The browser redirect did not say which provider sent it (no iss parameter), but this sign-in expected ' + + safeText(issuer.expected) + + '.' + : undefined; + } + if (sameIssuer(received, issuer.expected)) return undefined; + return ( + 'The browser redirect was sent by ' + + (safeText(received) || 'an empty issuer') + + ', but this sign-in expected ' + + safeText(issuer.expected) + + '.' + ); +}; + /** Starts the loopback listener, resolving with the port the OS actually bound. */ const listen = (server: ReturnType, port: number): Promise => new Promise((resolve, reject) => { @@ -962,11 +2014,13 @@ const listen = (server: ReturnType, port: number): Promise< */ const openBrowser = (url: string): void => { const windows = process.platform === 'win32'; + // Resolved through the absolute `PATH` entries only, as the keychain helper is, so a relative + // entry cannot put a planted opener in front of the real one. + const opener = windows ? undefined : resolveOnPath(process.platform === 'darwin' ? 'open' : 'xdg-open'); + if (!windows && !opener) return; const [file, ...args] = windows ? [windowsPowerShell(), '-NoProfile', '-NonInteractive', '-Command', '-'] - : process.platform === 'darwin' - ? ['open', url] - : ['xdg-open', url]; + : [opener, url]; try { const child = spawn(file as string, args, { stdio: windows ? ['pipe', 'ignore', 'ignore'] : 'ignore', @@ -996,7 +2050,7 @@ const openBrowser = (url: string): void => { const exchangeToken = async ( tokenUrl: string, baseUrl: string, - body: Readonly>, + body: GrantParams, timeoutMs: number = TOKEN_REQUEST_TIMEOUT_MS, ): Promise => { const url = requireSecureUrl(tokenUrl, baseUrl, 'token endpoint'); @@ -1015,9 +2069,13 @@ const tokenResponse = (payload: Record | undefined): TokenRespo } const refreshToken = payload?.['refresh_token']; const expiresIn = payload?.['expires_in']; + const idToken = payload?.['id_token']; return { accessToken, ...(typeof refreshToken === 'string' && refreshToken ? { refreshToken } : {}), + // Kept as sent, even when empty or not a string, so the OIDC flow refuses a malformed one rather + // than treating it as absent. + ...(idToken === undefined || idToken === null ? {} : { idToken: String(idToken) }), // A lifetime at or below zero is not a lifetime. Stored as one it makes `needsRefresh` true // forever, so every command pays a full refresh round trip ahead of the request it wanted — // on a token that is in fact perfectly good. The device grant already applies this floor to @@ -1030,6 +2088,7 @@ const tokenResponse = (payload: Record | undefined): TokenRespo const getJson = async ( url: URL, label: string, + timeoutMs: number = TOKEN_REQUEST_TIMEOUT_MS, ): Promise<{ readonly response: Response; readonly text: string }> => { try { const response = await fetch(url, { @@ -1039,14 +2098,14 @@ const getJson = async ( // discovery endpoint that redirects would have its answer — the authorization and token URLs // this whole grant is then pointed at — supplied by whichever origin it forwarded to. redirect: 'error', - signal: AbortSignal.timeout(TOKEN_REQUEST_TIMEOUT_MS), + signal: AbortSignal.timeout(timeoutMs), }); return { response, text: await readBounded(response) }; } catch (error) { const name = error instanceof Error ? error.name : ''; throw new Error( name === 'TimeoutError' || name === 'AbortError' - ? 'The ' + label + ' did not answer within ' + String(TOKEN_REQUEST_TIMEOUT_MS / 1000) + ' seconds.' + ? 'The ' + label + ' did not answer within ' + String(timeoutMs / 1000) + ' seconds.' : 'Could not reach the ' + label + '.', ); } @@ -1061,17 +2120,21 @@ const getJson = async ( * * The endpoint is spec-derived, so its own error text is never repeated beyond whether the wait ran * out: a `fetch` failure can carry the request, and the request carries the secret. + * + * `label` names the endpoint in those two messages, so a revocation that times out does not + * claim to have been a token request. */ const postForToken = async ( url: URL, - body: Readonly>, + body: GrantParams, timeoutMs: number = TOKEN_REQUEST_TIMEOUT_MS, + label = 'token endpoint', ): Promise<{ readonly response: Response; readonly text: string }> => { try { const response = await fetch(url, { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded', accept: 'application/json' }, - body: new URLSearchParams(body).toString(), + body: writeParams(new URLSearchParams(), body).toString(), // A 307/308 preserves the POST body. Do not let a spec-derived endpoint forward a refresh // token, authorization code, or device code to a different (possibly insecure) origin. redirect: 'error', @@ -1084,8 +2147,8 @@ const postForToken = async ( const name = error instanceof Error ? error.name : ''; throw new Error( name === 'TimeoutError' || name === 'AbortError' - ? 'The token endpoint did not answer within ' + String(timeoutMs / 1000) + ' seconds.' - : 'Could not reach the token endpoint.', + ? 'The ' + label + ' did not answer within ' + String(timeoutMs / 1000) + ' seconds.' + : 'Could not reach the ' + label + '.', ); } }; @@ -1378,15 +2441,6 @@ const promptChoice = async (heading: string, choices: readonly Choice[]): Promis }); }; -/** - * Cuts a line to the terminal's width. - * - * A row that wrapped would occupy two of them, and the redraw counts rows rather than measuring - * them, so one wrapped label would put every following frame a line out of place. - */ -const clip = (text: string, width: number): string => - text.length <= width ? text : text.slice(0, Math.max(0, width - 3)) + '...'; - /** Reads one visible line from the terminal. Prompts go to stderr so stdout stays machine-readable. */ const promptLine = (label: string): Promise => new Promise((resolve, reject) => { diff --git a/src/cli/runtime.ts b/src/cli/runtime.ts index 9f35865..bf173b1 100644 --- a/src/cli/runtime.ts +++ b/src/cli/runtime.ts @@ -7,12 +7,25 @@ import as from 'ansis'; import { Command } from 'commander'; import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'; +import { listRow } from './list'; import { encodeToon } from './toon.js'; import { takeWarnings } from './credentials'; import { type CliAuthDefinition, UsageError, runLogin, runLogout, storedCredentials } from './login'; const LOGIN_COMMAND = 'dedalus login'; +// The sign-in command for the environment a request targeted. +const loginCommandFor = (environment: string | undefined): string => { + if (environment === undefined) return LOGIN_COMMAND; + const word = /^[A-Za-z0-9._-]+$/u.test(environment) ? environment : shellQuote(environment); + return LOGIN_COMMAND + ' --environment ' + word; +}; + +// Quotes one word for a POSIX shell so it reaches the command exactly as written. +// biome-ignore lint/suspicious/noControlCharactersInRegex: dropping control characters is the point. +const shellQuote = (value: string): string => + "'" + value.replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/gu, '').replace(/'/gu, "'\\''") + "'"; + type OutputFormat = 'auto' | 'json' | 'jsonl' | 'pretty' | 'raw' | 'toon' | 'yaml'; export type CliValueKind = @@ -40,6 +53,9 @@ export type CliFlagDefinition = { readonly itemKind?: CliValueKind; // Wire-property path under the parent param for dotted leaf flags (e.g. `--address.city`). readonly objectPath?: readonly string[]; + // For a positional, the `--` spelling it is also accepted under. Absent when the name is + // already taken, in which case `optionKey` belongs to whatever took it and must not be read. + readonly flagName?: string; }; export type CliCommandDefinition = { @@ -53,6 +69,13 @@ export type CliCommandDefinition = { readonly iterable: boolean; readonly callShape: 'options' | 'params' | 'body'; readonly authClientKeyRequirements: readonly (readonly string[])[]; + // Set when the groups are one per scheme because the document records no requirement: every + // credential present is sent. Absent, a credential outside the group the request picks is + // withheld where it would overwrite one inside it, or wherever it lands with `authSendsSelected`. + readonly authSendsEvery?: true; + // Set when the client sends only the alternative it selects: every credential outside the one + // picked here is withheld, wherever it lands, so the client selects the same one. + readonly authSendsSelected?: true; // Param key of a body blob that is forwarded bare or spread into params, depending on callShape. readonly bodyParamKey?: string; readonly positional: readonly CliFlagDefinition[]; @@ -72,12 +95,28 @@ export type CliClientOptionDefinition = { readonly env?: string; readonly description?: string; readonly auth: boolean; + // Where a credential lands (`header:`, `query:`, `cookie:`); credentials only. + readonly authLocation?: string; // Documented in --help only. Deliberately NOT registered as a Commander default: a default // would make the flag always look explicitly set, and the forwarded value would shadow the // environment variable the SDK reads before falling back to this same default itself. readonly defaultValue?: string; }; +export type CliEnvironment = { + readonly name: string; + readonly url: string; +}; + +// What `--environment` draws on: every configured environment plus the one a bare invocation +// targets. An empty list means neither the flag nor the `environments` command is registered. +type EnvironmentSelection = { + readonly environments: readonly CliEnvironment[]; + readonly defaultEnvironment: string | undefined; + readonly environmentEnv: string | undefined; + readonly baseUrlEnv: string | undefined; +}; + export type CreateProgramOptions = { readonly SDK: new (...args: any[]) => unknown; readonly binaryName: string; @@ -93,7 +132,23 @@ export type CreateProgramOptions = { // Completion script per shell, generated alongside the command table. Absent when the SDK // config disables shell completions, in which case no `completion` command is registered. readonly completions?: Readonly>; + // Named environments this API declares, in the order the embedded SDK resolves them. Absent + // when fewer than two are configured, in which case neither `--environment` nor the + // `environments` command is registered and the SDK's constant base URL is the only one. + readonly environments?: readonly CliEnvironment[]; + // The environment a bare invocation targets, which is also the one the embedded SDK falls back + // to. Carried rather than taken as `environments[0]` so both agree by construction. + readonly defaultEnvironment?: string; + // Environment variable that selects an environment the way the flag does, and the embedded + // SDK's own base-URL variable, which cannot be combined with it. Absent when the CLI offers no + // such variable, in which case only the flag selects an environment. + readonly environmentEnv?: string; + readonly baseUrlEnv?: string; readonly auth?: CliAuthDefinition; + // Registers `upgrade`/`uninstall`. Absent when no channel publishes a standalone executable, so + // a CLI with nothing to upgrade to registers neither. The daily update check is deliberately + // not here: it belongs to running the CLI, not to building its program (see `checkForUpdates`). + readonly addUpgradeCommands?: (program: Command, binaryName: string, version: string) => void; }; type OutputOptions = { @@ -109,6 +164,7 @@ type OutputOptions = { type GlobalOptions = { readonly baseUrl?: string; + readonly environment?: string; readonly timeout?: string; readonly maxRetries?: string; readonly format?: OutputFormat; @@ -131,8 +187,14 @@ export const createProgram = ({ commands, groups, completions, + environments = [], + defaultEnvironment, + environmentEnv, + baseUrlEnv, auth, + addUpgradeCommands, }: CreateProgramOptions): Command => { + const selection: EnvironmentSelection = { environments, defaultEnvironment, environmentEnv, baseUrlEnv }; const program = usageExitCode(new Command()); program .enablePositionalOptions() @@ -154,6 +216,14 @@ export const createProgram = ({ .option('-r, --raw-output', 'Print transformed string values without JSON quotes') .option('--debug', 'Enable SDK debug logging'); + // Registered only for an API that declares more than one environment, because that is when the + // embedded SDK accepts an `environment` option at all. No Commander default is set: the SDK + // applies its own default, and a value here would look explicitly passed and trip the + // mutual-exclusion check below against a `--base-url` the user did pass on purpose. + if (environments.length > 0) { + program.option('--environment ', environmentFlagDescription(selection)); + } + // Register configured client options (auth credentials, org headers, etc.) as global flags. // Mirrored on each subcommand below so users can supply them either before or after the verb. for (const option of clientOptions) { @@ -161,10 +231,13 @@ export const createProgram = ({ } for (const definition of commands) - addGeneratedCommand(program, SDK, clientOptions, definition, groups, auth); + addGeneratedCommand(program, SDK, clientOptions, definition, groups, selection, auth); + + if (environments.length > 0) addEnvironmentsCommand(program, selection, defaultFormat); if (completions) addCompletionCommand(program, binaryName, completions); - if (auth) addAuthCommands(program, auth); + if (auth) addAuthCommands(program, auth, selection); + if (addUpgradeCommands) addUpgradeCommands(program, binaryName, version); return program; }; @@ -225,6 +298,186 @@ const completionHelpExamples = (binaryName: string, shells: readonly string[]): return lines.length > 0 ? '\nAdd one of these to your shell startup file:\n' + lines.join('\n') : ''; }; +// Help text for `--environment`, naming the environments the embedded SDK accepts and the one it +// falls back to. +// +// Kept in step with `environmentFlagDescription` in the generator's `helpers/environments.ts`, which +// renders the same sentence into the man pages, the README, and the completion scripts. It is built +// here rather than passed in because this runtime is one fixed file for every generated CLI: only +// the data handed to `createProgram` varies. +const environmentFlagDescription = ({ + environments, + defaultEnvironment, + environmentEnv, +}: EnvironmentSelection): string => { + const names = environments.map((environment) => environmentLabel(environment.name)).join(', '); + return ( + 'Named environment to target: ' + + names + + (environmentEnv ? ' (can also be set with ' + environmentEnv + ' env var)' : '') + + (defaultEnvironment ? ' (default: ' + environmentLabel(defaultEnvironment) + ')' : '') + ); +}; + +// Reduces a configured environment name to text that is safe on one line of the help column. +// +// Commander wraps a flag description into a column, so a newline in a name would tear the option +// list apart, and a control character would be written to the terminal as an escape sequence when +// help is printed. Only the description is reduced: `--environment` still matches against the name +// itself, and the `environments` command prints it unchanged. +// biome-ignore lint/suspicious/noControlCharactersInRegex: dropping control characters is the point. +// Whitespace collapses first, so a line break becomes the space it reads as; dropping control +// characters first would swallow it and run the words either side of it together. +const environmentLabel = (name: string): string => + name + .replace(/\s+/gu, ' ') + .replace(/[\u0000-\u001F\u007F-\u009F]/gu, '') + .trim(); + +// Lists the configured environments, so what `--environment` accepts is discoverable from the CLI +// itself rather than only from its docs. +// +// It prints through the same writer every generated command uses and takes its own `--format`, so a +// script can read the URLs straight out of it (`--format json`) instead of parsing the table a human +// reads. +// +// "Default" is the environment a command without `--environment` uses, so an exported +// environment variable naming a configured one moves the mark there: every such command now goes +// to it. An unknown name leaves the configured default marked, since every other command refuses +// that value and this list is where a user looks up what it should have been. +const addEnvironmentsCommand = ( + program: Command, + { environments, defaultEnvironment, environmentEnv }: EnvironmentSelection, + defaultFormat: OutputFormat, +): void => { + // Read when the command runs, not when it is registered, like every other environment variable. + const listRows = (): { readonly name: string; readonly url: string; readonly default: boolean }[] => { + const ambient = ambientEnvironment(environmentEnv); + const effective = environments.some((environment) => environment.name === ambient) + ? ambient + : defaultEnvironment; + return environments.map((environment) => ({ + name: environment.name, + url: environment.url, + default: environment.name === effective, + })); + }; + program + .command('environments') + .description('List the named environments --environment can select') + .option('--format ', 'Output format: auto, json, jsonl, pretty, raw, toon, yaml') + .action(async (options: { readonly format?: string }) => { + // A machine format asked for by name is answered with the rows; anything else is a person + // reading, so the list is drawn the way the sign-in picker draws its own. `auto` lands here + // rather than on JSON because this command exists to be read, not parsed — a script names + // the format it wants, and `--format json` is what the README and the man page tell it to. + const rows = listRows(); + const requested = options.format ?? program.opts().format; + if (requested === undefined || requested === 'auto' || requested === 'pretty') { + writeEnvironmentList(rows); + return; + } + await writeOutput(rows, { format: normalizeFormat(requested, defaultFormat), title: 'environments' }); + }); +}; + +// Draws the environments as the list a person reads: the default marked and coloured, each URL +// dimmed behind its name, through the same renderer the sign-in picker uses for its rows. +// +// Escapes only when stdout is a terminal, so a redirected list is the same text without them — +// and the names are printed as configured, since this is the one place they are the value to type +// rather than prose about it. +const writeEnvironmentList = ( + rows: readonly { readonly name: string; readonly url: string; readonly default: boolean }[], +): void => { + const columns = Number(processStdout.columns) || 80; + const color = Boolean(processStdout.isTTY); + const width = Math.max(0, ...rows.map((row) => row.name.length)); + for (const row of rows) { + const label = row.name.padEnd(width, ' '); + const detail = row.url + (row.default ? ' (default)' : ''); + processStdout.write(listRow(label, detail, { columns, selected: row.default, color }) + '\n'); + } +}; + +// The environment the selecting variable names, or undefined when it is unset or not offered. +// Blank is unset, as the embedded SDK treats its own variables: an `export NAME=` left in a shell +// profile must not select an environment called "". Shared by `resolveEnvironment` and the +// `environments` list, so the two cannot disagree about which environment the variable picks. +const ambientEnvironment = (environmentEnv: string | undefined): string | undefined => + environmentEnv ? process.env[environmentEnv]?.trim() || undefined : undefined; + +// Resolves the environment a command targets: `--environment`, else the environment variable that +// stands in for it, checked against the configured list. +// +// Every failure is a usage error: no request is built for any of them, and none is one the embedded +// SDK can report in command-line terms. An unknown name reaches the client as a key it cannot index, +// leaving it with no base URL at all, and a URL paired with an environment is rejected there with a +// message naming `baseURL: null` — a library construct a command line has no spelling for, which is +// the same reason `buildClient` restates the credential guard. +// +// `login` and `logout` resolve through here too, because the environment decides which stored +// credential a request carries: the two must agree on it or a sign-in lands where no request looks. +const resolveEnvironment = ( + options: GlobalOptions, + command: Command, + { environments, environmentEnv, baseUrlEnv }: EnvironmentSelection, +): string | undefined => { + // Answered before the option bag is read at all: with no environments configured the CLI never + // registers `--environment`, so an `environment` key here belongs to something else — a client + // option of that name, whose value would otherwise be rejected as an environment (and, for a + // credential, echoed into the error). + if (environments.length === 0) return undefined; + const flagged = options.environment; + // A URL typed on this command line outranks an environment exported for the whole shell, the + // precedence every other option follows — so the variable is not even read, and a stale value in + // it cannot fail a command that named its URL. Trimmed, as the request path trims it: a blank + // `--base-url` is no flag at all, so it cannot outrank anything. + if (flagged === undefined && options.baseUrl?.trim()) return undefined; + const ambient = ambientEnvironment(environmentEnv); + const selected = flagged ?? ambient; + if (selected === undefined) return undefined; + const names = environments.map((environment) => environment.name); + if (!names.includes(selected)) { + command.error( + "error: unknown environment '" + + environmentLabel(selected) + + "'" + + (flagged === undefined ? ' in ' + environmentEnv : '') + + '. Available environments: ' + + names.map(environmentLabel).join(', '), + { exitCode: 2 }, + ); + } + if (flagged !== undefined) { + // Each names a base URL on its own, so honoring either would silently discard the other. + // Trimmed like every other reading of the flag: a blank `--base-url` names no URL, so it + // conflicts with nothing, and the variable form below already treats it that way. + if (options.baseUrl?.trim()) { + command.error( + 'error: --environment cannot be combined with --base-url, which already names the URL to call', + { exitCode: 2 }, + ); + } + return selected; + } + // Two exported variables, each naming where requests go, with nothing to say which was meant. + // The embedded SDK refuses a base URL beside an environment for the same reason, so this is not + // settled by picking one: a production URL exported last week must not quietly beat a staging + // environment exported today, or the other way round. + if (baseUrlEnv && process.env[baseUrlEnv]?.trim()) { + command.error( + 'error: ' + + environmentEnv + + ' and ' + + baseUrlEnv + + ' are both set, and each names where requests go. Unset one, or pass --environment or --base-url to choose.', + { exitCode: 2 }, + ); + } + return selected; +}; + // `login`/`logout` sit at the top level unless the API already claims one of those names, in // which case they fall back under an `auth` parent. That parent is created here rather than // from the command table, so it needs its own description or `--help` lists a bare `auth`, @@ -235,7 +488,11 @@ const authGroups = (auth: CliAuthDefinition): readonly CliCommandGroup[] => [ { commandPath: auth.logoutPath.slice(0, -1), description: 'Sign in and out' }, ]; -const addAuthCommands = (program: Command, auth: CliAuthDefinition): void => { +const addAuthCommands = ( + program: Command, + auth: CliAuthDefinition, + selection: EnvironmentSelection, +): void => { const flows = auth.methods.map((method) => method.name).join(', '); const login = usageExitCode(new Command(auth.loginPath.at(-1) ?? 'login')) .description('Sign in and save credentials for later commands') @@ -244,25 +501,58 @@ const addAuthCommands = (program: Command, auth: CliAuthDefinition): void => { .option('--flow ', 'Sign-in flow to use: ' + flows) .addHelpText('after', authFlowHelp(auth)) .action(async (_options: unknown, command: Command) => { - const options = command.optsWithGlobals<{ baseUrl?: string; flow?: string }>(); - await runAuthCommand(() => runLogin(auth, resolvedBaseUrl(auth, options.baseUrl), options.flow)); + const options = command.optsWithGlobals(); + const environment = resolveEnvironment(options, command, selection); + await runAuthCommand(() => + runLogin( + auth, + credentialBaseUrl(auth, options.baseUrl, environment), + options.flow, + loginCommandFor(environment), + ), + ); }); + addEnvironmentOption(login, selection); ensureCommandPath(program, auth.loginPath.slice(0, -1), authGroups(auth)).addCommand(login); const logout = usageExitCode(new Command(auth.logoutPath.at(-1) ?? 'logout')) - .description('Forget saved credentials') + .description('Forget saved credentials, and revoke them if the provider supports it') .showHelpAfterError() - .option('--base-url ', 'Forget the credentials saved for this base URL') + .option('--base-url ', 'Forget the credentials saved for this base URL (not with --all)') .option('--all', 'Forget every saved credential, for every base URL') .action(async (_options: unknown, command: Command) => { - const options = command.optsWithGlobals<{ baseUrl?: string; all?: boolean }>(); + const options = command.optsWithGlobals(); + if (options.all === true) { + if (options.baseUrl?.trim()) { + command.error( + 'error: --base-url cannot be combined with --all, which forgets the credentials of every base URL', + { exitCode: 2 }, + ); + } + if (selection.environments.length > 0 && options.environment !== undefined) { + command.error( + 'error: --environment cannot be combined with --all, which forgets the credentials of every environment', + { exitCode: 2 }, + ); + } + await runAuthCommand(() => runLogout(auth, '', true)); + return; + } + const environment = resolveEnvironment(options, command, selection); await runAuthCommand(() => - runLogout(auth, resolvedBaseUrl(auth, options.baseUrl), options.all === true), + runLogout(auth, credentialBaseUrl(auth, options.baseUrl, environment), false), ); }); + addEnvironmentOption(logout, selection); ensureCommandPath(program, auth.logoutPath.slice(0, -1), authGroups(auth)).addCommand(logout); }; +// Lets `login` and `logout` take `--environment` after the verb, as every request command does. +const addEnvironmentOption = (command: Command, selection: EnvironmentSelection): void => { + if (selection.environments.length > 0) + command.option('--environment ', environmentFlagDescription(selection)); +}; + const runAuthCommand = async (run: () => string | Promise): Promise => { try { processStdout.write((await run()) + '\n'); @@ -274,8 +564,17 @@ const runAuthCommand = async (run: () => string | Promise): Promise - flag?.trim() || process.env[auth.baseUrlEnv]?.trim() || auth.defaultBaseUrl; +// The base URL a stored credential is filed under for this invocation. One resolver for `login`, +// `logout` and the request path, so a sign-in lands exactly where a later request looks. +const credentialBaseUrl = ( + auth: CliAuthDefinition, + flag: string | undefined, + environment: string | undefined, +): string => + flag?.trim() || + auth.environments?.find((entry) => entry.name === environment)?.url || + process.env[auth.baseUrlEnv]?.trim() || + auth.defaultBaseUrl; // Lists the flows by name so `--flow` can be used without first running the picker. const authFlowHelp = (auth: CliAuthDefinition): string => @@ -302,6 +601,7 @@ const buildClient = ( SDK: CreateProgramOptions['SDK'], options: Record, clientOptions: readonly CliClientOptionDefinition[], + environment: string | undefined, ): Record => { try { return new SDK(options) as Record; @@ -311,7 +611,7 @@ const buildClient = ( if (!missing) throw error; throw new Error( 'Missing credential: run `' + - LOGIN_COMMAND + + loginCommandFor(environment) + '`, pass --' + missing.name + ' ' + @@ -327,6 +627,7 @@ const addGeneratedCommand = ( clientOptions: readonly CliClientOptionDefinition[], definition: CliCommandDefinition, groups: readonly CliCommandGroup[] | undefined, + selection: EnvironmentSelection, auth: CliAuthDefinition | undefined, ): void => { const parent = ensureCommandPath(program, definition.commandPath.slice(0, -1), groups); @@ -344,6 +645,13 @@ const addGeneratedCommand = ( .option('-r, --raw-output', 'Print transformed string values without JSON quotes') .option('--debug', 'Enable SDK debug logging'); + // Mirrored on the subcommand for the same reason the client options below are: so it can be + // passed before or after the verb. Registered only when the API declares more than one + // environment, matching the program-level registration. + if (selection.environments.length > 0) { + command.option('--environment ', environmentFlagDescription(selection)); + } + // Mirror configured client-option flags on the subcommand so they can appear before or after the verb. for (const option of clientOptions) { command.option('--' + option.name + ' ', clientOptionDescription(option)); @@ -385,24 +693,21 @@ const addGeneratedCommand = ( command.option('--' + flag.name + value, flag.description ?? ''); } - // Flag spelling for path params (`--id wkr_1`); skipped when the name is already taken by a - // client option or generated flag so Commander does not throw on a duplicate registration. - // - // `help` is skipped on top of that scan rather than through it: Commander keeps its built-in - // help option in `_helpOption`, not in `command.options`, so the scan cannot see it and - // `--help ` would register over it — leaving ` --help` to fail with "argument - // missing" instead of printing help. The param is still accepted positionally. + // Flag spelling for path params (`--id wkr_1`). `flagName` is absent when the name is already + // taken — by a global flag, a client option, a generated flag, or Commander's own `--help`, which + // lives in `_helpOption` where no scan of `command.options` could see it — and the param is then + // accepted positionally only. The decision is made once, by the emitter, so the man pages and the + // completion scripts advertise exactly the spellings registered here. for (const positional of definition.positional) { - if (positional.name === 'help') continue; - if (command.options.some((option) => option.long === '--' + positional.name)) continue; - command.option('--' + positional.name + ' ', positional.description ?? ''); + if (!positional.flagName) continue; + command.option('--' + positional.flagName + ' ', positional.description ?? ''); } command.action(async (...args: unknown[]) => { const command = args.at(-1); if (!(command instanceof Command)) throw new Error('Expected Commander command context'); const positionalValues = args.slice(0, -1); - await runGeneratedCommand(SDK, clientOptions, definition, command, positionalValues, auth); + await runGeneratedCommand(SDK, clientOptions, definition, command, positionalValues, selection, auth); }); parent.addCommand(command); @@ -451,10 +756,15 @@ const runGeneratedCommand = async ( definition: CliCommandDefinition, command: Command, positionalValues: readonly unknown[], + selection: EnvironmentSelection, auth: CliAuthDefinition | undefined, ): Promise => { const rootOptions = command.optsWithGlobals(); const commandOptions = command.opts(); + // Resolved before the request is set up, not inside the try below: a rejected `--environment` + // is a usage error reported by Commander, and running it through the catch that classifies API + // failures would re-report it as one. + const environment = resolveEnvironment(rootOptions, command, selection); const maxItems = definition.iterable ? normalizeMaxItems(commandOptions.maxItems) : undefined; const outputOptions: OutputOptions = { format: normalizeFormat(commandOptions.format ?? rootOptions.format, 'auto'), @@ -476,8 +786,9 @@ const runGeneratedCommand = async ( try { const client = buildClient( SDK, - await sdkClientOptions(rootOptions, command, clientOptions, definition, auth), + await sdkClientOptions(rootOptions, command, clientOptions, definition, environment, auth), clientOptions, + environment, ); const method = sdkMethod(client, definition); const call = await callArguments(definition, command.opts>(), positionalValues); @@ -510,7 +821,7 @@ const runGeneratedCommand = async ( await writeOutput(resolved, outputOptions); } catch (error) { - await writeError(error, errorOptions, clientOptions, SDK); + await writeError(error, errorOptions, clientOptions, SDK, environment); process.exitCode = errorExitCode(error, SDK); } }; @@ -520,6 +831,7 @@ const sdkClientOptions = async ( command: Command, clientOptions: readonly CliClientOptionDefinition[], definition: CliCommandDefinition, + environment: string | undefined, auth: CliAuthDefinition | undefined, ): Promise> => { // Forward configured client-option flags (auth keys, org headers, etc.) to the embedded SDK @@ -537,15 +849,19 @@ const sdkClientOptions = async ( // structured decoding below it: an SDK client option is always a scalar. forwarded[option.sdkKey] = typeof value === 'string' ? clientOptionValue(value, option) : value; } + const typed = new Set(Object.keys(forwarded)); await applyStoredCredentials( forwarded, clientOptions, definition.authClientKeyRequirements, auth, options.baseUrl, + environment, ); + withholdOtherCredentials(forwarded, typed, clientOptions, definition); return { ...(options.baseUrl?.trim() ? { baseURL: options.baseUrl.trim() } : {}), + ...(environment !== undefined ? { environment, baseURL: null } : {}), ...(options.timeout ? { timeout: Number(options.timeout) } : {}), ...(options.maxRetries ? { maxRetries: Number(options.maxRetries) } : {}), ...(options.debug ? { logLevel: 'debug' } : {}), @@ -564,11 +880,12 @@ const applyStoredCredentials = async ( authClientKeyRequirements: readonly (readonly string[])[], auth: CliAuthDefinition | undefined, baseUrl: string | undefined, + environment: string | undefined, ): Promise => { if (!auth) return; if (authClientKeyRequirements.length === 0) return; const hasExplicitValue = (option: CliClientOptionDefinition): boolean => - forwarded[option.sdkKey] !== undefined || Boolean(option.env && (process.env[option.env] ?? '').trim()); + suppliedByCaller(forwarded, option); const explicit = authClientKeyRequirements.find((keys) => keys.every((key) => { const option = clientOptions.find((candidate) => candidate.clientKey === key); @@ -576,7 +893,7 @@ const applyStoredCredentials = async ( }), ); if (explicit) return; - const stored = await storedCredentials(auth, resolvedBaseUrl(auth, baseUrl)); + const stored = await storedCredentials(auth, credentialBaseUrl(auth, baseUrl, environment)); const isSatisfiable = (keys: readonly string[]): boolean => keys.every((key) => { const option = clientOptions.find((candidate) => candidate.clientKey === key); @@ -597,6 +914,45 @@ const applyStoredCredentials = async ( } }; +// Whether a flag (already forwarded) or a non-blank environment variable supplies this option. +const suppliedByCaller = (forwarded: Record, option: CliClientOptionDefinition): boolean => + forwarded[option.sdkKey] !== undefined || Boolean(option.env && (process.env[option.env] ?? '').trim()); + +// Withholds the credentials outside the security alternative this request satisfies: those that would +// overwrite one inside it, or every one when the client sends only the alternative it selects. +const withholdOtherCredentials = ( + forwarded: Record, + typed: ReadonlySet, + clientOptions: readonly CliClientOptionDefinition[], + definition: CliCommandDefinition, +): void => { + if (definition.authSendsEvery) return; + if (definition.transport === 'websocket') return; + const supplied = (key: string): boolean => { + const option = clientOptions.find((candidate) => candidate.clientKey === key); + return option !== undefined && suppliedByCaller(forwarded, option); + }; + const fromFlags = (key: string): boolean => { + const option = clientOptions.find((candidate) => candidate.clientKey === key); + return option !== undefined && typed.has(option.sdkKey); + }; + const selected = + definition.authClientKeyRequirements.find((keys) => keys.every(fromFlags)) ?? + definition.authClientKeyRequirements.find((keys) => keys.every(supplied) && keys.some(fromFlags)) ?? + definition.authClientKeyRequirements.find((keys) => keys.every(supplied)); + if (!selected) return; + const taken = new Set( + clientOptions.flatMap((option) => + selected.includes(option.clientKey) && option.authLocation ? [option.authLocation] : [], + ), + ); + for (const option of clientOptions) { + if (!option.auth || selected.includes(option.clientKey)) continue; + if (definition.authSendsSelected || (option.authLocation && taken.has(option.authLocation))) + forwarded[option.sdkKey] = null; + } +}; + const sdkMethod = ( client: Record, definition: CliCommandDefinition, @@ -622,7 +978,11 @@ const callArguments = async ( ): Promise<{ readonly args: readonly unknown[]; readonly params: Record }> => { const positionalParams: Record = {}; definition.positional.forEach((param, index) => { - const value = positionalValues[index] ?? options[param.optionKey]; + // `optionKey` is only this positional's when it was given a flag spelling. Without one the key + // belongs to whatever took the name — a `--environment` selector, say — and reading it would + // fill the path param with that flag's value and satisfy the required-argument check below. + const value = + positionalValues[index] ?? (param.flagName === undefined ? undefined : options[param.optionKey]); if (value !== undefined) positionalParams[param.paramKey] = coerceValue(value, param.valueKind, undefined, param.name); }); @@ -993,7 +1353,8 @@ const coerceValue = ( // marker honest about what follows, and leaves every other format untouched. const streamItemText = (value: unknown, options: OutputOptions): string => { if (options.format !== 'toon') return serializeOutput(value, options); - if (options.rawOutput && typeof value === 'string') return value; + if (options.rawOutput && typeof value === 'string') + return processStdout.isTTY ? stripControls(value) : value; return serializeOutput([value], options); }; @@ -1116,20 +1477,48 @@ const collectIterable = async (value: AsyncIterable, maxItems?: number) }; // `auto` renders like `json` (2-space pretty-printed): `pretty` is reserved for the distinct -// human-readable card view, matching warp-style CLI defaults. +// human-readable card view, matching common CLI defaults. const serializeOutput = (value: unknown, options: OutputOptions): string => { const normalized = options.format === 'auto' ? 'json' : options.format; - if (options.rawOutput && typeof value === 'string') return value; + const tty = Boolean(processStdout.isTTY); + if (options.rawOutput && typeof value === 'string') return tty ? stripControls(value) : value; const safeValue = value === undefined ? null : value; - if (normalized === 'raw') return typeof safeValue === 'string' ? safeValue : JSON.stringify(safeValue); - if (normalized === 'yaml') return stringifyYaml(JSON.parse(JSON.stringify(safeValue))).trimEnd(); - if (normalized === 'jsonl') return JSON.stringify(safeValue); + if (normalized === 'raw' && typeof safeValue === 'string') + return tty ? stripControls(safeValue) : safeValue; if (normalized === 'pretty') return prettyCard(safeValue, options); + const text = serializeData(safeValue, normalized); + return tty ? escapeControls(text) : text; +}; + +/** The machine-readable formats, which a pipe receives byte for byte. */ +const serializeData = (value: unknown, format: OutputFormat): string => { + if (format === 'raw' || format === 'jsonl') return JSON.stringify(value); + if (format === 'yaml') return stringifyYaml(JSON.parse(JSON.stringify(value))).trimEnd(); // TOON keeps the JSON data model but drops repeated syntax, so a list response costs an agent // markedly fewer context tokens than the same data as JSON. - if (normalized === 'toon') return encodeToon(JSON.parse(JSON.stringify(safeValue))); - return JSON.stringify(safeValue, null, 2); -}; + if (format === 'toon') return encodeToon(JSON.parse(JSON.stringify(value))); + return JSON.stringify(value, null, 2); +}; + +// Server-supplied text reaching a terminal can carry commands: ESC and U+009B (a one-character +// CSI) start sequences that recolour, move the cursor, retitle the window or overwrite earlier +// output. `JSON.stringify` escapes C0 but passes C1 and DEL through, and YAML quotes but keeps +// them, so text bound for a terminal is cleaned here. Tab, newline and a CRLF line ending are +// layout, not commands; a lone CR is not, since it returns the cursor to overwrite the line. +// A pipe or file still gets the exact bytes, which is what a script reading the output needs; only +// the `pretty` card, laid out for a person, is cleaned wherever it goes. +// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the point. +const TERMINAL_CONTROLS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]|\r(?!\n)/gu; + +/** Replaces every terminal control character in free text, for output a person reads. */ +const stripControls = (text: string): string => text.replace(TERMINAL_CONTROLS, '\ufffd'); + +/** + * Writes every control character a serializer left raw as a `\uXXXX` escape. In JSON and YAML + * they can only sit inside quoted strings, where that escape is valid syntax for the same text. + */ +const escapeControls = (text: string): string => + text.replace(TERMINAL_CONTROLS, (char) => '\\u' + char.charCodeAt(0).toString(16).padStart(4, '0')); // Human-readable `pretty` view: a bordered key/value card titled with the command path, // rendering booleans as yes/no and array entries as numbered items. @@ -1156,41 +1545,51 @@ const prettyLines = (value: unknown, indent: string): string[] => { if (value && typeof value === 'object') { return Object.entries(value as Record).flatMap(([key, entry]) => { if (entry && typeof entry === 'object') - return [indent + key + ':', ...prettyLines(entry, indent + ' ')]; - return [indent + key + ': ' + prettyScalar(entry)]; + return [indent + cardText(key) + ':', ...prettyLines(entry, indent + ' ')]; + return [indent + cardText(key) + ': ' + prettyScalar(entry)]; }); } return [indent + prettyScalar(value)]; }; +// The card is laid out line by line, so a value or key keeps no control character at all: a +// newline would break the frame as surely as an escape sequence would rewrite it. const prettyScalar = (value: unknown): string => { if (value === true) return 'yes'; if (value === false) return 'no'; if (value === null || value === undefined) return ''; - return String(value); + return cardText(String(value)); }; +/** Text for one line of the pretty card: every control character, tab and newline included, removed. */ +const cardText = (text: string): string => stripControls(text).replace(/\r?\n|\t/gu, ' '); + const writeError = async ( error: unknown, options: OutputOptions, clientOptions: readonly CliClientOptionDefinition[], SDK: CreateProgramOptions['SDK'], + environment: string | undefined, ): Promise => { - const body = transformValue(errorBody(error, clientOptions, SDK), options.transform); + const body = transformValue(errorBody(error, clientOptions, SDK, environment), options.transform); + // An error body is the server's text too, so a terminal gets it cleaned like any other output. + const tty = Boolean(process.stderr.isTTY); if (options.rawOutput && typeof body === 'string') { - process.stderr.write(body + '\n'); + process.stderr.write((tty ? stripControls(body) : body) + '\n'); return; } if (options.format === 'raw') { // The hint is appended rather than dropped: before failures were classified, the auth hint // *was* the message, so printing the message alone would lose advice `raw` used to show. const hint = errorHintText(body); - process.stderr.write(String(errorMessage(body)) + (hint ? ' ' + hint : '') + '\n'); + const message = String(errorMessage(body)) + (hint ? ' ' + hint : ''); + process.stderr.write((tty ? stripControls(message) : message) + '\n'); return; } const output = options.format === 'auto' ? 'pretty' : options.format; const safeBody = body === undefined ? null : body; - const serialized = serializeErrorBody(safeBody, output); + const raw = serializeErrorBody(safeBody, output); + const serialized = tty ? escapeControls(raw) : raw; process.stderr.write((output === 'pretty' ? as.red(serialized) : serialized) + '\n'); }; @@ -1214,10 +1613,11 @@ const errorBody = ( error: unknown, clientOptions: readonly CliClientOptionDefinition[], SDK: CreateProgramOptions['SDK'], + environment: string | undefined, ): Record => { if (error && typeof error === 'object') { const record = error as Record; - const hint = errorHint(record, clientOptions); + const hint = errorHint(record, clientOptions, environment); return { name: record.name, // Stable class identifier so a caller can branch on the kind of failure without parsing prose. @@ -1295,9 +1695,10 @@ const errorExitCode = (error: unknown, SDK: CreateProgramOptions['SDK']): number const errorHint = ( error: Record, clientOptions: readonly CliClientOptionDefinition[], + environment: string | undefined, ): string | undefined => { const status = error.status; - if (status === 401) return authHint(clientOptions); + if (status === 401) return authHint(clientOptions, environment); // 403 is a permission failure, not a credential one: the request authenticated fine, so // telling the caller to set the auth env var would send it round the same loop again. if (status === 403) return 'Access denied. The credential is valid but lacks permission for this resource.'; @@ -1308,7 +1709,10 @@ const errorHint = ( // Undefined when the SDK declares no authentication: there would be no variable to name, and a // generic "set the required environment variable" would point at something that does not exist. -const authHint = (clientOptions: readonly CliClientOptionDefinition[]): string | undefined => { +const authHint = ( + clientOptions: readonly CliClientOptionDefinition[], + environment: string | undefined, +): string | undefined => { const authOptions = clientOptions.filter((option) => option.auth); if (authOptions.length === 0) return undefined; const env = authOptions @@ -1316,7 +1720,11 @@ const authHint = (clientOptions: readonly CliClientOptionDefinition[]): string | .filter((value): value is string => !!value) .join(', '); return ( - 'Authentication failed. Run `' + LOGIN_COMMAND + '`' + (env ? ', or set ' + env : '') + ', and try again.' + 'Authentication failed. Run `' + + loginCommandFor(environment) + + '`' + + (env ? ', or set ' + env : '') + + ', and try again.' ); }; diff --git a/src/cli/upgrade.ts b/src/cli/upgrade.ts new file mode 100644 index 0000000..3eca116 --- /dev/null +++ b/src/cli/upgrade.ts @@ -0,0 +1,1353 @@ +// Generated by the Scalar SDK Generator. Edits here are overwritten on the next generation. +import { type SpawnSyncOptions, type SpawnSyncReturns, execFileSync, spawnSync } from 'node:child_process'; +import { createHash } from 'node:crypto'; +import { + accessSync, + chmodSync, + constants, + existsSync, + lstatSync, + mkdirSync, + mkdtempSync, + readFileSync, + realpathSync, + renameSync, + rmSync, + writeFileSync, +} from 'node:fs'; +import { tmpdir } from 'node:os'; +import { basename, dirname, isAbsolute, join } from 'node:path'; + +import type { Command } from 'commander'; + +/** + * Release coordinates and the per-manager upgrade commands, fixed at generation time. + * + * Injected as one JSON literal rather than field-by-field interpolation: `JSON.stringify` is the + * escaper, so a repository or package name carrying a quote or a backslash cannot terminate a + * string literal in this file. Absent entries mean the config does not publish that channel. + */ +const RELEASE = { + repo: 'dedalus-labs/dedalus-cli', + npmPackage: 'dedalus-cli', + brewFormula: 'dedalus', + windowsArchive: true, +} as { + readonly repo: string; + readonly npmPackage?: string; + readonly brewFormula?: string; + readonly windowsArchive?: boolean; +}; + +/** + * Whether this CLI registers `login`/`logout`, fixed at generation time. `uninstall` names `logout` as + * the way to clear a stored credential, and a CLI with no sign-in has neither the command nor the + * credential to clear. + */ +const HAS_LOGIN: boolean = true; + +/** + * Whether the release ships `install.sh`, fixed at generation time. That script can append a PATH line + * to a shell startup file, which `uninstall` then names as something removing the executable leaves. + */ +const HAS_INSTALL_SCRIPT: boolean = true; + +/** How this executable got onto the machine, which decides whether upgrading is ours to do. */ +type InstallKind = + | { readonly kind: 'self-managed'; readonly path: string } + | { + readonly kind: 'managed'; + readonly manager: string; + /** The manager's upgrade command as the user would type it, printed before it runs. */ + readonly upgrade: string; + readonly remove: string; + /** + * The same command as a program and arguments, which `upgrade` runs on the user's behalf. + * + * Absent where there is nothing safe to run: a distro package this cannot name, a Windows + * download, a checkout, an `npx` cache. `upgrade` then prints `upgrade` and stops, which is the + * most it can honestly do for an install it did not make and cannot drive. + */ + readonly run?: ManagerCommand; + }; + +/** + * A package manager invocation. Spawned with no shell on macOS and Linux; on Windows it has to go + * through `cmd.exe`, which {@link spawnManager} accounts for. + */ +type ManagerCommand = { + readonly program: string; + readonly args: readonly string[]; + /** + * Set for an npm install, which may be a project's dependency rather than a global install: npm + * links both the same way, and `npm install -g` on a project dependency would install a second copy + * that the project never uses. Checked only when `upgrade` runs, since it costs a subprocess. + */ + readonly npmGlobal?: { readonly script: string; readonly pkg: string }; + /** Run first, whatever it exits with, for a manager that upgrades from a local copy of its index. */ + readonly refresh?: readonly string[]; + /** Prints ` ...`, so `upgrade` can tell an upgrade from a manager that did nothing. */ + readonly installedVersions?: readonly string[]; +}; + +/** + * npm's package-name charset. The name reaches a spawned argument list, and on Windows that list goes + * through `cmd.exe` (a `.cmd` shim cannot be spawned without a shell), so a name outside the charset + * is never run. It is fixed at generation time, so this only ever rejects a config npm itself rejects. + */ +const NPM_PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/u; + +/** Resolves symlinks, falling back to the path itself when it cannot be read, with `/` separators. */ +const resolvedPath = (path: string): string => { + let resolved = path; + try { + resolved = realpathSync(path); + } catch { + // An unreadable link target is not a reason to refuse; the unresolved path still classifies, and a + // replacement that cannot write it fails later with a real permission error. + } + return resolved.replace(/\\/gu, '/'); +}; + +/** + * Classifies the running executable's install method from its resolved path. + * + * There is deliberately no install receipt to read. A receipt written by one channel would be absent + * for every other, so the path still has to be classified — and a receipt that drifted from reality + * (a binary moved, or a package manager adopting the path) would be believed over the filesystem. + * + * Symlinks are resolved first because that is what distinguishes the cases: Homebrew links + * `/usr/local/bin/` into its Cellar, so only the real path shows which manager owns the file. + */ +const detectInstall = (binaryName: string): InstallKind => { + const executable = process.execPath; + // A compiled standalone executable *is* the command; running under `node`/`bun` instead means this + // is the npm package (or a checkout of it), and the script's own path says which manager owns it. + if (!runsCompiled(executable, binaryName)) return detectPackageInstall(); + + const path = resolvedPath(executable); + + // `Caskroom` as well as `Cellar`, and that is not redundant with the `homebrew`/`linuxbrew` segments + // beside it: on an **Intel** Mac Homebrew's prefix is `/usr/local`, so a cask stages its executable + // at `/usr/local/Caskroom///` — a path carrying none of the other three. Without + // this, such an install classified as self-managed and `upgrade` renamed a downloaded binary over the + // file inside the Caskroom, which is admin-owned on Intel Homebrew and so writable without `sudo`. + // Brew went on recording the old version and reverted the binary on the next `brew upgrade`. Apple + // Silicon and Linux casks were caught only because `/opt/homebrew` and `/home/linuxbrew` happen to + // contain a matching segment. + if (/\/(Cellar|Caskroom|homebrew|linuxbrew)\//u.test(path) && RELEASE.brewFormula) { + // A cask is upgraded and removed through `--cask`. The token is the formula's own lowercased name, + // which is what the generated cask is declared under, so one value serves both spellings. + const cask = /\/Caskroom\//u.test(path); + const kind = cask ? ['--cask'] : []; + const args = ['upgrade', ...kind, RELEASE.brewFormula]; + const brew = brewProgram(path); + return { + kind: 'managed', + manager: 'Homebrew', + // `brew update` first because `brew upgrade` reads the local clone of the tap, which Homebrew + // refreshes at most once a day: without it a release this command has just announced is not + // there yet, and `brew upgrade` reports the old version as up to date and exits 0. + upgrade: `brew update && brew ${args.join(' ')}`, + remove: `brew uninstall ${cask ? '--cask ' : ''}${RELEASE.brewFormula}`, + ...(brew + ? { + run: { + program: brew, + args, + refresh: ['update'], + installedVersions: ['list', ...kind, '--versions', RELEASE.brewFormula], + }, + } + : {}), + }; + } + // `/usr/bin` is where a distro package manager installs; the documented direct download goes to + // `/usr/local/bin`, so it does not land here. + // + // Fails closed, always. Falling through to `self-managed` would overwrite a file dpkg or rpm owns — + // the manager's database still records the shipped checksum, so `dpkg -V` reports a mismatch and the + // next `apt upgrade` silently reverts the binary. Nothing this config publishes installs to + // `/usr/bin`, so a binary found there was put there by something else and is never ours to replace. + if (path.startsWith('/usr/bin/')) { + return { + kind: 'managed', + manager: "this system's package manager", + upgrade: `upgrade ${binaryName} the way it was installed; ${path} is owned by a package manager, so replacing it in place would corrupt that manager's database`, + remove: `remove ${binaryName} with the package manager that installed ${path}`, + }; + } + // Windows is never replaced in place from here. Its release asset is a `.zip` rather than the + // `.tar.gz` the replace path unpacks, and Windows refuses to overwrite a running executable at all, + // so the honest answer is to name the archive and let the user put it in place. Reported as + // `managed` because the outcome is the same: someone else does the work. + if (process.platform === 'win32') { + return RELEASE.windowsArchive + ? { + kind: 'managed', + manager: 'a direct download', + upgrade: `download the latest ${binaryName}-windows-x64.zip from https://github.com/${RELEASE.repo}/releases/latest`, + remove: `remove ${path}`, + } + : // No Windows archive is published for this config, so naming one would be a permanent 404. + // Reported rather than guessed: whatever put this executable here is what has to replace it. + { + kind: 'managed', + manager: 'however it was installed', + upgrade: `reinstall ${binaryName} the way it was installed; no Windows archive is published for it to download`, + remove: `remove ${path}`, + }; + } + return { kind: 'self-managed', path }; +}; + +/** + * Whether this process is the compiled standalone executable rather than the npm package under a + * JavaScript runtime. + * + * The executable's own name says so, unless someone renamed it (`~/bin/wdg`); then the main module + * says so, since `bun build --compile` serves it from Bun's embedded filesystem (`/$bunfs/…`, or + * `B:/~BUN/…` on Windows) and no installed package ever runs from there. + */ +const runsCompiled = (executable: string, binaryName: string): boolean => + basename(executable).replace(/\.exe$/iu, '') === binaryName || + /^(?:\/\$bunfs\/|[A-Za-z]:[\\/]~BUN[\\/])/u.test(process.argv[1] ?? ''); + +/** + * The `brew` belonging to the prefix that owns `path`, or undefined when it cannot be located. + * + * Taken from the install's own prefix rather than looked up on `PATH`: a machine can carry two + * Homebrews (an Intel `/usr/local` one beside an Apple Silicon `/opt/homebrew` one, after a migration), + * and only the one whose Cellar holds this executable can upgrade it. Nothing found means the command + * is printed rather than run. + */ +const brewProgram = (path: string): string | undefined => { + const prefix = /^(.*?)\/(?:Cellar|Caskroom)\//u.exec(path)?.[1]; + if (!prefix) return undefined; + const brew = `${prefix}/bin/brew`; + return existsSync(brew) ? brew : undefined; +}; + +/** + * Classifies the npm package, run by a JavaScript runtime rather than as a compiled executable. + * + * Which manager owns it is read off the path of the running *script*, resolved through the bin link + * every manager creates, because each one keeps its global packages in its own tree. npm's tree has + * no fixed marker — its prefix is configurable — so it is what remains once the others are ruled out, + * and whether it is global at all is settled by asking npm when `upgrade` actually runs. + */ +const detectPackageInstall = (): InstallKind => { + const script = resolvedPath(process.argv[1] ?? ''); + const pkg = RELEASE.npmPackage; + // Not inside any `node_modules`: this is a checkout being run directly, which only git can update. + if (!script.includes('/node_modules/') || !pkg) { + // Inside a `node_modules` yet not from an npm channel this config publishes: a package manager + // installed it from somewhere else, so that manager's command is the only one that can change it. + if (script.includes('/node_modules/')) { + return { + kind: 'managed', + manager: 'the package manager that installed it', + upgrade: `reinstall ${RELEASE.repo} with the package manager that installed it; no npm package is published for it`, + remove: 'remove it with the package manager that installed it', + }; + } + return { + kind: 'managed', + manager: 'this checkout', + upgrade: 'git pull && npm install', + remove: 'remove the checkout', + }; + } + // `npx`, `bunx` and `pnpm dlx` run from a cache rather than an install, and already fetch a newer + // release when asked for `@latest`; there is nothing installed to upgrade. `bunx` stages each run + // from its own cache in current releases and from `$TMPDIR/bunx--@` in older ones, + // where a scoped name nests a `/` into that directory, so both spellings are matched. pnpm keeps its + // dlx cache under `pnpm/dlx`, or `pnpm-cache/dlx` on Windows. + const runner = /\/_npx\//u.test(script) + ? 'npx' + : /\/\.bun\/install\/cache\/|\/bunx-\d+-.*?\/node_modules\//u.test(script) + ? 'bunx' + : /\/pnpm(?:-cache)?\/dlx\//iu.test(script) + ? 'pnpm dlx' + : undefined; + if (runner) { + return { + kind: 'managed', + manager: runner, + upgrade: `${runner} ${pkg}@latest`, + remove: `nothing to remove; ${runner} keeps the package only in its cache`, + }; + } + // Yarn's Plug'n'Play has no `node_modules` tree: it serves each package out of a zip, in the project's + // `.yarn/cache` or (Yarn 4's default) the global `~/.yarn/berry/cache`, and sets `process.versions.pnp`. + // Either way the package is a project dependency whose version is the project's lockfile's to set, + // and the zip's path says nothing about which project. Yarn exports the project root as `PROJECT_CWD` + // for the scripts and bins it runs, which is the best name available for it. + if (/\.zip\/node_modules\//u.test(script) || process.versions['pnp']) { + const project = process.env['PROJECT_CWD']; + return { + kind: 'managed', + manager: `Yarn Plug'n'Play${project ? ` in ${project}` : ''}`, + upgrade: `upgrade ${pkg} in the package.json that lists it, with the project's Yarn`, + remove: `remove ${pkg} from the package.json that lists it, with the project's Yarn`, + }; + } + const safe = NPM_PACKAGE_NAME.test(pkg); + const bunRoot = /^(.*)\/install\/global\/node_modules\//u.exec(script)?.[1]; + if (bunRoot) { + // Bun's own binary sits beside its global tree (`$BUN_INSTALL/bin/bun`); `bun` on PATH otherwise. + const local = join(bunRoot, 'bin', process.platform === 'win32' ? 'bun.exe' : 'bun'); + const bun = existsSync(local) ? local : 'bun'; + return managerInstall('Bun', bun, ['add', '-g', `${pkg}@latest`], `bun remove -g ${pkg}`, safe); + } + // pnpm's global tree is `/global//`, holding its `.pnpm` store or the + // `node_modules` linked from it. Matched on that layout rather than on a `pnpm` segment, because + // `PNPM_HOME` is whatever the user set (`~/.pnpm-home`, say), and nothing else nests a numbered + // directory under `global` — Bun's and Yarn's trees put `node_modules` directly beneath it. + if (/\/\.?pnpm\/global\/|\/global\/\d+\/(?:\.pnpm|node_modules)\//iu.test(script)) { + return managerInstall('pnpm', 'pnpm', ['add', '-g', `${pkg}@latest`], `pnpm remove -g ${pkg}`, safe); + } + // Yarn classic keeps its global tree under `~/.config/yarn/global` and, on Windows, + // `%LOCALAPPDATA%\Yarn\Data\global`, hence the optional segment and the case-insensitive match. + if (/\/yarn\/(?:data\/)?global\/node_modules\//iu.test(script)) { + return managerInstall( + 'Yarn', + 'yarn', + ['global', 'add', `${pkg}@latest`], + `yarn global remove ${pkg}`, + safe, + ); + } + // The npm that ships beside the running `node`, which is the one that installed into this runtime's + // global tree; `npm` on PATH only when it is not there. It is also no less trusted than the `node` + // already executing this file, which the bin link's shebang resolved the same way. + const local = join(dirname(process.execPath), process.platform === 'win32' ? 'npm.cmd' : 'npm'); + const npm = existsSync(local) ? local : 'npm'; + const install = managerInstall( + 'npm', + npm, + ['install', '-g', `${pkg}@latest`], + `npm uninstall -g ${pkg}`, + safe, + ); + return install.kind === 'managed' && install.run + ? { ...install, run: { ...install.run, npmGlobal: { script, pkg } } } + : install; +}; + +/** A managed install whose upgrade `upgrade` runs, unless the package name failed the charset check. */ +const managerInstall = ( + manager: string, + program: string, + args: readonly string[], + remove: string, + safe: boolean, +): InstallKind => ({ + kind: 'managed', + manager, + upgrade: `${basename(program).replace(/\.(cmd|exe)$/iu, '')} ${args.join(' ')}`, + remove, + ...(safe ? { run: { program, args } } : {}), +}); + +/** + * Where npm keeps global packages, or undefined when npm cannot say. + * + * Asked rather than derived, because the global prefix is user configuration (`npm config set prefix` + * is the documented fix for a root-owned one) and no path rule recovers it. + */ +const npmGlobalRoot = (program: string): string | undefined => { + const result = spawnManager(program, ['root', '-g'], { + encoding: 'utf8', + timeout: MANAGER_QUERY_TIMEOUT_MS, + }); + const root = result.status === 0 ? String(result.stdout).trim() : ''; + return root ? resolvedPath(root) : undefined; +}; + +/** How long `npm root -g` may take; it reads config and prints a path, so this is generous. */ +const MANAGER_QUERY_TIMEOUT_MS = 15_000; + +/** + * Spawns a package manager with its arguments, the one way that works on each platform. + * + * macOS and Linux get an argument list and no shell. Windows package-manager shims are `.cmd` files, + * which Node refuses to spawn without a shell, so there the command runs through `cmd.exe` as a single + * line built here: passing an argument list alongside `shell: true` is deprecated (DEP0190), and + * Node would only join it unquoted anyway. The program is always quoted, because a profile path can + * carry `&`, `(` or `^` as well as spaces; every argument is a fixed word, the charset-checked package + * name, or the formula name, so none of them needs quoting. + */ +const spawnManager = ( + program: string, + args: readonly string[], + options: SpawnSyncOptions, +): SpawnSyncReturns => { + if (process.platform !== 'win32') return spawnSync(program, [...args], options); + // A `"` cannot be escaped inside a `cmd.exe` quoted string, and no Windows path contains one, so + // refusing it costs nothing and keeps the quoting sound. + if (program.includes('"')) throw new Error(`refusing to run ${program}: its path contains a quote`); + return spawnSync([`"${program}"`, ...args].join(' '), { ...options, shell: true }); +}; + +/** + * Whether `path` lies inside `directory`. + * + * Case-insensitive on Windows, whose filesystem is, and where `realpathSync` keeps whatever case the + * path was spelled in — so `argv[1]` reached through a PATH entry typed `c:\users` and npm's own + * `C:\Users` answer would otherwise never match. + */ +const isInside = (path: string, directory: string): boolean => + process.platform === 'win32' + ? path.toLowerCase().startsWith(`${directory.toLowerCase()}/`) + : path.startsWith(`${directory}/`); + +/** + * The package manager the project at `project` uses, read off what it has on disk: pnpm's `.pnpm` + * store in the script's own path, then the lockfile, and npm when nothing else is recorded. + * + * Named rather than turned into a command. The right command depends on what this cannot see — which + * workspace member lists the CLI, and which major version of Yarn the project runs — and a command + * that is wrong for either fails or edits a `package.json` other than the one that lists it. + */ +const projectManager = (project: string, script: string): string => { + /** Whether the project root holds this file, which is how a lockfile names the manager. */ + const has = (file: string): boolean => existsSync(join(project, file)); + if (script.includes('/node_modules/.pnpm/') || has('pnpm-lock.yaml')) return 'pnpm'; + if (has('yarn.lock')) return 'Yarn'; + if (has('bun.lock') || has('bun.lockb')) return 'Bun'; + return 'npm'; +}; + +/** + * Settles what {@link detectInstall} leaves to a subprocess: whether an npm install is the global one + * this runtime's npm owns, a project's dependency, or another npm's global tree. + * + * npm links a project dependency and a global install the same way, so the path alone cannot tell + * them apart; only `npm root -g` can. Asked by `upgrade`, `upgrade --check` and `uninstall` — explicit + * commands, where one subprocess is cheap — and never by the daily notice, which only ever says to run + * `upgrade`, where this is settled before anything is done. + * + * A `package.json` beside the `node_modules` makes it a project's dependency: that project's lockfile + * decides its version, so neither a global upgrade nor a global uninstall is right for it — the global + * command would add a second copy, or remove a different one. Without one it is a global tree belonging + * to a different npm (Volta's per-package images, a second Node install): the global command is still + * right, but only *that* npm can run it, so it is printed rather than run through this one. + */ +const settledInstall = (install: InstallKind): InstallKind => { + if (install.kind !== 'managed' || !install.run?.npmGlobal) return install; + const { script, pkg } = install.run.npmGlobal; + const root = npmGlobalRoot(install.run.program); + if (!root || isInside(script, root)) return install; + const project = script.slice(0, script.indexOf('/node_modules/')); + if (existsSync(join(project, 'package.json'))) { + const manager = projectManager(project, script); + return { + kind: 'managed', + manager: `${manager}, as a dependency of the project in ${project}`, + upgrade: `upgrade ${pkg} in the package.json that lists it, with the project's ${manager}`, + remove: `remove ${pkg} from the package.json that lists it, with the project's ${manager}`, + }; + } + return { + kind: 'managed', + manager: `a different npm than the one beside this Node.js, into ${project}`, + upgrade: install.upgrade, + remove: install.remove, + }; +}; + +/** + * Runs the owning manager's upgrade, with its output on this terminal. + * + * Delegated rather than reproduced: the manager records what it installed, so only its own upgrade + * leaves that record true. A spawn that fails outright (the manager is gone from PATH) prints the + * command so the user can run it themselves. Returns whether the manager ran and succeeded. + */ +const runManagerUpgrade = ( + binaryName: string, + install: Extract, + run: ManagerCommand, +): boolean => { + process.stderr.write( + `${binaryName} was installed with ${install.manager}. Upgrading with:\n ${install.upgrade}\n\n`, + ); + // A failed refresh does not stop the upgrade: the manager has said why on this terminal, the local + // copy may already have the release, and `confirmManagerUpgrade` catches the case where it does not. + if (run.refresh) spawnManager(run.program, run.refresh, { stdio: 'inherit' }); + let result: SpawnSyncReturns; + try { + result = spawnManager(run.program, run.args, { stdio: 'inherit' }); + } catch (error) { + result = { error: error as Error } as SpawnSyncReturns; + } + // `cmd.exe` reports a program it cannot find as status 9009 rather than as a spawn error, so on + // Windows that status is the same "the manager is not installed" case. + if (result.error || (process.platform === 'win32' && result.status === 9009)) { + const reason = result.error ? result.error.message : `${basename(run.program)} was not found`; + process.stderr.write( + `error: could not run ${install.manager}: ${reason}\nRun it yourself:\n ${install.upgrade}\n`, + ); + process.exitCode = 1; + return false; + } + // The manager has already said why on this terminal. Its own status is named but not passed + // through: npm exits 243 for a permission error and anything may exit 2, which a script reading + // this command's documented statuses would take for a usage error. 1 is "the command failed". + if (result.status !== 0) { + process.stderr.write( + `error: ${install.manager} exited with ${result.status === null ? `signal ${result.signal}` : `status ${result.status}`}\n`, + ); + process.exitCode = 1; + return false; + } + return true; +}; + +/** + * Fails an upgrade that the manager reported as a success without installing anything newer. + * + * `brew upgrade` exits 0 on a formula it believes is current, so a tap behind the release looks like a + * successful upgrade to a script chaining `upgrade && …`. Refreshing first cannot rule that out: the + * refresh can fail, and a tap published through pull requests lags until the pull request merges. + * + * The release is only asked for once the version is known not to have moved, and exiting 0 stays right + * when nothing newer exists. Not being able to ask is a warning rather than a failure, because the + * manager did succeed and most such runs are simply already current. + */ +const confirmManagerUpgrade = async ( + binaryName: string, + version: string, + install: Extract, + run: ManagerCommand, + query: readonly string[], +): Promise => { + const result = spawnManager(run.program, query, { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + timeout: MANAGER_QUERY_TIMEOUT_MS, + }); + // Several versions when Homebrew kept the old keg, so any other version here means one was installed. + const installed = result.status === 0 ? String(result.stdout).trim().split(/\s+/u).slice(1) : []; + if (installed.length === 0 || installed.some((entry) => entry !== version)) return; + + let tag: string; + try { + tag = await withTimeout((signal) => latestTag(signal), UPGRADE_CHECK_TIMEOUT_MS, 'the release check'); + } catch (error) { + process.stderr.write(`warning: could not confirm the upgrade: ${(error as Error).message}\n`); + return; + } + if (!isNewerRelease(tag, version)) return; + process.stderr.write( + `error: ${install.manager} still has ${binaryName} ${version}, but ${tag} is released.\n` + + `The release may not have reached its tap yet. Try again later, or run:\n ${install.upgrade}\n`, + ); + process.exitCode = 1; +}; + +/** Maps this machine onto the release asset built for it, matching the names the release step packs. */ +const detectTarget = (): string => { + const platforms: Record = { darwin: 'darwin', linux: 'linux' }; + const architectures: Record = { x64: 'x64', arm64: 'arm64' }; + const os = platforms[process.platform]; + const arch = architectures[process.arch]; + if (!os || !arch) { + throw new Error(`no release binary is published for ${process.platform}/${process.arch}`); + } + return `${os}-${arch}`; +}; + +/** Latest published release tag, read from the GitHub API so the command can report the version. */ +const latestTag = async (signal?: AbortSignal): Promise => { + const response = await fetch(`https://api.github.com/repos/${RELEASE.repo}/releases/latest`, { + // `connection: close` because the abort below bounds the *request*, not the process. Node keeps + // a pooled keep-alive socket referenced after the response resolves, so an unawaited check still + // held the process open for seconds after the command's own work finished — the delay this is + // supposed to have no part in. Bun does not exhibit it; the npm channel runs on Node. + headers: { accept: 'application/vnd.github+json', connection: 'close' }, + ...(signal ? { signal } : {}), + }); + if (!response.ok) { + // An unauthenticated read past GitHub's per-address limit is refused with 403 or 429, not with the + // release missing. Said as such, because the status alone reads like a broken release. + if (response.status === 403 || response.status === 429) { + throw new Error( + `GitHub refused the release lookup (HTTP ${response.status}), usually the unauthenticated API rate limit for this network; try again later`, + ); + } + throw new Error(`could not read the latest release (HTTP ${response.status})`); + } + // Capped like the archive read is. A release payload is a few kilobytes of JSON, and this is the + // request the *daily notifier* makes unasked — so a redirect or captive proxy answering with an + // endless body inside the deadline would buffer it into a CLI the user only ran to do something + // else. `json()` offers no way to bound it, so the bytes are read first and parsed after. + const body = JSON.parse( + (await readCapped(response, response.url || 'the latest release', MAX_METADATA_BYTES)).toString('utf8'), + ) as { tag_name?: unknown }; + if (typeof body.tag_name !== 'string' || body.tag_name.length === 0) { + throw new Error('the latest release has no tag'); + } + // Validated here, not only where a *cached* tag is printed. This value goes straight into a download + // URL and onto the terminal, and the same reasoning applies to both paths: a git refname cannot hold + // a control character, so one that does was not written by a release — and writing it raw would let + // cursor-control sequences rewrite the surrounding lines and forge an instruction that appears to + // come from the CLI itself. Checking the cache and trusting the live response left the guard on the + // path that had already been through it and off the path the value arrives by. + if (!RELEASE_TAG.test(body.tag_name)) { + throw new Error('the latest release has an unusable tag'); + } + return body.tag_name; +}; + +/** + * Fetches one release asset, bounded by both a deadline and a size cap. + * + * Used for the archive and for `checksums.txt`, so both halves of the integrity check are bounded the + * same way — a release that answers one of them slowly cannot leave the command waiting indefinitely. + */ +const download = async (url: string): Promise => + // The *whole* read runs inside the deadline, headers and body alike. Bounding only the `fetch` call + // leaves the body unbounded: a proxy that answers 200 and then stops sending bytes resolves the + // response, the timer is cleared, and the command hangs forever on the read — the exact failure + // this exists to prevent, one step later than where it was first looked for. + withTimeout( + async (signal) => { + const response = await fetch(url, { signal }); + if (!response.ok) throw new Error(`could not download ${url} (HTTP ${response.status})`); + return readCapped(response, url); + }, + DOWNLOAD_TIMEOUT_MS, + url, + ); + +/** + * Reads a response body, refusing one larger than {@link MAX_DOWNLOAD_BYTES}. + * + * Read chunk by chunk with a running total rather than through `arrayBuffer()`: that buffers the + * whole body *before* any length can be checked, so a cap applied afterwards has already paid the + * memory it was meant to refuse. `content-length` is checked first where the server sends one, + * because that refuses the transfer before a byte of it arrives — but it is a claim, not a + * guarantee, so the running total is what actually enforces the bound. + * + * Buffered whole once read, because the checksum is over the whole archive. A compiled executable + * for one platform is tens of megabytes, so the cap is loose enough never to reject a real asset. + */ +const readCapped = async (response: Response, url: string, limit = MAX_DOWNLOAD_BYTES): Promise => { + // Reported in megabytes against whichever limit is in force, since both are whole megabytes. A unit + // switch would be dead code today; add one here if a sub-megabyte cap is ever introduced. + /** The refusal, named once because the declared length and the running total both raise it. */ + const tooLarge = (): Error => + new Error(`${url} is larger than the ${Math.round(limit / 1_000_000)}MB limit`); + + const declared = Number(response.headers.get('content-length') ?? ''); + if (Number.isFinite(declared) && declared > limit) throw tooLarge(); + + // No body to stream (a HEAD-like response, or a stub in a test) leaves `arrayBuffer` as the only + // reader; it is bounded by the same cap on the way out. + if (!response.body) { + const whole = Buffer.from(await response.arrayBuffer()); + if (whole.byteLength > limit) throw tooLarge(); + return whole; + } + + const chunks: Buffer[] = []; + let total = 0; + const reader = response.body.getReader(); + for (;;) { + const { done, value } = await reader.read(); + if (done) break; + total += value.byteLength; + if (total > limit) { + // Released so the connection is torn down rather than left draining in the background. + await reader.cancel().catch(() => {}); + throw tooLarge(); + } + chunks.push(Buffer.from(value)); + } + return Buffer.concat(chunks); +}; + +/** Upper bound on a release asset, so a wrong URL cannot buffer an unbounded body into memory. */ +const MAX_DOWNLOAD_BYTES = 250_000_000; + +/** + * Upper bound on an API read, which is the release JSON and nothing else. + * + * Far tighter than the asset cap because the shape is known: a `releases/latest` payload is a few + * kilobytes, and generous room for release notes still leaves this three orders of magnitude below + * the archive bound. This is the request the daily check makes without being asked, so it is the one + * that most needs a bound the user never has to think about. + */ +const MAX_METADATA_BYTES = 2_000_000; + +/** How long the downloaded executable may take to answer `--version` before it counts as broken. */ +const VERSION_PROBE_TIMEOUT_MS = 15_000; + +/** Long enough for a large archive on a slow connection, short enough to fail rather than hang. */ +const DOWNLOAD_TIMEOUT_MS = 120_000; + +/** How long `upgrade` waits on the release API before giving up; it is interactive, so it is short. */ +const UPGRADE_CHECK_TIMEOUT_MS = 10_000; + +/** + * Runs one request under a deadline, so a stalled connection fails instead of hanging. + * + * `fetch` has no default timeout, and a captive portal or a stalled proxy completes the handshake + * and then never answers — which left `upgrade` sitting with nothing on screen, indefinitely, while + * the daily notifier on the same machine aborted after two seconds. `.agents/security.md` asks for + * every request a generated runtime makes to be bounded. + */ +const withTimeout = async ( + run: (signal: AbortSignal) => Promise, + ms: number, + what: string, +): Promise => { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), ms); + try { + return await run(controller.signal); + } catch (error) { + // `AbortError` names the signal, not the cause, so it is reported as what the user experienced. + if (controller.signal.aborted) throw new Error(`${what} timed out after ${Math.round(ms / 1000)}s`); + throw error; + } finally { + clearTimeout(timer); + } +}; + +/** + * Replaces this executable with the one from `tag`, verified against the release's checksums. + * + * The integrity check the release's own `checksums.txt` exists for, with bounds on both reads: the archive and + * the checksum file come from one release, so this catches a corrupted or truncated download rather + * than a compromised release. + */ +const replaceExecutable = async (executable: string, tag: string, binaryName: string): Promise => { + const asset = `${binaryName}-${detectTarget()}.tar.gz`; + const base = `https://github.com/${RELEASE.repo}/releases/download/${tag}`; + + const archive = await download(`${base}/${asset}`); + const checksums = (await download(`${base}/checksums.txt`)).toString('utf8'); + // Same two-field `sha256sum` format the release publishes: " ". + const expected = checksums + .split('\n') + .map((line) => line.trim().split(/\s+/u)) + .find((fields) => fields[1] === asset)?.[0]; + if (!expected) throw new Error(`the release publishes no checksum for ${asset}`); + const actual = createHash('sha256').update(archive).digest('hex'); + if (actual !== expected.toLowerCase()) { + throw new Error(`checksum mismatch for ${asset} (expected ${expected}, got ${actual})`); + } + + const staging = mkdtempSync(join(tmpdir(), `${binaryName}-upgrade-`)); + // Written beside the target rather than in the temp dir, so the final rename is within one + // filesystem and therefore atomic — a cross-device rename would fall back to a copy that can be + // interrupted halfway, leaving a truncated executable on the user's PATH. + const pending = join(dirname(executable), `.${binaryName}.upgrade`); + try { + const archivePath = join(staging, asset); + writeFileSync(archivePath, archive); + // `tar` is present on every platform this upgrades on (macOS and Linux); Windows self-upgrades + // are unreachable because its asset is a `.zip` no release publishes a `.tar.gz` for. + // + // The child's PATH is pinned, and resolving `tar` absolutely is not enough on its own: GNU tar + // implements `-z` by *running* `gzip`, looked up through the inherited PATH (verified against GNU + // tar 1.35). Under `sudo` on a system whose sudoers has no `secure_path` — several distributions + // ship none — the user's own `gzip` would then run as root, which is the hole pinning `tar` was + // meant to close, one process along. bsdtar on macOS decompresses in-process and never looks. + // The rest of the environment is passed through, so locale and proxy settings still apply. + execFileSync(tarProgram(), ['-xzf', archivePath, '-C', staging], { + env: { ...process.env, PATH: TRUSTED_TOOL_PATH }, + }); + const extracted = join(staging, binaryName); + // The archive layout is a release-time contract this cannot verify ahead of time, and a bare + // ENOENT from the read below matches none of the guidance `upgrade` prints, so it is checked + // here, naming the archive rather than letting a bare ENOENT surface from the read below. + if (!existsSync(extracted)) { + throw new Error(`${asset} did not contain the expected ${binaryName} executable`); + } + + // `wx` rather than a plain write: the path is a fixed, predictable name in the directory the real + // executable lives in, and this command tells the user to re-run it under `sudo`. A plain + // `writeFileSync` follows a symlink, so anyone who can create that one name in a group-writable + // install directory chooses a file for root to overwrite with content they also control. `wx` is + // `O_CREAT|O_EXCL`, which refuses an existing file and a symlink alike, so the only way past it is + // a live race rather than a planted link. + // + // Unlinked first, because `wx` refuses a *stale* file too. The `finally` below cleans up after this + // process, but a run killed outright — SIGKILL, OOM, power loss — leaves the name behind with no + // cleanup having run, and the next `upgrade` would then fail with a bare `EEXIST` naming a hidden + // dotfile the user has no reason to know about. That message matches none of the guidance this + // command prints. Removing the link rather than following it keeps the property: a name re-created + // between these two lines makes the write fail, which is the right outcome. + rmSync(pending, { force: true }); + writeFileSync(pending, readFileSync(extracted), { flag: 'wx' }); + chmodSync(pending, 0o755); + + // Run before it replaces anything, exactly as `install.sh` does. The checksum proves the archive + // is the one the release published; it says nothing about whether this machine can execute what + // came out of it — a 32-bit userland on a 64-bit kernel reports a 64-bit `uname -m`, and a release + // can simply be built wrong. Replacing the working binary with one that cannot run takes `upgrade` + // with it, so the tool that would recover the install is the one just broken. Failing here leaves + // the old executable in place, and the `finally` below removes the staged file. + // + // The staged path is absolute and `execFileSync` takes no shell, so nothing here is interpreted. + // Output is discarded: this asks whether the binary runs, not what it says. The environment is the + // real one, not the pinned `PATH` the extraction uses — that pin exists because `tar` resolves + // `gzip` through it, while this runs a known absolute path, and stripping the environment would + // only risk failing a build that runs perfectly well in the one it is about to be installed into. + // Bounded, because a build that hangs instead of failing would otherwise hang `upgrade` with it. + // `--version` is answered by the program before any command runs and makes no request — the + // update check skips it — so a working build is done in well under a second. + try { + execFileSync(pending, ['--version'], { + stdio: 'ignore', + timeout: VERSION_PROBE_TIMEOUT_MS, + killSignal: 'SIGKILL', + }); + } catch (error) { + const hung = (error as NodeJS.ErrnoException).code === 'ETIMEDOUT'; + throw new Error( + hung + ? `the downloaded ${binaryName} did not answer --version within ${VERSION_PROBE_TIMEOUT_MS / 1000}s; nothing was changed` + : `the downloaded ${binaryName} does not run on this machine (${process.platform} ${process.arch}); nothing was changed`, + ); + } + + // Replacing a running executable is legal on POSIX: the running process keeps the old inode + // open, and the next invocation resolves the new one. + renameSync(pending, executable); + } finally { + rmSync(staging, { recursive: true, force: true }); + // A failure between the write and the rename — ENOSPC, a signal — would otherwise leave a + // partial dotfile next to the real executable, owned by root in the `sudo upgrade` flow this + // command tells the user to run. + rmSync(pending, { force: true }); + } +}; + +/** + * The directories a trusted system tool is looked up in, and the `PATH` the extraction runs with. + * + * Both uses need the same answer, so they share one value: `tar` is resolved from here rather than + * through the caller's `PATH`, and the child is given this as its `PATH` because GNU tar implements + * `-z` by running `gzip`, which it finds the ordinary way. These two cover macOS and every mainstream + * Linux distribution; an image that keeps `tar` elsewhere is handled by the ownership-checked search + * below instead of by widening this. + */ +const TRUSTED_TOOL_PATH = '/usr/bin:/bin'; + +/** + * Absolute path to `tar`, so the extraction cannot be redirected by `PATH`. + * + * `upgrade` tells the user to re-run under `sudo` when the executable is not writable, and macOS + * ships no `secure_path` in its default sudoers — so a bare `tar` would resolve through the invoking + * user's `PATH` and run a file they control as root. The two standard locations are tried first + * because they cover macOS and every mainstream Linux distribution. + * + * The `PATH` search that follows is for the images that keep `tar` elsewhere (`/usr/local/bin` under + * Nix or Homebrew-on-Linux). Absolute entries alone are not enough — `/tmp/evil` is absolute — so a + * candidate is accepted only if root owns it and no one else can write it or the directory holding + * it. That is the property that matters under `sudo`, and it is what a store path or a distribution + * prefix has while an attacker-controlled directory does not. Nothing found means an outright + * failure: there is no safe way to run a program this cannot locate. + */ +const tarProgram = (): string => { + for (const candidate of TRUSTED_TOOL_PATH.split(':').map((directory) => `${directory}/tar`)) { + if (existsSync(candidate)) return candidate; + } + for (const entry of (process.env['PATH'] ?? '').split(':')) { + if (!entry.startsWith('/')) continue; + const candidate = join(entry, 'tar'); + if (existsSync(candidate) && rootOwnedAndProtected(candidate) && rootOwnedAndProtected(entry)) + return candidate; + } + throw new Error('no trusted tar was found on PATH, so the archive cannot be extracted'); +}; + +/** Whether root owns the path and neither group nor other can write it — checked without following links. */ +const rootOwnedAndProtected = (path: string): boolean => { + try { + const stats = lstatSync(path); + return stats.uid === 0 && (stats.mode & 0o022) === 0; + } catch { + return false; + } +}; + +/** + * Whether `tag` names a release newer than the running `version`. + * + * "Different" is not "newer". `releases/latest` follows whatever release is currently marked latest, + * so deleting a broken release moves it *backwards* — and a bare inequality would then tell a user + * on 2.0.1 that "a new release is available: 2.0.1 → v2.0.0". Release-please, which every generated + * CLI publishes through, produces strict semver, so that is what is compared; anything else falls + * back to the inequality, on the grounds that an imprecise word beats never mentioning a release at + * all for a versioning scheme this cannot read. + */ +const isNewerRelease = (tag: string, version: string): boolean => { + const candidate = tag.replace(/^v/u, ''); + const latest = parseVersion(candidate); + const current = parseVersion(version); + if (!latest || !current) return candidate !== version; + + for (let index = 0; index < latest.release.length; index += 1) { + const next = latest.release[index] ?? 0; + const now = current.release[index] ?? 0; + if (next !== now) return next > now; + } + // Same `major.minor.patch`: semver puts a prerelease below the release it leads to, so `1.2.0` is + // newer than `1.2.0-rc.1`. + if (latest.prerelease === current.prerelease) return false; + if (!latest.prerelease) return true; + if (!current.prerelease) return false; + return comparePrerelease(latest.prerelease, current.prerelease) > 0; +}; + +/** + * Orders two semver prerelease strings, returning >0 when `left` is the newer one. + * + * Semver's dotted rule, not a string comparison: identifiers are compared field by field, numeric + * ones numerically and the rest lexically, with numeric sorting below alphanumeric and a shorter + * prefix below its extension. Comparing the whole string instead put `rc.10` *below* `rc.9`, which a + * long prerelease train reaches routinely — a user on `rc.9` would then never be told about `rc.10`, + * and running `upgrade` would install it while calling the result a move rather than an upgrade. + */ +const comparePrerelease = (left: string, right: string): number => { + const a = left.split('.'); + const b = right.split('.'); + for (let index = 0; index < Math.max(a.length, b.length); index += 1) { + const x = a[index]; + const y = b[index]; + // A field the other side does not have makes the longer one greater, per semver. + if (x === undefined) return -1; + if (y === undefined) return 1; + if (x === y) continue; + const xNumeric = /^\d+$/u.test(x); + const yNumeric = /^\d+$/u.test(y); + if (xNumeric && yNumeric) return Number(x) - Number(y); + // Numeric identifiers always sort below alphanumeric ones. + if (xNumeric !== yNumeric) return xNumeric ? -1 : 1; + return x < y ? -1 : 1; + } + return 0; +}; + +/** Splits a strict semver string into its numeric release triple and prerelease text, or undefined. */ +const parseVersion = (value: string): { release: readonly number[]; prerelease: string } | undefined => { + const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/u.exec(value); + if (!match) return undefined; + return { release: [Number(match[1]), Number(match[2]), Number(match[3])], prerelease: match[4] ?? '' }; +}; + +/** + * This command's own opt-out variable, fixed at generation time. + * + * Substituted rather than derived from `binaryName` here, because the generated README documents it + * by name — deriving it twice is how a documented opt-out stops matching the one that is read. + */ +const UPDATE_OPT_OUT = 'DEDALUS_NO_UPDATE_NOTIFIER'; + +/** Charset a git tag can actually use, applied to anything read back from the cache before printing. */ +const RELEASE_TAG = /^[A-Za-z0-9._+-]{1,64}$/u; + +/** How long a version check is trusted before the next run looks again. */ +const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; + +/** + * Hard bound on the background version check. + * + * `fetch` keeps its socket referenced, so an unawaited request still holds the process open after + * the command's own work is done — a host that accepts the connection and never answers (a captive + * portal, a stalled proxy) would otherwise hang the CLI indefinitely on every run. The abort caps + * that at this, and the cache write below caps how often it can happen at all. + */ +const CHECK_TIMEOUT_MS = 2_000; + +/** One line naming the installed and available versions, shared by `upgrade` and `upgrade --check`. */ +const versionLine = (binaryName: string, version: string, tag: string): string => + `${binaryName} ${version} is installed; ${tag} is available.\n`; + +/** Resolves the latest tag, reporting and setting a failing exit code rather than throwing. */ +const resolveLatestTag = async (): Promise => { + try { + return await withTimeout((signal) => latestTag(signal), UPGRADE_CHECK_TIMEOUT_MS, 'the release check'); + } catch (error) { + process.stderr.write(`error: ${(error as Error).message}\n`); + process.exitCode = 1; + return undefined; + } +}; + +/** Where the last check is remembered, so every invocation does not hit the network. */ +const cachePath = (binaryName: string): string | undefined => { + // Windows sets neither `HOME` nor `XDG_CACHE_HOME` from cmd or PowerShell, so without this the + // cache lands under the temp directory that Disk Cleanup purges — and the throttle it exists to + // enforce would reset every time that happened. + if (process.platform === 'win32') { + const local = process.env['LOCALAPPDATA']; + return local ? join(local, binaryName, 'update-check.json') : undefined; + } + // A relative `XDG_CACHE_HOME` is invalid per the XDG base directory spec and ignored, which also + // keeps the cache off a path that would otherwise be resolved against the working directory: the + // throttle would then be per-directory, and a repository could carry a writable one. + const xdg = process.env['XDG_CACHE_HOME']; + const base = (xdg && isAbsolute(xdg) ? xdg : undefined) ?? homeCacheBase(); + return base ? join(base, binaryName, 'update-check.json') : undefined; +}; + +/** Per-user cache root under `$HOME`, or undefined when there is no home directory to put it in. */ +const homeCacheBase = (): string | undefined => { + const home = process.env['HOME']; + if (!home) return undefined; + return process.platform === 'darwin' ? join(home, 'Library', 'Caches') : join(home, '.cache'); +}; + +/** + * Whether it is safe to print an update hint at all. + * + * Deliberately conservative. The notice is a courtesy, and every case below is one where printing it + * does more harm than the notice is worth: + * + * - Not a TTY on stderr: the output is being captured or piped, where an unexpected line is noise at + * best and corrupts a parsed stream at worst. This is also why the notice only ever goes to + * stderr — stdout carries the command's real output, which `--format json` callers parse. + * - `CI`: build logs are read by machines and by people debugging failures, neither of whom asked. + * - `NO_UPDATE_NOTIFIER` or this command's own opt-out variable: an explicit request to stop. + */ +const notificationsAllowed = (): boolean => { + if (process.env['CI']) return false; + if (process.env['NO_UPDATE_NOTIFIER']) return false; + if (process.env[UPDATE_OPT_OUT]) return false; + // Never under `sudo`, and the reason is the throttle rather than the notice. `sudo` keeps `HOME` on + // macOS, so a root run that lands past the 24h window creates the cache directory owned by root — + // and every later run as the real user then fails to write it, silently. With nothing recorded the + // throttle never engages, so the unauthenticated API request goes out on *every* invocation, which + // is exactly the rate-limit exhaustion recording-before-the-request exists to prevent. `upgrade` + // itself tells the user to re-run under `sudo` for a root-owned install, so this is a path they are + // actively sent down. + // + // Keyed on `SUDO_USER` rather than on being root, deliberately. `SUDO_USER` is set only where sudo + // elevated from a real user — precisely when `HOME` belongs to somebody else — while plain root + // (a container image, a root-only appliance) owns its own `$HOME` and has no such problem. Testing + // `getuid() === 0` would switch the notice off for every containerized CLI, which is a large class + // of ordinary user, to fix a case they are not in. + if (process.env['SUDO_USER']) return false; + // Both streams, not just stderr. The documented way to install completions is + // `eval "$( completion bash)"` in a shell rc: that captures stdout while leaving stderr + // attached to the terminal, so a stderr-only gate printed the notice into *every new shell* the + // user opened. Requiring stdout to be a terminal too is what tells a real interactive run from a + // command whose output something else is reading. + return Boolean(process.stderr.isTTY) && Boolean(process.stdout.isTTY); +}; + +/** + * Tells the user, at most once a day, that a newer release exists. + * + * Fire-and-forget on purpose: it is started before the command runs and never awaited, so a slow or + * unreachable network never delays the command's own work. The process can still be held open for up + * to {@link CHECK_TIMEOUT_MS} after it finishes, on a stalled connection, at most once a day. Every failure path is silent — a version check that cannot + * reach GitHub is not something the user asked about, and reporting it would turn a courtesy into + * noise on every offline run. + * + * The notice is printed on the *next* run rather than this one when the cache is cold: the check + * resolves after the command has usually finished, and interleaving a notice with output already in + * flight is worse than telling them a moment later. + */ +export const notifyIfOutdated = ( + binaryName: string, + version: string, + argv: readonly string[] = process.argv, +): void => { + if (!notificationsAllowed()) return; + // Commander answers these and exits before a request could leave the process, but only after the + // attempt below is recorded — so the day's first `--help` would use up the day's check without + // making it. Skipped instead, which keeps the throttle and the check. + if (answeredWithoutRunning(argv.slice(2))) return; + + // No private cache directory means no throttle, and an unthrottled check would hit the API on + // every invocation. It also means the only remaining location would be a world-writable one: + // with `HOME` unset (`su` without `-`, `env -i`, a minimal container) a `/tmp//` fallback + // is a path any local user can create first and then own, and its contents are written to this + // terminal below. Skipping the check entirely is the cheap, safe answer. + const path = cachePath(binaryName); + if (!path) return; + + let cached: { checkedAt?: number; latest?: string } = {}; + try { + const parsed: unknown = JSON.parse(readFileSync(path, 'utf8')); + // `JSON.parse` returns `null` for the literal `null` without throwing, and `typeof null` is + // `'object'` — so both are checked. Reading `.latest` off `null` would throw *outside* this + // catch, and the notifier runs while the program is being built, taking the whole CLI down with + // an unhandled stack trace on every invocation until the file is deleted by hand. + if (parsed && typeof parsed === 'object') cached = parsed as typeof cached; + } catch { + // No cache yet, or an unreadable one: treated as "never checked". + } + + // Report what the last check found before starting another, so a known-stale version is surfaced + // immediately rather than a day later. + // Validated before it reaches the terminal. A real `tag_name` cannot contain control characters — + // git refnames forbid them — so anything that does was not written by this code, and writing it + // raw would let cursor-control sequences rewrite the surrounding lines and forge an instruction + // that appears to come from the CLI itself. + if (cached.latest && RELEASE_TAG.test(cached.latest) && isNewerRelease(cached.latest, version)) { + const install = detectInstall(binaryName); + // ` upgrade` wherever it can do the work itself — in place, or by running the owning manager + // — and the manager's own instruction only where it can do neither. + const how = install.kind === 'managed' && !install.run ? install.upgrade : `${binaryName} upgrade`; + process.stderr.write( + `\nA new release of ${binaryName} is available: ${version} → ${cached.latest}\n ${how}\n\n`, + ); + } + + // A negative delta satisfies a bare `<`, so a `checkedAt` written while the clock was ahead — a + // dead RTC battery, a hypervisor clock jump on resume — would suppress every later check for the + // whole skew and the user would never hear about another release. Out-of-range in either direction + // means "check again". + const since = Date.now() - (cached.checkedAt ?? 0); + if (cached.checkedAt && since >= 0 && since < CHECK_INTERVAL_MS) return; + + // The attempt is recorded *before* the request, not when it resolves. Commander exits the process + // outright for `--help`, `--version` and any usage error, which kills the in-flight check before + // it can write anything — so a user who mostly types `--help` would issue one unauthenticated API + // request per invocation forever, never cache a result, and eventually exhaust GitHub's 60/hr + // limit for their whole NAT. Writing up front costs one stale-by-a-day notice at worst. + recordCheck(path, cached.latest); + + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS); + // The timer itself would hold the event loop open for its full duration; `unref` exists on Node + // and Bun timers but not in the DOM typing, hence the guarded call. + (timeout as unknown as { unref?: () => void }).unref?.(); + + void latestTag(controller.signal) + .then((tag) => recordCheck(path, tag)) + // Failure needs no second write: the attempt was already recorded above, so the throttle holds + // whether the check succeeded, failed, or never finished. + .catch(() => {}) + .finally(() => clearTimeout(timeout)); +}; + +/** + * Whether Commander answers these arguments itself — help or the version — and exits without running + * a command: no arguments at all (the program prints its help), `help`, `-v`/`--version` on their own, + * or `-h`/`--help` anywhere before a `--` that ends option parsing. + */ +const answeredWithoutRunning = (args: readonly string[]): boolean => { + const options = args.includes('--') ? args.slice(0, args.indexOf('--')) : args; + if (options.length === 0 || options[0] === 'help') return true; + if (options.length === 1 && (options[0] === '-v' || options[0] === '--version')) return true; + return options.includes('-h') || options.includes('--help'); +}; + +/** Remembers when the check last ran, and what it found, so the throttle above can engage. */ +const recordCheck = (path: string, latest: string | undefined): void => { + try { + mkdirSync(dirname(path), { recursive: true }); + writeFileSync(path, JSON.stringify({ checkedAt: Date.now(), ...(latest ? { latest } : {}) })); + } catch { + // An unwritable cache directory is not worth reporting: the check is a courtesy, and the only + // consequence is that it runs again next time. + } +}; + +/** + * Reports `upgrade --check`: already the latest, a newer release and the command that installs it, or + * a latest release older than this one. + * + * "Different" is not "newer" — `releases/latest` moves backwards when a broken release is deleted — so + * the ordering decides the wording. `canMove` says whether `how` would install an older release: true + * for a self-managed install, which `upgrade` replaces with whatever is latest; false for a managed + * one, whose manager never downgrades. + */ +const reportCheck = ( + binaryName: string, + version: string, + tag: string, + how: string, + canMove: boolean, +): void => { + if (tag.replace(/^v/u, '') === version) { + process.stderr.write(`${binaryName} ${version} is already the latest release.\n`); + return; + } + process.stderr.write(versionLine(binaryName, version, tag)); + if (isNewerRelease(tag, version)) { + process.stderr.write(`Upgrade it with:\n ${how}\n`); + return; + } + process.stderr.write( + canMove + ? `That is older than what you have. Move to it with:\n ${how}\n` + : 'That is older than what you have, so there is nothing to upgrade.\n', + ); +}; + +/** Whether this process can create and rename files in `directory`. */ +const writableDirectory = (directory: string): boolean => { + try { + accessSync(directory, constants.W_OK); + return true; + } catch { + return false; + } +}; + +/** + * Registers `upgrade` and `uninstall`, which both hinge on how this executable was installed. + * + * `upgrade` upgrades every install it can identify, but never by writing over a file another package + * manager owns. Overwriting a Homebrew- or npm-managed binary in place leaves that manager's database + * describing a file that is no longer there: `brew` still reports the old version, and the next managed + * upgrade silently reverts this one. So a managed install is upgraded by *running* its manager's own + * command, and only a download nothing else manages is replaced in place. A binary in `/usr/bin` is + * refused outright, because nothing published here installs there — so something else owns it, and + * this cannot name what. + */ +export const addUpgradeCommands = (program: Command, binaryName: string, version: string): void => { + program + .command('upgrade') + .description('Upgrade to the latest release') + .option('--check', 'Report the latest version without installing it') + .action(async (options: { check?: boolean }) => { + const install = settledInstall(detectInstall(binaryName)); + + // A managed install returns unconditionally, which is also what narrows `install` to the + // self-managed variant for the replace below — the alternative, testing `kind` again further + // down, reads as a guard against a state that cannot happen. + if (install.kind === 'managed') { + if (options.check) { + const tag = await resolveLatestTag(); + if (!tag) return; + process.stderr.write(`${binaryName} was installed with ${install.manager}.\n`); + // A manager only ever moves forward, so a `releases/latest` that went backwards is nothing + // to act on here — unlike a self-managed install, which `upgrade` would move to it. + reportCheck( + binaryName, + version, + tag, + install.run ? `${binaryName} upgrade` : install.upgrade, + false, + ); + return; + } + if (install.run) { + const upgraded = runManagerUpgrade(binaryName, install, install.run); + if (upgraded && install.run.installedVersions) { + await confirmManagerUpgrade( + binaryName, + version, + install, + install.run, + install.run.installedVersions, + ); + } + return; + } + process.stderr.write( + `${binaryName} was installed with ${install.manager}, which owns the installed files.\n` + + `Upgrade it with:\n ${install.upgrade}\n`, + ); + return; + } + + const tag = await resolveLatestTag(); + if (!tag) return; + if (options.check) { + reportCheck(binaryName, version, tag, `${binaryName} upgrade`, true); + return; + } + + // Compared as strings after stripping the tag's `v`: the release tag is the package version, + // so whether to act at all is an equality question, not an ordering one. + if (tag.replace(/^v/u, '') === version) { + process.stderr.write(`${binaryName} ${version} is already the latest release.\n`); + return; + } + + // Checked before the download rather than discovered at the rename: a root-owned install + // directory otherwise costs the whole archive before failing with the same permission error. + if (!writableDirectory(dirname(install.path))) { + process.stderr.write( + `error: ${dirname(install.path)} is not writable, so ${install.path} cannot be replaced.\n` + + `Try again with elevated permissions.\n`, + ); + process.exitCode = 1; + return; + } + + try { + await replaceExecutable(install.path, tag, binaryName); + // "moved" rather than "upgraded" when the release moved backwards. `releases/latest` follows + // whichever release is marked latest, so deleting a broken one really does point this at an + // older build — installing it is right (that is the release the project is publishing), but + // calling it an upgrade is not. + const direction = isNewerRelease(tag, version) ? 'upgraded' : 'moved'; + process.stderr.write(`${direction} ${binaryName} to ${tag}\n`); + } catch (error) { + const message = (error as Error).message; + // A permission error here is the common case — the binary may sit in a root-owned directory — + // so say what to do rather than only what failed. + const reinstall = /permission|EACCES|EPERM/iu.test(message) + ? 'Try again with elevated permissions.\n' + : ''; + process.stderr.write(`error: ${message}\n${reinstall}`); + process.exitCode = 1; + } + }); + + program + .command('uninstall') + .description('Show how to remove this installation') + .action(() => { + const install = settledInstall(detectInstall(binaryName)); + if (install.kind === 'managed') { + process.stderr.write( + `${binaryName} was installed with ${install.manager}, which owns the installed files.\n` + + `Remove it with:\n ${install.remove}\n`, + ); + return; + } + // Printed rather than performed: a command that deletes the executable running it cannot + // report a failure afterwards, and the one-liner is auditable before it is run. + // Single-quoted, because this is the one line in the module that is a shell command the user is + // meant to paste. The path comes from `realpathSync(process.execPath)` and can carry spaces — + // `~/Library/Application Support/...`, or any directory a user named — and an unquoted `rm` + // would then name two paths, neither of them the executable. Nothing expands inside single + // quotes, and an embedded `'` is closed, escaped and reopened. + // `sudo` only where it is needed: a root-owned `/usr/local/bin` refuses a plain `rm`, and a + // user-owned `~/.local/bin` should not be handed a root command it does not need. + const sudo = writableDirectory(dirname(install.path)) ? '' : 'sudo '; + process.stderr.write( + `Remove ${binaryName} with:\n ${sudo}rm '${install.path.replace(/'/gu, "'\\''")}'\n${leftoverState(binaryName)}`, + ); + }); +}; + +/** + * The state removing the executable leaves behind, named so a user can clear it too. + * + * Three things outlive the binary and none is obvious: a stored credential, which `logout` is the + * right way to clear because only the CLI knows where its keychain entry or file lives — named only + * when the CLI has sign-in at all — the update-check cache, and the PATH line the install script may + * have added to a shell startup file, named only when the release ships that script. Printed rather + * than deleted for the same reason the executable is: `uninstall` reports, so that what it says can be + * read before it is run. + */ +const leftoverState = (binaryName: string): string => { + const cache = cachePath(binaryName); + const leftovers = [ + ...(HAS_LOGIN ? [` a stored credential, if you signed in — clear it with: ${binaryName} logout\n`] : []), + ...(cache + ? [` the update-check cache — remove it with: rm -rf '${dirname(cache).replace(/'/gu, "'\\''")}'\n`] + : []), + ...(HAS_INSTALL_SCRIPT + ? [ + ` a PATH line, if the install script added one — delete the two lines starting at "# Added by the ${binaryName} installer" in your shell startup file (for fish, the file conf.d/${binaryName}.fish)\n`, + ] + : []), + ]; + return leftovers.length > 0 ? `\nThis leaves no other files behind except:\n${leftovers.join('')}` : ''; +}; diff --git a/src/commands/index.ts b/src/commands/index.ts index 0d815e5..e2fb3dc 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -10,6 +10,7 @@ import { } from '../cli/runtime'; import { completions } from '../cli/completions'; import type { CliAuthDefinition } from '../cli/login'; +import { addUpgradeCommands, notifyIfOutdated } from '../cli/upgrade'; const clientOptions = [ { @@ -19,8 +20,9 @@ const clientOptions = [ optionKey: 'apiKey', env: 'DEDALUS_API_KEY', description: - 'Dedalus API key or short-lived delegated access token in Authorization: Bearer .', + 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `.', auth: true, + authLocation: 'header:authorization', }, { clientKey: 'xAPIKey', @@ -30,6 +32,16 @@ const clientOptions = [ env: 'DEDALUS_X_API_KEY', description: 'Dedalus API key. Alternative to Bearer token.', auth: true, + authLocation: 'header:x-api-key', + }, + { + clientKey: 'browserToken', + sdkKey: 'browserToken', + name: 'browser-token', + optionKey: 'browserToken', + env: 'DEDALUS_BROWSER_TOKEN', + auth: true, + authLocation: 'header:authorization', }, { clientKey: 'dedalusOrgID', @@ -52,7 +64,7 @@ const commands = [ transport: 'http', iterable: true, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -81,7 +93,7 @@ const commands = [ transport: 'http', iterable: false, callShape: 'body', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -94,6 +106,15 @@ const commands = [ 'Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable.', valueKind: 'string', }, + { + name: 'image-id', + optionKey: 'imageId', + paramKey: 'image_id', + location: 'body', + required: false, + description: 'Organization-owned ready custom image ID. Requires Pro. Omit for the platform default.', + valueKind: 'string', + }, { name: 'memory-mib', optionKey: 'memoryMib', @@ -131,7 +152,7 @@ const commands = [ transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -150,10 +171,11 @@ const commands = [ commandPath: ['machines', 'update'], methodName: 'update', summary: 'Update machine', + description: 'Changes settings such as autosleep.', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -171,37 +193,16 @@ const commands = [ paramKey: 'autosleep', location: 'body', required: false, - description: - 'Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable.', valueKind: 'string', }, - { - name: 'memory-mib', - optionKey: 'memoryMib', - paramKey: 'memory_mib', - location: 'body', - required: false, - description: 'Memory in MiB.', - valueKind: 'integer', - }, { name: 'storage-gib', optionKey: 'storageGib', paramKey: 'storage_gib', location: 'body', required: false, - description: 'Storage in GiB.', valueKind: 'integer', }, - { - name: 'vcpu', - optionKey: 'vcpu', - paramKey: 'vcpu', - location: 'body', - required: false, - description: 'CPU in vCPUs.', - valueKind: 'number', - }, ], }, { @@ -212,7 +213,7 @@ const commands = [ transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -224,6 +225,16 @@ const commands = [ description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', valueKind: 'string', }, + { + name: 'force', + optionKey: 'force', + paramKey: 'force', + location: 'query', + required: false, + description: + "Destroy from the last published filesystem checkpoint without publishing the Machine's remaining writes, whether the Machine is running or failed. Unpublished file writes are lost. The default publishes them first, and waits while it cannot.", + valueKind: 'boolean', + }, ], }, { @@ -234,7 +245,7 @@ const commands = [ transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -256,7 +267,7 @@ const commands = [ transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -280,7 +291,7 @@ const commands = [ transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -304,15 +315,57 @@ const commands = [ }, ], }, + { + resourcePath: ['machines'], + commandPath: ['machines', 'resize'], + methodName: 'resize', + summary: 'Resize machine', + description: + 'Wakes a sleeping Machine, then waits up to 30 seconds for the host to confirm CPU and RAM. Returns the Machine with its confirmed size. After RESIZE_TIMEOUT, repeat the same request and Idempotency-Key to wait again.', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'memory-mib', + optionKey: 'memoryMib', + paramKey: 'memory_mib', + location: 'body', + required: false, + description: 'RAM in MiB.', + valueKind: 'integer', + }, + { + name: 'vcpu', + optionKey: 'vcpu', + paramKey: 'vcpu', + location: 'body', + required: false, + description: 'CPU in 0.25-vCPU steps.', + valueKind: 'number', + }, + ], + }, { resourcePath: ['machines', 'ssh'], - commandPath: ['machines:ssh', 'list'], + commandPath: ['machines', 'ssh', 'list'], methodName: 'list', summary: 'List SSH sessions', transport: 'http', iterable: true, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -344,13 +397,13 @@ const commands = [ }, { resourcePath: ['machines', 'ssh'], - commandPath: ['machines:ssh', 'create'], + commandPath: ['machines', 'ssh', 'create'], methodName: 'create', summary: 'Create SSH session', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -374,13 +427,13 @@ const commands = [ }, { resourcePath: ['machines', 'ssh'], - commandPath: ['machines:ssh', 'retrieve'], + commandPath: ['machines', 'ssh', 'retrieve'], methodName: 'retrieve', summary: 'Get SSH session', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -404,13 +457,13 @@ const commands = [ }, { resourcePath: ['machines', 'ssh'], - commandPath: ['machines:ssh', 'delete'], + commandPath: ['machines', 'ssh', 'delete'], methodName: 'delete', summary: 'Delete SSH session', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -434,13 +487,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions'], - commandPath: ['machines:executions', 'list'], + commandPath: ['machines', 'executions', 'list'], methodName: 'list', summary: 'List executions', transport: 'http', iterable: true, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -472,13 +525,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions'], - commandPath: ['machines:executions', 'create'], + commandPath: ['machines', 'executions', 'create'], methodName: 'create', summary: 'Create execution', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -534,13 +587,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions'], - commandPath: ['machines:executions', 'retrieve'], + commandPath: ['machines', 'executions', 'retrieve'], methodName: 'retrieve', summary: 'Get execution', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -564,13 +617,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions'], - commandPath: ['machines:executions', 'delete'], + commandPath: ['machines', 'executions', 'delete'], methodName: 'delete', summary: 'Delete execution', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -594,13 +647,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions'], - commandPath: ['machines:executions', 'output'], + commandPath: ['machines', 'executions', 'output'], methodName: 'output', summary: 'Get execution output', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -624,13 +677,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions'], - commandPath: ['machines:executions', 'events'], + commandPath: ['machines', 'executions', 'events'], methodName: 'events', summary: 'List execution events', transport: 'http', iterable: true, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -670,13 +723,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions', 'logs'], - commandPath: ['machines:executions:logs', 'retrieve'], + commandPath: ['machines', 'executions', 'logs', 'retrieve'], methodName: 'retrieve', summary: 'Get execution log status', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -700,13 +753,13 @@ const commands = [ }, { resourcePath: ['machines', 'executions', 'logs'], - commandPath: ['machines:executions:logs', 'reauthorize'], - methodName: 'reauthorize', - summary: 'Reauthorize execution log publication', + commandPath: ['machines', 'executions', 'logs', 'create-token'], + methodName: 'createToken', + summary: 'Create execution log read token', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -729,14 +782,14 @@ const commands = [ ], }, { - resourcePath: ['machines', 'executions', 'logs'], - commandPath: ['machines:executions:logs', 'create-token'], - methodName: 'createToken', - summary: 'Create execution log read token', + resourcePath: ['machines', 'autoresizing'], + commandPath: ['machines', 'autoresizing', 'retrieve'], + methodName: 'retrieve', + summary: "Read this machine's autoresizing settings", transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -748,25 +801,18 @@ const commands = [ description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', valueKind: 'string', }, - { - name: 'execution-id', - optionKey: 'executionId', - paramKey: 'execution_id', - location: 'path', - required: true, - valueKind: 'string', - }, ], }, { resourcePath: ['machines', 'autoresizing'], - commandPath: ['machines:autoresizing', 'retrieve'], - methodName: 'retrieve', - summary: "Read this machine's RAM autoresizing settings", + commandPath: ['machines', 'autoresizing', 'update'], + methodName: 'update', + summary: "Set this machine's autoresizing settings", + description: 'Changes RAM, CPU or both for this machine. An absent resource keeps its setting.', transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { @@ -778,70 +824,324 @@ const commands = [ description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', valueKind: 'string', }, + { + name: 'cpu', + optionKey: 'cpu', + paramKey: 'cpu', + location: 'body', + required: false, + valueKind: 'string', + }, + { + name: 'cpu-max-vcpu', + optionKey: 'cpuMaxVcpu', + paramKey: 'cpu_max_vcpu', + location: 'body', + required: false, + valueKind: 'number', + }, + { + name: 'memory', + optionKey: 'memory', + paramKey: 'memory', + location: 'body', + required: false, + valueKind: 'string', + }, + { + name: 'memory-max-mib', + optionKey: 'memoryMaxMib', + paramKey: 'memory_max_mib', + location: 'body', + required: false, + valueKind: 'integer', + }, ], }, { - resourcePath: ['machines', 'autoresizing'], - commandPath: ['machines:autoresizing', 'update'], + resourcePath: ['organization', 'autoresizing'], + commandPath: ['organization', 'autoresizing', 'retrieve'], + methodName: 'retrieve', + summary: 'Read organization autoresizing policy', + transport: 'http', + iterable: false, + callShape: 'options', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [], + }, + { + resourcePath: ['organization', 'autoresizing'], + commandPath: ['organization', 'autoresizing', 'update'], methodName: 'update', - summary: "Set this machine's RAM autoresizing settings", + summary: 'Set organization autoresizing policy', + description: 'Changes defaults copied to new Machines. Existing Machines retain their own policy.', + transport: 'http', + iterable: false, + callShape: 'body', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'cpu', + optionKey: 'cpu', + paramKey: 'cpu', + location: 'body', + required: false, + valueKind: 'string', + }, + { + name: 'cpu-max-vcpu', + optionKey: 'cpuMaxVcpu', + paramKey: 'cpu_max_vcpu', + location: 'body', + required: false, + valueKind: 'number', + }, + { + name: 'memory', + optionKey: 'memory', + paramKey: 'memory', + location: 'body', + required: false, + valueKind: 'string', + }, + { + name: 'memory-max-mib', + optionKey: 'memoryMaxMib', + paramKey: 'memory_max_mib', + location: 'body', + required: false, + valueKind: 'integer', + }, + ], + }, + { + resourcePath: ['images'], + commandPath: ['images', 'list'], + methodName: 'list', + summary: 'List image IDs owned by the authenticated organization', + description: + "Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID.", transport: 'http', iterable: false, callShape: 'params', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { - name: 'machine-id', - optionKey: 'machineId', - paramKey: 'machine_id', - location: 'path', + name: 'limit', + optionKey: 'limit', + paramKey: 'limit', + location: 'query', + required: false, + valueKind: 'integer', + }, + { + name: 'cursor', + optionKey: 'cursor', + paramKey: 'cursor', + location: 'query', + required: false, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['images'], + commandPath: ['images', 'create'], + methodName: 'create', + summary: 'Register an immutable OCI image for preparation', + description: + 'Requires an entitled organization and linux/amd64 on the current fleet. Acceptance queues preparation; only a ready image can launch a machine. Private registry credentials are not yet supported.', + transport: 'http', + iterable: false, + callShape: 'body', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'credential-ref', + optionKey: 'credentialRef', + paramKey: 'credential_ref', + location: 'body', + required: false, + valueKind: 'string', + }, + { + name: 'name', + optionKey: 'name', + paramKey: 'name', + location: 'body', + required: false, + description: 'A label people use to tell images apart. Programs use the image ID.', + valueKind: 'string', + }, + { + name: 'platform', + optionKey: 'platform', + paramKey: 'platform', + location: 'body', required: true, - description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', valueKind: 'string', }, { - name: 'enabled', - optionKey: 'enabled', - paramKey: 'enabled', + name: 'source', + optionKey: 'source', + paramKey: 'source', location: 'body', required: true, - valueKind: 'boolean', + valueKind: 'object', + }, + { + name: 'source.kind', + optionKey: 'source.kind', + paramKey: 'source', + location: 'body', + required: false, + valueKind: 'string', + objectPath: ['kind'], + }, + { + name: 'source.reference', + optionKey: 'source.reference', + paramKey: 'source', + location: 'body', + required: false, + valueKind: 'string', + objectPath: ['reference'], + }, + { + name: 'source.sha256', + optionKey: 'source.sha256', + paramKey: 'source', + location: 'body', + required: false, + valueKind: 'string', + objectPath: ['sha256'], + }, + { + name: 'source.upload-id', + optionKey: 'source.uploadId', + paramKey: 'source', + location: 'body', + required: false, + valueKind: 'string', + objectPath: ['upload_id'], }, ], }, { - resourcePath: ['organization', 'autoresizing'], - commandPath: ['organization:autoresizing', 'retrieve'], + resourcePath: ['images'], + commandPath: ['images', 'retrieve'], methodName: 'retrieve', - summary: 'Read organization RAM autoresizing policy', + summary: 'Read preparation status for an organization-owned image', + description: + "A preparing image reports its stage, the worker's last step and an estimated percent of the whole preparation. A failed image names the cause: IMAGE_OS_UNSUPPORTED, IMAGE_SOURCE_INVALID, IMAGE_SOURCE_NOT_FOUND and IMAGE_SOURCE_UNAUTHORIZED describe the image or its reference and are final; IMAGE_SOURCE_UNAVAILABLE, IMAGE_REGISTRY_UNREACHABLE, IMAGE_REGISTRY_RATE_LIMITED, IMAGE_ARCHIVE_UNAVAILABLE and IMAGE_EXECUTION_FAILED describe this attempt and are retryable with a new idempotency key.", transport: 'http', iterable: false, - callShape: 'options', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], - flags: [], + flags: [ + { + name: 'image-id', + optionKey: 'imageId', + paramKey: 'image_id', + location: 'path', + required: true, + valueKind: 'string', + }, + ], }, { - resourcePath: ['organization', 'autoresizing'], - commandPath: ['organization:autoresizing', 'update'], + resourcePath: ['images'], + commandPath: ['images', 'update'], methodName: 'update', - summary: 'Set organization RAM autoresizing policy', + summary: 'Rename an organization-owned image', + description: "Changes only the name. The image's source, platform and state are immutable.", + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'image-id', + optionKey: 'imageId', + paramKey: 'image_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'name', + optionKey: 'name', + paramKey: 'name', + location: 'body', + required: true, + description: 'The new label, or null to clear it. No other field can change.', + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['images'], + commandPath: ['images', 'delete'], + methodName: 'delete', + summary: 'Delete an organization-owned image', + description: + "The image can create no new Machine and no longer counts against the organization's image limit. Machines already running from it keep working. The image stays readable, and deleting it again returns the same image.", + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'image-id', + optionKey: 'imageId', + paramKey: 'image_id', + location: 'path', + required: true, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['images', 'uploads'], + commandPath: ['images', 'uploads', 'create'], + methodName: 'create', + summary: 'Reserve an immutable Docker image archive upload', transport: 'http', iterable: false, callShape: 'body', - authClientKeyRequirements: [['xAPIKey'], ['apiKey']], + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], positional: [], flags: [ { - name: 'enabled', - optionKey: 'enabled', - paramKey: 'enabled', + name: 'platform', + optionKey: 'platform', + paramKey: 'platform', location: 'body', required: true, - description: - 'Allow automatic RAM increases for all organization machines. Disabling preserves applied RAM and already admitted resizes.', - valueKind: 'boolean', + valueKind: 'string', + }, + { + name: 'sha256', + optionKey: 'sha256', + paramKey: 'sha256', + location: 'body', + required: true, + valueKind: 'string', + }, + { + name: 'size-bytes', + optionKey: 'sizeBytes', + paramKey: 'size_bytes', + location: 'body', + required: true, + valueKind: 'integer', }, ], }, @@ -858,10 +1158,11 @@ const auth = { baseUrlEnv: 'DEDALUS_BASE_URL', backend: 'auto', defaultBaseUrl: 'https://dcs.dedaluslabs.ai', - requirements: [['xAPIKey'], ['apiKey']], + requirements: [['browserToken'], ['apiKey'], ['xAPIKey']], envByKey: { apiKey: 'DEDALUS_API_KEY', xAPIKey: 'DEDALUS_X_API_KEY', + browserToken: 'DEDALUS_BROWSER_TOKEN', }, methods: [ { @@ -878,6 +1179,22 @@ const auth = { clientKey: 'xAPIKey', prompt: 'API key: ', }, + { + name: 'oauth-browser', + label: 'Sign in with a browser (OAuth authorization code)', + kind: 'oauth', + grant: 'authorizationCode', + clientKey: 'browserToken', + tokenUrl: 'https://clerk.dedaluslabs.ai/oauth/token', + refreshUrl: 'https://clerk.dedaluslabs.ai/oauth/token', + authorizationUrl: 'https://clerk.dedaluslabs.ai/oauth/authorize', + scopes: ['offline_access', 'user:org:read'], + clientId: 'j7A9ArTlXXvR2ocG', + redirectPort: 0, + revocationUrl: 'https://clerk.dedaluslabs.ai/oauth/token/revoke', + resource: ['https://dcs.dedaluslabs.ai'], + issuer: 'https://clerk.dedaluslabs.ai', + }, ], } as const satisfies CliAuthDefinition; @@ -885,13 +1202,17 @@ export const getProgram = (): Command => createProgram({ SDK, binaryName: 'dedalus', - version: '0.6.0', // x-release-please-version + version: '0.1.0', // x-release-please-version description: 'CLI for Dedalus', - defaultFormat: 'auto', - defaultErrorFormat: 'auto', + defaultFormat: 'json', + defaultErrorFormat: 'json', clientOptions, commands, groups, completions, auth, + addUpgradeCommands, }); + +/** Runs the daily update check. Called by `run()` only, so building the program makes no request. */ +export const checkForUpdates = (argv: readonly string[]): void => notifyIfOutdated('dedalus', '0.1.0', argv); // x-release-please-version diff --git a/src/index.ts b/src/index.ts index 46664c3..d40bf43 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,10 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -import { getProgram } from './commands/index'; +import { checkForUpdates, getProgram } from './commands/index'; export { getProgram }; export const run = async (argv: readonly string[] = process.argv): Promise => { + checkForUpdates(argv); await getProgram().parseAsync(argv); }; diff --git a/src/sdk/api-promise.ts b/src/sdk/api-promise.ts index 7ae484c..752002e 100644 --- a/src/sdk/api-promise.ts +++ b/src/sdk/api-promise.ts @@ -2,6 +2,12 @@ import type { Dedalus } from './client'; import type { FinalRequestOptions } from './internal/request-options'; +import { + MAX_RESPONSE_BODY_BYTES, + readBodyText, + readUnderDeadline, + releaseDeadline, +} from './internal/utils/body'; export type APIResponseProps = { readonly response: Response; @@ -14,17 +20,20 @@ export type APIResponseProps = { export type ParseResponse = (client: Dedalus, props: APIResponseProps) => T | Promise; -export const defaultParseResponse = async (_client: unknown, props: APIResponseProps): Promise => { - const { response } = props; - if (response.status === 204) return null as T; - if (props.options.__binaryResponse) return response as T; - const contentType = response.headers.get('content-type'); - const mediaType = contentType?.split(';')[0]?.trim(); - const isJson = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); - if (isJson && response.headers.get('content-length') === '0') return undefined as T; - if (isJson) return (await response.json()) as T; - return (await response.text()) as unknown as T; -}; +// The read runs under the request deadline, which `makeRequest` left armed for it and which is +// disarmed here once the body is in, however the read ends. +export const defaultParseResponse = async (_client: unknown, props: APIResponseProps): Promise => + readUnderDeadline(props, async () => { + const { response } = props; + if (response.status === 204) return null as T; + if (props.options.__binaryResponse) return response as T; + const contentType = response.headers.get('content-type'); + const mediaType = contentType?.split(';')[0]?.trim(); + const isJson = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); + if (isJson && response.headers.get('content-length') === '0') return undefined as T; + if (isJson) return JSON.parse(await readBodyText(response, MAX_RESPONSE_BODY_BYTES)) as T; + return (await readBodyText(response, MAX_RESPONSE_BODY_BYTES)) as unknown as T; + }); /** A Promise subclass providing SDK response helpers. */ export class APIPromise extends Promise { @@ -47,11 +56,19 @@ export class APIPromise extends Promise { } asResponse(): Promise { - return this.responsePromise.then((props) => props.response); + // The caller reads this body at its own pace, so the request deadline stops here. + return this.responsePromise.then((props) => { + releaseDeadline(props.controller); + return props.response; + }); } async withResponse(): Promise<{ data: T; response: Response }> { - const [data, response] = await Promise.all([this.parse(), this.asResponse()]); + // Not `asResponse()`, which would disarm the deadline the body parse runs under. + const [data, response] = await Promise.all([ + this.parse(), + this.responsePromise.then((props) => props.response), + ]); return { data, response }; } diff --git a/src/sdk/client.ts b/src/sdk/client.ts index d9556c8..0ea072b 100644 --- a/src/sdk/client.ts +++ b/src/sdk/client.ts @@ -4,11 +4,12 @@ import { APIPromise, type APIResponseProps } from './api-promise'; import { PagePromise, type AbstractPage, type CursorPageParams, CursorPageResponse } from './core/pagination'; import * as Pagination from './core/pagination'; import * as Errors from './error'; -import { uuid4 } from './internal/utils/uuid'; +import { uuid7 } from './internal/utils/uuid7'; import { validatePositiveInteger, isAbsoluteURL, safeJSON, isEmptyObj } from './internal/utils/values'; import { sleep } from './internal/utils/sleep'; import { castToError, isAbortError } from './internal/errors'; -import { getPlatformHeaders } from './internal/detect-platform'; +import { MAX_ERROR_BODY_BYTES, holdDeadline, readBodyText } from './internal/utils/body'; +import { getPlatformHeaders, isRunningInBrowser } from './internal/detect-platform'; import * as Shims from './internal/shims'; import * as Opts from './internal/request-options'; import { readEnv } from './internal/utils/env'; @@ -16,6 +17,7 @@ import { formatRequestDetails, loggerFor, parseLogLevel, + redactHeaders, redactUrl, type LogLevel, type Logger, @@ -36,8 +38,10 @@ import { type CreateParams, type UpdateParams, type LifecycleStatus, + type AutoresizingSwitch, type MachineListItemsCursorPage, type MachineRetrieveResponse, + type MachineResizeResponse, type MachineListParams, type MachineCreateParams, type MachineRetrieveParams, @@ -46,8 +50,21 @@ import { type MachineSleepParams, type MachineWakeParams, type MachineRebootParams, + type MachineResizeParams, } from './resources/machines/machines'; import { Organization } from './resources/organization/organization'; +import { + Images, + type Image, + type ImageList, + type Source, + type Error as ImagesError, + type ImageListParams, + type ImageCreateParams, + type ImageRetrieveParams, + type ImageUpdateParams, + type ImageDeleteParams, +} from './resources/images/images'; export type AuthTokenProvider = () => string | Promise; @@ -62,6 +79,11 @@ export interface ClientOptions { */ xAPIKey?: string | AuthTokenProvider | null | undefined; + /** + * Browser session access token managed by dedalus login. + */ + browserToken?: string | AuthTokenProvider | null | undefined; + /** * Optional organization assertion. Must match the organization identified by the API credential. */ @@ -100,6 +122,19 @@ export interface ClientOptions { * Specify a custom `fetch` function implementation. * * If not provided, we expect that `fetch` is defined globally. + * + * The client passes `redirect: 'manual'` and follows redirects itself, dropping credentials when + * a redirect leaves the API's origin. A custom `fetch` must honor that option: one that follows + * redirects on its own would re-send API keys and cookies to whatever host a redirect names, and + * a response it reports as `redirected` is refused for that reason. Every hop of a redirect goes + * through this function, so a wrapper that adds a credential itself must add it only for the + * API's own origin. A request whose `fetchOptions` set `redirect: 'manual'` gets its 3xx answer + * back unfollowed, so a caller can read a signed URL from `Location`; `'error'` is kept too. + * + * In a browser or a browser worker, which hide a manual redirect's target, a request whose only + * credentials are ones the browser itself keeps on the origin (`Authorization`, cookies) is sent + * with `redirect: 'follow'`. A request carrying an API key header is not, so a redirect it meets + * fails with an `APIConnectionError` rather than handing that key to another host. */ fetch?: Fetch | undefined; @@ -150,6 +185,7 @@ export type DedalusOptions = ClientOptions; export class Dedalus { apiKey: string | AuthTokenProvider | null; xAPIKey: string | AuthTokenProvider | null; + browserToken: string | AuthTokenProvider | null; dedalusOrgID: string | null; asBaseURL: string | null; @@ -159,7 +195,11 @@ export class Dedalus { logger: Logger; logLevel: LogLevel | undefined; fetchOptions: MergedRequestInit | undefined; - private fetch: Fetch; + /** + * The `fetch` implementation every request is sent through: the `fetch` client option, or the + * platform default. A replacement must honor the same contract as that option. + */ + fetch: Fetch; #encoder: Opts.RequestEncoder; protected idempotencyHeader?: string; private _baseURLOverridden: boolean; @@ -171,6 +211,7 @@ export class Dedalus { * * @param {string | AuthTokenProvider | null | undefined} [opts.apiKey=process.env["DEDALUS_API_KEY"] ?? null] * @param {string | AuthTokenProvider | null | undefined} [opts.xAPIKey=process.env["DEDALUS_X_API_KEY"] ?? null] + * @param {string | AuthTokenProvider | null | undefined} [opts.browserToken=process.env["DEDALUS_BROWSER_TOKEN"] ?? null] * @param {string | null | undefined} [opts.dedalusOrgID=process.env["DEDALUS_ORG_ID"] ?? null] * @param {string | null | undefined} [opts.asBaseURL=process.env["DEDALUS_AS_URL"] ?? "https://as.dedaluslabs.ai"] * @param {string} [opts.baseURL=process.env["DEDALUS_BASE_URL"] ?? https://dcs.dedaluslabs.ai] - Override the default base URL for the API. @@ -185,6 +226,7 @@ export class Dedalus { baseURL = readEnv('DEDALUS_BASE_URL'), apiKey = readEnv('DEDALUS_API_KEY') ?? null, xAPIKey = readEnv('DEDALUS_X_API_KEY') ?? null, + browserToken = readEnv('DEDALUS_BROWSER_TOKEN') ?? null, dedalusOrgID = readEnv('DEDALUS_ORG_ID') ?? null, asBaseURL = readEnv('DEDALUS_AS_URL') ?? 'https://as.dedaluslabs.ai', ...opts @@ -192,6 +234,7 @@ export class Dedalus { const options: ClientOptions = { apiKey, xAPIKey, + browserToken, dedalusOrgID, asBaseURL, ...opts, @@ -233,6 +276,7 @@ export class Dedalus { this.apiKey = apiKey; this.xAPIKey = xAPIKey; + this.browserToken = browserToken; this.dedalusOrgID = dedalusOrgID; this.asBaseURL = asBaseURL; } @@ -249,6 +293,7 @@ export class Dedalus { fetchOptions: this.fetchOptions, apiKey: this.apiKey, xAPIKey: this.xAPIKey, + browserToken: this.browserToken, dedalusOrgID: this.dedalusOrgID, asBaseURL: this.asBaseURL, ...options, @@ -261,6 +306,25 @@ export class Dedalus { return this._baseURLOverridden || this.baseURL !== this._defaultBaseURL; } + /** + * The client as `JSON.stringify` sees it: every credential masked, and the resource accessors, + * which point back at the client, left out. + */ + toJSON(): Record { + const view: Record = {}; + for (const [key, value] of Object.entries(this)) { + if (typeof value === 'object' && value !== null && (value as { _client?: unknown })._client === this) + continue; + view[key] = redactClientField(key, value); + } + return view; + } + + /** What `console.log` and `util.inspect` print for the client: the masked view `toJSON` builds. */ + [Symbol.for('nodejs.util.inspect.custom')](): Record { + return this.toJSON(); + } + protected defaultQuery(): Record | undefined { return this._options.defaultQuery; } @@ -274,7 +338,7 @@ export class Dedalus { } protected defaultIdempotencyKey(): string { - return `scalar-node-retry-${uuid4()}`; + return uuid7().replace(/-/g, ''); } protected makeStatusError( @@ -408,10 +472,25 @@ export class Dedalus { } const controller = new AbortController(); - const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError); + // The deadline stays armed until the body is read, not just until headers arrive, so a server + // that answers quickly and then trickles its body is still cut off at `timeout`. + const { release: releaseDeadline, unref: unrefDeadline } = this.#armDeadline( + req.signal, + timeout, + controller, + ); + // A subclass's own `fetchWithTimeout` sends the request; the deadline above still covers the body. + const viaOverride = this.fetchWithTimeout !== Dedalus.prototype.fetchWithTimeout; + const response = await (viaOverride + ? Promise.resolve().then(() => this.fetchWithTimeout(url, req, timeout, controller)) + : this.#fetchFollowingRedirects(url, req, controller) + ).catch(castToError); const headersTime = Date.now(); if (response instanceof globalThis.Error) { + releaseDeadline(); + // A redirect the SDK refused to follow fails the same way on every attempt, so it is not retried. + if (isRefusedRedirect(response)) throw response; const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; if (options.signal?.aborted) { throw new Errors.APIUserAbortError(); @@ -466,6 +545,7 @@ export class Dedalus { const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; // We don't need the body of this response. + releaseDeadline(); await Shims.CancelReadableStream(response.body); loggerFor(this).info(`${responseInfo} - ${retryMessage}`); loggerFor(this).debug( @@ -490,7 +570,12 @@ export class Dedalus { loggerFor(this).info(`${responseInfo} - ${retryMessage}`); - const errText = await response.text().catch((err: any) => castToError(err).message); + // Only the first 64 KiB of an error body is read: enough for any message, and a hostile or + // broken server cannot make the client buffer more. The read still runs under the deadline. + const errText = await readBodyText(response, MAX_ERROR_BODY_BYTES, 'truncate').catch( + (err: any) => castToError(err).message, + ); + releaseDeadline(); const errJSON = safeJSON(errText) as any; const errMessage = errJSON ? undefined : errText; @@ -522,6 +607,16 @@ export class Dedalus { }), ); + // A streamed or binary body is the caller's to read at its own pace, so the deadline ends with + // the headers there; a buffered body keeps it until `defaultParseResponse` has read it. + if (options.stream || options.__binaryResponse) releaseDeadline(); + else { + // Unreferenced so a response nobody parses (a call never awaited) cannot hold the process + // open until the deadline; a body being read keeps it alive through its own socket. + unrefDeadline(); + holdDeadline(controller, releaseDeadline); + } + return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; } @@ -550,28 +645,84 @@ export class Dedalus { return new PagePromise(this, this.makeRequest(options, null, undefined), Page); } + /** + * Sends one request with a deadline on its response headers, following redirects as the client + * does. + * + * Override it in a subclass to wrap every HTTP request this client sends to its API, retries included; + * call `super.fetchWithTimeout` to send, which keeps the client's redirect handling. When a redirect + * leaves the origin that drops the client's own credential headers, but a header an override adds + * goes on to the redirect target, so a secret belongs in a client option rather than added here. + * A client that does not override it skips this method and sends directly. + * + * The SDK's own deadline aborts `controller` and stays armed until a buffered body is read, so it + * cuts off an override that sends through `super` or passes `controller.signal` on; a larger `ms` + * passed to `super` cannot extend it, so set the `timeout` option instead. + */ async fetchWithTimeout( url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController, ): Promise { - const { signal, method, ...options } = init || {}; + const deadline = this.#armDeadline(init?.signal, ms, controller); + try { + return await this.#fetchFollowingRedirects(url, init, controller); + } finally { + deadline.release(); + } + } + + /** + * Starts the request deadline on `controller` and forwards the caller's abort signal to it. + * + * `release` disarms the deadline. `unref` stops it alone from keeping a Node process alive, for + * the stretch where it waits on a body nobody may ever read. + */ + #armDeadline( + signal: RequestInit['signal'], + ms: number, + controller: AbortController, + ): { release: () => void; unref: () => void } { const abort = this._makeAbort(controller); if (signal?.aborted) abort(); else if (signal) signal.addEventListener('abort', abort, { once: true }); const timeout = setTimeout(abort, ms); + return { + release: () => clearTimeout(timeout), + unref: () => (timeout as { unref?: () => void } | undefined)?.unref?.(), + }; + } - const isReadableBody = - ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) || - (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body); + /** + * Sends one request, following its redirects here rather than in `fetch`. + * + * Platform `fetch` strips only `Authorization` when a redirect leaves the origin, so it would hand + * a header API key, cookies and a 307 body to whatever host the API names. Following here, where + * the client knows which headers carry credentials, keeps them on the API's own origin. + */ + async #fetchFollowingRedirects( + url: RequestInfo, + init: RequestInit | undefined, + controller: AbortController, + ): Promise { + const { signal, method, ...options } = init || {}; + const isReadableBody = isOneShotBody(options.body); + const request = typeof url === 'string' || url instanceof URL ? undefined : url; + const carriesUnguardedCredential = [...new Headers(options.headers ?? request?.headers).keys()].some( + (name) => CREDENTIAL_HEADERS.includes(name) && !BROWSER_GUARDED_HEADERS.includes(name), + ); + const browserFollows = hidesRedirectTargets() && !carriesUnguardedCredential; + const callerRedirect = + options.redirect === 'error' || options.redirect === 'manual' ? options.redirect : undefined; const fetchOptions: RequestInit = { signal: controller.signal as any, ...(isReadableBody ? { duplex: 'half' } : {}), method: 'GET', ...options, + redirect: callerRedirect ?? (browserFollows ? 'follow' : 'manual'), }; if (method) { // Custom methods like 'patch' need to be uppercased @@ -579,11 +730,97 @@ export class Dedalus { fetchOptions.method = method.toUpperCase(); } - try { - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - return await this.fetch.call(undefined, url, fetchOptions); - } finally { - clearTimeout(timeout); + // use undefined this binding; fetch errors if bound to something else in browsers and edge runtimes / workers + let response = await this.fetch.call(undefined, url, fetchOptions); + let current = request ? request.url : String(url); + let hop: RequestInit = { + ...fetchOptions, + headers: new Headers(fetchOptions.headers ?? request?.headers), + }; + // Once a hop leaves the origin, credentials stay dropped for the rest of the chain, even if a + // later hop comes back: the foreign host chose where that hop goes. + let leftOrigin = false; + for (let redirects = 0; ; redirects++) { + if (callerRedirect) return response; + if (hop.redirect === 'manual' && response.redirected) { + throw refuseRedirect( + "The fetch implementation followed a redirect itself although the client asked it not to, so its response was not used. A custom fetch must honor redirect: 'manual'.", + ); + } + if (response.type === 'opaqueredirect') { + // Browsers answer a manual redirect with an opaque response that hides its target, so there + // is nothing safe to follow; it is refused rather than mistaken for the API's answer. + throw refuseRedirect( + carriesUnguardedCredential + ? 'The server answered with a redirect, which this request does not follow: the platform hides the target from the SDK, and the request carries an API key header that could reach another host. Call the redirect target directly, or send the request from a server.' + : 'The server answered with a redirect whose target this platform hides from the SDK, so it was not followed. Call the redirect target directly, or send the request from a server.', + ); + } + const location = REDIRECT_STATUSES.includes(response.status) + ? response.headers.get('location')?.trim() + : undefined; + if (!location) return response; + await Shims.CancelReadableStream(response.body); + if (redirects >= MAX_REDIRECTS) throw refuseRedirect(`Maximum redirects exceeded (${MAX_REDIRECTS}).`); + + const from = new URL(current); + let target: URL; + try { + target = new URL(location, from); + } catch { + throw refuseRedirect('The server redirected to a URL that cannot be parsed.'); + } + if (target.protocol !== 'https:' && target.protocol !== 'http:') { + throw refuseRedirect(`Refusing to follow a redirect to a ${target.protocol} URL.`); + } + if (from.protocol === 'https:' && target.protocol === 'http:') { + throw refuseRedirect('Refusing to follow a redirect from https to http.'); + } + + const headers = new Headers(hop.headers); + let nextMethod = hop.method ?? 'GET'; + let body = hop.body ?? request?.body ?? undefined; + // A 303 (but for HEAD), and a 301 or 302 answering a POST, re-ask with a bodiless GET, as + // browsers do. Every other redirect repeats the request, so its body has to be sent again. + if ( + (response.status === 303 && nextMethod !== 'HEAD') || + ((response.status === 301 || response.status === 302) && nextMethod === 'POST') + ) { + nextMethod = 'GET'; + body = undefined; + for (const name of [...headers.keys()]) if (name.startsWith('content-')) headers.delete(name); + } else if (body != null && isOneShotBody(body)) { + throw refuseRedirect( + `Refusing to follow a ${response.status} redirect: the request body was a stream, which cannot be sent again.`, + ); + } + + if (target.origin !== from.origin) leftOrigin = true; + if (leftOrigin) { + for (const name of CREDENTIAL_HEADERS) headers.delete(name); + } else { + // A `Location` the server spelled does not repeat our query credentials, so a same-origin + // hop carries them over; appended rather than set so the target's own query keeps its bytes. + for (const name of CREDENTIAL_QUERY) { + const value = from.searchParams.get(name); + if (value === null || target.searchParams.has(name)) continue; + target.search = + (target.search ? target.search + '&' : '?') + + encodeURIComponent(name) + + '=' + + encodeURIComponent(value); + } + } + + hop = { ...hop, method: nextMethod, headers }; + if (body == null) { + delete hop.body; + delete (hop as { duplex?: unknown }).duplex; + } else { + hop.body = body; + } + current = target.href; + response = await this.fetch.call(undefined, current, hop); } } @@ -748,12 +985,24 @@ export class Dedalus { appendAuthCookies(headers.values, await this.authCookiesAsync()); this.validateAuth(url, headers.values, options); + // Last, so a subclass sees the headers as they leave here, after the SDK has checked the auth. + await this.validateHeaders(headers); return headers.values; } + /** + * Runs once for every HTTP request built from the client's headers, at the end of header building, + * with the headers it will be sent with: `values` holds them and `nulls` the names the call removed + * with a `null`. + * Throwing, or rejecting from an `async` override, which is awaited, rejects the request before it + * is sent. Does nothing unless a subclass overrides it. + * `fetchOptions.headers` and `prepareRequest` are applied afterwards, so the hook does not see them. + */ + protected validateHeaders({ values, nulls }: NullableHeaders): void {} + private _makeAbort(controller: AbortController) { - // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure + // note: we can't just inline this method inside `#armDeadline()` because then the closure // would capture all request options, and cause a memory leak. return () => controller.abort(); } @@ -769,18 +1018,20 @@ export class Dedalus { if (body == null) { return { bodyHeaders: undefined, body: undefined }; } - const headers = buildHeaders([rawHeaders]); + // A `content-type` from either header bag says how the body is already encoded; the request's + // own wins over the client-wide default, as it does on the wire. + const headers = buildHeaders([this._options.defaultHeaders, rawHeaders]); if ( // Pass raw type verbatim ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || - // Always pass strings through verbatim. The previous guard required a caller-set - // `content-type` and otherwise fell through to `FallbackEncoder`, which JSON.stringifies - // the value and labels it `application/json` — silently quoting plain-text payloads and - // mislabeling them as JSON. fetch defaults a string body to `text/plain;charset=UTF-8` - // when no `content-type` is set, which is a safer default than misclaiming JSON. - typeof body === 'string' || + // A string is only already-encoded when something has said what it is encoded as. + // Generated call sites state the declared request media type, so a `text/plain` or + // ndjson payload reaches the wire byte-for-byte. A string with no `content-type` came + // from a body the document declared as JSON — `{ "type": "string" }` — and encoding it + // below is what puts the quotes the server parses for around it. + (typeof body === 'string' && headers.values.has('content-type')) || // `Blob` is superset of `File` ((globalThis as any).Blob && body instanceof (globalThis as any).Blob) || // `FormData` -> `multipart/form-data` @@ -818,7 +1069,7 @@ export class Dedalus { throw new Errors.AuthenticationError( 401, undefined, - 'Could not resolve authentication method. Expected either apiKey or xAPIKey to be set. Or for one of the "Authorization" or "x-api-key" headers to be explicitly omitted', + 'Could not resolve authentication method. Expected either apiKey, browserToken or xAPIKey to be set. Or for one of the "Authorization" or "x-api-key" headers to be explicitly omitted', headers, ); } @@ -829,6 +1080,8 @@ export class Dedalus { if (apiKey) headers['Authorization'] = `Bearer ${apiKey}`; const xAPIKey = this.resolveAuthOptionSync('xAPIKey', this.xAPIKey); if (xAPIKey) headers['x-api-key'] = xAPIKey; + const browserToken = this.resolveAuthOptionSync('browserToken', this.browserToken); + if (browserToken) headers['Authorization'] = `Bearer ${browserToken}`; return headers; } @@ -841,7 +1094,11 @@ export class Dedalus { } protected async authHeaders(opts: FinalRequestOptions): Promise { - return buildHeaders([await this.bearerAuth(opts), await this.apiKeyAuth(opts)]); + return buildHeaders([ + await this.bearerAuth(opts), + await this.apiKeyAuth(opts), + await this.browserAuth(opts), + ]); } protected async bearerAuth(opts: FinalRequestOptions): Promise { @@ -860,6 +1117,14 @@ export class Dedalus { return buildHeaders([{ 'x-api-key': xAPIKey }]); } + protected async browserAuth(opts: FinalRequestOptions): Promise { + const browserToken = await this.resolveAuthOption('browserToken', this.browserToken); + if (browserToken == null) { + return undefined; + } + return buildHeaders([{ Authorization: `Bearer ${browserToken}` }]); + } + private async authQueryAsync(): Promise> { const query: Record = {}; return query; @@ -912,10 +1177,12 @@ export class Dedalus { machines: Machines = new Machines(this); organization: Organization = new Organization(this); + images: Images = new Images(this); } Dedalus.Machines = Machines; Dedalus.Organization = Organization; +Dedalus.Images = Images; export declare namespace Dedalus { export type RequestOptions = Opts.RequestOptions; @@ -931,8 +1198,10 @@ export declare namespace Dedalus { type CreateParams as CreateParams, type UpdateParams as UpdateParams, type LifecycleStatus as LifecycleStatus, + type AutoresizingSwitch as AutoresizingSwitch, type MachineListItemsCursorPage as MachineListItemsCursorPage, type MachineRetrieveResponse as MachineRetrieveResponse, + type MachineResizeResponse as MachineResizeResponse, type MachineListParams as MachineListParams, type MachineCreateParams as MachineCreateParams, type MachineRetrieveParams as MachineRetrieveParams, @@ -941,9 +1210,23 @@ export declare namespace Dedalus { type MachineSleepParams as MachineSleepParams, type MachineWakeParams as MachineWakeParams, type MachineRebootParams as MachineRebootParams, + type MachineResizeParams as MachineResizeParams, }; export { Organization as Organization }; + + export { + Images as Images, + type Image as Image, + type ImageList as ImageList, + type Source as Source, + type ImagesError as Error, + type ImageListParams as ImageListParams, + type ImageCreateParams as ImageCreateParams, + type ImageRetrieveParams as ImageRetrieveParams, + type ImageUpdateParams as ImageUpdateParams, + type ImageDeleteParams as ImageDeleteParams, + }; } const headerExplicitlyOmitted = (source: HeadersLike | undefined, name: string): boolean => { @@ -966,3 +1249,97 @@ const cookieHeaderHas = (value: string | null, name: string): boolean => { const target = encodeURIComponent(name) + '='; return value.split(';').some((cookie) => cookie.trim().startsWith(target)); }; + +/** Client fields holding a secret, masked whenever the client is printed or serialized. */ +const SECRET_CLIENT_FIELDS: readonly string[] = ['apiKey', 'xAPIKey', 'browserToken']; + +/** + * One field of the client (or of its stored options) as a printed client shows it. Credentials are + * masked outright; header bags go through the log redaction, which knows every header this SDK + * authenticates with; a base URL loses any userinfo or query credential it carries. + */ +const redactClientField = (key: string, value: unknown): unknown => { + if (value === null || value === undefined) return value; + if (SECRET_CLIENT_FIELDS.includes(key)) return '***'; + if (key === 'baseURL' && typeof value === 'string') return redactUrl(value); + if (key === 'defaultHeaders') { + if (value instanceof Headers) return redactHeaders(value); + if (typeof value !== 'object' || Array.isArray(value)) return '***'; + const redactValue = (name: string, field: unknown): unknown => { + if (typeof field === 'string') return redactHeaders({ [name]: field })[name]; + if (Array.isArray(field)) return field.map((entry) => redactValue(name, entry)); + return field === null || field === undefined ? field : '***'; + }; + return Object.fromEntries(Object.entries(value).map(([name, field]) => [name, redactValue(name, field)])); + } + if (typeof value !== 'object') return value; + if (key === 'fetchOptions') { + const { headers: _headers, ...rest } = value as Record; + return _headers === undefined ? rest : { ...rest, headers: '***' }; + } + if (key === '_options') { + return Object.fromEntries( + Object.entries(value).map(([name, field]) => [name, redactClientField(name, field)]), + ); + } + return value; +}; + +/** Statuses the client follows when they carry a `Location`; any other 3xx is the server's answer. */ +const REDIRECT_STATUSES: readonly number[] = [301, 302, 303, 307, 308]; + +/** The most redirects one request follows, the same cap the platform `fetch` uses. */ +const MAX_REDIRECTS = 20; + +/** + * Headers that carry a credential: the platform's own and every header this API's security schemes + * place. A redirect that leaves the origin drops each of them, wherever it was set. + */ +const CREDENTIAL_HEADERS: readonly string[] = ['authorization', 'cookie', 'proxy-authorization', 'x-api-key']; + +/** Query parameters this API's security schemes place, carried only to a same-origin redirect target. */ +const CREDENTIAL_QUERY: readonly string[] = []; + +/** + * Credential headers a browser keeps on the origin itself: it drops `Authorization` from a + * cross-origin redirect and never lets script set the other two. + */ +const BROWSER_GUARDED_HEADERS: readonly string[] = ['authorization', 'cookie', 'proxy-authorization']; + +/** + * Whether this runtime's fetch answers a manual redirect opaquely, hiding its target: a browser + * page, or a dedicated, shared or service worker in one. A worker scope alone is not enough, + * since edge runtimes model theirs on it while returning the real 3xx; a browser user agent is. + */ +const hidesRedirectTargets = (): boolean => { + if (isRunningInBrowser()) return true; + if (typeof (globalThis as { WorkerGlobalScope?: unknown }).WorkerGlobalScope === 'undefined') return false; + const agent: unknown = (globalThis as any).navigator?.userAgent; + return typeof agent === 'string' && agent.startsWith('Mozilla/'); +}; + +/** Marks the error for a redirect the client refused to follow, which `makeRequest` does not retry. */ +const REFUSED_REDIRECT = Symbol('refusedRedirect'); + +/** Marks `error` as a redirect refusal, which no retry layer repeats. */ +const markRefusedRedirect = (error: Errors.APIConnectionError): Errors.APIConnectionError => { + (error as { [REFUSED_REDIRECT]?: true })[REFUSED_REDIRECT] = true; + return error; +}; + +/** A connection error for a redirect the client will not follow. */ +const refuseRedirect = (message: string): Errors.APIConnectionError => + markRefusedRedirect(new Errors.APIConnectionError({ message })); + +/** Whether `error` is a redirect refusal from {@link refuseRedirect}. */ +const isRefusedRedirect = (error: unknown): boolean => + typeof error === 'object' && + error !== null && + (error as { [REFUSED_REDIRECT]?: true })[REFUSED_REDIRECT] === true; + +/** Whether a request body can be read only once, so a redirect that repeats the request cannot resend it. */ +const isOneShotBody = (body: unknown): boolean => + !!( + ((globalThis as any).ReadableStream && body instanceof (globalThis as any).ReadableStream) || + (typeof body === 'object' && body !== null && Symbol.asyncIterator in body) + ); diff --git a/src/sdk/core/pagination.ts b/src/sdk/core/pagination.ts index b9c0e5e..ae53ea5 100644 --- a/src/sdk/core/pagination.ts +++ b/src/sdk/core/pagination.ts @@ -10,9 +10,11 @@ export type PageRequestOptions = Pick implements AsyncIterable { protected readonly client: Dedalus; - protected readonly options: FinalRequestOptions; - protected readonly response: Response; - protected readonly body: unknown; + // Writable so a subclass can rewrite what it parsed or the options the next page is built from; + // a subclass that only reads them is unaffected. + protected options: FinalRequestOptions; + protected response: Response; + protected body: unknown; constructor(client: Dedalus, response: Response, body: unknown, options: FinalRequestOptions) { this.client = client; @@ -25,7 +27,8 @@ export abstract class AbstractPage implements AsyncIterable { } abstract nextPageRequestOptions(): PageRequestOptions | null; - abstract getPaginatedItems(): readonly Item[]; + // A plain array, not `readonly`, so a caller can keep a page's items in an `Item[]` it owns. + abstract getPaginatedItems(): Item[]; hasNextPage(): boolean { const items = this.getPaginatedItems(); diff --git a/src/sdk/internal/detect-platform.ts b/src/sdk/internal/detect-platform.ts index 3954ec3..2730124 100644 --- a/src/sdk/internal/detect-platform.ts +++ b/src/sdk/internal/detect-platform.ts @@ -104,7 +104,7 @@ const getPlatformProperties = (): PlatformProperties => { }; } - // TODO add support for Cloudflare workers, etc. + // TODO add support for worker runtimes that expose no EdgeRuntime global, etc. return { 'X-Scalar-Lang': 'js', 'X-Scalar-Package-Version': VERSION, @@ -122,35 +122,52 @@ type BrowserInfo = { declare const navigator: { userAgent: string } | undefined; -// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts +/** + * Reads the browser family and version from `navigator.userAgent`, or returns `null` outside a + * browser or for an agent it does not recognise. + * + * Every major browser also carries the tokens of the engines it grew out of (Edge says `Chrome/` and + * `Safari/`, Chrome says `Safari/`), so the most specific token is checked first. + */ function getBrowserInfo(): BrowserInfo | null { - if (typeof navigator === 'undefined' || !navigator) { + if (typeof navigator === 'undefined' || !navigator || typeof navigator.userAgent !== 'string') { return null; } + const userAgent = navigator.userAgent; + const tokens = userAgentTokens(userAgent); + /** Returns the version of the first of `names` the agent carries a token for. */ + const pick = (...names: string[]): string | undefined => + names.map((name) => tokens.get(name)).find((version) => version !== undefined); + + const edge = pick('Edg', 'Edge', 'EdgA', 'EdgiOS'); + if (edge) return { browser: 'edge', version: edge }; + // IE 11 dropped `MSIE`; it is told apart by its `Trident/` engine token and an `rv:` version. + const ie = + /\bMSIE (\d+(?:\.\d+)*)/.exec(userAgent)?.[1] ?? + (tokens.has('Trident') ? /\brv:(\d+(?:\.\d+)*)/.exec(userAgent)?.[1] : undefined); + if (ie) return { browser: 'ie', version: ie }; + const firefox = pick('Firefox', 'FxiOS'); + if (firefox) return { browser: 'firefox', version: firefox }; + const chrome = pick('Chrome', 'CriOS', 'HeadlessChrome'); + if (chrome) return { browser: 'chrome', version: chrome }; + // Safari's own version is the `Version/` token; its `Safari/` token is the WebKit build, so an + // iOS app's web view that carries only `Safari/` is still Safari, at a version it does not state. + if (tokens.has('Safari')) return { browser: 'safari', version: tokens.get('Version') ?? 'unknown' }; + return null; +} - // NOTE: The order matters here! - const browserPatterns = [ - { key: 'edge' as const, pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: 'ie' as const, pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: 'ie' as const, pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: 'chrome' as const, pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: 'firefox' as const, pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ }, - { key: 'safari' as const, pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ }, - ]; - - // Find the FIRST matching browser - for (const { key, pattern } of browserPatterns) { - const match = pattern.exec(navigator.userAgent); - if (match) { - const major = match[1] || 0; - const minor = match[2] || 0; - const patch = match[3] || 0; - - return { browser: key, version: `${major}.${minor}.${patch}` }; - } +/** + * Collects the `Name/1.2.3` product tokens of a user-agent string, keeping the first version seen for + * each name. + */ +function userAgentTokens(userAgent: string): Map { + const tokens = new Map(); + // The lookbehind starts a name only where a run of letters starts, so a long run is scanned once + // rather than retried from every letter in it. + for (const match of userAgent.matchAll(/(? { diff --git a/src/sdk/internal/headers.ts b/src/sdk/internal/headers.ts index 411434e..066ea8c 100644 --- a/src/sdk/internal/headers.ts +++ b/src/sdk/internal/headers.ts @@ -27,6 +27,14 @@ export type NullableHeaders = { nulls: Set; }; +/** + * Whether `value` is a fetch `Headers`. Checked through `typeof` first, so a runtime without the global + * (a verifier imported on its own into an older Node, say) reads the value as some other shape instead + * of throwing a `ReferenceError`. + */ +const isFetchHeaders = (value: unknown): value is Headers => + typeof Headers !== 'undefined' && value instanceof Headers; + function* iterateHeaders(headers: HeadersLike): IterableIterator { if (!headers) return; @@ -41,7 +49,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator; - if (headers instanceof Headers) { + if (isFetchHeaders(headers)) { iter = headers.entries(); } else if (isReadonlyArray(headers)) { iter = headers; @@ -95,3 +103,67 @@ export const isEmptyHeaders = (headers: HeadersLike) => { for (const _ of iterateHeaders(headers)) return false; return true; }; + +/** A headers object read through a `get` method, like the fetch API's `Headers`. */ +export interface HeadersProtocol { + get: (header: string) => string | null | undefined; +} + +export const isHeadersProtocol = (headers: unknown): headers is HeadersProtocol => + typeof (headers as { get?: unknown } | null | undefined)?.get === 'function'; + +/** + * Lowercases ASCII letters only. HTTP header names are ASCII, and `toLowerCase` also folds characters + * such as the Kelvin sign (U+212A) to `k`, which would let a header no client sends match one it does. + */ +const asciiLowerCase = (name: string): string => name.replace(/[A-Z]/g, (letter) => letter.toLowerCase()); + +/** + * Reads every value of one header, matching its name case-insensitively, from any headers shape a + * request handler hands over: each entry of an array value, and the value of every name that differs + * only in case, in order. A fetch `Headers`, or any object read through `get`, has already folded + * repeated lines into one comma-joined value, so it yields at most one. + * + * This is the one lookup the webhook verifier and its companions read headers through, so a delivery is + * read the same way whichever method receives it. A value that is not a non-empty string is skipped + * rather than coerced, since a JavaScript caller may hand over anything. + */ +export const getHeaderValues = (headers: HeadersLike | HeadersProtocol, header: string): string[] => { + if (!headers) return []; + + const lowerCasedHeader = asciiLowerCase(header); + if (isHeadersProtocol(headers)) { + // A fetch `Headers` matches any casing, but a look-alike `get` may be case-sensitive, so the common + // spellings are tried in turn (`Webhook-Id` covers a header stored in title case). + const intercapsHeader = + header.charAt(0).toUpperCase() + + header.substring(1).replace(/([^\w])(\w)/g, (_m, g1: string, g2: string) => g1 + g2.toUpperCase()); + for (const key of [header, lowerCasedHeader, header.toUpperCase(), intercapsHeader]) { + const value = headers.get(key); + if (typeof value === 'string' && value) return [value]; + } + if (isFetchHeaders(headers)) return []; + } + + const values: string[] = []; + for (const [name, value] of iterateHeaders(headers as HeadersLike)) { + if (typeof value === 'string' && value && asciiLowerCase(name) === lowerCasedHeader) values.push(value); + } + return values; +}; + +/** + * Reads one header like {@link getHeaderValues}, yielding its first value: the first entry of an array + * value, or the first of two names that differ only in case. + */ +export const getHeader = (headers: HeadersLike | HeadersProtocol, header: string): string | undefined => + getHeaderValues(headers, header)[0]; + +/** Reads one header like {@link getHeader}, throwing when the headers do not carry it. */ +export const getRequiredHeader = (headers: HeadersLike | HeadersProtocol, header: string): string => { + const value = getHeader(headers, header); + if (value === undefined) { + throw new Error(`Could not find ${header} header`); + } + return value; +}; diff --git a/src/sdk/internal/qs/LICENSE.md b/src/sdk/internal/qs/LICENSE.md deleted file mode 100644 index 3fda157..0000000 --- a/src/sdk/internal/qs/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/sdk/internal/qs/README.md b/src/sdk/internal/qs/README.md deleted file mode 100644 index 67ae04e..0000000 --- a/src/sdk/internal/qs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# qs - -This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library. diff --git a/src/sdk/internal/qs/formats.ts b/src/sdk/internal/qs/formats.ts deleted file mode 100644 index e76a742..0000000 --- a/src/sdk/internal/qs/formats.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Format } from './types'; - -export const default_format: Format = 'RFC3986'; -export const default_formatter = (v: PropertyKey) => String(v); -export const formatters: Record string> = { - RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'), - RFC3986: default_formatter, -}; -export const RFC1738 = 'RFC1738'; -export const RFC3986 = 'RFC3986'; diff --git a/src/sdk/internal/qs/index.ts b/src/sdk/internal/qs/index.ts deleted file mode 100644 index c3a3620..0000000 --- a/src/sdk/internal/qs/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { default_format, formatters, RFC1738, RFC3986 } from './formats'; - -const formats = { - formatters, - RFC1738, - RFC3986, - default: default_format, -}; - -export { stringify } from './stringify'; -export { formats }; - -export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types'; diff --git a/src/sdk/internal/qs/stringify.ts b/src/sdk/internal/qs/stringify.ts deleted file mode 100644 index 66ef9a4..0000000 --- a/src/sdk/internal/qs/stringify.ts +++ /dev/null @@ -1,384 +0,0 @@ -import { encode, is_buffer, maybe_map, has } from './utils'; -import { default_format, default_formatter, formatters } from './formats'; -import type { NonNullableProperties, StringifyOptions } from './types'; -import { isArray } from '../utils/values'; - -const array_prefix_generators = { - brackets(prefix: PropertyKey) { - return String(prefix) + '[]'; - }, - comma: 'comma', - indices(prefix: PropertyKey, key: string) { - return String(prefix) + '[' + key + ']'; - }, - repeat(prefix: PropertyKey) { - return String(prefix); - }, -}; - -const push_to_array = function (arr: any[], value_or_array: any) { - Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]); -}; - -let toISOString; - -const defaults = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: 'indices', - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encodeDotInKeys: false, - encoder: encode, - encodeValuesOnly: false, - format: default_format, - formatter: default_formatter, - /** @deprecated */ - indices: false, - serializeDate(date) { - return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date); - }, - skipNulls: false, - strictNullHandling: false, -} as NonNullableProperties; - -function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint { - return ( - typeof v === 'string' || - typeof v === 'number' || - typeof v === 'boolean' || - typeof v === 'symbol' || - typeof v === 'bigint' - ); -} - -const sentinel = {}; - -function inner_stringify( - object: any, - prefix: PropertyKey, - generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string), - commaRoundTrip: boolean, - allowEmptyArrays: boolean, - strictNullHandling: boolean, - skipNulls: boolean, - encodeDotInKeys: boolean, - encoder: StringifyOptions['encoder'], - filter: StringifyOptions['filter'], - sort: StringifyOptions['sort'], - allowDots: StringifyOptions['allowDots'], - serializeDate: StringifyOptions['serializeDate'], - format: StringifyOptions['format'], - formatter: StringifyOptions['formatter'], - encodeValuesOnly: boolean, - charset: StringifyOptions['charset'], - sideChannel: WeakMap, -) { - let obj = object; - - let tmp_sc = sideChannel; - let step = 0; - let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) { - // Where object last appeared in the ref tree - const pos = tmp_sc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - find_flag = true; // Break while - } - } - if (typeof tmp_sc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate?.(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = maybe_map(obj, function (value) { - if (value instanceof Date) { - return serializeDate?.(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly - ? // @ts-expect-error - encoder(prefix, defaults.encoder, charset, 'key', format) - : prefix; - } - - obj = ''; - } - - if (is_non_nullish_primitive(obj) || is_buffer(obj)) { - if (encoder) { - const key_value = encodeValuesOnly - ? prefix - : // @ts-expect-error - encoder(prefix, defaults.encoder, charset, 'key', format); - return [ - formatter?.(key_value) + - '=' + - // @ts-expect-error - formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)), - ]; - } - return [formatter?.(prefix) + '=' + formatter?.(String(obj))]; - } - - const values: string[] = []; - - if (typeof obj === 'undefined') { - return values; - } - - let obj_keys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - if (encodeValuesOnly && encoder) { - // @ts-expect-error values only - obj = maybe_map(obj, encoder); - } - obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - obj_keys = filter; - } else { - const keys = Object.keys(obj); - obj_keys = sort ? keys.sort(sort) : keys; - } - - const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); - - const adjusted_prefix = - commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix; - - if (allowEmptyArrays && isArray(obj) && obj.length === 0) { - return adjusted_prefix + '[]'; - } - - for (let j = 0; j < obj_keys.length; ++j) { - const key = obj_keys[j]; - const value = - // @ts-ignore - typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any]; - - if (skipNulls && value === null) { - continue; - } - - // @ts-ignore - const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key; - const key_prefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' - ? generateArrayPrefix(adjusted_prefix, encoded_key) - : adjusted_prefix - : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']'); - - sideChannel.set(object, step); - const valueSideChannel = new WeakMap(); - valueSideChannel.set(sentinel, sideChannel); - push_to_array( - values, - inner_stringify( - value, - key_prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - // @ts-ignore - generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel, - ), - ); - } - - return values; -} - -function normalize_stringify_options( - opts: StringifyOptions = defaults, -): NonNullableProperties> & { indices?: boolean } { - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { - throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - const charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - let format = default_format; - if (typeof opts.format !== 'undefined') { - if (!has(formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - const formatter = formatters[format]; - - let filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - let arrayFormat: StringifyOptions['arrayFormat']; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { - arrayFormat = opts.arrayFormat; - } else if ('indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = defaults.arrayFormat; - } - - if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - - const allowDots = - typeof opts.allowDots === 'undefined' - ? !!opts.encodeDotInKeys === true - ? true - : defaults.allowDots - : !!opts.allowDots; - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - // @ts-ignore - allowDots: allowDots, - allowEmptyArrays: - typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - arrayFormat: arrayFormat, - charset: charset, - charsetSentinel: - typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encodeDotInKeys: - typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: - typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - // @ts-ignore - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: - typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, - }; -} - -export function stringify(object: any, opts: StringifyOptions = {}) { - let obj = object; - const options = normalize_stringify_options(opts); - - let obj_keys: PropertyKey[] | undefined; - let filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - obj_keys = filter; - } - - const keys: string[] = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; - const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; - - if (!obj_keys) { - obj_keys = Object.keys(obj); - } - - if (options.sort) { - obj_keys.sort(options.sort); - } - - const sideChannel = new WeakMap(); - for (let i = 0; i < obj_keys.length; ++i) { - const key = obj_keys[i]!; - - if (options.skipNulls && obj[key] === null) { - continue; - } - push_to_array( - keys, - inner_stringify( - obj[key], - key, - // @ts-expect-error - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel, - ), - ); - } - - const joined = keys.join(options.delimiter); - let prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -} diff --git a/src/sdk/internal/qs/types.ts b/src/sdk/internal/qs/types.ts deleted file mode 100644 index 7c28dbb..0000000 --- a/src/sdk/internal/qs/types.ts +++ /dev/null @@ -1,71 +0,0 @@ -export type Format = 'RFC1738' | 'RFC3986'; - -export type DefaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string; -export type DefaultDecoder = (str: string, decoder?: any, charset?: string) => string; - -export type BooleanOptional = boolean | undefined; - -export type StringifyBaseOptions = { - delimiter?: string; - allowDots?: boolean; - encodeDotInKeys?: boolean; - strictNullHandling?: boolean; - skipNulls?: boolean; - encode?: boolean; - encoder?: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format?: Format, - ) => string; - filter?: Array | ((prefix: PropertyKey, value: any) => any); - arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma'; - indices?: boolean; - sort?: ((a: PropertyKey, b: PropertyKey) => number) | null; - serializeDate?: (d: Date) => string; - format?: 'RFC1738' | 'RFC3986'; - formatter?: (str: PropertyKey) => string; - encodeValuesOnly?: boolean; - addQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - allowEmptyArrays?: boolean; - commaRoundTrip?: boolean; -}; - -export type StringifyOptions = StringifyBaseOptions; - -export type ParseBaseOptions = { - comma?: boolean; - delimiter?: string | RegExp; - depth?: number | false; - decoder?: (str: string, defaultDecoder: DefaultDecoder, charset: string, type: 'key' | 'value') => any; - arrayLimit?: number; - parseArrays?: boolean; - plainObjects?: boolean; - allowPrototypes?: boolean; - allowSparse?: boolean; - parameterLimit?: number; - strictDepth?: boolean; - strictNullHandling?: boolean; - ignoreQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - interpretNumericEntities?: boolean; - allowEmptyArrays?: boolean; - duplicates?: 'combine' | 'first' | 'last'; - allowDots?: boolean; - decodeDotInKeys?: boolean; -}; - -export type ParseOptions = ParseBaseOptions; - -export type ParsedQs = { - [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[]; -}; - -// Type to remove null or undefined union from each property -export type NonNullableProperties = { - [K in keyof T]-?: Exclude; -}; diff --git a/src/sdk/internal/qs/utils.ts b/src/sdk/internal/qs/utils.ts deleted file mode 100644 index 4cd5657..0000000 --- a/src/sdk/internal/qs/utils.ts +++ /dev/null @@ -1,265 +0,0 @@ -import { RFC1738 } from './formats'; -import type { DefaultEncoder, Format } from './types'; -import { isArray } from '../utils/values'; - -export let has = (obj: object, key: PropertyKey): boolean => ( - (has = (Object as any).hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty)), - has(obj, key) -); - -const hex_table = /* @__PURE__ */ (() => { - const array = []; - for (let i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -})(); - -function compact_queue>(queue: Array<{ obj: T; prop: string }>) { - while (queue.length > 1) { - const item = queue.pop(); - if (!item) continue; - - const obj = item.obj[item.prop]; - - if (isArray(obj)) { - const compacted: unknown[] = []; - - for (let j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - // @ts-ignore - item.obj[item.prop] = compacted; - } - } -} - -function array_to_object(source: any[], options: { plainObjects: boolean }) { - const obj = options && options.plainObjects ? Object.create(null) : {}; - for (let i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -} - -export function merge( - target: any, - source: any, - options: { plainObjects?: boolean; allowPrototypes?: boolean } = {}, -) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - let mergeTarget = target; - if (isArray(target) && !isArray(source)) { - // @ts-ignore - mergeTarget = array_to_object(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has(target, i)) { - const targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - const value = source[key]; - - if (has(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -} - -export function assign_single_source(target: any, source: any) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -} - -export function decode(str: string, _: any, charset: string) { - const strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -} - -const limit = 1024; - -export const encode: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format: Format, -) => string = (str, _defaultEncoder, charset, _kind, format: Format) => { - // This code was originally written by Brian White for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - let string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - let out = ''; - for (let j = 0; j < string.length; j += limit) { - const segment = string.length >= limit ? string.slice(j, j + limit) : string; - const arr = []; - - for (let i = 0; i < segment.length; ++i) { - let c = segment.charCodeAt(i); - if ( - c === 0x2d || // - - c === 0x2e || // . - c === 0x5f || // _ - c === 0x7e || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5a) || // a-z - (c >= 0x61 && c <= 0x7a) || // A-Z - (format === RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - arr[arr.length] = segment.charAt(i); - continue; - } - - if (c < 0x80) { - arr[arr.length] = hex_table[c]; - continue; - } - - if (c < 0x800) { - arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - if (c < 0xd800 || c >= 0xe000) { - arr[arr.length] = - hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff)); - - arr[arr.length] = - hex_table[0xf0 | (c >> 18)]! + - hex_table[0x80 | ((c >> 12) & 0x3f)] + - hex_table[0x80 | ((c >> 6) & 0x3f)] + - hex_table[0x80 | (c & 0x3f)]; - } - - out += arr.join(''); - } - - return out; -}; - -export function compact(value: any) { - const queue = [{ obj: { o: value }, prop: 'o' }]; - const refs = []; - - for (let i = 0; i < queue.length; ++i) { - const item = queue[i]; - // @ts-ignore - const obj = item.obj[item.prop]; - - const keys = Object.keys(obj); - for (let j = 0; j < keys.length; ++j) { - const key = keys[j]!; - const val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compact_queue(queue); - - return value; -} - -export function is_regexp(obj: any) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -} - -export function is_buffer(obj: any) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -} - -export function combine(a: any, b: any) { - return [].concat(a, b); -} - -export function maybe_map(val: T[], fn: (v: T) => T) { - if (isArray(val)) { - const mapped = []; - for (let i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i]!)); - } - return mapped; - } - return fn(val); -} diff --git a/src/sdk/internal/utils/body.ts b/src/sdk/internal/utils/body.ts new file mode 100644 index 0000000..dd12a09 --- /dev/null +++ b/src/sdk/internal/utils/body.ts @@ -0,0 +1,163 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIConnectionTimeoutError, DedalusError } from '../../core/error'; +import { isAbortError } from '../errors'; +import { concatBytes, decodeUTF8, encodeUTF8 } from './bytes'; + +/** + * The most a buffered (non-streaming) response body may hold, counted after transparent + * decompression. A body handed to the caller as a stream or a binary `Response` is not capped. + */ +export const MAX_RESPONSE_BODY_BYTES = 64 * 1024 * 1024; + +/** The most of an error body the client reads for its message; anything after it is dropped. */ +export const MAX_ERROR_BODY_BYTES = 64 * 1024; + +/** The most a stream decoder holds for one pending line, event or frame before it gives up. */ +export const MAX_STREAM_PENDING_BYTES = 64 * 1024 * 1024; + +/** A byte count as the error messages state it: whole MiB or KiB where it divides evenly. */ +const formatLimit = (bytes: number): string => { + if (bytes % (1024 * 1024) === 0) return `${bytes / (1024 * 1024)} MiB`; + if (bytes % 1024 === 0) return `${bytes / 1024} KiB`; + return `${bytes} bytes`; +}; + +/** The error a decoder or body read throws when the server sends more than `limit` bytes for one value. */ +export const sizeLimitError = (what: string, limit: number): DedalusError => + new DedalusError(`The ${what} is larger than the ${formatLimit(limit)} the SDK will buffer.`); + +/** The part of a body stream reader {@link readBodyText} uses, typed without the DOM lib. */ +type BodyReader = { + read(): Promise<{ done: boolean; value?: Uint8Array | string | undefined }>; + cancel(): Promise; +}; + +/** + * Reads a response body as UTF-8 text, never holding more than `limit` bytes of it. + * + * `response.text()` buffers whatever the server sends, so a hostile or broken server could make the + * process hold gigabytes. Past `limit`, `'error'` throws (a success body cut short would only parse + * wrong) and `'truncate'` keeps what was read (an error message is still useful in part). + */ +export async function readBodyText( + response: Response, + limit: number, + overflow: 'error' | 'truncate' = 'error', +): Promise { + const body = response.body as unknown as + | ({ getReader?: () => BodyReader } & Partial>) + | null; + const reader: BodyReader | undefined = + body && typeof body.getReader === 'function' + ? body.getReader() + : body && typeof body[Symbol.asyncIterator] === 'function' + ? iterableReader(body as AsyncIterable) + : undefined; + if (!reader) return readWholeText(response, limit, overflow); + + const chunks: Uint8Array[] = []; + let total = 0; + let finished = false; + try { + for (;;) { + const { done, value } = await reader.read(); + if (done) { + finished = true; + break; + } + if (value == null) continue; + const bytes = typeof value === 'string' ? encodeUTF8(value) : value; + if (total + bytes.length > limit) { + if (overflow === 'error') throw sizeLimitError('response body', limit); + chunks.push(bytes.subarray(0, limit - total)); + break; + } + chunks.push(bytes); + total += bytes.length; + } + } finally { + // Stops the download of whatever is left, rather than leaving the connection to drain it. + if (!finished) reader.cancel().catch(() => {}); + } + return decodeUTF8(concatBytes(chunks)); +} + +/** + * A {@link BodyReader} over an async-iterable body: a Node stream, which is what `node-fetch` passed + * as `fetch` hands back in place of a web `ReadableStream`. Cancelling ends the iteration, which + * destroys the stream. + */ +const iterableReader = (body: AsyncIterable): BodyReader => { + const iterator = body[Symbol.asyncIterator](); + return { + read: async () => { + const next = await iterator.next(); + return next.done ? { done: true } : { done: false, value: next.value }; + }, + cancel: async () => { + await iterator.return?.(); + }, + }; +}; + +/** + * Reads a body that offers no stream (some React Native polyfills) in one piece. It cannot be cut + * off part way, so a declared length over `limit` is refused before reading, and the text read is + * held to `limit` afterwards, which at least keeps an oversized body from reaching the caller. + */ +const readWholeText = async ( + response: Response, + limit: number, + overflow: 'error' | 'truncate', +): Promise => { + const declared = Number(response.headers.get('content-length')); + if (overflow === 'error' && Number.isFinite(declared) && declared > limit) { + throw sizeLimitError('response body', limit); + } + const text = await response.text(); + const bytes = encodeUTF8(text); + if (bytes.length <= limit) return text; + if (overflow === 'error') throw sizeLimitError('response body', limit); + return decodeUTF8(bytes.subarray(0, limit)); +}; + +/** Deadlines left armed past the response headers, keyed by the request's abort controller. */ +const pendingDeadlines = new WeakMap void>(); + +/** + * Leaves a request's deadline armed until its buffered body has been read, so a server that sends + * headers promptly and then trickles the body is still cut off at the timeout. + */ +export const holdDeadline = (controller: AbortController, release: () => void): void => { + pendingDeadlines.set(controller, release); +}; + +/** Disarms the deadline {@link holdDeadline} left armed for this request, if any. */ +export const releaseDeadline = (controller: AbortController): void => { + const release = pendingDeadlines.get(controller); + pendingDeadlines.delete(controller); + release?.(); +}; + +/** + * Runs a buffered body read under the request deadline, disarming it once the read settles. + * + * A read the deadline aborted rejects with a bare `AbortError`; it is reported as the timeout it was. + * One the caller's own signal aborted is left as it is. + */ +export async function readUnderDeadline( + props: { controller: AbortController; options: { signal?: AbortSignal | null | undefined } }, + read: () => Promise, +): Promise { + try { + return await read(); + } catch (error) { + if (isAbortError(error) && props.controller.signal.aborted && !props.options.signal?.aborted) { + throw new APIConnectionTimeoutError(); + } + throw error; + } finally { + releaseDeadline(props.controller); + } +} diff --git a/src/sdk/internal/utils/log.ts b/src/sdk/internal/utils/log.ts index ddd44d3..aee8262 100644 --- a/src/sdk/internal/utils/log.ts +++ b/src/sdk/internal/utils/log.ts @@ -114,6 +114,88 @@ const REDACTED_HEADERS: ReadonlySet = new Set([ */ const REDACTED_QUERY_PARAMS: readonly string[] = []; +/** + * A byte's percent-encoded spelling at any depth and in either hex case, as a pattern: `%3F`, + * `%3f`, `%253F`. Each extra round of encoding turns the `%` into `%25` and leaves the hex alone, + * and encoders disagree on which case they write the hex in. + */ +const encodedBytePattern = (byte: number): string => + '%(?:25)*' + + [...byte.toString(16).padStart(2, '0')] + .map((digit) => (/[a-f]/u.test(digit) ? `[${digit}${digit.toUpperCase()}]` : digit)) + .join(''); + +/** + * The UTF-8 bytes of one code point, worked out from `encodeURIComponent` rather than a + * `TextEncoder`: this runs while the module loads, and a runtime without `TextEncoder` (older React + * Native engines) must still be able to import the client. A lone surrogate, which has no UTF-8 + * spelling, yields no bytes, and `namePattern` then matches that character only as written. + */ +const utf8Bytes = (char: string): number[] => { + const code = char.charCodeAt(0); + if (char.length === 1 && code < 0x80) return [code]; + try { + return encodeURIComponent(char) + .split('%') + .slice(1) + .map((hex) => parseInt(hex, 16)); + } catch { + return []; + } +}; + +/** + * A pattern matching one credential query name in every spelling a URL can carry it in: each + * character as written or percent-encoded (its UTF-8 bytes, at any depth and in either hex case), + * and a space also as `+`. `redactUrl` decodes a top-level name before it compares, so this keeps + * a nested name, which nothing decodes, from slipping past with one of its bytes escaped + * (`api%5Fkey`). Only the hex ignores case, not the name. + */ +const namePattern = (name: string): string => + [...name] + .map((char) => { + // Only syntax characters: the pattern is compiled with the `u` flag, under which escaping + // anything else (`\-`) is a syntax error rather than a no-op. + const escaped = char.replace(/[.*+?^${}()|[\]\\/]/gu, '\\$&'); + const encoded = utf8Bytes(char).map(encodedBytePattern).join(''); + // A lone surrogate has no bytes to encode; an empty alternative would make it optional. + if (encoded === '') return `(?:${escaped})`; + return `(?:${escaped}|${encoded}${char === ' ' ? '|\\+' : ''})`; + }) + .join(''); + +/** + * Matches a credential query parameter wherever text carries one, nested or not, with the name, + * separator and `=` in group 1 and the value after it. `undefined` when this SDK places no + * credential in the query. + * + * A name counts after a separator, `?`, `&` or `;`, either literal or percent-encoded any number of + * times over (`%3F`, `%253F`): a server can echo a whole URL encoded inside another parameter's + * value, as a login redirect's `return_to` does, and splitting the outer query on `&` never looks + * inside it. `;` also counts because an HTML-escaped `&` reads `&`. The `=` after the name can + * be encoded the same way. The value then runs to the next literal `&`, `#` or whitespace: an + * encoded `%26` may end a nested value, but stopping there would leak the rest of one a sloppy + * encoder left half-encoded, and masking too much is harmless. `<`, `>` and `"` end it too, since + * no valid URL carries them unencoded, so a `Link` header's `` or a quoted URL keeps its + * closing delimiter. `'` does not: a query value can hold it raw. No quantifier nests inside + * another, so matching stays linear on hostile input. + */ +const QUERY_CREDENTIAL: RegExp | undefined = (() => { + // An empty name would build a pattern that masks every `?=`. + const names = REDACTED_QUERY_PARAMS.filter((name) => name !== '').map(namePattern); + if (names.length === 0) return undefined; + // `\u0026` is `&` as a JSON string escapes it, which Go's `encoding/json` does by default, so a + // URL quoted in JSON text (a header value, a non-JSON error body quoting one) carries its + // separators that way. + const separator = `(?:[?&;]|\\\\u0026|${[0x3f, 0x26, 0x3b].map(encodedBytePattern).join('|')})`; + const equals = `(?:=|${encodedBytePattern(0x3d)})`; + return new RegExp(`(${separator}(?:${names.join('|')})${equals})[^&#\\s<>"]*`, 'gu'); +})(); + +/** Masks the value of every credential query parameter in `text`, nested and encoded ones included. */ +const redactQueryCredentials = (text: string): string => + QUERY_CREDENTIAL === undefined ? text : text.replace(QUERY_CREDENTIAL, `$1${REDACTED}`); + /** * Blanks the userinfo of a URL, which is a credential wherever it appears. * @@ -161,7 +243,9 @@ export const redactUrl = (url: string): string => { const url_ = redactUserinfo(url); if (REDACTED_QUERY_PARAMS.length === 0) return url_; const mark = url_.indexOf('?'); - if (mark === -1) return url_; + // A path can nest an encoded URL too (`/proxy/https%3A%2F%2Fh%2Fv1%3Fapi_key%3D…`), and so can a + // fragment, so the text outside the query is scanned for a nested credential as well. + if (mark === -1) return redactQueryCredentials(url_); // A fragment is not part of the query, so splitting it off keeps it out of the rewrite. const fragment = url_.indexOf('#', mark); const end = fragment === -1 ? url_.length : fragment; @@ -175,13 +259,18 @@ export const redactUrl = (url: string): string => { .split('&') .map((pair) => { const equals = pair.indexOf('='); - // A parameter with no `=` carries no value, so there is nothing in it to redact. - if (equals === -1) return pair; + // A parameter with no `=` carries no value of its own, but it can still be a whole encoded URL + // (`?%2Fv1%3Fapi_key%3D…`), so it is scanned for a nested credential like any other value. + if (equals === -1) return redactQueryCredentials(pair); const name = pair.slice(0, equals); - return REDACTED_QUERY_PARAMS.includes(decodeQueryName(name)) ? name + '=' + REDACTED : pair; + // Any other value still goes through `redactQueryCredentials`: it can nest a whole encoded URL + // that carries a credential, as a redirect target echoing the request in `return_to` does. + return REDACTED_QUERY_PARAMS.includes(decodeQueryName(name)) + ? name + '=' + REDACTED + : redactQueryCredentials(pair); }) .join('&'); - return url_.slice(0, mark + 1) + query + url_.slice(end); + return redactQueryCredentials(url_.slice(0, mark)) + '?' + query + redactQueryCredentials(url_.slice(end)); }; /** @@ -192,35 +281,53 @@ export const redactUrl = (url: string): string => { */ const redactQuery = (query: object): object => { const redacted: Record = { ...(query as Record) }; + for (const [name, value] of Object.entries(redacted)) { + // Every other string value is cleaned as text: an operation parameter such as `return_to` can + // hold a URL that carries the credential, and the URL logged beside this masks it there. + if (typeof value === 'string') redacted[name] = redactText(value); + else if (Array.isArray(value)) { + redacted[name] = value.map((item: unknown) => (typeof item === 'string' ? redactText(item) : item)); + } + } for (const name of REDACTED_QUERY_PARAMS) { if (hasOwn(redacted, name)) redacted[name] = REDACTED; } return redacted; }; -/** Replaces the value of every credential-bearing header, for a `Headers` or a plain record alike. */ +/** + * Replaces the value of every credential-bearing header, for a `Headers` or a plain record alike. + * + * Every other value is cleaned as free text: a response can echo the request URL back, in a + * `Location` or a `Link`, either as written or nested and encoded in a `return_to`, and a header's + * name says nothing about whether its value quotes a credential. + */ export const redactHeaders = (headers: Headers | Record): Record => Object.fromEntries( (headers instanceof Headers ? [...headers] : Object.entries(headers)).map(([name, value]) => [ name, - REDACTED_HEADERS.has(name.toLowerCase()) ? REDACTED : value, + REDACTED_HEADERS.has(name.toLowerCase()) ? REDACTED : redactText(value), ]), ); -/** URL-shaped runs inside free text. Whitespace and quotes end one; see {@link TRAILING_PUNCTUATION}. */ +/** + * URL-shaped runs inside free text, for their userinfo. Whitespace, quotes, `<` and `>` end one, so + * two quoted URLs side by side stay two matches, each with its own userinfo masked, and an `@` + * further on in the text is not taken for one. + */ const URL_IN_TEXT = /\bhttps?:\/\/[^\s"'<>]+/gu; /** - * Punctuation that ends a sentence or closes a bracket rather than belonging to the URL. - * - * Trimmed back after the match instead of being excluded from it, because an IPv6 host carries its - * own `]` (`http://[::1]:8080/p?api_key=…`). Excluding the character cut the match short at the - * host and left the query — credential included — in the text. + * Text that cannot hold a URL credential: no query separator (literal, encoded or JSON-escaped), no + * `%` escape, no scheme. */ -const TRAILING_PUNCTUATION = /[.,;:!?)\]}]+$/u; +const NO_URL_CREDENTIAL = /^[^?&;%:\\]*$/u; /** - * Redacts every URL quoted inside free text, leaving the rest of the text alone. + * Redacts free text that may quote a URL anywhere in it: the userinfo of every absolute URL, then + * every credential query parameter anywhere in the text, which covers an absolute URL's own query, + * a relative URL (a `Location` of `/login?api_key=…`) and one nested, encoded, inside another + * parameter's value alike. * * Runs for every SDK, not only those with a query credential: Node's `fetch` rejects a URL carrying * userinfo with a message that quotes the whole URL back (`Request cannot be constructed from a URL @@ -228,15 +335,49 @@ const TRAILING_PUNCTUATION = /[.,;:!?)\]}]+$/u; * this on the query list left the password in the log for every SDK whose document happens not to * put a credential in the query. * - * Only the matched URL is rewritten, never the whole string: a message is not a query string, and - * handing one to `URLSearchParams` wholesale would swallow everything after the first parameter and - * take the diagnostic with it. + * Only the userinfo and the credential values are rewritten, never the whole string: a message is + * not a query string, and handing one to `URLSearchParams` wholesale would swallow everything after + * the first parameter and take the diagnostic with it. The query scan runs over the whole text in one + * pass rather than URL by URL, because where a URL ends in prose is a guess and a credential value + * can hold a raw `'` or end in punctuation: a masked value runs to the next whitespace, `&`, `#`, + * `<`, `>` or `"`, so punctuation right after it (`(https://h/v1?api_key=***): error`) goes with it. + * Text with none of the characters a credential needs is returned as is, since header values pass + * through here on every request whether or not anything logs them. */ -const redactUrlsInText = (text: string): string => - text.replace(URL_IN_TEXT, (match) => { - const trailing = match.match(TRAILING_PUNCTUATION)?.[0] ?? ''; - return redactUrl(match.slice(0, match.length - trailing.length)) + trailing; - }); +const redactText = (text: string): string => + NO_URL_CREDENTIAL.test(text) ? text : redactQueryCredentials(text.replace(URL_IN_TEXT, redactUserinfo)); + +/** + * What a log line says about a request or response body: its kind and size, never its content. + * + * A body is the data an API exists to move — a token endpoint's answer, a customer's records — and + * no list of field names can tell which parts of it are secret, while a debug log ends up in CI + * output and support tickets. The response's `content-type` is logged with its headers beside this. + */ +const describeBody = (body: unknown): string => { + if (body === null) return '[empty body]'; + if (typeof body === 'string') return `[text body: ${body.length} characters]`; + if (body instanceof ArrayBuffer) return `[binary body: ${body.byteLength} bytes]`; + if (ArrayBuffer.isView(body)) return `[binary body: ${body.byteLength} bytes]`; + const BlobClass = (globalThis as { Blob?: new () => { size: number; type: string } }).Blob; + if (BlobClass && body instanceof BlobClass) { + return `[binary body: ${body.size} bytes${body.type ? `, ${body.type}` : ''}]`; + } + if (typeof body === 'object') { + // Plain data first: a parsed JSON body is a plain object or array, and its own `constructor` key + // is server text, so the class name is read only off an object that is neither. + const proto = Object.getPrototypeOf(body); + if (!Array.isArray(body) && proto !== Object.prototype && proto !== null) { + const name = proto.constructor?.name; + return typeof name === 'string' && name ? `[${name} body]` : '[object body]'; + } + // Its shape rather than its serialized length: this runs on every parsed response whether or + // not debug logging is on, and serializing a large body just to measure it would cost each call. + if (Array.isArray(body)) return `[JSON body: array of ${body.length} items]`; + return `[JSON body: object with ${Object.keys(body).length} keys]`; + } + return `[${typeof body} body]`; +}; export const formatRequestDetails = (details: { options?: RequestOptions | undefined; @@ -269,6 +410,7 @@ export const formatRequestDetails = (details: { } const query = options['query']; if (query && typeof query === 'object') options['query'] = redactQuery(query); + if (options['body'] !== undefined) options['body'] = describeBody(options['body']); // These three are URL strings, not route fragments: `buildURL` takes an absolute `path` whole -- // userinfo, query string and all -- while `defaultBaseURL` and the Speakeasy profile's // `serverURL` each replace the base URL outright. The caller-supplied escape hatches therefore @@ -282,6 +424,9 @@ export const formatRequestDetails = (details: { } details.options = options as RequestOptions; } + if (details.body !== undefined) { + details.body = describeBody(details.body); + } if (details.url) { details.url = redactUrl(details.url); } @@ -292,7 +437,7 @@ export const formatRequestDetails = (details: { // request URL inside their text (see the note at the `connection failed` call sites), so a query // credential rides along in a field none of the checks above look at. if (typeof details.message === 'string') { - details.message = redactUrlsInText(details.message); + details.message = redactText(details.message); } if ('retryOfRequestLogID' in details) { if (details.retryOfRequestLogID) { diff --git a/src/sdk/internal/utils/query-string.ts b/src/sdk/internal/utils/query-string.ts new file mode 100644 index 0000000..bcbef68 --- /dev/null +++ b/src/sdk/internal/utils/query-string.ts @@ -0,0 +1,160 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +/** + * How an array is written to the query string: + * - `comma`: one pair, values joined with `,` (`a=1%2C2`) + * - `repeat`: one pair per value under the same key (`a=1&a=2`) + * - `indices`: one pair per value, keyed by position (`a%5B0%5D=1&a%5B1%5D=2`) + * - `brackets`: one pair per value, keyed with empty brackets (`a%5B%5D=1&a%5B%5D=2`) + */ +export type QueryArrayFormat = 'comma' | 'repeat' | 'indices' | 'brackets'; + +/** How `encodeQueryString` lays out arrays and nested objects; both are fixed per SDK by its config. */ +export type QueryStringOptions = { + /** How an array becomes pairs; see {@link QueryArrayFormat}. */ + readonly arrayFormat: QueryArrayFormat; + /** Writes nested object keys as `a.b` instead of `a[b]`. Array positions keep their brackets. */ + readonly allowDots: boolean; +}; + +/** + * Encodes the own enumerable properties of `query` as `key=value` pairs joined with `&`, recursing + * into nested objects and arrays. Anything that is not an object encodes to an empty string. + */ +export function encodeQueryString(query: unknown, options: QueryStringOptions): string { + if (query === null || typeof query !== 'object') return ''; + const pairs: string[] = []; + const ancestors = new Set([query]); + for (const key of Object.keys(query)) { + appendPairs(pairs, key, (query as Record)[key], options, ancestors); + } + return pairs.join('&'); +} + +/** + * Appends the pairs for one value under its full key path. + * + * `undefined` and functions are left out, while `null` keeps its key with an empty value, so a caller + * can still send `key=` on purpose. Empty arrays and objects contribute no pairs at all. + */ +function appendPairs( + pairs: string[], + key: string, + value: unknown, + options: QueryStringOptions, + ancestors: Set, +): void { + if (value === undefined || typeof value === 'function') return; + if (value === null) { + pairs.push(`${encodeComponent(key)}=`); + return; + } + if (value instanceof Date) { + pairs.push(`${encodeComponent(key)}=${encodeComponent(isoString(value))}`); + return; + } + if (Array.isArray(value)) { + enter(ancestors, value, key); + appendArrayPairs(pairs, key, value, options, ancestors); + ancestors.delete(value); + return; + } + if (isNodeBuffer(value)) { + // A Node `Buffer` is written as its UTF-8 text, the way it reads when interpolated, rather than + // walked byte by byte like the plain object it otherwise is. A bare `Uint8Array` is still walked. + pairs.push(`${encodeComponent(key)}=${encodeComponent(String(value))}`); + return; + } + if (typeof value === 'object') { + enter(ancestors, value, key); + for (const childKey of Object.keys(value)) { + const childPath = options.allowDots ? `${key}.${childKey}` : `${key}[${childKey}]`; + appendPairs(pairs, childPath, (value as Record)[childKey], options, ancestors); + } + ancestors.delete(value); + return; + } + pairs.push(`${encodeComponent(key)}=${encodeComponent(String(value))}`); +} + +/** Appends the pairs for one array, laid out by `options.arrayFormat`. */ +function appendArrayPairs( + pairs: string[], + key: string, + values: readonly unknown[], + options: QueryStringOptions, + ancestors: Set, +): void { + if (values.length === 0) return; + if (options.arrayFormat === 'comma') { + // A single pair whose value is the plain `Array#join` of the elements: top-level dates become ISO + // strings first, `null`/`undefined` become empty slots, and anything nested is joined by `join`'s + // own string conversion rather than encoded as a further level. + const joined = values.map((item) => (item instanceof Date ? isoString(item) : item)).join(','); + pairs.push(`${encodeComponent(key)}=${encodeComponent(joined)}`); + return; + } + // Indexing by position, not by a running count, keeps `a[2]` for the third element even when an + // earlier `undefined` element was left out. `forEach` skips the holes of a sparse array, which + // leaves them out the same way. + values.forEach((item, index) => { + appendPairs(pairs, arrayItemPath(key, index, options.arrayFormat), item, options, ancestors); + }); +} + +/** + * Returns whether `value` is a Node `Buffer`. The global is looked up rather than imported so the + * runtime still loads where there is no `Buffer`, and then nothing is one. + */ +function isNodeBuffer(value: unknown): boolean { + const buffer = (globalThis as unknown as { Buffer?: { isBuffer?: (candidate: unknown) => boolean } }) + .Buffer; + return typeof buffer?.isBuffer === 'function' && buffer.isBuffer(value); +} + +/** + * Returns the ISO 8601 form of `date` through `Date.prototype`, so a `Date` whose own + * `toISOString` was replaced still encodes as the instant it holds. + */ +function isoString(date: Date): string { + return Date.prototype.toISOString.call(date); +} + +/** + * Marks `value` as being encoded under `key`, or throws when it already is further up the same path. + * + * Only the objects on the current path are held, and each is released once its children are done, + * so the same object appearing twice side by side still encodes. Without this, an object that + * contains itself (an ORM entity with a back-reference, say) would recurse until the stack overflows. + */ +function enter(ancestors: Set, value: object, key: string): void { + if (ancestors.has(value)) { + throw new RangeError(`Cyclic object value at "${key}": a query value cannot contain itself`); + } + ancestors.add(value); +} + +/** Returns the key path one array element is written under, before percent-encoding. */ +function arrayItemPath(key: string, index: number, arrayFormat: QueryArrayFormat): string { + if (arrayFormat === 'indices') return `${key}[${index}]`; + if (arrayFormat === 'brackets') return `${key}[]`; + return key; +} + +/** Matches a well-formed surrogate pair first, so the second alternative only sees a lone surrogate. */ +const surrogatePattern = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g; + +/** + * Percent-encodes a key path or value as UTF-8, leaving only `A-Z a-z 0-9 - . _ ~` as they are, so + * `[`, `]`, `,`, `&`, `=`, `+` and also `! ' ( ) *` are always escaped. + * + * `encodeURIComponent` throws on a lone surrogate, so one is replaced with U+FFFD first, the + * replacement character `TextEncoder` writes for it too, and a malformed string still encodes. + */ +function encodeComponent(text: string): string { + const wellFormed = text.replace(surrogatePattern, (match) => (match.length === 2 ? match : '\uFFFD')); + return encodeURIComponent(wellFormed).replace( + /[!'()*]/g, + (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} diff --git a/src/sdk/internal/utils/query.ts b/src/sdk/internal/utils/query.ts index 638b5a0..de172b7 100644 --- a/src/sdk/internal/utils/query.ts +++ b/src/sdk/internal/utils/query.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -import * as qs from '../qs/stringify'; +import { encodeQueryString } from './query-string'; export function stringifyQuery(query: object | Record): string { // Substituted from the same config as the client's own `stringifyQuery`; this module is re-exported // through the package's `./*` subpath, so a hardcoded format here would serialize arrays differently // from every generated request. - return qs.stringify(query, { arrayFormat: 'comma', allowDots: false }); + return encodeQueryString(query, { arrayFormat: 'comma', allowDots: false }); } diff --git a/src/sdk/internal/utils/uuid7.ts b/src/sdk/internal/utils/uuid7.ts new file mode 100644 index 0000000..b6b1bbc --- /dev/null +++ b/src/sdk/internal/utils/uuid7.ts @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +/** + * A time-ordered (version 7) UUID per RFC 9562: a 48-bit Unix millisecond timestamp, then the + * version and variant bits, with every other bit random. + */ +export const uuid7 = function (): string { + const { crypto } = globalThis as any; + const bytes = new Uint8Array(16); + if (crypto?.getRandomValues) { + crypto.getRandomValues(bytes); + } else { + for (let i = 0; i < bytes.length; i++) bytes[i] = (Math.random() * 0x100) & 0xff; + } + // A clock set before 1970 writes a zero timestamp rather than wrapping to the far future. + const ms = Math.max(0, Date.now()); + // Bitwise operators work on 32 bits, so the timestamp's top 16 bits are split off arithmetically. + const high = Math.floor(ms / 0x100000000); + bytes[0] = (high >>> 8) & 0xff; + bytes[1] = high & 0xff; + bytes[2] = (ms >>> 24) & 0xff; + bytes[3] = (ms >>> 16) & 0xff; + bytes[4] = (ms >>> 8) & 0xff; + bytes[5] = ms & 0xff; + bytes[6] = (bytes[6]! & 0x0f) | 0x70; + bytes[8] = (bytes[8]! & 0x3f) | 0x80; + const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join(''); + return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`; +}; diff --git a/src/sdk/resources.ts b/src/sdk/resources.ts index 11bb295..b6221b7 100644 --- a/src/sdk/resources.ts +++ b/src/sdk/resources.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -export { Machines, Organization } from './resources/index'; +export { Machines, Organization, Images } from './resources/index'; export type { Machine, MachineList, @@ -8,6 +8,7 @@ export type { CreateParams, UpdateParams, LifecycleStatus, + AutoresizingSwitch, MachineListParams, MachineListItemsCursorPage, MachineCreateParams, @@ -18,4 +19,15 @@ export type { MachineSleepParams, MachineWakeParams, MachineRebootParams, + MachineResizeParams, + MachineResizeResponse, + Image, + ImageList, + Source, + Error, + ImageListParams, + ImageCreateParams, + ImageRetrieveParams, + ImageUpdateParams, + ImageDeleteParams, } from './resources/index'; diff --git a/src/sdk/resources/images.ts b/src/sdk/resources/images.ts new file mode 100644 index 0000000..aaa7411 --- /dev/null +++ b/src/sdk/resources/images.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export * from './images/index'; diff --git a/src/sdk/resources/images/images.ts b/src/sdk/resources/images/images.ts new file mode 100644 index 0000000..db6ae33 --- /dev/null +++ b/src/sdk/resources/images/images.ts @@ -0,0 +1,251 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from '../../resource'; +import { APIPromise } from '../../api-promise'; +import type { RequestOptions } from '../../internal/request-options'; +import { path as __scalarPath } from '../../internal/utils/path'; +import * as UploadsAPI from './uploads'; +import { Uploads, type Reservation, type UploadCreateParams } from './uploads'; + +export class Images extends APIResource { + uploads: UploadsAPI.Uploads = new UploadsAPI.Uploads(this._client); + + /** + * Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. + * + * @param {ImageListParams} [query] - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const imageList = await client.images.list({ + * limit: 100, + * }); + * ``` + */ + list(query: ImageListParams | null | undefined = {}, options?: RequestOptions): APIPromise { + return this._client.get('/v1/images', { query, ...options }); + } + + /** + * Requires an entitled organization and linux/amd64 on the current fleet. Acceptance queues preparation; only a ready image can launch a machine. Private registry credentials are not yet supported. + * + * @param {ImageCreateParams} body - The request body to send. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} Accepted + * + * @example + * ```ts + * const image = await client.images.create({ + * platform: 'linux/amd64', + * source: { + * kind: '', + * }, + * }); + * ``` + */ + create(body: ImageCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/v1/images', { body, ...options }); + } + + /** + * A preparing image reports its stage, the worker's last step and an estimated percent of the whole preparation. A failed image names the cause: IMAGE_OS_UNSUPPORTED, IMAGE_SOURCE_INVALID, IMAGE_SOURCE_NOT_FOUND and IMAGE_SOURCE_UNAUTHORIZED describe the image or its reference and are final; IMAGE_SOURCE_UNAVAILABLE, IMAGE_REGISTRY_UNREACHABLE, IMAGE_REGISTRY_RATE_LIMITED, IMAGE_ARCHIVE_UNAVAILABLE and IMAGE_EXECUTION_FAILED describe this attempt and are retryable with a new idempotency key. + * + * @param {ImageRetrieveParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const image = await client.images.retrieve({ + * image_id: 'imageID', + * }); + * ``` + */ + retrieve(params: ImageRetrieveParams, options?: RequestOptions): APIPromise { + const { image_id } = params; + return this._client.get(__scalarPath`/v1/images/${image_id}`, options); + } + + /** + * Changes only the name. The image's source, platform and state are immutable. + * + * @param {ImageUpdateParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const image = await client.images.update({ + * image_id: 'imageID', + * name: '', + * }); + * ``` + */ + update(params: ImageUpdateParams, options?: RequestOptions): APIPromise { + const { image_id, ...body } = params; + return this._client.patch(__scalarPath`/v1/images/${image_id}`, { body, ...options }); + } + + /** + * The image can create no new Machine and no longer counts against the organization's image limit. Machines already running from it keep working. The image stays readable, and deleting it again returns the same image. + * + * @param {ImageDeleteParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const image = await client.images.delete({ + * image_id: 'imageID', + * }); + * ``` + */ + delete(params: ImageDeleteParams, options?: RequestOptions): APIPromise { + const { image_id } = params; + return this._client.delete(__scalarPath`/v1/images/${image_id}`, options); + } +} + +export interface Image { + /** + * @format date-time + */ + created_at: string; + image_id: string; + name: string | null; + platform: string; + source: Source; + state: string; + context?: Image.Context; + error?: Error; + reason?: string; +} + +export namespace Image { + export interface Context { + /** + * @format int64 + */ + percent: number; + stage: string; + progress?: Context.Progress; + } + + export namespace Context { + export interface Progress { + /** + * @format int64 + */ + completed: number; + step: string; + /** + * @format int64 + */ + total: number; + } + } +} + +export interface ImageList { + image_ids: Array | null; + next_cursor?: string; +} + +export interface Source { + kind: string; + reference?: string; + sha256?: string; + upload_id?: string; +} + +export interface Error { + error_code: string; + message: string; + retryable: boolean; + details?: Record; + /** + * @format int64 + */ + retry_after_ms?: number; +} + +export interface ImageListParams { + /** + * @default 100 + * @format int64 + * @minimum 1 + * @maximum 100 + */ + limit?: number; + /** + * @maxLength 100 + */ + cursor?: string; +} + +export interface ImageCreateParams { + platform: 'linux/amd64' | 'linux/arm64'; + source: Source; + credential_ref?: string; + /** + * A label people use to tell images apart. Programs use the image ID. + * @maxLength 128 + */ + name?: string; +} + +export interface ImageRetrieveParams { + /** + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + image_id: string; +} + +export interface ImageUpdateParams { + /** + * Path param + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + image_id: string; + /** + * Body param: The new label, or null to clear it. No other field can change. + * @maxLength 128 + */ + name: string | null; +} + +export interface ImageDeleteParams { + /** + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + image_id: string; +} +Images.Uploads = Uploads; + +export declare namespace Images { + export { + type Image as Image, + type ImageList as ImageList, + type Source as Source, + type Error as Error, + type ImageListParams as ImageListParams, + type ImageCreateParams as ImageCreateParams, + type ImageRetrieveParams as ImageRetrieveParams, + type ImageUpdateParams as ImageUpdateParams, + type ImageDeleteParams as ImageDeleteParams, + }; + + export { + Uploads as Uploads, + type Reservation as Reservation, + type UploadCreateParams as UploadCreateParams, + }; +} diff --git a/src/sdk/resources/images/index.ts b/src/sdk/resources/images/index.ts new file mode 100644 index 0000000..1e475ab --- /dev/null +++ b/src/sdk/resources/images/index.ts @@ -0,0 +1,16 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export { Images } from './images'; +export type { + Image, + ImageList, + Source, + Error, + ImageListParams, + ImageCreateParams, + ImageRetrieveParams, + ImageUpdateParams, + ImageDeleteParams, +} from './images'; +export { Uploads } from './uploads'; +export type { Reservation, UploadCreateParams } from './uploads'; diff --git a/src/sdk/resources/images/uploads.ts b/src/sdk/resources/images/uploads.ts new file mode 100644 index 0000000..a6bd19c --- /dev/null +++ b/src/sdk/resources/images/uploads.ts @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from '../../resource'; +import { APIPromise } from '../../api-promise'; +import type { RequestOptions } from '../../internal/request-options'; +import type * as ImagesAPI from './images'; + +export class Uploads extends APIResource { + /** + * Reserve an immutable Docker image archive upload + * + * @param {UploadCreateParams} body - The request body to send. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const reservation = await client.images.uploads.create({ + * platform: '', + * sha256: '', + * size_bytes: 0, + * }); + * ``` + */ + create(body: UploadCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/v1/images/uploads', { body, ...options }); + } +} + +export interface Reservation { + source: ImagesAPI.Source; + upload: Reservation.Upload; +} + +export namespace Reservation { + export interface Upload { + /** + * @format date-time + */ + expires_at: string; + headers: Record | null>; + method: string; + url: string; + } +} + +export interface UploadCreateParams { + platform: string; + sha256: string; + /** + * @format int64 + */ + size_bytes: number; +} +export declare namespace Uploads { + export { type Reservation as Reservation, type UploadCreateParams as UploadCreateParams }; +} diff --git a/src/sdk/resources/index.ts b/src/sdk/resources/index.ts index 25ae9f1..dbb5548 100644 --- a/src/sdk/resources/index.ts +++ b/src/sdk/resources/index.ts @@ -8,6 +8,7 @@ export type { CreateParams, UpdateParams, LifecycleStatus, + AutoresizingSwitch, MachineListParams, MachineListItemsCursorPage, MachineCreateParams, @@ -18,5 +19,19 @@ export type { MachineSleepParams, MachineWakeParams, MachineRebootParams, + MachineResizeParams, + MachineResizeResponse, } from './machines/machines'; export { Organization } from './organization/organization'; +export { Images } from './images/images'; +export type { + Image, + ImageList, + Source, + Error, + ImageListParams, + ImageCreateParams, + ImageRetrieveParams, + ImageUpdateParams, + ImageDeleteParams, +} from './images/images'; diff --git a/src/sdk/resources/machines/autoresizing.ts b/src/sdk/resources/machines/autoresizing.ts index e5af9dc..1d43296 100644 --- a/src/sdk/resources/machines/autoresizing.ts +++ b/src/sdk/resources/machines/autoresizing.ts @@ -4,50 +4,84 @@ import { APIResource } from '../../resource'; import { APIPromise } from '../../api-promise'; import type { RequestOptions } from '../../internal/request-options'; import { path as __scalarPath } from '../../internal/utils/path'; +import type * as MachinesAPI from './machines'; export class Autoresizing extends APIResource { /** - * Read this machine's RAM autoresizing settings + * Read this machine's autoresizing settings * * @param {AutoresizingRetrieveParams} params - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} OK + * @returns {APIPromise} OK * * @example * ```ts - * const settings = await client.machines.autoresizing.retrieve({ + * const policy = await client.machines.autoresizing.retrieve({ * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', * }); * ``` */ - retrieve(params: AutoresizingRetrieveParams, options?: RequestOptions): APIPromise { + retrieve(params: AutoresizingRetrieveParams, options?: RequestOptions): APIPromise { const { machine_id } = params; return this._client.get(__scalarPath`/v1/machines/${machine_id}/autoresizing`, options); } /** - * Set this machine's RAM autoresizing settings + * Changes RAM, CPU or both for this machine. An absent resource keeps its setting. * * @param {AutoresizingUpdateParams} params - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} OK + * @returns {APIPromise} OK * * @example * ```ts - * const settings = await client.machines.autoresizing.update({ + * const policy = await client.machines.autoresizing.update({ * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', - * enabled: false, * }); * ``` */ - update(params: AutoresizingUpdateParams, options?: RequestOptions): APIPromise { + update(params: AutoresizingUpdateParams, options?: RequestOptions): APIPromise { const { machine_id, ...body } = params; - return this._client.put(__scalarPath`/v1/machines/${machine_id}/autoresizing`, { body, ...options }); + return this._client.patch(__scalarPath`/v1/machines/${machine_id}/autoresizing`, { body, ...options }); } } -export interface Settings { +export interface Policy { + /** + * Permit automatic CPU growth independently of RAM. + */ + cpu: MachinesAPI.AutoresizingSwitch; + cpu_limit_source: 'plan' | 'configured' | 'platform'; + /** + * Configured CPU growth limit in 0.25-vCPU steps. Null uses the plan limit. + * @format double + */ + cpu_max_vcpu: number | null; + /** + * Largest automatic CPU size allowed by this policy, plan and platform. + * @format double + */ + effective_cpu_max_vcpu: number; + /** + * Largest automatic RAM size allowed by this policy and plan, in MiB. + * @format int64 + */ + effective_memory_max_mib: number; + /** + * Deprecated RAM permission alias. Use memory. + * @deprecated + */ enabled: boolean; + /** + * Permit automatic RAM growth. Automatic shrink remains internal. + */ + memory: MachinesAPI.AutoresizingSwitch; + memory_limit_source: 'plan' | 'configured' | 'platform'; + /** + * Configured RAM growth limit in MiB. Null uses the plan limit. + * @format int64 + */ + memory_max_mib: number | null; } export interface AutoresizingRetrieveParams { @@ -71,11 +105,28 @@ export interface AutoresizingUpdateParams { /** * Body param */ - enabled: boolean; + cpu?: MachinesAPI.AutoresizingSwitch; + /** + * Body param + * @format double + * @minimum 0.25 + * @multipleOf 0.25 + */ + cpu_max_vcpu?: number | null; + /** + * Body param + */ + memory?: MachinesAPI.AutoresizingSwitch; + /** + * Body param + * @format int64 + * @minimum 256 + */ + memory_max_mib?: number | null; } export declare namespace Autoresizing { export { - type Settings as Settings, + type Policy as Policy, type AutoresizingRetrieveParams as AutoresizingRetrieveParams, type AutoresizingUpdateParams as AutoresizingUpdateParams, }; diff --git a/src/sdk/resources/machines/executions/executions.ts b/src/sdk/resources/machines/executions/executions.ts index 516f697..8647db7 100644 --- a/src/sdk/resources/machines/executions/executions.ts +++ b/src/sdk/resources/machines/executions/executions.ts @@ -6,14 +6,7 @@ import { CursorPage, type CursorPageParams, type PagePromise } from '../../../co import type { RequestOptions } from '../../../internal/request-options'; import { path as __scalarPath } from '../../../internal/utils/path'; import * as LogsAPI from './logs'; -import { - Logs, - type Status, - type ReadToken, - type LogRetrieveParams, - type LogReauthorizeParams, - type LogCreateTokenParams, -} from './logs'; +import { Logs, type Status, type ReadToken, type LogRetrieveParams, type LogCreateTokenParams } from './logs'; export class Executions extends APIResource { logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); @@ -424,7 +417,6 @@ export declare namespace Executions { type Status as Status, type ReadToken as ReadToken, type LogRetrieveParams as LogRetrieveParams, - type LogReauthorizeParams as LogReauthorizeParams, type LogCreateTokenParams as LogCreateTokenParams, }; } diff --git a/src/sdk/resources/machines/executions/index.ts b/src/sdk/resources/machines/executions/index.ts index 6989d90..9f8cad0 100644 --- a/src/sdk/resources/machines/executions/index.ts +++ b/src/sdk/resources/machines/executions/index.ts @@ -18,10 +18,4 @@ export type { ExecutionEventsCursorPage, } from './executions'; export { Logs } from './logs'; -export type { - Status, - ReadToken, - LogRetrieveParams, - LogReauthorizeParams, - LogCreateTokenParams, -} from './logs'; +export type { Status, ReadToken, LogRetrieveParams, LogCreateTokenParams } from './logs'; diff --git a/src/sdk/resources/machines/executions/logs.ts b/src/sdk/resources/machines/executions/logs.ts index 88b2f20..b9fac9d 100644 --- a/src/sdk/resources/machines/executions/logs.ts +++ b/src/sdk/resources/machines/executions/logs.ts @@ -29,29 +29,6 @@ export class Logs extends APIResource { ); } - /** - * Reauthorize execution log publication - * - * @param {LogReauthorizeParams} params - The parameters to send with the request. - * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} OK - * - * @example - * ```ts - * const status = await client.machines.executions.logs.reauthorize({ - * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', - * execution_id: 'executionID', - * }); - * ``` - */ - reauthorize(params: LogReauthorizeParams, options?: RequestOptions): APIPromise { - const { machine_id, execution_id } = params; - return this._client.post( - __scalarPath`/v1/machines/${machine_id}/executions/${execution_id}/logs/reauthorize`, - options, - ); - } - /** * Create execution log read token * @@ -79,8 +56,6 @@ export class Logs extends APIResource { export interface Status { capture: Status.Capture; execution_id: string; - code?: string; - publication?: Status.Publication; stream_id?: string; } @@ -99,17 +74,6 @@ export namespace Status { */ unconfirmed_bytes?: string; } - - export interface Publication { - complete: boolean; - /** - * @format int64 - * @minimum 0 - */ - queued_messages: number; - state: 'active' | 'finishing' | 'failed' | 'closed'; - code?: string; - } } export interface ReadToken { @@ -140,22 +104,6 @@ export interface LogRetrieveParams { execution_id: string; } -export interface LogReauthorizeParams { - /** - * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. - * @minLength 36 - * @maxLength 39 - * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ - */ - machine_id: string; - /** - * @minLength 1 - * @maxLength 253 - * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ - */ - execution_id: string; -} - export interface LogCreateTokenParams { /** * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. @@ -176,7 +124,6 @@ export declare namespace Logs { type Status as Status, type ReadToken as ReadToken, type LogRetrieveParams as LogRetrieveParams, - type LogReauthorizeParams as LogReauthorizeParams, type LogCreateTokenParams as LogCreateTokenParams, }; } diff --git a/src/sdk/resources/machines/index.ts b/src/sdk/resources/machines/index.ts index 3c78d73..9c753eb 100644 --- a/src/sdk/resources/machines/index.ts +++ b/src/sdk/resources/machines/index.ts @@ -8,6 +8,7 @@ export type { CreateParams, UpdateParams, LifecycleStatus, + AutoresizingSwitch, MachineListParams, MachineListItemsCursorPage, MachineCreateParams, @@ -18,6 +19,8 @@ export type { MachineSleepParams, MachineWakeParams, MachineRebootParams, + MachineResizeParams, + MachineResizeResponse, } from './machines'; export { SSH } from './ssh'; export type { @@ -50,4 +53,4 @@ export type { ExecutionEventsCursorPage, } from './executions/executions'; export { Autoresizing } from './autoresizing'; -export type { Settings, AutoresizingRetrieveParams, AutoresizingUpdateParams } from './autoresizing'; +export type { Policy, AutoresizingRetrieveParams, AutoresizingUpdateParams } from './autoresizing'; diff --git a/src/sdk/resources/machines/machines.ts b/src/sdk/resources/machines/machines.ts index 6889c05..fe68a21 100644 --- a/src/sdk/resources/machines/machines.ts +++ b/src/sdk/resources/machines/machines.ts @@ -5,6 +5,7 @@ import { APIPromise } from '../../api-promise'; import { CursorPage, type CursorPageParams, type PagePromise } from '../../core/pagination'; import type { RequestOptions } from '../../internal/request-options'; import { path as __scalarPath } from '../../internal/utils/path'; +import type * as ImagesAPI from '../images/images'; import * as SSHAPI from './ssh'; import { SSH, @@ -40,7 +41,7 @@ import { import * as AutoresizingAPI from './autoresizing'; import { Autoresizing, - type Settings, + type Policy, type AutoresizingRetrieveParams, type AutoresizingUpdateParams, } from './autoresizing'; @@ -74,7 +75,7 @@ export class Machines extends APIResource { * * @param {MachineCreateParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} Create converged inline + * @returns {APIPromise} Create has converged * * @example * ```ts @@ -110,7 +111,7 @@ export class Machines extends APIResource { } /** - * Update machine + * Changes settings such as autosleep. * * @param {MachineUpdateParams} params - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. @@ -143,8 +144,8 @@ export class Machines extends APIResource { * ``` */ delete(params: MachineDeleteParams, options?: RequestOptions): APIPromise { - const { machine_id } = params; - return this._client.delete(__scalarPath`/v1/machines/${machine_id}`, options); + const { machine_id, force } = params; + return this._client.delete(__scalarPath`/v1/machines/${machine_id}`, { query: { force }, ...options }); } /** @@ -206,6 +207,25 @@ export class Machines extends APIResource { ...options, }); } + + /** + * Wakes a sleeping Machine, then waits up to 30 seconds for the host to confirm CPU and RAM. Returns the Machine with its confirmed size. After RESIZE_TIMEOUT, repeat the same request and Idempotency-Key to wait again. + * + * @param {MachineResizeParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} Machine with the confirmed size. + * + * @example + * ```ts + * const machine = await client.machines.resize({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * }); + * ``` + */ + resize(params: MachineResizeParams, options?: RequestOptions): APIPromise { + const { machine_id, ...body } = params; + return this._client.post(__scalarPath`/v1/machines/${machine_id}/resize`, { body, ...options }); + } } export interface Machine { @@ -301,6 +321,12 @@ export interface CreateParams { * @default 300s */ autosleep?: string; + /** + * Organization-owned ready custom image ID. Requires Pro. Omit for the platform default. + * @minLength 1 + * @pattern ^\S+$ + */ + image_id?: string; /** * Memory in MiB. * @default 4096 @@ -325,28 +351,15 @@ export interface CreateParams { } export interface UpdateParams { - /** - * Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. - */ autosleep?: string; /** - * Memory in MiB. - * @format int64 - */ - memory_mib?: number; - /** - * Storage in GiB. * @format int64 */ storage_gib?: number; - /** - * CPU in vCPUs. - * @format double - */ - vcpu?: number; } export interface LifecycleStatus { + autoresize: LifecycleStatus.Autoresize; /** * @format date-time */ @@ -355,12 +368,6 @@ export interface LifecycleStatus { * @format date-time */ last_transition_at: string; - /** - * Accepted RAM maximum, including completed automatic increases. - * @format int64 - * @minimum 1 - */ - memory_configured_mib: number; phase: | 'accepted' | 'placement_pending' @@ -375,29 +382,59 @@ export interface LifecycleStatus { retryable: boolean; revision: string; last_error?: string; - /** - * Last confirmed RAM allocation for the current running generation. Absent when the allocation is unknown or no longer current. - * @format int64 - * @minimum 1 - */ - memory_assigned_mib?: number; - /** - * Time of the latest confirmed automatic RAM increase. Does not include explicit resizing or a complete change history. - * @format date-time - */ - memory_last_autoresized_at?: string; - /** - * Resize progress reported by the current runtime. A pending automatic target may not yet be applied by that runtime. - */ - memory_resize_state?: 'stable' | 'error' | 'pending_capacity'; - /** - * Pending automatic RAM target, or the current runtime target when no automatic target is pending. - * @format int64 - * @minimum 1 - */ - memory_target_mib?: number; } +export namespace LifecycleStatus { + export interface Autoresize { + cpu: Autoresize.CPU | null; + memory: Autoresize.Memory | null; + } + + export namespace Autoresize { + export interface CPU { + /** + * Time the current refusal was first recorded. + * @format date-time + */ + blocked_at?: string; + /** + * Why the latest automatic increase could not proceed, as the error code an explicit resize would return. Absent once an automatic increase is accepted. + */ + blocked_reason?: + | 'MACHINE_GROWTH_LIMIT_REACHED' + | 'MACHINE_TIER_SHAPE_EXCEEDED' + | 'MACHINE_QUOTA_EXCEEDED' + | 'MACHINE_MEMORY_ABOVE_LIMIT' + | 'ASSIGNED_HOST_CAPACITY_CONFLICT' + | 'MACHINE_PLACEMENT_EXHAUSTED' + | 'MACHINE_RESIZE_UNAVAILABLE' + | 'MACHINE_SHAPE_UNSUPPORTED'; + } + + export interface Memory { + /** + * Time the current refusal was first recorded. + * @format date-time + */ + blocked_at?: string; + /** + * Why the latest automatic increase could not proceed, as the error code an explicit resize would return. Absent once an automatic increase is accepted. + */ + blocked_reason?: + | 'MACHINE_GROWTH_LIMIT_REACHED' + | 'MACHINE_TIER_SHAPE_EXCEEDED' + | 'MACHINE_QUOTA_EXCEEDED' + | 'MACHINE_MEMORY_ABOVE_LIMIT' + | 'ASSIGNED_HOST_CAPACITY_CONFLICT' + | 'MACHINE_PLACEMENT_EXHAUSTED' + | 'MACHINE_RESIZE_UNAVAILABLE' + | 'MACHINE_SHAPE_UNSUPPORTED'; + } + } +} + +export type AutoresizingSwitch = 'on' | 'off'; + export interface MachineListParams extends CursorPageParams {} export type MachineListItemsCursorPage = CursorPage; @@ -408,6 +445,12 @@ export interface MachineCreateParams { * @default 300s */ autosleep?: string; + /** + * Organization-owned ready custom image ID. Requires Pro. Omit for the platform default. + * @minLength 1 + * @pattern ^\S+$ + */ + image_id?: string; /** * Memory in MiB. * @default 4096 @@ -480,34 +523,28 @@ export interface MachineUpdateParams { */ machine_id: string; /** - * Body param: Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. + * Body param */ autosleep?: string; /** - * Body param: Memory in MiB. - * @format int64 - */ - memory_mib?: number; - /** - * Body param: Storage in GiB. + * Body param * @format int64 */ storage_gib?: number; - /** - * Body param: CPU in vCPUs. - * @format double - */ - vcpu?: number; } export interface MachineDeleteParams { /** - * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. * @minLength 36 * @maxLength 39 * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ */ machine_id: string; + /** + * Query param: Destroy from the last published filesystem checkpoint without publishing the Machine's remaining writes, whether the Machine is running or failed. Unpublished file writes are lost. The default publishes them first, and waits while it cannot. + */ + force?: boolean; } export interface MachineSleepParams { @@ -543,6 +580,56 @@ export interface MachineRebootParams { */ force?: boolean; } + +export interface MachineResizeParams { + /** + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * Body param: RAM in MiB. + * @format int64 + */ + memory_mib?: number; + /** + * Body param: CPU in 0.25-vCPU steps. + * @format double + */ + vcpu?: number; +} + +export interface MachineResizeResponse { + /** + * Seconds of inactivity before autosleep. 0 disables autosleep. + * @format int64 + * @minimum 0 + * @maximum 9223372036 + */ + autosleep_seconds: number; + desired_state: 'running' | 'sleeping' | 'destroyed'; + /** + * @format uuid + */ + machine_id: string; + /** + * Memory in MiB. + * @format int64 + */ + memory_mib: number; + status: LifecycleStatus; + /** + * @format int64 + */ + storage_gib: number; + /** + * CPU in vCPUs. + * @format double + */ + vcpu: number; +} Machines.SSH = SSH; Machines.Executions = Executions; Machines.Autoresizing = Autoresizing; @@ -555,8 +642,10 @@ export declare namespace Machines { type CreateParams as CreateParams, type UpdateParams as UpdateParams, type LifecycleStatus as LifecycleStatus, + type AutoresizingSwitch as AutoresizingSwitch, type MachineListItemsCursorPage as MachineListItemsCursorPage, type MachineRetrieveResponse as MachineRetrieveResponse, + type MachineResizeResponse as MachineResizeResponse, type MachineListParams as MachineListParams, type MachineCreateParams as MachineCreateParams, type MachineRetrieveParams as MachineRetrieveParams, @@ -565,6 +654,7 @@ export declare namespace Machines { type MachineSleepParams as MachineSleepParams, type MachineWakeParams as MachineWakeParams, type MachineRebootParams as MachineRebootParams, + type MachineResizeParams as MachineResizeParams, }; export { @@ -601,7 +691,7 @@ export declare namespace Machines { export { Autoresizing as Autoresizing, - type Settings as Settings, + type Policy as Policy, type AutoresizingRetrieveParams as AutoresizingRetrieveParams, type AutoresizingUpdateParams as AutoresizingUpdateParams, }; diff --git a/src/sdk/resources/organization/autoresizing.ts b/src/sdk/resources/organization/autoresizing.ts index 5393c09..a90d475 100644 --- a/src/sdk/resources/organization/autoresizing.ts +++ b/src/sdk/resources/organization/autoresizing.ts @@ -3,10 +3,11 @@ import { APIResource } from '../../resource'; import { APIPromise } from '../../api-promise'; import type { RequestOptions } from '../../internal/request-options'; +import type * as MachinesAPI from '../machines/machines'; export class Autoresizing extends APIResource { /** - * Read organization RAM autoresizing policy + * Read organization autoresizing policy * * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} OK @@ -21,7 +22,7 @@ export class Autoresizing extends APIResource { } /** - * Set organization RAM autoresizing policy + * Changes defaults copied to new Machines. Existing Machines retain their own policy. * * @param {AutoresizingUpdateParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. @@ -29,28 +30,66 @@ export class Autoresizing extends APIResource { * * @example * ```ts - * const policy = await client.organization.autoresizing.update({ - * enabled: false, - * }); + * const policy = await client.organization.autoresizing.update({}); * ``` */ update(body: AutoresizingUpdateParams, options?: RequestOptions): APIPromise { - return this._client.put('/v1/organization/autoresizing', { body, ...options }); + return this._client.patch('/v1/organization/autoresizing', { body, ...options }); } } export interface Policy { /** - * Allow automatic RAM increases for all organization machines. Disabling preserves applied RAM and already admitted resizes. + * Permit automatic CPU growth independently of RAM. + */ + cpu: MachinesAPI.AutoresizingSwitch; + cpu_limit_source: 'plan' | 'configured' | 'platform'; + /** + * Configured CPU growth limit in 0.25-vCPU steps. Null uses the plan limit. + * @format double + */ + cpu_max_vcpu: number | null; + /** + * Largest automatic CPU size allowed by this policy, plan and platform. + * @format double + */ + effective_cpu_max_vcpu: number; + /** + * Largest automatic RAM size allowed by this policy and plan, in MiB. + * @format int64 + */ + effective_memory_max_mib: number; + /** + * Deprecated RAM permission alias. Use memory. + * @deprecated */ enabled: boolean; + /** + * Permit automatic RAM growth. Automatic shrink remains internal. + */ + memory: MachinesAPI.AutoresizingSwitch; + memory_limit_source: 'plan' | 'configured' | 'platform'; + /** + * Configured RAM growth limit in MiB. Null uses the plan limit. + * @format int64 + */ + memory_max_mib: number | null; } export interface AutoresizingUpdateParams { + cpu?: MachinesAPI.AutoresizingSwitch; /** - * Allow automatic RAM increases for all organization machines. Disabling preserves applied RAM and already admitted resizes. + * @format double + * @minimum 0.25 + * @multipleOf 0.25 */ - enabled: boolean; + cpu_max_vcpu?: number | null; + memory?: MachinesAPI.AutoresizingSwitch; + /** + * @format int64 + * @minimum 256 + */ + memory_max_mib?: number | null; } export declare namespace Autoresizing { export { type Policy as Policy, type AutoresizingUpdateParams as AutoresizingUpdateParams }; diff --git a/src/sdk/version.ts b/src/sdk/version.ts index 870051e..5c38ecd 100644 --- a/src/sdk/version.ts +++ b/src/sdk/version.ts @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -export const VERSION = '0.6.0'; // x-release-please-version +export const VERSION = '0.1.0'; // x-release-please-version diff --git a/tests/smoke-test.ts b/tests/smoke-test.ts index 3c33dc6..c3f1c9a 100644 --- a/tests/smoke-test.ts +++ b/tests/smoke-test.ts @@ -48,6 +48,7 @@ const cases: { operation: string; method: string; path: string; label?: string; operation: 'create', method: 'POST', path: '/v1/machines', + label: 'required params', args: [ 'machines', 'create', @@ -62,6 +63,27 @@ const cases: { operation: string; method: string; path: string; label?: string; ], }, + { + operation: 'create', + method: 'POST', + path: '/v1/machines', + label: 'all params', + args: [ + 'machines', + 'create', + '--autosleep', + '300s', + '--image-id', + 'x', + '--memory-mib', + '4096', + '--storage-gib', + '10', + '--vcpu', + '1', + ], + }, + { operation: 'retrieve', method: 'GET', @@ -89,12 +111,8 @@ const cases: { operation: string; method: string; path: string; label?: string; '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--autosleep', '', - '--memory-mib', - '0', '--storage-gib', '0', - '--vcpu', - '0', ], }, @@ -102,9 +120,18 @@ const cases: { operation: string; method: string; path: string; label?: string; operation: 'delete', method: 'DELETE', path: '/v1/machines/{machine_id}', + label: 'required params', args: ['machines', 'delete', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], }, + { + operation: 'delete', + method: 'DELETE', + path: '/v1/machines/{machine_id}', + label: 'all params', + args: ['machines', 'delete', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--force'], + }, + { operation: 'sleep', method: 'POST', @@ -135,12 +162,38 @@ const cases: { operation: string; method: string; path: string; label?: string; args: ['machines', 'reboot', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--force'], }, + { + operation: 'resize', + method: 'POST', + path: '/v1/machines/{machine_id}/resize', + label: 'required params', + args: ['machines', 'resize', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + }, + + { + operation: 'resize', + method: 'POST', + path: '/v1/machines/{machine_id}/resize', + label: 'all params', + args: [ + 'machines', + 'resize', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--memory-mib', + '0', + '--vcpu', + '0', + ], + }, + { operation: 'list', method: 'GET', path: '/v1/machines/{machine_id}/ssh', args: [ - 'machines:ssh', + 'machines', + 'ssh', 'list', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -154,7 +207,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'POST', path: '/v1/machines/{machine_id}/ssh', args: [ - 'machines:ssh', + 'machines', + 'ssh', 'create', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -168,7 +222,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'GET', path: '/v1/machines/{machine_id}/ssh/{session_id}', args: [ - 'machines:ssh', + 'machines', + 'ssh', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -182,7 +237,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'DELETE', path: '/v1/machines/{machine_id}/ssh/{session_id}', args: [ - 'machines:ssh', + 'machines', + 'ssh', 'delete', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -196,7 +252,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'GET', path: '/v1/machines/{machine_id}/executions', args: [ - 'machines:executions', + 'machines', + 'executions', 'list', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -211,7 +268,8 @@ const cases: { operation: string; method: string; path: string; label?: string; path: '/v1/machines/{machine_id}/executions', label: 'required params', args: [ - 'machines:executions', + 'machines', + 'executions', 'create', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -226,7 +284,8 @@ const cases: { operation: string; method: string; path: string; label?: string; path: '/v1/machines/{machine_id}/executions', label: 'all params', args: [ - 'machines:executions', + 'machines', + 'executions', 'create', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -248,7 +307,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'GET', path: '/v1/machines/{machine_id}/executions/{execution_id}', args: [ - 'machines:executions', + 'machines', + 'executions', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -262,7 +322,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'DELETE', path: '/v1/machines/{machine_id}/executions/{execution_id}', args: [ - 'machines:executions', + 'machines', + 'executions', 'delete', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -276,7 +337,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'GET', path: '/v1/machines/{machine_id}/executions/{execution_id}/output', args: [ - 'machines:executions', + 'machines', + 'executions', 'output', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -290,7 +352,8 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'GET', path: '/v1/machines/{machine_id}/executions/{execution_id}/events', args: [ - 'machines:executions', + 'machines', + 'executions', 'events', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -306,7 +369,9 @@ const cases: { operation: string; method: string; path: string; label?: string; method: 'GET', path: '/v1/machines/{machine_id}/executions/{execution_id}/logs', args: [ - 'machines:executions:logs', + 'machines', + 'executions', + 'logs', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -315,26 +380,14 @@ const cases: { operation: string; method: string; path: string; label?: string; ], }, - { - operation: 'reauthorize', - method: 'POST', - path: '/v1/machines/{machine_id}/executions/{execution_id}/logs/reauthorize', - args: [ - 'machines:executions:logs', - 'reauthorize', - '--machine-id', - '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', - '--execution-id', - 'execution_id', - ], - }, - { operation: 'createToken', method: 'POST', path: '/v1/machines/{machine_id}/executions/{execution_id}/logs/token', args: [ - 'machines:executions:logs', + 'machines', + 'executions', + 'logs', 'create-token', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', @@ -347,19 +400,36 @@ const cases: { operation: string; method: string; path: string; label?: string; operation: 'retrieve', method: 'GET', path: '/v1/machines/{machine_id}/autoresizing', - args: ['machines:autoresizing', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + args: ['machines', 'autoresizing', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], }, { operation: 'update', - method: 'PUT', + method: 'PATCH', + path: '/v1/machines/{machine_id}/autoresizing', + label: 'required params', + args: ['machines', 'autoresizing', 'update', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + }, + + { + operation: 'update', + method: 'PATCH', path: '/v1/machines/{machine_id}/autoresizing', + label: 'all params', args: [ - 'machines:autoresizing', + 'machines', + 'autoresizing', 'update', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', - '--enabled', + '--cpu', + 'on', + '--cpu-max-vcpu', + '0.25', + '--memory', + 'on', + '--memory-max-mib', + '256', ], }, @@ -367,14 +437,106 @@ const cases: { operation: string; method: string; path: string; label?: string; operation: 'retrieve', method: 'GET', path: '/v1/organization/autoresizing', - args: ['organization:autoresizing', 'retrieve'], + args: ['organization', 'autoresizing', 'retrieve'], + }, + + { + operation: 'update', + method: 'PATCH', + path: '/v1/organization/autoresizing', + label: 'required params', + args: ['organization', 'autoresizing', 'update'], }, { operation: 'update', - method: 'PUT', + method: 'PATCH', path: '/v1/organization/autoresizing', - args: ['organization:autoresizing', 'update', '--enabled'], + label: 'all params', + args: [ + 'organization', + 'autoresizing', + 'update', + '--cpu', + 'on', + '--cpu-max-vcpu', + '0.25', + '--memory', + 'on', + '--memory-max-mib', + '256', + ], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/images', + label: 'required params', + args: ['images', 'list', '--limit', '100'], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/images', + label: 'all params', + args: ['images', 'list', '--limit', '100', '--cursor', 'cursor'], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/images', + label: 'required params', + args: ['images', 'create', '--platform', 'linux/amd64', '--source', '{"kind":""}'], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/images', + label: 'all params', + args: [ + 'images', + 'create', + '--credential-ref', + '', + '--name', + '', + '--platform', + 'linux/amd64', + '--source', + '{"kind":"","reference":"","sha256":"","upload_id":""}', + ], + }, + + { + operation: 'retrieve', + method: 'GET', + path: '/v1/images/{image_id}', + args: ['images', 'retrieve', '--image-id', 'image_id'], + }, + + { + operation: 'update', + method: 'PATCH', + path: '/v1/images/{image_id}', + args: ['images', 'update', '--image-id', 'image_id', '--name', ''], + }, + + { + operation: 'delete', + method: 'DELETE', + path: '/v1/images/{image_id}', + args: ['images', 'delete', '--image-id', 'image_id'], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/images/uploads', + args: ['images', 'uploads', 'create', '--platform', '', '--sha256', '', '--size-bytes', '0'], }, ]; From 5128905031839d9aa3fd2bca3bc639418d63a3f1 Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:20:43 -0800 Subject: [PATCH 02/12] feat(api): add machine ports and access key commands --- .claude/skills/dedalus-cli-sdk/SKILL.md | 2 +- .release-please-manifest.json | 2 +- README.md | 3 +- SKILL.md | 2 +- api-contract.json | 49 +- api.md | 109 +- biome.json | 2 +- ci/publish-steps.ts | 54 +- ci/release-please.ts | 60 +- ci/sdk-release.ts | 20 +- generation-provenance.json | 18 +- man/dedalus-images-create.1 | 3 + man/dedalus-images-delete.1 | 3 + man/dedalus-images-list.1 | 7 +- man/dedalus-images-retrieve.1 | 3 + man/dedalus-images-update.1 | 3 + man/dedalus-images-uploads-create.1 | 3 + man/dedalus-login.1 | 3 + man/dedalus-machines-autoresizing-retrieve.1 | 3 + man/dedalus-machines-autoresizing-update.1 | 3 + man/dedalus-machines-create.1 | 3 + man/dedalus-machines-delete.1 | 3 + man/dedalus-machines-executions-create.1 | 5 +- man/dedalus-machines-executions-delete.1 | 3 + man/dedalus-machines-executions-events.1 | 3 + man/dedalus-machines-executions-list.1 | 3 + ...us-machines-executions-logs-create-token.1 | 3 + ...edalus-machines-executions-logs-retrieve.1 | 3 + man/dedalus-machines-executions-output.1 | 3 + man/dedalus-machines-executions-retrieve.1 | 3 + man/dedalus-machines-list.1 | 3 + man/dedalus-machines-ports-access-keys-list.1 | 117 + man/dedalus-machines-ports-access-keys-mint.1 | 115 + ...edalus-machines-ports-access-keys-revoke.1 | 115 + ...edalus-machines-ports-access-keys-rotate.1 | 119 + man/dedalus-machines-ports-create.1 | 122 + man/dedalus-machines-ports-delete.1 | 111 + man/dedalus-machines-ports-list.1 | 117 + man/dedalus-machines-ports-retrieve.1 | 111 + man/dedalus-machines-ports-update.1 | 115 + man/dedalus-machines-reboot.1 | 3 + man/dedalus-machines-resize.1 | 3 + man/dedalus-machines-retrieve.1 | 3 + man/dedalus-machines-sleep.1 | 3 + man/dedalus-machines-ssh-create.1 | 3 + man/dedalus-machines-ssh-delete.1 | 3 + man/dedalus-machines-ssh-list.1 | 3 + man/dedalus-machines-ssh-retrieve.1 | 3 + man/dedalus-machines-update.1 | 3 + man/dedalus-machines-wake.1 | 3 + ...dalus-organization-autoresizing-retrieve.1 | 3 + ...dedalus-organization-autoresizing-update.1 | 3 + man/dedalus-upgrade.1 | 4 +- man/dedalus.1 | 32 +- package.json | 9 + scalar-sdk.manifest.json | 8416 +++++++++++------ scripts/package-staging.mjs | 3 +- scripts/publish-binaries.mjs | 75 +- scripts/update-homebrew.mjs | 193 +- src/cli/completions.ts | 6 +- src/cli/context.ts | 241 + src/cli/login.ts | 85 +- src/cli/prompt.ts | 67 + src/cli/runtime.ts | 176 +- src/cli/upgrade.ts | 478 +- src/commands/index.ts | 371 +- src/custom/browser-routing.ts | 7 +- src/custom/machines.ts | 152 +- src/custom/ssh-picker.ts | 234 +- src/custom/ssh.ts | 266 +- src/feedback/bundle.ts | 4 +- src/feedback/command.ts | 4 +- src/feedback/diagnostics.ts | 26 +- src/sdk/client.ts | 18 +- src/sdk/internal/qs/LICENSE.md | 13 - src/sdk/internal/qs/README.md | 3 - src/sdk/internal/qs/formats.ts | 10 - src/sdk/internal/qs/index.ts | 13 - src/sdk/internal/qs/stringify.ts | 384 - src/sdk/internal/qs/types.ts | 71 - src/sdk/internal/qs/utils.ts | 265 - src/sdk/internal/to-file.ts | 4 +- src/sdk/internal/utils/sleep.ts | 24 +- src/sdk/resources.ts | 1 - src/sdk/resources/images/images.ts | 6 +- src/sdk/resources/index.ts | 1 - src/sdk/resources/machines/autoresizing.ts | 9 +- .../machines/executions/executions.ts | 5 +- src/sdk/resources/machines/index.ts | 12 +- src/sdk/resources/machines/machines.ts | 29 +- src/sdk/resources/machines/ports.ts | 3 + .../resources/machines/ports/access-keys.ts | 316 + src/sdk/resources/machines/ports/index.ts | 24 + src/sdk/resources/machines/ports/ports.ts | 362 + .../resources/organization/autoresizing.ts | 9 +- tests/browser-login.test.mjs | 197 +- tests/browser-routing.test.mjs | 84 +- tests/credential-boundary.test.mjs | 88 +- tests/feedback-bundles.test.mjs | 6 +- tests/feedback-command.test.mjs | 204 +- tests/feedback-diagnostics.test.mjs | 70 +- tests/feedback-retry-keys.test.mjs | 18 +- tests/feedback-runtime.test.mjs | 18 +- .../fixtures/production-oauth-entrypoint.mjs | 23 +- tests/homebrew-release.test.mjs | 220 +- tests/legacy-installer.test.mjs | 68 +- tests/machine-aliases.test.mjs | 411 +- tests/ports-commands.test.mjs | 77 + tests/production-auth-routing.test.mjs | 118 +- tests/production-oauth-lifecycle.test.mjs | 88 +- tests/smoke-test.ts | 386 +- tests/ssh-paths.test.mjs | 99 +- 112 files changed, 11131 insertions(+), 4940 deletions(-) create mode 100644 man/dedalus-machines-ports-access-keys-list.1 create mode 100644 man/dedalus-machines-ports-access-keys-mint.1 create mode 100644 man/dedalus-machines-ports-access-keys-revoke.1 create mode 100644 man/dedalus-machines-ports-access-keys-rotate.1 create mode 100644 man/dedalus-machines-ports-create.1 create mode 100644 man/dedalus-machines-ports-delete.1 create mode 100644 man/dedalus-machines-ports-list.1 create mode 100644 man/dedalus-machines-ports-retrieve.1 create mode 100644 man/dedalus-machines-ports-update.1 create mode 100644 src/cli/context.ts create mode 100644 src/cli/prompt.ts delete mode 100644 src/sdk/internal/qs/LICENSE.md delete mode 100644 src/sdk/internal/qs/README.md delete mode 100644 src/sdk/internal/qs/formats.ts delete mode 100644 src/sdk/internal/qs/index.ts delete mode 100644 src/sdk/internal/qs/stringify.ts delete mode 100644 src/sdk/internal/qs/types.ts delete mode 100644 src/sdk/internal/qs/utils.ts create mode 100644 src/sdk/resources/machines/ports.ts create mode 100644 src/sdk/resources/machines/ports/access-keys.ts create mode 100644 src/sdk/resources/machines/ports/index.ts create mode 100644 src/sdk/resources/machines/ports/ports.ts create mode 100644 tests/ports-commands.test.mjs diff --git a/.claude/skills/dedalus-cli-sdk/SKILL.md b/.claude/skills/dedalus-cli-sdk/SKILL.md index b2be238..1c4f14b 100644 --- a/.claude/skills/dedalus-cli-sdk/SKILL.md +++ b/.claude/skills/dedalus-cli-sdk/SKILL.md @@ -53,7 +53,7 @@ Paginated commands fetch subsequent pages for you. Use `--max-items ` to ## Error handling -Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. +Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. When the API answered with a JSON error payload, its parsed form is under `body`, so structured details such as an API-specific error code or field errors can be read without parsing `message`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. ## Working with this SDK programmatically diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca9..64f3cdd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { ".": "0.8.0" -} \ No newline at end of file +} diff --git a/README.md b/README.md index 314b25a..1518293 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ Declared schemes: ## Errors -Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. +Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. When the API answered with a JSON error payload, its parsed form is under `body`, so structured details such as an API-specific error code or field errors can be read without parsing `message`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. Documented error statuses: `401`, `403`, `409`, `429`, `503`, `default`. @@ -282,6 +282,7 @@ Paginated commands fetch subsequent pages for you. Use `--max-items ` to - `--transform ` and `--transform-error ` — dot-path transform for data/error output. - `--raw-output`, `-r` — print transformed string values without JSON quotes. - `--max-items ` — bound iterator, streaming, and WebSocket command output. +- `--no-input` — never prompt: a command that would ask fails instead, the same as it does without a terminal. - Errors carry a stable `code` and an actionable `hint` beside the API's own message, and each failure class exits with its own status: `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`.
diff --git a/SKILL.md b/SKILL.md index 50b3a10..8198270 100644 --- a/SKILL.md +++ b/SKILL.md @@ -53,7 +53,7 @@ Paginated commands fetch subsequent pages for you. Use `--max-items ` to ## Error handling -Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. +Failed requests print a structured error to standard error and exit with a status that identifies the failure class. The error body carries the API's own `message` plus a stable `code`, the HTTP `status`, the `requestId`, and — where one applies — an actionable `hint`. When the API answered with a JSON error payload, its parsed form is under `body`, so structured details such as an API-specific error code or field errors can be read without parsing `message`. Usage errors (exit `2`) are reported as a plain message instead, since no request was made. Exit statuses: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. ## Working with this SDK programmatically diff --git a/api-contract.json b/api-contract.json index 05d3d94..7c1ca5a 100644 --- a/api-contract.json +++ b/api-contract.json @@ -1,6 +1,6 @@ { - "source_sha": "9f8d54f123e81b8bc7252f855c52ecbf7cc8ae42", - "spec_sha256": "c0b2db893e3017c5c83c14375e6085581584641f617ee7ea1305ab80e9b50421", + "source_sha": "33b1723ceb008dfddf66ed9939c1c69aef73fd91", + "spec_sha256": "bb5bd464c8160621397668abdcd19834cbae34629865d4fd98c588f3c083d122", "operations": [ { "method": "GET", @@ -107,6 +107,51 @@ "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", "bodyParams": [] }, + { + "method": "GET", + "path": "/v1/machines/{machine_id}/ports", + "bodyParams": [] + }, + { + "method": "POST", + "path": "/v1/machines/{machine_id}/ports", + "bodyParams": ["expires", "port", "protocol", "visibility"] + }, + { + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}", + "bodyParams": [] + }, + { + "method": "GET", + "path": "/v1/machines/{machine_id}/ports/{port_id}", + "bodyParams": [] + }, + { + "method": "PATCH", + "path": "/v1/machines/{machine_id}/ports/{port_id}", + "bodyParams": ["visibility"] + }, + { + "method": "GET", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + "bodyParams": [] + }, + { + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + "bodyParams": ["expires_in"] + }, + { + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", + "bodyParams": [] + }, + { + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", + "bodyParams": ["expires_in"] + }, { "method": "POST", "path": "/v1/machines/{machine_id}/reboot", diff --git a/api.md b/api.md index c75bc10..ef59831 100644 --- a/api.md +++ b/api.md @@ -32,12 +32,23 @@ Complete reference of every operation, grouped by resource. See [the README](./R - [`Machines Autoresizing`](#machines-autoresizing) - [Read this machine's autoresizing settings](#read-this-machines-autoresizing-settings) - [Set this machine's autoresizing settings](#set-this-machines-autoresizing-settings) + - [`Machines Ports`](#machines-ports) + - [List ports](#list-ports) + - [Create port](#create-port) + - [Get port](#get-port) + - [Update port](#update-port) + - [Delete port](#delete-port) + - [`Machines Ports AccessKeys`](#machines-ports-accesskeys) + - [List port access keys](#list-port-access-keys) + - [Mint port access key](#mint-port-access-key) + - [Revoke port access key](#revoke-port-access-key) + - [Rotate port access key](#rotate-port-access-key) - [`Organization`](#organization) - [`Organization Autoresizing`](#organization-autoresizing) - [Read organization autoresizing policy](#read-organization-autoresizing-policy) - [Set organization autoresizing policy](#set-organization-autoresizing-policy) - [`Images`](#images) - - [List image IDs owned by the authenticated organization](#list-image-ids-owned-by-the-authenticated-organization) + - [List images owned by the authenticated organization](#list-images-owned-by-the-authenticated-organization) - [Register an immutable OCI image for preparation](#register-an-immutable-oci-image-for-preparation) - [Read preparation status for an organization-owned image](#read-preparation-status-for-an-organization-owned-image) - [Rename an organization-owned image](#rename-an-organization-owned-image) @@ -261,6 +272,98 @@ dedalus machines autoresizing update \ --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' ``` +### `Machines Ports` + +#### List ports + +```sh +dedalus machines ports list \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --max-items 10 +``` + +#### Create port + +```sh +dedalus machines ports create \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port '0' \ + --protocol 'http' \ + --visibility 'private' +``` + +#### Get port + +```sh +dedalus machines ports retrieve \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' +``` + +#### Update port + +```sh +dedalus machines ports update \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' \ + --visibility 'public' +``` + +#### Delete port + +```sh +dedalus machines ports delete \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' +``` + +#### `Machines Ports AccessKeys` + +##### List port access keys + +```sh +dedalus machines ports access-keys list \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' +``` + +##### Mint port access key + +```sh +dedalus machines ports access-keys mint \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' \ + --expires-in '1' +``` + +##### Revoke port access key + +```sh +dedalus machines ports access-keys revoke \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' \ + --access-key-id 'access_key_id' +``` + +##### Rotate port access key + +```sh +dedalus machines ports access-keys rotate \ + --browser-token "$DEDALUS_BROWSER_TOKEN" \ + --machine-id '017f22e2-79b0-7cc3-98c4-dc0c0c07398f' \ + --port-id 'port_id' \ + --access-key-id 'access_key_id' \ + --expires-in '1' +``` + ## `Organization` ### `Organization Autoresizing` @@ -281,9 +384,9 @@ dedalus organization autoresizing update --browser-token "$DEDALUS_BROWSER_TOKEN ## `Images` -### List image IDs owned by the authenticated organization +### List images owned by the authenticated organization -Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. +Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID. ```sh dedalus images list --browser-token "$DEDALUS_BROWSER_TOKEN" --limit '100' diff --git a/biome.json b/biome.json index b2ce844..294bd6c 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json", + "$schema": "https://biomejs.dev/schemas/2.6.6/schema.json", "root": true, "files": { "includes": [ diff --git a/ci/publish-steps.ts b/ci/publish-steps.ts index 2b1b3e2..d155748 100644 --- a/ci/publish-steps.ts +++ b/ci/publish-steps.ts @@ -1,54 +1,48 @@ -import { - command, - unsafeShell, - type GitHubWorkflowStep, -} from "@dedalus-labs/hollywood"; +import { command, unsafeShell, type GitHubWorkflowStep } from '@dedalus-labs/hollywood'; // npm trusted publishing requires a GitHub-hosted runner. export const publishSteps = [ { - uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1", + uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1', }, { - uses: "actions/setup-node@820762786026740c76f36085b0efc47a31fe5020", + uses: 'actions/setup-node@820762786026740c76f36085b0efc47a31fe5020', with: { - "node-version": "24", - "registry-url": "https://registry.npmjs.org", + 'node-version': '24', + 'registry-url': 'https://registry.npmjs.org', }, }, { run: unsafeShell(`npm install`), - shell: "bash", + shell: 'bash', }, { run: unsafeShell(`npm run build`), - shell: "bash", + shell: 'bash', }, { - name: "Read package version", - run: unsafeShell( - `echo "PKG_VERSION=$(node -p 'require("./package.json").version')" >> "$GITHUB_ENV"`, - ), - shell: "bash", + name: 'Read package version', + run: unsafeShell(`echo "PKG_VERSION=$(node -p 'require("./package.json").version')" >> "$GITHUB_ENV"`), + shell: 'bash', }, { run: unsafeShell(`npm install -g npm@11`), - shell: "bash", + shell: 'bash', }, { - name: "Publish to npm", + name: 'Publish to npm', run: unsafeShell(`node scripts/publish-npm.mjs`), - shell: "bash", + shell: 'bash', }, { - name: "Set up Bun", - uses: "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6", + name: 'Set up Bun', + uses: 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6', with: { - "bun-version": "1.4.0", + 'bun-version': '1.4.0', }, }, { - name: "Compile standalone binaries", + name: 'Compile standalone binaries', run: unsafeShell(`ROOT="$PWD" mkdir -p release-binaries for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do @@ -66,20 +60,20 @@ for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do done rm -rf compile-out `), - shell: "bash", + shell: 'bash', }, { - name: "Attach binaries to the release", - run: command({ file: "node", args: ["scripts/publish-binaries.mjs"] }), + name: 'Attach binaries to the release', + run: command({ file: 'node', args: ['scripts/publish-binaries.mjs'] }), env: { - GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}", + GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}', }, }, { - name: "Open Homebrew release PR", + name: 'Open Homebrew release PR', env: { - HOMEBREW_TAP_TOKEN: "${{ secrets.HOMEBREW_TAP_TOKEN }}", + HOMEBREW_TAP_TOKEN: '${{ secrets.HOMEBREW_TAP_TOKEN }}', }, - run: command({ file: "node", args: ["scripts/update-homebrew.mjs"] }), + run: command({ file: 'node', args: ['scripts/update-homebrew.mjs'] }), }, ] as const satisfies readonly GitHubWorkflowStep[]; diff --git a/ci/release-please.ts b/ci/release-please.ts index 7a9ff4a..f0f28d3 100644 --- a/ci/release-please.ts +++ b/ci/release-please.ts @@ -1,47 +1,47 @@ -import { workflow, unsafeShell } from "@dedalus-labs/hollywood"; -import { publishSteps } from "./publish-steps"; +import { workflow, unsafeShell } from '@dedalus-labs/hollywood'; +import { publishSteps } from './publish-steps'; export const releaseWorkflow = workflow( { - name: "Release Please", + name: 'Release Please', on: { push: { - branches: ["main"], - "paths-ignore": [".github/workflows/**"], + branches: ['main'], + 'paths-ignore': ['.github/workflows/**'], }, workflow_dispatch: null, }, permissions: { - contents: "write", - "pull-requests": "write", + contents: 'write', + 'pull-requests': 'write', }, jobs: { - "release-please": { - "runs-on": "ubuntu-24.04", + 'release-please': { + 'runs-on': 'ubuntu-24.04', outputs: { - release_created: "${{ steps.release.outputs.release_created }}", - tag_name: "${{ steps.release.outputs.tag_name }}", + release_created: '${{ steps.release.outputs.release_created }}', + tag_name: '${{ steps.release.outputs.tag_name }}', }, steps: [ { - uses: "googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7", - id: "release", + uses: 'googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7', + id: 'release', with: { - "target-branch": "main", - "config-file": "release-please-config.json", - "manifest-file": ".release-please-manifest.json", - "skip-github-pull-request": true, + 'target-branch': 'main', + 'config-file': 'release-please-config.json', + 'manifest-file': '.release-please-manifest.json', + 'skip-github-pull-request': true, }, }, { - uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1", + uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1', if: "${{ steps.release.outputs.release_created == 'true' }}", with: { - "fetch-depth": 0, + 'fetch-depth': 0, }, }, { - name: "Sync release back to scalar-next", + name: 'Sync release back to scalar-next', if: "${{ steps.release.outputs.release_created == 'true' }}", run: unsafeShell(`git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -50,32 +50,32 @@ git checkout -B scalar-next origin/scalar-next git merge --no-edit -m "Sync release \${{ steps.release.outputs.tag_name }} back to scalar-next" "\${{ steps.release.outputs.sha }}" git push origin scalar-next `), - shell: "bash", + shell: 'bash', }, ], }, publish: { - needs: "release-please", + needs: 'release-please', if: "${{ !cancelled() && needs.release-please.outputs.release_created == 'true' }}", - "runs-on": "ubuntu-24.04", - environment: "production", + 'runs-on': 'ubuntu-24.04', + environment: 'production', permissions: { - contents: "write", - "id-token": "write", - packages: "write", + contents: 'write', + 'id-token': 'write', + packages: 'write', }, env: { - VERSIONING_POLICY: "manual", + VERSIONING_POLICY: 'manual', }, steps: [ { ...publishSteps[0], - with: { ref: "${{ needs.release-please.outputs.tag_name }}" }, + with: { ref: '${{ needs.release-please.outputs.tag_name }}' }, }, ...publishSteps.slice(1), ], }, }, }, - { filename: "release-please.yml" }, + { filename: 'release-please.yml' }, ); diff --git a/ci/sdk-release.ts b/ci/sdk-release.ts index a402894..60c8ca1 100644 --- a/ci/sdk-release.ts +++ b/ci/sdk-release.ts @@ -1,27 +1,27 @@ -import { workflow, unsafeShell } from "@dedalus-labs/hollywood"; -import { publishSteps } from "./publish-steps"; +import { workflow, unsafeShell } from '@dedalus-labs/hollywood'; +import { publishSteps } from './publish-steps'; export const manualReleaseWorkflow = workflow( { - name: "CLI SDK Release", + name: 'CLI SDK Release', on: { workflow_dispatch: null, }, permissions: { - contents: "write", - "id-token": "write", - packages: "write", + contents: 'write', + 'id-token': 'write', + packages: 'write', }, jobs: { release: { - "runs-on": "ubuntu-24.04", - environment: "production", + 'runs-on': 'ubuntu-24.04', + environment: 'production', env: { - VERSIONING_POLICY: "manual", + VERSIONING_POLICY: 'manual', }, steps: [{ ...publishSteps[0] }, ...publishSteps.slice(1)], }, }, }, - { filename: "sdk-release.yml" }, + { filename: 'sdk-release.yml' }, ); diff --git a/generation-provenance.json b/generation-provenance.json index 8e1a1b5..669f937 100644 --- a/generation-provenance.json +++ b/generation-provenance.json @@ -1,12 +1,14 @@ { - "source_spec_sha": "f5b640b324aafb001a8da6facd807f13197630bb", - "source_spec_sha256": "a717ed108ea8bbb6b9c0b70255a07da7e9a01224c6941546089084e02097a632", - "generator_version": "0.38.0", - "build_version": "0.1.19", - "configuration_sha256": "477d944077da8e1163423c505fe3f773cce14eda953aa934fe91582d04e4e915", - "operation_count": 31, + "source_spec_sha": "33b1723ceb008dfddf66ed9939c1c69aef73fd91", + "source_spec_sha256": "bb5bd464c8160621397668abdcd19834cbae34629865d4fd98c588f3c083d122", + "generator_version": "0.45.0", + "build_version": "1.1795132129.103696082", + "configuration_sha256": "7b27a7b3a3cb4b0b6f0aa88c80ed3fadac01bfc9075e05095456e986d4430de4", + "operation_count": 40, "generated_commit": null, - "download_sha256": "449d6baf322f0f55edb97085298e4d72238dc8da19749e2f578505ae19c0a239", + "download_sha256": "3c3790a85dbb5ecc8a7e9beecb1a0c24726dfab34414f80c3e0d587df1d248b2", "integration_base": "scalar-next", - "published_package": false + "published_package": false, + "build_id": "e5rUcpIZesILtTifEy6SC", + "custom_code_ref": "753d33130bf5b02e4265ad1f2df503d4941b46ae" } diff --git a/man/dedalus-images-create.1 b/man/dedalus-images-create.1 index 9160f18..fdc608e 100644 --- a/man/dedalus-images-create.1 +++ b/man/dedalus-images-create.1 @@ -60,6 +60,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-images-delete.1 b/man/dedalus-images-delete.1 index c375d34..79fd700 100644 --- a/man/dedalus-images-delete.1 +++ b/man/dedalus-images-delete.1 @@ -39,6 +39,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-images-list.1 b/man/dedalus-images-list.1 index 1ea9466..08b21f1 100644 --- a/man/dedalus-images-list.1 +++ b/man/dedalus-images-list.1 @@ -1,12 +1,12 @@ .\" File generated from our OpenAPI spec by Scalar. Do not edit. .TH "DEDALUS\-IMAGES\-LIST" "1" "" "dedalus" "Dedalus Manual" .SH "NAME" -dedalus\-images\-list \- List image IDs owned by the authenticated organization +dedalus\-images\-list \- List images owned by the authenticated organization .SH "SYNOPSIS" .B dedalus images list [\fIoptions\fR] .SH "DESCRIPTION" -Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. +Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID. .SH "OPTIONS" .TP \fB\-\-limit\fR \fI\fR @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-images-retrieve.1 b/man/dedalus-images-retrieve.1 index 1807efc..f6ee2c7 100644 --- a/man/dedalus-images-retrieve.1 +++ b/man/dedalus-images-retrieve.1 @@ -39,6 +39,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-images-update.1 b/man/dedalus-images-update.1 index 6a86490..ed5ad56 100644 --- a/man/dedalus-images-update.1 +++ b/man/dedalus-images-update.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-images-uploads-create.1 b/man/dedalus-images-uploads-create.1 index 8a6c1e3..33d3899 100644 --- a/man/dedalus-images-uploads-create.1 +++ b/man/dedalus-images-uploads-create.1 @@ -45,6 +45,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-login.1 b/man/dedalus-login.1 index f57d8e5..1f4f4ee 100644 --- a/man/dedalus-login.1 +++ b/man/dedalus-login.1 @@ -14,6 +14,9 @@ Sign\-in flow to use, skipping the prompt. One of: api\-key, x\-api\-key, oauth\ .TP \fB\-\-base\-url\fR \fIurl\fR Sign in against this base URL instead of the default. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. .SH "SIGN\-IN FLOWS" .TP \fBapi\-key\fR diff --git a/man/dedalus-machines-autoresizing-retrieve.1 b/man/dedalus-machines-autoresizing-retrieve.1 index bac433f..d52c199 100644 --- a/man/dedalus-machines-autoresizing-retrieve.1 +++ b/man/dedalus-machines-autoresizing-retrieve.1 @@ -39,6 +39,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-autoresizing-update.1 b/man/dedalus-machines-autoresizing-update.1 index 4f1c3bb..5584c0f 100644 --- a/man/dedalus-machines-autoresizing-update.1 +++ b/man/dedalus-machines-autoresizing-update.1 @@ -51,6 +51,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-create.1 b/man/dedalus-machines-create.1 index b9e03ae..de5cf61 100644 --- a/man/dedalus-machines-create.1 +++ b/man/dedalus-machines-create.1 @@ -51,6 +51,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-delete.1 b/man/dedalus-machines-delete.1 index c961579..b6ea177 100644 --- a/man/dedalus-machines-delete.1 +++ b/man/dedalus-machines-delete.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-create.1 b/man/dedalus-machines-executions-create.1 index 663fbd1..2cb14b2 100644 --- a/man/dedalus-machines-executions-create.1 +++ b/man/dedalus-machines-executions-create.1 @@ -13,7 +13,7 @@ Create execution Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. .TP \fB\-\-command\fR \fI\fR -The command body parameter. Required. +Program and its arguments as an array of strings, such as ["ls", "\-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "\-c", ""]. Required. .TP \fB\-\-cwd\fR \fI\fR The cwd body parameter. @@ -54,6 +54,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-delete.1 b/man/dedalus-machines-executions-delete.1 index c7d0c8d..bc392f9 100644 --- a/man/dedalus-machines-executions-delete.1 +++ b/man/dedalus-machines-executions-delete.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-events.1 b/man/dedalus-machines-executions-events.1 index bbb9a3b..4ce3f17 100644 --- a/man/dedalus-machines-executions-events.1 +++ b/man/dedalus-machines-executions-events.1 @@ -51,6 +51,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-list.1 b/man/dedalus-machines-executions-list.1 index 21e24ae..abb4f08 100644 --- a/man/dedalus-machines-executions-list.1 +++ b/man/dedalus-machines-executions-list.1 @@ -48,6 +48,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-logs-create-token.1 b/man/dedalus-machines-executions-logs-create-token.1 index 5768346..f8bfa0d 100644 --- a/man/dedalus-machines-executions-logs-create-token.1 +++ b/man/dedalus-machines-executions-logs-create-token.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-logs-retrieve.1 b/man/dedalus-machines-executions-logs-retrieve.1 index 80f1ad2..bf92077 100644 --- a/man/dedalus-machines-executions-logs-retrieve.1 +++ b/man/dedalus-machines-executions-logs-retrieve.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-output.1 b/man/dedalus-machines-executions-output.1 index bccd8b8..8bd2e54 100644 --- a/man/dedalus-machines-executions-output.1 +++ b/man/dedalus-machines-executions-output.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-executions-retrieve.1 b/man/dedalus-machines-executions-retrieve.1 index d6c3aea..1c313ab 100644 --- a/man/dedalus-machines-executions-retrieve.1 +++ b/man/dedalus-machines-executions-retrieve.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-list.1 b/man/dedalus-machines-list.1 index e047928..8adc786 100644 --- a/man/dedalus-machines-list.1 +++ b/man/dedalus-machines-list.1 @@ -45,6 +45,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-ports-access-keys-list.1 b/man/dedalus-machines-ports-access-keys-list.1 new file mode 100644 index 0000000..e90dd98 --- /dev/null +++ b/man/dedalus-machines-ports-access-keys-list.1 @@ -0,0 +1,117 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-ACCESS\-KEYS\-LIST" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-access\-keys\-list \- List port access keys +.SH "SYNOPSIS" +.B dedalus machines ports access\-keys list +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +List port access keys +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-limit\fR \fI\fR +The limit query parameter. +.TP +\fB\-\-cursor\fR \fI\fR +The cursor query parameter. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports access\-keys list \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-access-keys-mint.1 b/man/dedalus-machines-ports-access-keys-mint.1 new file mode 100644 index 0000000..9a2dffb --- /dev/null +++ b/man/dedalus-machines-ports-access-keys-mint.1 @@ -0,0 +1,115 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-ACCESS\-KEYS\-MINT" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-access\-keys\-mint \- Mint port access key +.SH "SYNOPSIS" +.B dedalus machines ports access\-keys mint +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR \fB\-\-expires\-in\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Mint port access key +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-expires\-in\fR \fI\fR +Lifetime in integer seconds. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports access\-keys mint \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' \e + \-\-expires\-in '1' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-access-keys-revoke.1 b/man/dedalus-machines-ports-access-keys-revoke.1 new file mode 100644 index 0000000..34ccd10 --- /dev/null +++ b/man/dedalus-machines-ports-access-keys-revoke.1 @@ -0,0 +1,115 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-ACCESS\-KEYS\-REVOKE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-access\-keys\-revoke \- Revoke port access key +.SH "SYNOPSIS" +.B dedalus machines ports access\-keys revoke +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR \fB\-\-access\-key\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Revoke port access key +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-access\-key\-id\fR \fI\fR +The access\-key\-id path parameter. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports access\-keys revoke \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' \e + \-\-access\-key\-id 'access_key_id' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-access-keys-rotate.1 b/man/dedalus-machines-ports-access-keys-rotate.1 new file mode 100644 index 0000000..baf70da --- /dev/null +++ b/man/dedalus-machines-ports-access-keys-rotate.1 @@ -0,0 +1,119 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-ACCESS\-KEYS\-ROTATE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-access\-keys\-rotate \- Rotate port access key +.SH "SYNOPSIS" +.B dedalus machines ports access\-keys rotate +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR \fB\-\-access\-key\-id\fR \fI\fR \fB\-\-expires\-in\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Rotate port access key +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-access\-key\-id\fR \fI\fR +The access\-key\-id path parameter. Required. +.TP +\fB\-\-expires\-in\fR \fI\fR +Lifetime in integer seconds. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports access\-keys rotate \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' \e + \-\-access\-key\-id 'access_key_id' \e + \-\-expires\-in '1' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-create.1 b/man/dedalus-machines-ports-create.1 new file mode 100644 index 0000000..04bc92b --- /dev/null +++ b/man/dedalus-machines-ports-create.1 @@ -0,0 +1,122 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-CREATE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-create \- Create port +.SH "SYNOPSIS" +.B dedalus machines ports create +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Create port +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-expires\fR \fI\fR +Port lifetime in integer seconds. Omit for no expiry. +.TP +\fB\-\-port\fR \fI\fR +The port body parameter. Required. +.TP +\fB\-\-protocol\fR \fI\fR +The protocol body parameter. +.TP +\fB\-\-visibility\fR \fI\fR +Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X\-Dedalus\-API\-Key header. key_required requires a port access key in the X\-Dedalus\-Port\-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports create \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port '0' \e + \-\-protocol 'http' \e + \-\-visibility 'private' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-delete.1 b/man/dedalus-machines-ports-delete.1 new file mode 100644 index 0000000..e9e43a1 --- /dev/null +++ b/man/dedalus-machines-ports-delete.1 @@ -0,0 +1,111 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-DELETE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-delete \- Delete port +.SH "SYNOPSIS" +.B dedalus machines ports delete +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Delete port +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports delete \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-list.1 b/man/dedalus-machines-ports-list.1 new file mode 100644 index 0000000..e59a1ee --- /dev/null +++ b/man/dedalus-machines-ports-list.1 @@ -0,0 +1,117 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-LIST" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-list \- List ports +.SH "SYNOPSIS" +.B dedalus machines ports list +\fB\-\-machine\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +List ports +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-limit\fR \fI\fR +The limit query parameter. +.TP +\fB\-\-cursor\fR \fI\fR +The cursor query parameter. +.TP +\fB\-\-max\-items\fR \fI\fR +Maximum number of items to print; use \-1 for unlimited. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports list \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-max\-items 10 +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-retrieve.1 b/man/dedalus-machines-ports-retrieve.1 new file mode 100644 index 0000000..66d1f51 --- /dev/null +++ b/man/dedalus-machines-ports-retrieve.1 @@ -0,0 +1,111 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-RETRIEVE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-retrieve \- Get port +.SH "SYNOPSIS" +.B dedalus machines ports retrieve +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Get port +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports retrieve \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-ports-update.1 b/man/dedalus-machines-ports-update.1 new file mode 100644 index 0000000..5e58d29 --- /dev/null +++ b/man/dedalus-machines-ports-update.1 @@ -0,0 +1,115 @@ +.\" File generated from our OpenAPI spec by Scalar. Do not edit. +.TH "DEDALUS\-MACHINES\-PORTS\-UPDATE" "1" "" "dedalus" "Dedalus Manual" +.SH "NAME" +dedalus\-machines\-ports\-update \- Update port +.SH "SYNOPSIS" +.B dedalus machines ports update +\fB\-\-machine\-id\fR \fI\fR \fB\-\-port\-id\fR \fI\fR \fB\-\-visibility\fR \fI\fR [\fIoptions\fR] +.SH "DESCRIPTION" +Update port +.SH "OPTIONS" +.TP +\fB\-\-machine\-id\fR \fI\fR +Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. Required. +.TP +\fB\-\-port\-id\fR \fI\fR +The port\-id path parameter. Required. +.TP +\fB\-\-visibility\fR \fI\fR +Who may reach the port. private requires a Dedalus API key from the owning organization in the X\-Dedalus\-API\-Key header. key_required requires a port access key in the X\-Dedalus\-Port\-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges. Required. +.TP +\fB\-\-base\-url\fR \fI\fR +Override the base URL for API requests. +.TP +\fB\-\-timeout\fR \fI\fR +Request timeout in milliseconds. +.TP +\fB\-\-max\-retries\fR \fI\fR +Number of retries for retryable failures. +.TP +\fB\-\-format\fR \fI\fR +Output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-format\-error\fR \fI\fR +Error output format: auto, json, jsonl, pretty, raw, toon, yaml. +.TP +\fB\-\-transform\fR \fI\fR +Dot\-path transform for data output. +.TP +\fB\-\-transform\-error\fR \fI\fR +Dot\-path transform for error output. +.TP +\fB\-r\fR, \fB\-\-raw\-output\fR +Print transformed string values without JSON quotes. +.TP +\fB\-\-debug\fR +Enable SDK debug logging on standard error. +.TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP +\fB\-\-api\-key\fR \fI\fR +Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. +.TP +\fB\-\-x\-api\-key\fR \fI\fR +Dedalus API key. Alternative to Bearer token. Can also be set with the DEDALUS_X_API_KEY environment variable. +.TP +\fB\-\-browser\-token\fR \fI\fR +API credential. Can also be set with the DEDALUS_BROWSER_TOKEN environment variable. +.TP +\fB\-\-dedalus\-org\-id\fR \fI\fR +Optional organization assertion. Must match the organization identified by the API credential. Can also be set with the DEDALUS_ORG_ID environment variable. +.SH "EXAMPLES" +.PP +.RS 4 +.nf +dedalus machines ports update \e + \-\-browser\-token "$DEDALUS_BROWSER_TOKEN" \e + \-\-machine\-id '017f22e2\-79b0\-7cc3\-98c4\-dc0c0c07398f' \e + \-\-port\-id 'port_id' \e + \-\-visibility 'public' +.fi +.RE +.SH "ENVIRONMENT" +.TP +\fBDEDALUS_API_KEY\fR +Fallback for \-\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_X_API_KEY\fR +Fallback for \-\-x\-api\-key when the flag is not passed. +.TP +\fBDEDALUS_BROWSER_TOKEN\fR +Fallback for \-\-browser\-token when the flag is not passed. +.TP +\fBDEDALUS_ORG_ID\fR +Fallback for \-\-dedalus\-org\-id when the flag is not passed. +.SH "EXIT STATUS" +.TP +\fB0\fR +The command completed successfully. +.TP +\fB1\fR +The request failed for an unclassified reason. Reported as error. +.TP +\fB2\fR +The command was invoked incorrectly (missing or invalid arguments). +.TP +\fB10\fR +Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed. +.TP +\fB11\fR +The requested resource does not exist (HTTP 404). Reported as not\-found. +.TP +\fB12\fR +The request was rate limited (HTTP 429). Reported as rate\-limited. +.TP +\fB13\fR +The request was rejected (any other HTTP 4xx). Reported as client\-error. +.TP +\fB14\fR +The API failed to handle the request (HTTP 5xx). Reported as server\-error. +.TP +\fB15\fR +The API could not be reached, or the request timed out. Reported as connection\-error. +.SH "SEE ALSO" +.BR dedalus (1) diff --git a/man/dedalus-machines-reboot.1 b/man/dedalus-machines-reboot.1 index 1cbdb9a..4eeb1ff 100644 --- a/man/dedalus-machines-reboot.1 +++ b/man/dedalus-machines-reboot.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-resize.1 b/man/dedalus-machines-resize.1 index f3080da..7fe1dc0 100644 --- a/man/dedalus-machines-resize.1 +++ b/man/dedalus-machines-resize.1 @@ -45,6 +45,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-retrieve.1 b/man/dedalus-machines-retrieve.1 index c3300c5..14685a5 100644 --- a/man/dedalus-machines-retrieve.1 +++ b/man/dedalus-machines-retrieve.1 @@ -39,6 +39,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-sleep.1 b/man/dedalus-machines-sleep.1 index 745d490..0a92931 100644 --- a/man/dedalus-machines-sleep.1 +++ b/man/dedalus-machines-sleep.1 @@ -39,6 +39,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-ssh-create.1 b/man/dedalus-machines-ssh-create.1 index 599daec..f10c6e3 100644 --- a/man/dedalus-machines-ssh-create.1 +++ b/man/dedalus-machines-ssh-create.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-ssh-delete.1 b/man/dedalus-machines-ssh-delete.1 index 3a03507..a05cf71 100644 --- a/man/dedalus-machines-ssh-delete.1 +++ b/man/dedalus-machines-ssh-delete.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-ssh-list.1 b/man/dedalus-machines-ssh-list.1 index cbf7481..37fcad1 100644 --- a/man/dedalus-machines-ssh-list.1 +++ b/man/dedalus-machines-ssh-list.1 @@ -48,6 +48,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-ssh-retrieve.1 b/man/dedalus-machines-ssh-retrieve.1 index 6afac56..6450f26 100644 --- a/man/dedalus-machines-ssh-retrieve.1 +++ b/man/dedalus-machines-ssh-retrieve.1 @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-update.1 b/man/dedalus-machines-update.1 index 81c8dcf..1c27b6e 100644 --- a/man/dedalus-machines-update.1 +++ b/man/dedalus-machines-update.1 @@ -45,6 +45,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-machines-wake.1 b/man/dedalus-machines-wake.1 index 031cc5f..61cc87e 100644 --- a/man/dedalus-machines-wake.1 +++ b/man/dedalus-machines-wake.1 @@ -39,6 +39,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-organization-autoresizing-retrieve.1 b/man/dedalus-organization-autoresizing-retrieve.1 index 1d61491..08d1a54 100644 --- a/man/dedalus-organization-autoresizing-retrieve.1 +++ b/man/dedalus-organization-autoresizing-retrieve.1 @@ -36,6 +36,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-organization-autoresizing-update.1 b/man/dedalus-organization-autoresizing-update.1 index f5156af..1585e9a 100644 --- a/man/dedalus-organization-autoresizing-update.1 +++ b/man/dedalus-organization-autoresizing-update.1 @@ -48,6 +48,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP diff --git a/man/dedalus-upgrade.1 b/man/dedalus-upgrade.1 index 4717c61..4851d2b 100644 --- a/man/dedalus-upgrade.1 +++ b/man/dedalus-upgrade.1 @@ -10,7 +10,9 @@ Replaces this dedalus executable with the latest published release, after verify .PP When dedalus was installed through a package manager (Homebrew or npm) nothing is replaced. That manager owns the installed files, and overwriting them leaves its database describing a file that is no longer there, so the command runs the manager's own upgrade command instead, with its output on this terminal. .PP -dedalus also checks for a newer release at most once a day and mentions one on standard error. That check is skipped when either standard output or standard error is not a terminal, when CI is set, when running under sudo, and when NO_UPDATE_NOTIFIER or DEDALUS_NO_UPDATE_NOTIFIER is set in the environment. +dedalus also checks the npm registry for an npm install, and GitHub Releases for a standalone executable for a newer release at most once a day and mentions one on standard error. That check is skipped when either standard output or standard error is not a terminal, when CI is set, when running under sudo, and when NO_UPDATE_NOTIFIER or DEDALUS_NO_UPDATE_NOTIFIER is set in the environment. +.PP +An npm install is compared against the registry named by npm_config_registry (or NPM_CONFIG_REGISTRY), or https://registry.npmjs.org when neither is set (.npmrc is not read, so set one of these for a mirror), under the dist\-tag it was published on, and under the stable tag too for a prerelease. A run through npx, bunx or pnpm dlx has nothing installed to upgrade, and says so. .SH "OPTIONS" .TP \fB\-\-check\fR diff --git a/man/dedalus.1 b/man/dedalus.1 index 37d0e74..37f4bd3 100644 --- a/man/dedalus.1 +++ b/man/dedalus.1 @@ -38,6 +38,9 @@ Print transformed string values without JSON quotes. \fB\-\-debug\fR Enable SDK debug logging on standard error. .TP +\fB\-\-no\-input\fR +Never prompt; a command that would ask fails instead. +.TP \fB\-\-api\-key\fR \fI\fR Dedalus API key or short\-lived delegated access token in `Authorization: Bearer `. Can also be set with the DEDALUS_API_KEY environment variable. .TP @@ -120,6 +123,33 @@ Read this machine's autoresizing settings. See dedalus\-machines\-autoresizing\- \fBdedalus machines autoresizing update\fR Set this machine's autoresizing settings. See dedalus\-machines\-autoresizing\-update(1). .TP +\fBdedalus machines ports list\fR +List ports. See dedalus\-machines\-ports\-list(1). +.TP +\fBdedalus machines ports create\fR +Create port. See dedalus\-machines\-ports\-create(1). +.TP +\fBdedalus machines ports retrieve\fR +Get port. See dedalus\-machines\-ports\-retrieve(1). +.TP +\fBdedalus machines ports update\fR +Update port. See dedalus\-machines\-ports\-update(1). +.TP +\fBdedalus machines ports delete\fR +Delete port. See dedalus\-machines\-ports\-delete(1). +.TP +\fBdedalus machines ports access\-keys list\fR +List port access keys. See dedalus\-machines\-ports\-access\-keys\-list(1). +.TP +\fBdedalus machines ports access\-keys mint\fR +Mint port access key. See dedalus\-machines\-ports\-access\-keys\-mint(1). +.TP +\fBdedalus machines ports access\-keys revoke\fR +Revoke port access key. See dedalus\-machines\-ports\-access\-keys\-revoke(1). +.TP +\fBdedalus machines ports access\-keys rotate\fR +Rotate port access key. See dedalus\-machines\-ports\-access\-keys\-rotate(1). +.TP \fBdedalus organization autoresizing retrieve\fR Read organization autoresizing policy. See dedalus\-organization\-autoresizing\-retrieve(1). .TP @@ -127,7 +157,7 @@ Read organization autoresizing policy. See dedalus\-organization\-autoresizing\- Set organization autoresizing policy. See dedalus\-organization\-autoresizing\-update(1). .TP \fBdedalus images list\fR -List image IDs owned by the authenticated organization. See dedalus\-images\-list(1). +List images owned by the authenticated organization. See dedalus\-images\-list(1). .TP \fBdedalus images create\fR Register an immutable OCI image for preparation. See dedalus\-images\-create(1). diff --git a/package.json b/package.json index 058bed9..619075f 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,15 @@ "./man/dedalus-machines-executions-logs-create-token.1", "./man/dedalus-machines-autoresizing-retrieve.1", "./man/dedalus-machines-autoresizing-update.1", + "./man/dedalus-machines-ports-list.1", + "./man/dedalus-machines-ports-create.1", + "./man/dedalus-machines-ports-retrieve.1", + "./man/dedalus-machines-ports-update.1", + "./man/dedalus-machines-ports-delete.1", + "./man/dedalus-machines-ports-access-keys-list.1", + "./man/dedalus-machines-ports-access-keys-mint.1", + "./man/dedalus-machines-ports-access-keys-revoke.1", + "./man/dedalus-machines-ports-access-keys-rotate.1", "./man/dedalus-organization-autoresizing-retrieve.1", "./man/dedalus-organization-autoresizing-update.1", "./man/dedalus-images-list.1", diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index affc8a1..a1f8059 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -1,7 +1,7 @@ { "name": "Dedalus", "slug": "dedalus", - "generatorVersion": "0.38.0", + "generatorVersion": "0.45.0", "servers": [ "https://dcs.dedaluslabs.ai" ], @@ -198,8 +198,19 @@ "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "autoresizing_switch" + "kind": "enum", + "values": [ + "on", + "off" + ], + "names": [ + "On", + "Off" + ], + "deprecations": [ + false, + false + ] } }, { @@ -283,8 +294,19 @@ "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "autoresizing_switch" + "kind": "enum", + "values": [ + "on", + "off" + ], + "names": [ + "On", + "Off" + ], + "deprecations": [ + false, + false + ] } }, { @@ -348,8 +370,19 @@ "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "autoresizing_switch" + "kind": "enum", + "values": [ + "on", + "off" + ], + "names": [ + "On", + "Off" + ], + "deprecations": [ + false, + false + ] } }, { @@ -381,8 +414,19 @@ "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "autoresizing_switch" + "kind": "enum", + "values": [ + "on", + "off" + ], + "names": [ + "On", + "Off" + ], + "deprecations": [ + false, + false + ] } }, { @@ -571,21 +615,79 @@ } }, { - "name": "ssh_session_create_params", - "source": "ssh_session_create_params", + "name": "port_create_params", + "source": "port_create_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "public_key", - "publicName": "public_key", + "name": "expires", + "publicName": "expires", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int32", + "validation": { + "minimum": 1, + "maximum": 2147483647 + } + } + }, + { + "name": "port", + "publicName": "port", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" + } + }, + { + "name": "protocol", + "publicName": "protocol", + "required": false, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "http" + ], + "names": [ + "HTTP" + ], + "deprecations": [ + false + ] + } + }, + { + "name": "visibility", + "publicName": "visibility", + "required": false, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "public", + "key_required", + "private" + ], + "names": [ + "Public", + "KeyRequired", + "Private" + ], + "deprecations": [ + false, + false, + false + ] } } ], @@ -593,41 +695,22 @@ } }, { - "name": "error_detail", - "source": "error_detail", + "name": "ssh_session_create_params", + "source": "ssh_session_create_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "location", - "publicName": "location", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "message", - "publicName": "message", - "required": false, + "name": "public_key", + "publicName": "public_key", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - }, - { - "name": "value", - "publicName": "value", - "required": false, - "deprecated": false, - "type": { - "kind": "unknown" - } } ], "additionalProperties": false @@ -703,122 +786,6 @@ "additionalProperties": false } }, - { - "name": "error_model", - "source": "error_model", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "detail", - "publicName": "detail", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Property foo is required but is missing." - }, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "errors", - "publicName": "errors", - "required": false, - "deprecated": false, - "type": { - "kind": "union", - "variants": [ - { - "kind": "array", - "items": { - "kind": "ref", - "name": "error_detail" - } - }, - { - "kind": "null" - } - ] - } - }, - { - "name": "instance", - "publicName": "instance", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "https://example.com/error-log/abc123" - }, - "type": { - "kind": "primitive", - "type": "string", - "format": "uri" - } - }, - { - "name": "status", - "publicName": "status", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 400 - }, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" - } - }, - { - "name": "title", - "publicName": "title", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Bad Request" - }, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "type", - "publicName": "type", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "https://example.com/errors/example" - }, - "type": { - "kind": "primitive", - "type": "string", - "format": "uri" - } - } - ], - "additionalProperties": false - } - }, { "name": "execution_event", "source": "execution_event", @@ -1612,8 +1579,8 @@ "kind": "object", "properties": [ { - "name": "image_ids", - "publicName": "image_ids", + "name": "items", + "publicName": "items", "required": true, "deprecated": false, "type": { @@ -1622,8 +1589,8 @@ { "kind": "array", "items": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "image" } }, { @@ -2382,42 +2349,26 @@ } }, { - "name": "preparation_context", - "source": "preparation_context", + "name": "mint_port_access_key_request", + "source": "mint_port_access_key_request", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "percent", - "publicName": "percent", + "name": "expires_in", + "publicName": "expires_in", "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "integer", - "format": "int64" - } - }, - { - "name": "progress", - "publicName": "progress", - "required": false, - "deprecated": false, - "type": { - "kind": "ref", - "name": "execution_progress" - } - }, - { - "name": "stage", - "publicName": "stage", - "required": true, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" + "format": "int32", + "validation": { + "minimum": 1, + "maximum": 2147483647 + } } } ], @@ -2425,50 +2376,28 @@ } }, { - "name": "public_image_rename_input_body", - "source": "public_image_rename_input_body", + "name": "mint_port_access_key_response", + "source": "mint_port_access_key_response", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "name", - "publicName": "name", + "name": "access_key", + "publicName": "access_key", "required": true, "deprecated": false, + "access": "readOnly", "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string", - "validation": { - "maxLength": 128 - } - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "public_image_submit_input_body", - "source": "public_image_submit_input_body", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "credential_ref", - "publicName": "credential_ref", - "required": false, + "name": "access_key_id", + "publicName": "access_key_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -2476,47 +2405,57 @@ } }, { - "name": "name", - "publicName": "name", - "required": false, + "name": "created_at", + "publicName": "created_at", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string", - "validation": { - "maxLength": 128 - } + "format": "date-time" } }, { - "name": "platform", - "publicName": "platform", + "name": "expires_at", + "publicName": "expires_at", "required": true, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "linux/amd64", - "linux/arm64" - ], - "names": [ - "LinuxAmd64", - "LinuxArm64" - ], - "deprecations": [ - false, - false - ] + "kind": "primitive", + "type": "string", + "format": "date-time" } }, { - "name": "source", - "publicName": "source", + "name": "last_used_at", + "publicName": "last_used_at", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" + } + }, + { + "name": "port_id", + "publicName": "port_id", "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "source" + "kind": "primitive", + "type": "string" + } + }, + { + "name": "revoked_at", + "publicName": "revoked_at", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "date-time" } } ], @@ -2524,31 +2463,59 @@ } }, { - "name": "public_path_segment", - "source": "public_path_segment", + "name": "port_access_key_list_response", + "source": "port_access_key_list_response", "publicAliases": [], "deprecated": false, "type": { - "kind": "primitive", - "type": "string", - "validation": { - "pattern": "^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$", - "minLength": 1, - "maxLength": 253 - } + "kind": "object", + "properties": [ + { + "name": "items", + "publicName": "items", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "ref", + "name": "port_access_key_response" + } + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "next_cursor", + "publicName": "next_cursor", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false } }, { - "name": "read_token", - "source": "read_token", + "name": "port_access_key_response", + "source": "port_access_key_response", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "access_token", - "publicName": "access_token", + "name": "access_key_id", + "publicName": "access_key_id", "required": true, "deprecated": false, "type": { @@ -2557,29 +2524,31 @@ } }, { - "name": "base_url", - "publicName": "base_url", + "name": "created_at", + "publicName": "created_at", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "execution_id", - "publicName": "execution_id", + "name": "expires_at", + "publicName": "expires_at", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "expires_at", - "publicName": "expires_at", - "required": true, + "name": "last_used_at", + "publicName": "last_used_at", + "required": false, "deprecated": false, "type": { "kind": "primitive", @@ -2588,8 +2557,8 @@ } }, { - "name": "stream_id", - "publicName": "stream_id", + "name": "port_id", + "publicName": "port_id", "required": true, "deprecated": false, "type": { @@ -2598,13 +2567,14 @@ } }, { - "name": "token_type", - "publicName": "token_type", - "required": true, + "name": "revoked_at", + "publicName": "revoked_at", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } } ], @@ -2612,76 +2582,91 @@ } }, { - "name": "image", - "source": "image", + "name": "port_list", + "source": "port_list", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "context", - "publicName": "context", - "required": false, + "name": "items", + "publicName": "items", + "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "preparation_context" + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "ref", + "name": "port" + } + }, + { + "kind": "null" + } + ] } }, { - "name": "created_at", - "publicName": "created_at", - "required": true, + "name": "next_cursor", + "publicName": "next_cursor", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string", - "format": "date-time" + "type": "string" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "port", + "source": "port", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "error", - "publicName": "error", - "required": false, + "name": "application_url", + "publicName": "application_url", + "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "error" + "kind": "primitive", + "type": "string" } }, { - "name": "image_id", - "publicName": "image_id", + "name": "created_at", + "publicName": "created_at", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "name", - "publicName": "name", - "required": true, + "name": "error_code", + "publicName": "error_code", + "required": false, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string" } }, { - "name": "platform", - "publicName": "platform", - "required": true, + "name": "error_message", + "publicName": "error_message", + "required": false, "deprecated": false, "type": { "kind": "primitive", @@ -2689,148 +2674,136 @@ } }, { - "name": "reason", - "publicName": "reason", + "name": "expires_at", + "publicName": "expires_at", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "source", - "publicName": "source", - "required": true, + "name": "initial_access_key", + "publicName": "initial_access_key", + "required": false, "deprecated": false, + "access": "readOnly", "type": { "kind": "ref", - "name": "source" + "name": "mint_port_access_key_response" } }, { - "name": "state", - "publicName": "state", + "name": "machine_id", + "publicName": "machine_id", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "uuid" } - } - ], - "additionalProperties": false - } - }, - { - "name": "reservation", - "source": "reservation", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "source", - "publicName": "source", + "name": "port", + "publicName": "port", "required": true, "deprecated": false, "type": { - "kind": "ref", - "name": "source" + "kind": "primitive", + "type": "integer", + "format": "int64" } }, { - "name": "upload", - "publicName": "upload", + "name": "port_id", + "publicName": "port_id", "required": true, "deprecated": false, - "type": { - "kind": "ref", - "name": "execution_upload" - } - } - ], - "additionalProperties": false - } - }, - { - "name": "resize_machine_request", - "source": "resize_machine_request", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "memory_mib", - "publicName": "memory_mib", - "required": false, - "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "vcpu", - "publicName": "vcpu", + "name": "protocol", + "publicName": "protocol", "required": false, "deprecated": false, "type": { - "kind": "primitive", - "type": "number", - "format": "double" + "kind": "enum", + "values": [ + "http" + ], + "names": [ + "HTTP" + ], + "deprecations": [ + false + ] } - } - ], - "additionalProperties": false - } - }, - { - "name": "ssh_connection", - "source": "ssh_connection", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "endpoint", - "publicName": "endpoint", - "required": true, + "name": "ready_at", + "publicName": "ready_at", + "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "host_trust", - "publicName": "host_trust", + "name": "retry_after_ms", + "publicName": "retry_after_ms", "required": false, "deprecated": false, "type": { - "kind": "ref", - "name": "ssh_host_trust" + "kind": "primitive", + "type": "integer", + "format": "int64" } }, { - "name": "port", - "publicName": "port", + "name": "status", + "publicName": "status", "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" + "kind": "enum", + "values": [ + "wake_in_progress", + "ready", + "unavailable", + "closed", + "expired", + "failed" + ], + "names": [ + "WakeInProgress", + "Ready", + "Unavailable", + "Closed", + "Expired", + "Failed" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false + ] } }, { - "name": "ssh_username", - "publicName": "ssh_username", - "required": true, + "name": "url", + "publicName": "url", + "required": false, "deprecated": false, "type": { "kind": "primitive", @@ -2838,13 +2811,27 @@ } }, { - "name": "user_certificate", - "publicName": "user_certificate", - "required": false, + "name": "visibility", + "publicName": "visibility", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "enum", + "values": [ + "public", + "key_required", + "private" + ], + "names": [ + "Public", + "KeyRequired", + "Private" + ], + "deprecations": [ + false, + false, + false + ] } } ], @@ -2852,44 +2839,37 @@ } }, { - "name": "ssh_host_trust", - "source": "ssh_host_trust", + "name": "preparation_context", + "source": "preparation_context", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "host_pattern", - "publicName": "host_pattern", + "name": "percent", + "publicName": "percent", "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" } }, { - "name": "kind", - "publicName": "kind", - "required": true, + "name": "progress", + "publicName": "progress", + "required": false, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "cert_authority" - ], - "names": [ - "CertAuthority" - ], - "deprecations": [ - false - ] + "kind": "ref", + "name": "execution_progress" } }, { - "name": "public_key", - "publicName": "public_key", + "name": "stage", + "publicName": "stage", "required": true, "deprecated": false, "type": { @@ -2902,26 +2882,26 @@ } }, { - "name": "ssh_session_list", - "source": "ssh_session_list", + "name": "public_image_rename_input_body", + "source": "public_image_rename_input_body", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "items", - "publicName": "items", + "name": "name", + "publicName": "name", "required": true, "deprecated": false, "type": { "kind": "union", "variants": [ { - "kind": "array", - "items": { - "kind": "ref", - "name": "ssh_session" + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 128 } }, { @@ -2929,63 +2909,22 @@ } ] } - }, - { - "name": "next_cursor", - "publicName": "next_cursor", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" - } } ], "additionalProperties": false } }, { - "name": "ssh_session", - "source": "ssh_session", + "name": "public_image_submit_input_body", + "source": "public_image_submit_input_body", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "connection", - "publicName": "connection", - "required": false, - "deprecated": false, - "type": { - "kind": "ref", - "name": "ssh_connection" - } - }, - { - "name": "created_at", - "publicName": "created_at", - "required": true, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string", - "format": "date-time" - } - }, - { - "name": "error_code", - "publicName": "error_code", - "required": false, - "deprecated": false, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "error_message", - "publicName": "error_message", + "name": "credential_ref", + "publicName": "credential_ref", "required": false, "deprecated": false, "type": { @@ -2994,52 +2933,89 @@ } }, { - "name": "expires_at", - "publicName": "expires_at", + "name": "name", + "publicName": "name", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string", - "format": "date-time" + "validation": { + "maxLength": 128 + } } }, { - "name": "machine_id", - "publicName": "machine_id", + "name": "platform", + "publicName": "platform", "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string", - "format": "uuid" + "kind": "enum", + "values": [ + "linux/amd64", + "linux/arm64" + ], + "names": [ + "LinuxAmd64", + "LinuxArm64" + ], + "deprecations": [ + false, + false + ] } }, { - "name": "ready_at", - "publicName": "ready_at", - "required": false, + "name": "source", + "publicName": "source", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string", - "format": "date-time" + "kind": "ref", + "name": "source" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "public_path_segment", + "source": "public_path_segment", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$", + "minLength": 1, + "maxLength": 253 + } + } + }, + { + "name": "read_token", + "source": "read_token", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "retry_after_ms", - "publicName": "retry_after_ms", - "required": false, + "name": "access_token", + "publicName": "access_token", + "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "session_id", - "publicName": "session_id", + "name": "base_url", + "publicName": "base_url", "required": true, "deprecated": false, "type": { @@ -3048,53 +3024,8 @@ } }, { - "name": "status", - "publicName": "status", - "required": true, - "deprecated": false, - "type": { - "kind": "enum", - "values": [ - "wake_in_progress", - "ssh_in_progress", - "ready", - "closed", - "expired", - "failed" - ], - "names": [ - "WakeInProgress", - "SshInProgress", - "Ready", - "Closed", - "Expired", - "Failed" - ], - "deprecations": [ - false, - false, - false, - false, - false, - false - ] - } - } - ], - "additionalProperties": false - } - }, - { - "name": "source", - "source": "source", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "kind", - "publicName": "kind", + "name": "execution_id", + "publicName": "execution_id", "required": true, "deprecated": false, "type": { @@ -3103,19 +3034,20 @@ } }, { - "name": "reference", - "publicName": "reference", - "required": false, + "name": "expires_at", + "publicName": "expires_at", + "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "sha256", - "publicName": "sha256", - "required": false, + "name": "stream_id", + "publicName": "stream_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3123,9 +3055,9 @@ } }, { - "name": "upload_id", - "publicName": "upload_id", - "required": false, + "name": "token_type", + "publicName": "token_type", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3137,68 +3069,58 @@ } }, { - "name": "autoresizing_switch", - "source": "autoresizing_switch", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "enum", - "values": [ - "on", - "off" - ], - "names": [ - "On", - "Off" - ], - "deprecations": [ - false, - false - ] - } - }, - { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "image", + "source": "image", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "ETag", - "publicName": "ETag", + "name": "context", + "publicName": "context", "required": false, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "preparation_context" } }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "created_at", + "publicName": "created_at", + "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "Location", - "publicName": "Location", + "name": "error", + "publicName": "error", "required": false, "deprecated": false, + "type": { + "kind": "ref", + "name": "error" + } + }, + { + "name": "image_id", + "publicName": "image_id", + "required": true, + "deprecated": false, "type": { "kind": "primitive", "type": "string" } }, { - "name": "X-Dedalus-Storage-Operation-Id", - "publicName": "X-Dedalus-Storage-Operation-Id", - "required": false, + "name": "name", + "publicName": "name", + "required": true, "deprecated": false, "type": { "kind": "union", @@ -3212,23 +3134,11 @@ } ] } - } - ], - "additionalProperties": false - } - }, - { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "ETag", - "publicName": "ETag", - "required": false, + "name": "platform", + "publicName": "platform", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3236,8 +3146,8 @@ } }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "reason", + "publicName": "reason", "required": false, "deprecated": false, "type": { @@ -3246,31 +3156,23 @@ } }, { - "name": "Location", - "publicName": "Location", - "required": false, + "name": "source", + "publicName": "source", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "source" } }, { - "name": "X-Dedalus-Storage-Operation-Id", - "publicName": "X-Dedalus-Storage-Operation-Id", - "required": false, + "name": "state", + "publicName": "state", + "required": true, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string" } } ], @@ -3278,21 +3180,31 @@ } }, { - "name": "CreateStatus401ResponseHeaders", - "source": "CreateStatus401ResponseHeaders", + "name": "reservation", + "source": "reservation", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "source", + "publicName": "source", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "source" + } + }, + { + "name": "upload", + "publicName": "upload", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "execution_upload" } } ], @@ -3300,43 +3212,33 @@ } }, { - "name": "CreateStatus403ResponseHeaders", - "source": "CreateStatus403ResponseHeaders", + "name": "resize_machine_request", + "source": "resize_machine_request", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "memory_mib", + "publicName": "memory_mib", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "integer", + "format": "int64" } - } - ], - "additionalProperties": false - } - }, - { - "name": "CreateStatus409ResponseHeaders", - "source": "CreateStatus409ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "vcpu", + "publicName": "vcpu", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "number", + "format": "double" } } ], @@ -3344,38 +3246,57 @@ } }, { - "name": "CreateStatus429ResponseHeaders", - "source": "CreateStatus429ResponseHeaders", + "name": "ssh_connection", + "source": "ssh_connection", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "endpoint", + "publicName": "endpoint", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "host_trust", + "publicName": "host_trust", "required": false, "deprecated": false, + "type": { + "kind": "ref", + "name": "ssh_host_trust" + } + }, + { + "name": "port", + "publicName": "port", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "format": "int64" + } + }, + { + "name": "ssh_username", + "publicName": "ssh_username", + "required": true, + "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "CreateStatus503ResponseHeaders", - "source": "CreateStatus503ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "user_certificate", + "publicName": "user_certificate", "required": false, "deprecated": false, "type": { @@ -3388,17 +3309,45 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "ssh_host_trust", + "source": "ssh_host_trust", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "host_pattern", + "publicName": "host_pattern", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "kind", + "publicName": "kind", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "cert_authority" + ], + "names": [ + "CertAuthority" + ], + "deprecations": [ + false + ] + } + }, + { + "name": "public_key", + "publicName": "public_key", + "required": true, "deprecated": false, "type": { "kind": "primitive", @@ -3410,16 +3359,37 @@ } }, { - "name": "RetrieveResponseHeaders", - "source": "RetrieveResponseHeaders", + "name": "ssh_session_list", + "source": "ssh_session_list", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "ETag", - "publicName": "ETag", + "name": "items", + "publicName": "items", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "array", + "items": { + "kind": "ref", + "name": "ssh_session" + } + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "next_cursor", + "publicName": "next_cursor", "required": false, "deprecated": false, "type": { @@ -3432,36 +3402,37 @@ } }, { - "name": "UpdateResponseHeaders", - "source": "UpdateResponseHeaders", + "name": "ssh_session", + "source": "ssh_session", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "ETag", - "publicName": "ETag", + "name": "connection", + "publicName": "connection", "required": false, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "ref", + "name": "ssh_connection" } }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "created_at", + "publicName": "created_at", + "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "Location", - "publicName": "Location", + "name": "error_code", + "publicName": "error_code", "required": false, "deprecated": false, "type": { @@ -3470,186 +3441,147 @@ } }, { - "name": "X-Dedalus-Storage-Operation-Id", - "publicName": "X-Dedalus-Storage-Operation-Id", + "name": "error_message", + "publicName": "error_message", "required": false, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "UpdateResponseHeaders", - "source": "UpdateResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "ETag", - "publicName": "ETag", + "name": "expires_at", + "publicName": "expires_at", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "machine_id", + "publicName": "machine_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "uuid" } }, { - "name": "Location", - "publicName": "Location", + "name": "ready_at", + "publicName": "ready_at", "required": false, "deprecated": false, "type": { "kind": "primitive", - "type": "string" + "type": "string", + "format": "date-time" } }, { - "name": "X-Dedalus-Storage-Operation-Id", - "publicName": "X-Dedalus-Storage-Operation-Id", + "name": "retry_after_ms", + "publicName": "retry_after_ms", "required": false, "deprecated": false, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "integer", + "format": "int64" } - } - ], - "additionalProperties": false - } - }, - { - "name": "UpdateStatus401ResponseHeaders", - "source": "UpdateStatus401ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "session_id", + "publicName": "session_id", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } + }, + { + "name": "status", + "publicName": "status", + "required": true, + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "wake_in_progress", + "ssh_in_progress", + "ready", + "closed", + "expired", + "failed" + ], + "names": [ + "WakeInProgress", + "SshInProgress", + "Ready", + "Closed", + "Expired", + "Failed" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false + ] + } } ], "additionalProperties": false } }, { - "name": "UpdateStatus403ResponseHeaders", - "source": "UpdateStatus403ResponseHeaders", + "name": "source", + "source": "source", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "kind", + "publicName": "kind", + "required": true, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "UpdateStatus409ResponseHeaders", - "source": "UpdateStatus409ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "reference", + "publicName": "reference", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "UpdateStatus429ResponseHeaders", - "source": "UpdateStatus429ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "sha256", + "publicName": "sha256", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "UpdateStatus503ResponseHeaders", - "source": "UpdateStatus503ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "upload_id", + "publicName": "upload_id", "required": false, "deprecated": false, "type": { @@ -3662,21 +3594,35 @@ } }, { - "name": "UpdateStatusdefaultResponseHeaders", - "source": "UpdateStatusdefaultResponseHeaders", + "name": "port_update_params", + "source": "port_update_params", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", - "required": false, + "name": "visibility", + "publicName": "visibility", + "required": true, "deprecated": false, "type": { - "kind": "primitive", - "type": "string" + "kind": "enum", + "values": [ + "public", + "key_required", + "private" + ], + "names": [ + "Public", + "KeyRequired", + "Private" + ], + "deprecations": [ + false, + false, + false + ] } } ], @@ -3684,8 +3630,8 @@ } }, { - "name": "DeleteResponseHeaders", - "source": "DeleteResponseHeaders", + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3744,8 +3690,8 @@ } }, { - "name": "DeleteResponseHeaders", - "source": "DeleteResponseHeaders", + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3804,8 +3750,8 @@ } }, { - "name": "DeleteStatus401ResponseHeaders", - "source": "DeleteStatus401ResponseHeaders", + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3826,8 +3772,8 @@ } }, { - "name": "DeleteStatus403ResponseHeaders", - "source": "DeleteStatus403ResponseHeaders", + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3848,8 +3794,8 @@ } }, { - "name": "DeleteStatus409ResponseHeaders", - "source": "DeleteStatus409ResponseHeaders", + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3870,8 +3816,8 @@ } }, { - "name": "DeleteStatus429ResponseHeaders", - "source": "DeleteStatus429ResponseHeaders", + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3892,8 +3838,8 @@ } }, { - "name": "DeleteStatus503ResponseHeaders", - "source": "DeleteStatus503ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3914,8 +3860,8 @@ } }, { - "name": "DeleteStatusdefaultResponseHeaders", - "source": "DeleteStatusdefaultResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3936,8 +3882,30 @@ } }, { - "name": "SleepResponseHeaders", - "source": "SleepResponseHeaders", + "name": "RetrieveResponseHeaders", + "source": "RetrieveResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "ETag", + "publicName": "ETag", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "UpdateResponseHeaders", + "source": "UpdateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -3996,8 +3964,8 @@ } }, { - "name": "SleepResponseHeaders", - "source": "SleepResponseHeaders", + "name": "UpdateResponseHeaders", + "source": "UpdateResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4056,8 +4024,8 @@ } }, { - "name": "SleepStatus401ResponseHeaders", - "source": "SleepStatus401ResponseHeaders", + "name": "UpdateStatus401ResponseHeaders", + "source": "UpdateStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4078,8 +4046,8 @@ } }, { - "name": "SleepStatus403ResponseHeaders", - "source": "SleepStatus403ResponseHeaders", + "name": "UpdateStatus403ResponseHeaders", + "source": "UpdateStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4100,8 +4068,8 @@ } }, { - "name": "SleepStatus409ResponseHeaders", - "source": "SleepStatus409ResponseHeaders", + "name": "UpdateStatus409ResponseHeaders", + "source": "UpdateStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4122,8 +4090,8 @@ } }, { - "name": "SleepStatus429ResponseHeaders", - "source": "SleepStatus429ResponseHeaders", + "name": "UpdateStatus429ResponseHeaders", + "source": "UpdateStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4144,8 +4112,8 @@ } }, { - "name": "SleepStatus503ResponseHeaders", - "source": "SleepStatus503ResponseHeaders", + "name": "UpdateStatus503ResponseHeaders", + "source": "UpdateStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4166,8 +4134,8 @@ } }, { - "name": "SleepStatusdefaultResponseHeaders", - "source": "SleepStatusdefaultResponseHeaders", + "name": "UpdateStatusdefaultResponseHeaders", + "source": "UpdateStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4188,8 +4156,8 @@ } }, { - "name": "WakeResponseHeaders", - "source": "WakeResponseHeaders", + "name": "DeleteResponseHeaders", + "source": "DeleteResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4248,8 +4216,8 @@ } }, { - "name": "WakeResponseHeaders", - "source": "WakeResponseHeaders", + "name": "DeleteResponseHeaders", + "source": "DeleteResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4308,8 +4276,8 @@ } }, { - "name": "WakeStatus401ResponseHeaders", - "source": "WakeStatus401ResponseHeaders", + "name": "DeleteStatus401ResponseHeaders", + "source": "DeleteStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4330,8 +4298,8 @@ } }, { - "name": "WakeStatus403ResponseHeaders", - "source": "WakeStatus403ResponseHeaders", + "name": "DeleteStatus403ResponseHeaders", + "source": "DeleteStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4352,8 +4320,8 @@ } }, { - "name": "WakeStatus409ResponseHeaders", - "source": "WakeStatus409ResponseHeaders", + "name": "DeleteStatus409ResponseHeaders", + "source": "DeleteStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4374,8 +4342,8 @@ } }, { - "name": "WakeStatus429ResponseHeaders", - "source": "WakeStatus429ResponseHeaders", + "name": "DeleteStatus429ResponseHeaders", + "source": "DeleteStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4396,8 +4364,8 @@ } }, { - "name": "WakeStatus503ResponseHeaders", - "source": "WakeStatus503ResponseHeaders", + "name": "DeleteStatus503ResponseHeaders", + "source": "DeleteStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4418,8 +4386,8 @@ } }, { - "name": "WakeStatusdefaultResponseHeaders", - "source": "WakeStatusdefaultResponseHeaders", + "name": "DeleteStatusdefaultResponseHeaders", + "source": "DeleteStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4440,8 +4408,8 @@ } }, { - "name": "RebootResponseHeaders", - "source": "RebootResponseHeaders", + "name": "SleepResponseHeaders", + "source": "SleepResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4500,8 +4468,8 @@ } }, { - "name": "RebootResponseHeaders", - "source": "RebootResponseHeaders", + "name": "SleepResponseHeaders", + "source": "SleepResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4560,8 +4528,8 @@ } }, { - "name": "RebootStatus401ResponseHeaders", - "source": "RebootStatus401ResponseHeaders", + "name": "SleepStatus401ResponseHeaders", + "source": "SleepStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4582,8 +4550,8 @@ } }, { - "name": "RebootStatus403ResponseHeaders", - "source": "RebootStatus403ResponseHeaders", + "name": "SleepStatus403ResponseHeaders", + "source": "SleepStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4604,8 +4572,8 @@ } }, { - "name": "RebootStatus409ResponseHeaders", - "source": "RebootStatus409ResponseHeaders", + "name": "SleepStatus409ResponseHeaders", + "source": "SleepStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4626,9 +4594,9 @@ } }, { - "name": "RebootStatus429ResponseHeaders", - "source": "RebootStatus429ResponseHeaders", - "publicAliases": [], + "name": "SleepStatus429ResponseHeaders", + "source": "SleepStatus429ResponseHeaders", + "publicAliases": [], "deprecated": false, "type": { "kind": "object", @@ -4648,8 +4616,8 @@ } }, { - "name": "RebootStatus503ResponseHeaders", - "source": "RebootStatus503ResponseHeaders", + "name": "SleepStatus503ResponseHeaders", + "source": "SleepStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4670,8 +4638,8 @@ } }, { - "name": "RebootStatusdefaultResponseHeaders", - "source": "RebootStatusdefaultResponseHeaders", + "name": "SleepStatusdefaultResponseHeaders", + "source": "SleepStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4692,8 +4660,8 @@ } }, { - "name": "ResizeResponseHeaders", - "source": "ResizeResponseHeaders", + "name": "WakeResponseHeaders", + "source": "WakeResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4752,35 +4720,23 @@ } }, { - "name": "ResizeStatus400ResponseHeaders", - "source": "ResizeStatus400ResponseHeaders", + "name": "WakeResponseHeaders", + "source": "WakeResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "ETag", + "publicName": "ETag", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "ResizeStatus401ResponseHeaders", - "source": "ResizeStatus401ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { "name": "Idempotency-Key", "publicName": "Idempotency-Key", @@ -4790,36 +4746,42 @@ "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "ResizeStatus402ResponseHeaders", - "source": "ResizeStatus402ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "Location", + "publicName": "Location", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } } ], "additionalProperties": false } }, { - "name": "ResizeStatus403ResponseHeaders", - "source": "ResizeStatus403ResponseHeaders", + "name": "WakeStatus401ResponseHeaders", + "source": "WakeStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4840,8 +4802,8 @@ } }, { - "name": "ResizeStatus404ResponseHeaders", - "source": "ResizeStatus404ResponseHeaders", + "name": "WakeStatus403ResponseHeaders", + "source": "WakeStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4862,8 +4824,8 @@ } }, { - "name": "ResizeStatus409ResponseHeaders", - "source": "ResizeStatus409ResponseHeaders", + "name": "WakeStatus409ResponseHeaders", + "source": "WakeStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4884,8 +4846,8 @@ } }, { - "name": "ResizeStatus422ResponseHeaders", - "source": "ResizeStatus422ResponseHeaders", + "name": "WakeStatus429ResponseHeaders", + "source": "WakeStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4906,8 +4868,8 @@ } }, { - "name": "ResizeStatus429ResponseHeaders", - "source": "ResizeStatus429ResponseHeaders", + "name": "WakeStatus503ResponseHeaders", + "source": "WakeStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4928,8 +4890,8 @@ } }, { - "name": "ResizeStatus500ResponseHeaders", - "source": "ResizeStatus500ResponseHeaders", + "name": "WakeStatusdefaultResponseHeaders", + "source": "WakeStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -4950,35 +4912,23 @@ } }, { - "name": "ResizeStatus503ResponseHeaders", - "source": "ResizeStatus503ResponseHeaders", + "name": "RebootResponseHeaders", + "source": "RebootResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "ETag", + "publicName": "ETag", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } - } - ], - "additionalProperties": false - } - }, - { - "name": "ResizeStatus504ResponseHeaders", - "source": "ResizeStatus504ResponseHeaders", - "publicAliases": [], - "deprecated": false, - "type": { - "kind": "object", - "properties": [ + }, { "name": "Idempotency-Key", "publicName": "Idempotency-Key", @@ -4988,22 +4938,50 @@ "kind": "primitive", "type": "string" } + }, + { + "name": "Location", + "publicName": "Location", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } } ], "additionalProperties": false } }, { - "name": "ResizeStatusdefaultResponseHeaders", - "source": "ResizeStatusdefaultResponseHeaders", + "name": "RebootResponseHeaders", + "source": "RebootResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Idempotency-Key", - "publicName": "Idempotency-Key", + "name": "ETag", + "publicName": "ETag", "required": false, "deprecated": false, "type": { @@ -5012,8 +4990,8 @@ } }, { - "name": "Retry-After", - "publicName": "Retry-After", + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", "required": false, "deprecated": false, "type": { @@ -5022,22 +5000,40 @@ } }, { - "name": "x-should-retry", - "publicName": "x-should-retry", + "name": "Location", + "publicName": "Location", "required": false, "deprecated": false, "type": { "kind": "primitive", "type": "string" } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } } ], "additionalProperties": false } }, { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "RebootStatus401ResponseHeaders", + "source": "RebootStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5058,8 +5054,8 @@ } }, { - "name": "CreateStatus401ResponseHeaders", - "source": "CreateStatus401ResponseHeaders", + "name": "RebootStatus403ResponseHeaders", + "source": "RebootStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5080,8 +5076,8 @@ } }, { - "name": "CreateStatus403ResponseHeaders", - "source": "CreateStatus403ResponseHeaders", + "name": "RebootStatus409ResponseHeaders", + "source": "RebootStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5102,8 +5098,8 @@ } }, { - "name": "CreateStatus409ResponseHeaders", - "source": "CreateStatus409ResponseHeaders", + "name": "RebootStatus429ResponseHeaders", + "source": "RebootStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5124,8 +5120,8 @@ } }, { - "name": "CreateStatus429ResponseHeaders", - "source": "CreateStatus429ResponseHeaders", + "name": "RebootStatus503ResponseHeaders", + "source": "RebootStatus503ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5146,8 +5142,8 @@ } }, { - "name": "CreateStatus503ResponseHeaders", - "source": "CreateStatus503ResponseHeaders", + "name": "RebootStatusdefaultResponseHeaders", + "source": "RebootStatusdefaultResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5168,13 +5164,23 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "ResizeResponseHeaders", + "source": "ResizeResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ + { + "name": "ETag", + "publicName": "ETag", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, { "name": "Idempotency-Key", "publicName": "Idempotency-Key", @@ -5184,14 +5190,42 @@ "kind": "primitive", "type": "string" } + }, + { + "name": "Location", + "publicName": "Location", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "X-Dedalus-Storage-Operation-Id", + "publicName": "X-Dedalus-Storage-Operation-Id", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } } ], "additionalProperties": false } }, { - "name": "CreateResponseHeaders", - "source": "CreateResponseHeaders", + "name": "ResizeStatus400ResponseHeaders", + "source": "ResizeStatus400ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5212,8 +5246,8 @@ } }, { - "name": "CreateStatus401ResponseHeaders", - "source": "CreateStatus401ResponseHeaders", + "name": "ResizeStatus401ResponseHeaders", + "source": "ResizeStatus401ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5234,8 +5268,8 @@ } }, { - "name": "CreateStatus403ResponseHeaders", - "source": "CreateStatus403ResponseHeaders", + "name": "ResizeStatus402ResponseHeaders", + "source": "ResizeStatus402ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5256,8 +5290,8 @@ } }, { - "name": "CreateStatus409ResponseHeaders", - "source": "CreateStatus409ResponseHeaders", + "name": "ResizeStatus403ResponseHeaders", + "source": "ResizeStatus403ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5278,8 +5312,8 @@ } }, { - "name": "CreateStatus429ResponseHeaders", - "source": "CreateStatus429ResponseHeaders", + "name": "ResizeStatus404ResponseHeaders", + "source": "ResizeStatus404ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5300,8 +5334,8 @@ } }, { - "name": "CreateStatus503ResponseHeaders", - "source": "CreateStatus503ResponseHeaders", + "name": "ResizeStatus409ResponseHeaders", + "source": "ResizeStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5322,8 +5356,8 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "ResizeStatus422ResponseHeaders", + "source": "ResizeStatus422ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5344,16 +5378,16 @@ } }, { - "name": "RetrieveResponseHeaders", - "source": "RetrieveResponseHeaders", + "name": "ResizeStatus429ResponseHeaders", + "source": "ResizeStatus429ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Cache-Control", - "publicName": "Cache-Control", + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", "required": false, "deprecated": false, "type": { @@ -5366,16 +5400,102 @@ } }, { - "name": "CreateTokenResponseHeaders", - "source": "CreateTokenResponseHeaders", + "name": "ResizeStatus500ResponseHeaders", + "source": "ResizeStatus500ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "Cache-Control", - "publicName": "Cache-Control", + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus503ResponseHeaders", + "source": "ResizeStatus503ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatus504ResponseHeaders", + "source": "ResizeStatus504ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ResizeStatusdefaultResponseHeaders", + "source": "ResizeStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "Retry-After", + "publicName": "Retry-After", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "x-should-retry", + "publicName": "x-should-retry", "required": false, "deprecated": false, "type": { @@ -5453,6 +5573,72 @@ "additionalProperties": false } }, + { + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, { "name": "CreateStatusdefaultResponseHeaders", "source": "CreateStatusdefaultResponseHeaders", @@ -5542,8 +5728,8 @@ } }, { - "name": "CreateStatusdefaultResponseHeaders", - "source": "CreateStatusdefaultResponseHeaders", + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", "publicAliases": [], "deprecated": false, "type": { @@ -5562,76 +5748,2495 @@ ], "additionalProperties": false } - } - ], - "resources": [ - "machines", - "machines.ssh", - "machines.executions", - "machines.executions.logs", - "machines.autoresizing", - "organization", - "organization.autoresizing", - "images", - "images.uploads" - ], - "publicResources": [ - "machines", - "machines.ssh", - "machines.executions", - "machines.executions.logs", - "machines.autoresizing", - "organization", - "organization.autoresizing", - "images", - "images.uploads" - ], - "operations": [ + }, { - "resource": "machines", - "publicResource": "machines", - "operation": "list", - "publicOperation": "list", + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", + "publicAliases": [], "deprecated": false, - "method": "GET", - "path": "/v1/machines", - "pathParams": [], - "publicPathParams": [], - "queryParams": [ - "limit", - "cursor" - ], - "publicQueryParams": [ - "limit", - "cursor" - ], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false - }, - { - "name": "cursor", - "required": false, - "style": "form", - "explode": false - } + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "RetrieveResponseHeaders", + "source": "RetrieveResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Cache-Control", + "publicName": "Cache-Control", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateTokenResponseHeaders", + "source": "CreateTokenResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Cache-Control", + "publicName": "Cache-Control", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus409ResponseHeaders", + "source": "CreateStatus409ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus429ResponseHeaders", + "source": "CreateStatus429ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus503ResponseHeaders", + "source": "CreateStatus503ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateResponseHeaders", + "source": "CreateResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus401ResponseHeaders", + "source": "CreateStatus401ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatus403ResponseHeaders", + "source": "CreateStatus403ResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "CreateStatusdefaultResponseHeaders", + "source": "CreateStatusdefaultResponseHeaders", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "Idempotency-Key", + "publicName": "Idempotency-Key", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + } + ], + "resources": [ + "machines", + "machines.ssh", + "machines.executions", + "machines.executions.logs", + "machines.autoresizing", + "machines.ports", + "machines.ports.accessKeys", + "organization", + "organization.autoresizing", + "images", + "images.uploads" + ], + "publicResources": [ + "machines", + "machines.ssh", + "machines.executions", + "machines.executions.logs", + "machines.autoresizing", + "machines.ports", + "machines.ports.accessKeys", + "organization", + "organization.autoresizing", + "images", + "images.uploads" + ], + "operations": [ + { + "resource": "machines", + "publicResource": "machines", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/machines", + "pathParams": [], + "publicPathParams": [], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineListParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_list", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "machine_list_item", + "publicAliases": [] + } + }, + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/machines", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "autosleep", + "image_id", + "memory_mib", + "storage_gib", + "vcpu" + ], + "publicBodyParams": [ + "autosleep", + "image_id", + "memory_mib", + "storage_gib", + "vcpu" + ], + "bodyParamDetails": [ + { + "name": "autosleep", + "required": false + }, + { + "name": "image_id", + "required": false + }, + { + "name": "memory_mib", + "required": false + }, + { + "name": "storage_gib", + "required": false + }, + { + "name": "vcpu", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_detail_response", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "RetrieveResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "autosleep", + "storage_gib" + ], + "publicBodyParams": [ + "autosleep", + "storage_gib" + ], + "bodyParamDetails": [ + { + "name": "autosleep", + "required": false + }, + { + "name": "storage_gib", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "UpdateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "UpdateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/machines/{machine_id}", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [ + "force" + ], + "publicQueryParams": [ + "force" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [ + { + "name": "force", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineDeleteParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "DeleteResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "DeleteStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "sleep", + "publicOperation": "sleep", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/sleep", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineSleepParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "SleepResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "SleepStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "wake", + "publicOperation": "wake", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/wake", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineWakeParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "WakeResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "WakeStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "reboot", + "publicOperation": "reboot", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/reboot", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [ + "force" + ], + "publicQueryParams": [ + "force" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [ + { + "name": "force", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineRebootParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "RebootResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "RebootStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines", + "publicResource": "machines", + "operation": "resize", + "publicOperation": "resize", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/resize", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "memory_mib", + "vcpu" + ], + "publicBodyParams": [ + "memory_mib", + "vcpu" + ], + "bodyParamDetails": [ + { + "name": "memory_mib", + "required": false + }, + { + "name": "vcpu", + "required": false + } + ], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "MachineResizeParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "machine_detail_response", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "ResizeResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "402", + "403", + "404", + "409", + "422", + "429", + "500", + "503", + "504", + "default" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus400ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "402", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus402ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus404ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus422ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus500ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "504", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "ResizeStatus504ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "error", + "publicAliases": [] + }, + "headersModel": { + "name": "ResizeStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}/ssh", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SshListParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ssh_session_list", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "ssh_session", + "publicAliases": [] + } + }, + "transport": "http" + }, + { + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/ssh", + "pathParams": [ + "machine_id" + ], + "publicPathParams": [ + "machine_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "public_key" + ], + "publicBodyParams": [ + "public_key" + ], + "bodyParamDetails": [ + { + "name": "public_key", + "required": true + } + ], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SshCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ssh_session", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "409", + "429", + "503", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus409ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "429", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus429ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "503", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus503ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "pathParams": [ + "machine_id", + "session_id" + ], + "publicPathParams": [ + "machine_id", + "session_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "session_id", + "required": true, + "style": "simple", + "explode": false + } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineListParams" + "publicName": "SshRetrieveParams" }, "response": { "status": "200", @@ -5645,7 +8250,7 @@ ] }, "responseModel": { - "name": "machine_list", + "name": "ssh_session", "publicAliases": [] }, "result": { @@ -5712,106 +8317,57 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "machine_list_item", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "create", - "publicOperation": "create", + "resource": "machines.ssh", + "publicResource": "machines.ssh", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "POST", - "path": "/v1/machines", - "pathParams": [], - "publicPathParams": [], + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "pathParams": [ + "machine_id", + "session_id" + ], + "publicPathParams": [ + "machine_id", + "session_id" + ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "autosleep", - "image_id", - "memory_mib", - "storage_gib", - "vcpu" - ], - "publicBodyParams": [ - "autosleep", - "image_id", - "memory_mib", - "storage_gib", - "vcpu" - ], - "bodyParamDetails": [ - { - "name": "autosleep", - "required": false - }, - { - "name": "image_id", - "required": false - }, - { - "name": "memory_mib", - "required": false - }, + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ { - "name": "storage_gib", - "required": false + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false }, { - "name": "vcpu", - "required": false + "name": "session_id", + "required": true, + "style": "simple", + "explode": false } ], - "publicPositionalParams": [], - "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineCreateParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "SshDeleteParams" }, "response": { "status": "200", @@ -5825,11 +8381,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "CreateResponseHeaders", + "name": "ssh_session", "publicAliases": [] }, "result": { @@ -5837,7 +8389,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -5853,11 +8404,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -5868,26 +8415,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -5898,11 +8426,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -5911,13 +8435,9 @@ "contents": [ { "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus503ResponseHeaders", - "publicAliases": [] - } + "encoding": "json" + } + ] }, { "status": "default", @@ -5928,36 +8448,34 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "list", + "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}", + "path": "/v1/machines/{machine_id}/executions", "pathParams": [ "machine_id" ], "publicPathParams": [ "machine_id" ], - "queryParams": [], - "publicQueryParams": [], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" + ], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -5972,13 +8490,26 @@ "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineRetrieveParams" + "publicName": "ExecutionListParams" }, "response": { "status": "200", @@ -5992,11 +8523,7 @@ ] }, "responseModel": { - "name": "machine_detail_response", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RetrieveResponseHeaders", + "name": "execution_list", "publicAliases": [] }, "result": { @@ -6063,24 +8590,38 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "execution", + "publicAliases": [] + } + }, "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "update", - "publicOperation": "update", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "create", + "publicOperation": "create", "deprecated": false, - "method": "PATCH", - "path": "/v1/machines/{machine_id}", + "method": "POST", + "path": "/v1/machines/{machine_id}/executions", "pathParams": [ "machine_id" ], @@ -6092,20 +8633,38 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "autosleep", - "storage_gib" + "command", + "cwd", + "env", + "stdin", + "timeout_ms" ], "publicBodyParams": [ - "autosleep", - "storage_gib" + "command", + "cwd", + "env", + "stdin", + "timeout_ms" ], "bodyParamDetails": [ { - "name": "autosleep", + "name": "command", + "required": true + }, + { + "name": "cwd", "required": false }, { - "name": "storage_gib", + "name": "env", + "required": false + }, + { + "name": "stdin", + "required": false + }, + { + "name": "timeout_ms", "required": false } ], @@ -6124,7 +8683,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineUpdateParams" + "publicName": "ExecutionCreateParams" }, "requestBody": { "contentType": "application/json", @@ -6151,11 +8710,11 @@ ] }, "responseModel": { - "name": "machine", + "name": "execution", "publicAliases": [] }, "responseHeadersModel": { - "name": "UpdateResponseHeaders", + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { @@ -6181,7 +8740,7 @@ } ], "headersModel": { - "name": "UpdateStatus401ResponseHeaders", + "name": "CreateStatus401ResponseHeaders", "publicAliases": [] } }, @@ -6196,7 +8755,7 @@ } ], "headersModel": { - "name": "UpdateStatus403ResponseHeaders", + "name": "CreateStatus403ResponseHeaders", "publicAliases": [] } }, @@ -6211,7 +8770,7 @@ } ], "headersModel": { - "name": "UpdateStatus409ResponseHeaders", + "name": "CreateStatus409ResponseHeaders", "publicAliases": [] } }, @@ -6226,7 +8785,7 @@ } ], "headersModel": { - "name": "UpdateStatus429ResponseHeaders", + "name": "CreateStatus429ResponseHeaders", "publicAliases": [] } }, @@ -6241,7 +8800,7 @@ } ], "headersModel": { - "name": "UpdateStatus503ResponseHeaders", + "name": "CreateStatus503ResponseHeaders", "publicAliases": [] } }, @@ -6255,12 +8814,8 @@ "encoding": "json" } ], - "model": { - "name": "error_model", - "publicAliases": [] - }, "headersModel": { - "name": "UpdateStatusdefaultResponseHeaders", + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -6269,25 +8824,23 @@ "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" - ], - "queryParams": [ - "force" - ], - "publicQueryParams": [ - "force" + "machine_id", + "execution_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -6300,22 +8853,21 @@ "required": true, "style": "simple", "explode": false - } - ], - "queryParamDetails": [ + }, { - "name": "force", - "required": false, - "style": "form", + "name": "execution_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineDeleteParams" + "publicName": "ExecutionRetrieveParams" }, "response": { "status": "200", @@ -6329,11 +8881,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "DeleteResponseHeaders", + "name": "execution", "publicAliases": [] }, "result": { @@ -6341,7 +8889,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6357,11 +8904,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6372,26 +8915,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "DeleteStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6402,11 +8926,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6417,11 +8937,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "DeleteStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6432,33 +8948,27 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "DeleteStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "sleep", - "publicOperation": "sleep", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/sleep", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/executions/{execution_id}", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [], "publicQueryParams": [], @@ -6470,7 +8980,13 @@ "publicPositionalParams": [], "pathParamDetails": [ { - "name": "machine_id", + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "execution_id", "required": true, "style": "simple", "explode": false @@ -6482,7 +8998,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineSleepParams" + "publicName": "ExecutionDeleteParams" }, "response": { "status": "200", @@ -6496,11 +9012,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "SleepResponseHeaders", + "name": "execution", "publicAliases": [] }, "result": { @@ -6508,7 +9020,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6524,11 +9035,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6539,26 +9046,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "SleepStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6569,11 +9057,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6584,11 +9068,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "SleepStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6599,33 +9079,27 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "SleepStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "wake", - "publicOperation": "wake", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "output", + "publicOperation": "output", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/wake", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [], "publicQueryParams": [], @@ -6641,6 +9115,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -6649,7 +9129,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineWakeParams" + "publicName": "ExecutionOutputParams" }, "response": { "status": "200", @@ -6663,11 +9143,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "WakeResponseHeaders", + "name": "execution_output", "publicAliases": [] }, "result": { @@ -6675,7 +9151,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6691,11 +9166,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6706,26 +9177,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "WakeStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6736,11 +9188,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6751,11 +9199,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "WakeStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6766,39 +9210,35 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "WakeStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "reboot", - "publicOperation": "reboot", + "resource": "machines.executions", + "publicResource": "machines.executions", + "operation": "events", + "publicOperation": "events", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/reboot", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [ - "force" + "limit", + "cursor" ], "publicQueryParams": [ - "force" + "limit", + "cursor" ], "headerParams": [], "publicHeaderParams": [], @@ -6812,11 +9252,23 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [ { - "name": "force", + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", "required": false, "style": "form", "explode": false @@ -6827,7 +9279,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineRebootParams" + "publicName": "ExecutionEventsParams" }, "response": { "status": "200", @@ -6841,11 +9293,7 @@ ] }, "responseModel": { - "name": "machine", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RebootResponseHeaders", + "name": "execution_events", "publicAliases": [] }, "result": { @@ -6853,7 +9301,6 @@ "errorStatuses": [ "401", "403", - "409", "429", "503", "default" @@ -6869,11 +9316,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -6884,26 +9327,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "RebootStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -6914,11 +9338,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -6929,11 +9349,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "RebootStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -6944,56 +9360,53 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "RebootStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "execution_event", + "publicAliases": [] + } + }, "transport": "http" }, { - "resource": "machines", - "publicResource": "machines", - "operation": "resize", - "publicOperation": "resize", + "resource": "machines.executions.logs", + "publicResource": "machines.executions.logs", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/resize", + "method": "GET", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", "pathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "execution_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "memory_mib", - "vcpu" - ], - "publicBodyParams": [ - "memory_mib", - "vcpu" - ], - "bodyParamDetails": [ - { - "name": "memory_mib", - "required": false - }, - { - "name": "vcpu", - "required": false - } - ], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], "publicPositionalParams": [], "pathParamDetails": [ { @@ -7001,6 +9414,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -7009,20 +9428,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "MachineResizeParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "LogRetrieveParams" }, "response": { "status": "200", @@ -7036,46 +9442,22 @@ ] }, "responseModel": { - "name": "machine_detail_response", + "name": "status", "publicAliases": [] }, "responseHeadersModel": { - "name": "ResizeResponseHeaders", + "name": "RetrieveResponseHeaders", "publicAliases": [] }, "result": { "successStatus": "200", "errorStatuses": [ - "400", "401", - "402", "403", - "404", - "409", - "422", - "429", - "500", - "503", - "504", "default" ] }, "errorResponses": [ - { - "status": "400", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus400ResponseHeaders", - "publicAliases": [] - } - }, { "status": "401", "contentType": "application/json", @@ -7085,26 +9467,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus401ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "402", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus402ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -7115,89 +9478,99 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "404", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus404ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "422", - "contentType": "application/json", + "status": "default", + "contentType": "application/problem+json", "encoding": "json", "contents": [ { - "contentType": "application/json", + "contentType": "application/problem+json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus422ResponseHeaders", - "publicAliases": [] - } - }, + ] + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.executions.logs", + "publicResource": "machines.executions.logs", + "operation": "createToken", + "publicOperation": "createToken", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", + "pathParams": [ + "machine_id", + "execution_id" + ], + "publicPathParams": [ + "machine_id", + "execution_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [ { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus429ResponseHeaders", - "publicAliases": [] - } + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false }, { - "status": "500", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "ResizeStatus500ResponseHeaders", - "publicAliases": [] + "name": "execution_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LogCreateTokenParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" } - }, + ] + }, + "responseModel": { + "name": "read_token", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateTokenResponseHeaders", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "default" + ] + }, + "errorResponses": [ { - "status": "503", + "status": "401", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7205,14 +9578,10 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { - "status": "504", + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -7220,57 +9589,39 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "ResizeStatus504ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", - "contentType": "application/json", + "contentType": "application/problem+json", "encoding": "json", "contents": [ { - "contentType": "application/json", + "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error", - "publicAliases": [] - }, - "headersModel": { - "name": "ResizeStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "list", - "publicOperation": "list", + "resource": "machines.autoresizing", + "publicResource": "machines.autoresizing", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/ssh", + "path": "/v1/machines/{machine_id}/autoresizing", "pathParams": [ "machine_id" ], "publicPathParams": [ "machine_id" ], - "queryParams": [ - "limit", - "cursor" - ], - "publicQueryParams": [ - "limit", - "cursor" - ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -7285,26 +9636,13 @@ "explode": false } ], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false - }, - { - "name": "cursor", - "required": false, - "style": "form", - "explode": false - } - ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshListParams" + "publicName": "AutoresizingRetrieveParams" }, "response": { "status": "200", @@ -7318,7 +9656,7 @@ ] }, "responseModel": { - "name": "ssh_session_list", + "name": "policy", "publicAliases": [] }, "result": { @@ -7326,8 +9664,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -7354,28 +9690,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -7385,42 +9699,20 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "ssh_session", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "create", - "publicOperation": "create", + "resource": "machines.autoresizing", + "publicResource": "machines.autoresizing", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/ssh", + "method": "PATCH", + "path": "/v1/machines/{machine_id}/autoresizing", "pathParams": [ "machine_id" ], @@ -7432,15 +9724,33 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "public_key" + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" ], "publicBodyParams": [ - "public_key" + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" ], "bodyParamDetails": [ { - "name": "public_key", - "required": true + "name": "cpu", + "required": false + }, + { + "name": "cpu_max_vcpu", + "required": false + }, + { + "name": "memory", + "required": false + }, + { + "name": "memory_max_mib", + "required": false } ], "publicPositionalParams": [], @@ -7458,7 +9768,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshCreateParams" + "publicName": "AutoresizingUpdateParams" }, "requestBody": { "contentType": "application/json", @@ -7485,11 +9795,7 @@ ] }, "responseModel": { - "name": "ssh_session", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "CreateResponseHeaders", + "name": "policy", "publicAliases": [] }, "result": { @@ -7497,9 +9803,6 @@ "errorStatuses": [ "401", "403", - "409", - "429", - "503", "default" ] }, @@ -7513,11 +9816,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -7528,56 +9827,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus403ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "409", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus409ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus429ResponseHeaders", - "publicAliases": [] - } - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -7588,38 +9838,34 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "list", + "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "path": "/v1/machines/{machine_id}/ports", "pathParams": [ - "machine_id", - "session_id" + "machine_id" ], "publicPathParams": [ - "machine_id", - "session_id" + "machine_id" + ], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" ], - "queryParams": [], - "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -7632,21 +9878,28 @@ "required": true, "style": "simple", "explode": false + } + ], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false }, { - "name": "session_id", - "required": true, - "style": "simple", + "name": "cursor", + "required": false, + "style": "form", "explode": false } ], - "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshRetrieveParams" + "publicName": "PortListParams" }, "response": { "status": "200", @@ -7660,7 +9913,7 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "port_list", "publicAliases": [] }, "result": { @@ -7727,39 +9980,78 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], + "pagination": { + "style": "cursor", + "itemsField": "items", + "cursorField": "next_cursor", + "cursorParam": "cursor", + "cursorFields": [ + "next_cursor" + ], + "cursorParams": [ + "cursor" + ], + "requestLocation": "query", + "responseLocation": "body", + "itemModel": { + "name": "port", + "publicAliases": [] + } + }, "transport": "http" }, { - "resource": "machines.ssh", - "publicResource": "machines.ssh", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "create", + "publicOperation": "create", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}/ssh/{session_id}", + "method": "POST", + "path": "/v1/machines/{machine_id}/ports", "pathParams": [ - "machine_id", - "session_id" + "machine_id" ], "publicPathParams": [ - "machine_id", - "session_id" + "machine_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "expires", + "port", + "protocol", + "visibility" + ], + "publicBodyParams": [ + "expires", + "port", + "protocol", + "visibility" + ], + "bodyParamDetails": [ + { + "name": "expires", + "required": false + }, + { + "name": "port", + "required": true + }, + { + "name": "protocol", + "required": false + }, + { + "name": "visibility", + "required": false + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -7767,12 +10059,6 @@ "required": true, "style": "simple", "explode": false - }, - { - "name": "session_id", - "required": true, - "style": "simple", - "explode": false } ], "queryParamDetails": [], @@ -7781,7 +10067,20 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "SshDeleteParams" + "publicName": "PortCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -7795,7 +10094,11 @@ ] }, "responseModel": { - "name": "ssh_session", + "name": "port", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { @@ -7803,6 +10106,7 @@ "errorStatuses": [ "401", "403", + "409", "429", "503", "default" @@ -7818,7 +10122,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -7829,7 +10137,26 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } + }, + { + "status": "409", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "headersModel": { + "name": "CreateStatus409ResponseHeaders", + "publicAliases": [] + } }, { "status": "429", @@ -7840,7 +10167,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus429ResponseHeaders", + "publicAliases": [] + } }, { "status": "503", @@ -7851,7 +10182,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus503ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", @@ -7863,8 +10198,8 @@ "encoding": "json" } ], - "model": { - "name": "error_model", + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -7873,27 +10208,23 @@ "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "list", - "publicOperation": "list", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "retrieve", + "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions", + "path": "/v1/machines/{machine_id}/ports/{port_id}", "pathParams": [ - "machine_id" + "machine_id", + "port_id" ], "publicPathParams": [ - "machine_id" - ], - "queryParams": [ - "limit", - "cursor" - ], - "publicQueryParams": [ - "limit", - "cursor" + "machine_id", + "port_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -7906,28 +10237,21 @@ "required": true, "style": "simple", "explode": false - } - ], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false }, { - "name": "cursor", - "required": false, - "style": "form", + "name": "port_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionListParams" + "publicName": "PortRetrieveParams" }, "response": { "status": "200", @@ -7941,7 +10265,7 @@ ] }, "responseModel": { - "name": "execution_list", + "name": "port", "publicAliases": [] }, "result": { @@ -8008,86 +10332,42 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "execution", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "create", - "publicOperation": "create", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/executions", + "method": "PATCH", + "path": "/v1/machines/{machine_id}/ports/{port_id}", "pathParams": [ - "machine_id" + "machine_id", + "port_id" ], "publicPathParams": [ - "machine_id" + "machine_id", + "port_id" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "command", - "cwd", - "env", - "stdin", - "timeout_ms" + "visibility" ], "publicBodyParams": [ - "command", - "cwd", - "env", - "stdin", - "timeout_ms" + "visibility" ], "bodyParamDetails": [ { - "name": "command", + "name": "visibility", "required": true - }, - { - "name": "cwd", - "required": false - }, - { - "name": "env", - "required": false - }, - { - "name": "stdin", - "required": false - }, - { - "name": "timeout_ms", - "required": false } ], "publicPositionalParams": [], @@ -8097,6 +10377,12 @@ "required": true, "style": "simple", "explode": false + }, + { + "name": "port_id", + "required": true, + "style": "simple", + "explode": false } ], "queryParamDetails": [], @@ -8105,7 +10391,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionCreateParams" + "publicName": "PortUpdateParams" }, "requestBody": { "contentType": "application/json", @@ -8131,12 +10417,8 @@ } ] }, - "responseModel": { - "name": "execution", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "CreateResponseHeaders", + "responseModel": { + "name": "port", "publicAliases": [] }, "result": { @@ -8160,11 +10442,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus401ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "403", @@ -8175,11 +10453,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus403ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "409", @@ -8190,11 +10464,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus409ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "429", @@ -8205,11 +10475,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus429ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "503", @@ -8220,11 +10486,7 @@ "contentType": "application/json", "encoding": "json" } - ], - "headersModel": { - "name": "CreateStatus503ResponseHeaders", - "publicAliases": [] - } + ] }, { "status": "default", @@ -8235,35 +10497,27 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - }, - "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "machines.ports", + "publicResource": "machines.ports", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id" ], "queryParams": [], "publicQueryParams": [], @@ -8281,7 +10535,7 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false @@ -8293,7 +10547,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionRetrieveParams" + "publicName": "PortDeleteParams" }, "response": { "status": "200", @@ -8307,7 +10561,7 @@ ] }, "responseModel": { - "name": "execution", + "name": "port", "publicAliases": [] }, "result": { @@ -8374,34 +10628,36 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "delete", - "publicOperation": "delete", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "list", + "publicOperation": "list", "deprecated": false, - "method": "DELETE", - "path": "/v1/machines/{machine_id}/executions/{execution_id}", + "method": "GET", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", "pathParams": [ "machine_id", - "execution_id" + "port_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id" + ], + "queryParams": [ + "limit", + "cursor" + ], + "publicQueryParams": [ + "limit", + "cursor" ], - "queryParams": [], - "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], @@ -8416,19 +10672,32 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false } ], - "queryParamDetails": [], + "queryParamDetails": [ + { + "name": "limit", + "required": false, + "style": "form", + "explode": false + }, + { + "name": "cursor", + "required": false, + "style": "form", + "explode": false + } + ], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionDeleteParams" + "publicName": "AccessKeyListParams" }, "response": { "status": "200", @@ -8442,7 +10711,7 @@ ] }, "responseModel": { - "name": "execution", + "name": "port_access_key_list_response", "publicAliases": [] }, "result": { @@ -8450,8 +10719,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -8479,7 +10746,114 @@ ] }, { - "status": "429", + "status": "default", + "contentType": "application/problem+json", + "encoding": "json", + "contents": [ + { + "contentType": "application/problem+json", + "encoding": "json" + } + ] + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "mint", + "publicOperation": "mint", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys", + "pathParams": [ + "machine_id", + "port_id" + ], + "publicPathParams": [ + "machine_id", + "port_id" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "expires_in" + ], + "publicBodyParams": [ + "expires_in" + ], + "bodyParamDetails": [ + { + "name": "expires_in", + "required": true + } + ], + "publicPositionalParams": [], + "pathParamDetails": [ + { + "name": "machine_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "port_id", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "AccessKeyMintParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "mint_port_access_key_response", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "401", + "403", + "default" + ] + }, + "errorResponses": [ + { + "status": "401", "contentType": "application/json", "encoding": "json", "contents": [ @@ -8490,7 +10864,7 @@ ] }, { - "status": "503", + "status": "403", "contentType": "application/json", "encoding": "json", "contents": [ @@ -8509,31 +10883,29 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "output", - "publicOperation": "output", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "revoke", + "publicOperation": "revoke", "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/output", + "method": "DELETE", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}", "pathParams": [ "machine_id", - "execution_id" + "port_id", + "access_key_id" ], "publicPathParams": [ "machine_id", - "execution_id" + "port_id", + "access_key_id" ], "queryParams": [], "publicQueryParams": [], @@ -8551,7 +10923,13 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "access_key_id", "required": true, "style": "simple", "explode": false @@ -8563,7 +10941,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionOutputParams" + "publicName": "AccessKeyRevokeParams" }, "response": { "status": "200", @@ -8577,7 +10955,7 @@ ] }, "responseModel": { - "name": "execution_output", + "name": "port_access_key_response", "publicAliases": [] }, "result": { @@ -8585,8 +10963,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -8613,28 +10989,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -8644,45 +10998,46 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions", - "publicResource": "machines.executions", - "operation": "events", - "publicOperation": "events", - "deprecated": false, - "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/events", + "resource": "machines.ports.accessKeys", + "publicResource": "machines.ports.accessKeys", + "operation": "rotate", + "publicOperation": "rotate", + "deprecated": false, + "method": "POST", + "path": "/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate", "pathParams": [ "machine_id", - "execution_id" + "port_id", + "access_key_id" ], "publicPathParams": [ "machine_id", - "execution_id" - ], - "queryParams": [ - "limit", - "cursor" - ], - "publicQueryParams": [ - "limit", - "cursor" + "port_id", + "access_key_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], + "bodyParams": [ + "expires_in" + ], + "publicBodyParams": [ + "expires_in" + ], + "bodyParamDetails": [ + { + "name": "expires_in", + "required": true + } + ], "publicPositionalParams": [], "pathParamDetails": [ { @@ -8692,32 +11047,38 @@ "explode": false }, { - "name": "execution_id", + "name": "port_id", "required": true, "style": "simple", "explode": false - } - ], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false }, { - "name": "cursor", - "required": false, - "style": "form", + "name": "access_key_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ExecutionEventsParams" + "publicName": "AccessKeyRotateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -8731,7 +11092,7 @@ ] }, "responseModel": { - "name": "execution_events", + "name": "mint_port_access_key_response", "publicAliases": [] }, "result": { @@ -8739,8 +11100,6 @@ "errorStatuses": [ "401", "403", - "429", - "503", "default" ] }, @@ -8767,28 +11126,6 @@ } ] }, - { - "status": "429", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "503", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, { "status": "default", "contentType": "application/problem+json", @@ -8798,50 +11135,22 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], - "pagination": { - "style": "cursor", - "itemsField": "items", - "cursorField": "next_cursor", - "cursorParam": "cursor", - "cursorFields": [ - "next_cursor" - ], - "cursorParams": [ - "cursor" - ], - "requestLocation": "query", - "responseLocation": "body", - "itemModel": { - "name": "execution_event", - "publicAliases": [] - } - }, "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", + "resource": "organization.autoresizing", + "publicResource": "organization.autoresizing", "operation": "retrieve", "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs", - "pathParams": [ - "machine_id", - "execution_id" - ], - "publicPathParams": [ - "machine_id", - "execution_id" - ], + "path": "/v1/organization/autoresizing", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], @@ -8850,28 +11159,12 @@ "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false - }, - { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false - } - ], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], - "paramsModel": { - "publicName": "LogRetrieveParams" - }, "response": { "status": "200", "contentType": "application/json", @@ -8884,11 +11177,7 @@ ] }, "responseModel": { - "name": "status", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "RetrieveResponseHeaders", + "name": "policy", "publicAliases": [] }, "result": { @@ -8931,61 +11220,78 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.executions.logs", - "publicResource": "machines.executions.logs", - "operation": "createToken", - "publicOperation": "createToken", + "resource": "organization.autoresizing", + "publicResource": "organization.autoresizing", + "operation": "update", + "publicOperation": "update", "deprecated": false, - "method": "POST", - "path": "/v1/machines/{machine_id}/executions/{execution_id}/logs/token", - "pathParams": [ - "machine_id", - "execution_id" - ], - "publicPathParams": [ - "machine_id", - "execution_id" - ], + "method": "PATCH", + "path": "/v1/organization/autoresizing", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [ + "bodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "publicBodyParams": [ + "cpu", + "cpu_max_vcpu", + "memory", + "memory_max_mib" + ], + "bodyParamDetails": [ { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false + "name": "cpu", + "required": false }, { - "name": "execution_id", - "required": true, - "style": "simple", - "explode": false + "name": "cpu_max_vcpu", + "required": false + }, + { + "name": "memory", + "required": false + }, + { + "name": "memory_max_mib", + "required": false } ], + "publicPositionalParams": [], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "LogCreateTokenParams" + "publicName": "AutoresizingUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" }, "response": { "status": "200", @@ -8999,11 +11305,7 @@ ] }, "responseModel": { - "name": "read_token", - "publicAliases": [] - }, - "responseHeadersModel": { - "name": "CreateTokenResponseHeaders", + "name": "policy", "publicAliases": [] }, "result": { @@ -9046,53 +11348,58 @@ "contentType": "application/problem+json", "encoding": "json" } - ], - "model": { - "name": "error_model", - "publicAliases": [] - } + ] } ], "responseLinks": [], "transport": "http" }, { - "resource": "machines.autoresizing", - "publicResource": "machines.autoresizing", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "images", + "publicResource": "images", + "operation": "list", + "publicOperation": "list", "deprecated": false, "method": "GET", - "path": "/v1/machines/{machine_id}/autoresizing", - "pathParams": [ - "machine_id" + "path": "/v1/images", + "pathParams": [], + "publicPathParams": [], + "queryParams": [ + "limit", + "cursor" ], - "publicPathParams": [ - "machine_id" + "publicQueryParams": [ + "limit", + "cursor" ], - "queryParams": [], - "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [ + "pathParamDetails": [], + "queryParamDetails": [ { - "name": "machine_id", - "required": true, - "style": "simple", + "name": "limit", + "required": false, + "style": "form", + "explode": false, + "defaultValue": 100 + }, + { + "name": "cursor", + "required": false, + "style": "form", "explode": false } ], - "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingRetrieveParams" + "publicName": "ImageListParams" }, "response": { "status": "200", @@ -9106,7 +11413,7 @@ ] }, "responseModel": { - "name": "policy", + "name": "image_list", "publicAliases": [] }, "result": { @@ -9142,16 +11449,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -9160,69 +11467,58 @@ "transport": "http" }, { - "resource": "machines.autoresizing", - "publicResource": "machines.autoresizing", - "operation": "update", - "publicOperation": "update", + "resource": "images", + "publicResource": "images", + "operation": "create", + "publicOperation": "create", "deprecated": false, - "method": "PATCH", - "path": "/v1/machines/{machine_id}/autoresizing", - "pathParams": [ - "machine_id" - ], - "publicPathParams": [ - "machine_id" - ], + "method": "POST", + "path": "/v1/images", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "cpu", - "cpu_max_vcpu", - "memory", - "memory_max_mib" + "credential_ref", + "name", + "platform", + "source" ], "publicBodyParams": [ - "cpu", - "cpu_max_vcpu", - "memory", - "memory_max_mib" + "credential_ref", + "name", + "platform", + "source" ], "bodyParamDetails": [ { - "name": "cpu", + "name": "credential_ref", "required": false }, { - "name": "cpu_max_vcpu", + "name": "name", "required": false }, { - "name": "memory", - "required": false + "name": "platform", + "required": true }, { - "name": "memory_max_mib", - "required": false + "name": "source", + "required": true } ], "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "machine_id", - "required": true, - "style": "simple", - "explode": false - } - ], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingUpdateParams" + "publicName": "ImageCreateParams" }, "requestBody": { "contentType": "application/json", @@ -9238,7 +11534,7 @@ "publicIdentifier": "body" }, "response": { - "status": "200", + "status": "202", "contentType": "application/json", "encoding": "json", "contents": [ @@ -9249,11 +11545,15 @@ ] }, "responseModel": { - "name": "policy", + "name": "image", + "publicAliases": [] + }, + "responseHeadersModel": { + "name": "CreateResponseHeaders", "publicAliases": [] }, "result": { - "successStatus": "200", + "successStatus": "202", "errorStatuses": [ "401", "403", @@ -9270,7 +11570,11 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus401ResponseHeaders", + "publicAliases": [] + } }, { "status": "403", @@ -9281,20 +11585,28 @@ "contentType": "application/json", "encoding": "json" } - ] + ], + "headersModel": { + "name": "CreateStatus403ResponseHeaders", + "publicAliases": [] + } }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", + "publicAliases": [] + }, + "headersModel": { + "name": "CreateStatusdefaultResponseHeaders", "publicAliases": [] } } @@ -9303,15 +11615,19 @@ "transport": "http" }, { - "resource": "organization.autoresizing", - "publicResource": "organization.autoresizing", + "resource": "images", + "publicResource": "images", "operation": "retrieve", "publicOperation": "retrieve", "deprecated": false, "method": "GET", - "path": "/v1/organization/autoresizing", - "pathParams": [], - "publicPathParams": [], + "path": "/v1/images/{image_id}", + "pathParams": [ + "image_id" + ], + "publicPathParams": [ + "image_id" + ], "queryParams": [], "publicQueryParams": [], "headerParams": [], @@ -9320,12 +11636,22 @@ "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [], + "pathParamDetails": [ + { + "name": "image_id", + "required": true, + "style": "simple", + "explode": false + } + ], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], + "paramsModel": { + "publicName": "ImageRetrieveParams" + }, "response": { "status": "200", "contentType": "application/json", @@ -9338,7 +11664,7 @@ ] }, "responseModel": { - "name": "policy", + "name": "image", "publicAliases": [] }, "result": { @@ -9374,16 +11700,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -9392,58 +11718,51 @@ "transport": "http" }, { - "resource": "organization.autoresizing", - "publicResource": "organization.autoresizing", + "resource": "images", + "publicResource": "images", "operation": "update", "publicOperation": "update", "deprecated": false, "method": "PATCH", - "path": "/v1/organization/autoresizing", - "pathParams": [], - "publicPathParams": [], + "path": "/v1/images/{image_id}", + "pathParams": [ + "image_id" + ], + "publicPathParams": [ + "image_id" + ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "cpu", - "cpu_max_vcpu", - "memory", - "memory_max_mib" + "name" ], "publicBodyParams": [ - "cpu", - "cpu_max_vcpu", - "memory", - "memory_max_mib" + "name" ], "bodyParamDetails": [ { - "name": "cpu", - "required": false - }, - { - "name": "cpu_max_vcpu", - "required": false - }, - { - "name": "memory", - "required": false - }, - { - "name": "memory_max_mib", - "required": false + "name": "name", + "required": true } ], "publicPositionalParams": [], - "pathParamDetails": [], + "pathParamDetails": [ + { + "name": "image_id", + "required": true, + "style": "simple", + "explode": false + } + ], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AutoresizingUpdateParams" + "publicName": "ImageUpdateParams" }, "requestBody": { "contentType": "application/json", @@ -9470,7 +11789,7 @@ ] }, "responseModel": { - "name": "policy", + "name": "image", "publicAliases": [] }, "result": { @@ -9506,16 +11825,16 @@ }, { "status": "default", - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json", "contents": [ { - "contentType": "application/problem+json", + "contentType": "application/json", "encoding": "json" } ], "model": { - "name": "error_model", + "name": "error", "publicAliases": [] } } @@ -9526,49 +11845,40 @@ { "resource": "images", "publicResource": "images", - "operation": "list", - "publicOperation": "list", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "GET", - "path": "/v1/images", - "pathParams": [], - "publicPathParams": [], - "queryParams": [ - "limit", - "cursor" + "method": "DELETE", + "path": "/v1/images/{image_id}", + "pathParams": [ + "image_id" ], - "publicQueryParams": [ - "limit", - "cursor" + "publicPathParams": [ + "image_id" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], "publicPositionalParams": [], - "pathParamDetails": [], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": false, - "defaultValue": 100 - }, + "pathParamDetails": [ { - "name": "cursor", - "required": false, - "style": "form", + "name": "image_id", + "required": true, + "style": "simple", "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ImageListParams" + "publicName": "ImageDeleteParams" }, "response": { "status": "200", @@ -9582,7 +11892,7 @@ ] }, "responseModel": { - "name": "image_list", + "name": "image", "publicAliases": [] }, "result": { @@ -9636,13 +11946,13 @@ "transport": "http" }, { - "resource": "images", - "publicResource": "images", + "resource": "images.uploads", + "publicResource": "images.uploads", "operation": "create", "publicOperation": "create", "deprecated": false, "method": "POST", - "path": "/v1/images", + "path": "/v1/images/uploads", "pathParams": [], "publicPathParams": [], "queryParams": [], @@ -9650,32 +11960,26 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "credential_ref", - "name", "platform", - "source" + "sha256", + "size_bytes" ], "publicBodyParams": [ - "credential_ref", - "name", "platform", - "source" + "sha256", + "size_bytes" ], "bodyParamDetails": [ { - "name": "credential_ref", - "required": false - }, - { - "name": "name", - "required": false + "name": "platform", + "required": true }, { - "name": "platform", + "name": "sha256", "required": true }, { - "name": "source", + "name": "size_bytes", "required": true } ], @@ -9687,7 +11991,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ImageCreateParams" + "publicName": "UploadCreateParams" }, "requestBody": { "contentType": "application/json", @@ -9703,7 +12007,7 @@ "publicIdentifier": "body" }, "response": { - "status": "202", + "status": "200", "contentType": "application/json", "encoding": "json", "contents": [ @@ -9714,7 +12018,7 @@ ] }, "responseModel": { - "name": "image", + "name": "reservation", "publicAliases": [] }, "responseHeadersModel": { @@ -9722,7 +12026,7 @@ "publicAliases": [] }, "result": { - "successStatus": "202", + "successStatus": "200", "errorStatuses": [ "401", "403", @@ -9782,480 +12086,974 @@ ], "responseLinks": [], "transport": "http" - }, - { - "resource": "images", - "publicResource": "images", - "operation": "retrieve", - "publicOperation": "retrieve", - "deprecated": false, - "method": "GET", - "path": "/v1/images/{image_id}", - "pathParams": [ - "image_id" - ], - "publicPathParams": [ - "image_id" - ], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "image_id", - "required": true, - "style": "simple", - "explode": false - } - ], - "queryParamDetails": [], - "headerParamDetails": [], - "cookieParams": [], - "publicCookieParams": [], - "cookieParamDetails": [], - "paramsModel": { - "publicName": "ImageRetrieveParams" + } + ], + "webhooks": [], + "cli": { + "commands": [ + { + "path": [ + "machines", + "list" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--max-items ", + "mandatory": false + }, + { + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false + } + ] }, - "response": { - "status": "200", - "contentType": "application/json", - "encoding": "json", - "contents": [ + { + "path": [ + "machines", + "create" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ { - "contentType": "application/json", - "encoding": "json" + "flags": "--autosleep ", + "mandatory": false + }, + { + "flags": "--image-id ", + "mandatory": false + }, + { + "flags": "--memory-mib ", + "mandatory": false + }, + { + "flags": "--storage-gib ", + "mandatory": false + }, + { + "flags": "--vcpu ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "update" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--autosleep ", + "mandatory": false + }, + { + "flags": "--storage-gib ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "delete" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--force", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "sleep" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "wake" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "reboot" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--force", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "resize" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--memory-mib ", + "mandatory": false + }, + { + "flags": "--vcpu ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "ssh", + "list" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--max-items ", + "mandatory": false + }, + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "ssh", + "create" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--public-key ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "ssh", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--session-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "ssh", + "delete" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--session-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "list" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--max-items ", + "mandatory": false + }, + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "create" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--command ", + "mandatory": false + }, + { + "flags": "--cwd ", + "mandatory": false + }, + { + "flags": "--env ", + "mandatory": false + }, + { + "flags": "--stdin ", + "mandatory": false + }, + { + "flags": "--timeout-ms ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--execution-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "delete" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--execution-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "output" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--execution-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "events" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--max-items ", + "mandatory": false + }, + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--execution-id ", + "mandatory": false + }, + { + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "logs", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--execution-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "executions", + "logs", + "create-token" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--execution-id ", + "mandatory": false + } + ] + }, + { + "path": [ + "machines", + "autoresizing", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false } ] }, - "responseModel": { - "name": "image", - "publicAliases": [] - }, - "result": { - "successStatus": "200", - "errorStatuses": [ - "401", - "403", - "default" + { + "path": [ + "machines", + "autoresizing", + "update" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--cpu ", + "mandatory": false + }, + { + "flags": "--cpu-max-vcpu ", + "mandatory": false + }, + { + "flags": "--memory ", + "mandatory": false + }, + { + "flags": "--memory-max-mib ", + "mandatory": false + } ] }, - "errorResponses": [ - { - "status": "401", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "default", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "model": { - "name": "error", - "publicAliases": [] + { + "path": [ + "machines", + "ports", + "list" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--max-items ", + "mandatory": false + }, + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false } - } - ], - "responseLinks": [], - "transport": "http" - }, - { - "resource": "images", - "publicResource": "images", - "operation": "update", - "publicOperation": "update", - "deprecated": false, - "method": "PATCH", - "path": "/v1/images/{image_id}", - "pathParams": [ - "image_id" - ], - "publicPathParams": [ - "image_id" - ], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [ - "name" - ], - "publicBodyParams": [ - "name" - ], - "bodyParamDetails": [ - { - "name": "name", - "required": true - } - ], - "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "image_id", - "required": true, - "style": "simple", - "explode": false - } - ], - "queryParamDetails": [], - "headerParamDetails": [], - "cookieParams": [], - "publicCookieParams": [], - "cookieParamDetails": [], - "paramsModel": { - "publicName": "ImageUpdateParams" + ] }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ + { + "path": [ + "machines", + "ports", + "create" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ { - "contentType": "application/json", - "encoding": "json" + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--expires ", + "mandatory": false + }, + { + "flags": "--port ", + "mandatory": false + }, + { + "flags": "--protocol ", + "mandatory": false + }, + { + "flags": "--visibility ", + "mandatory": false } - ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + ] }, - "response": { - "status": "200", - "contentType": "application/json", - "encoding": "json", - "contents": [ + { + "path": [ + "machines", + "ports", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ { - "contentType": "application/json", - "encoding": "json" + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false } ] }, - "responseModel": { - "name": "image", - "publicAliases": [] - }, - "result": { - "successStatus": "200", - "errorStatuses": [ - "401", - "403", - "default" + { + "path": [ + "machines", + "ports", + "update" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false + }, + { + "flags": "--visibility ", + "mandatory": false + } ] }, - "errorResponses": [ - { - "status": "401", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "default", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "model": { - "name": "error", - "publicAliases": [] + { + "path": [ + "machines", + "ports", + "delete" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false } - } - ], - "responseLinks": [], - "transport": "http" - }, - { - "resource": "images", - "publicResource": "images", - "operation": "delete", - "publicOperation": "delete", - "deprecated": false, - "method": "DELETE", - "path": "/v1/images/{image_id}", - "pathParams": [ - "image_id" - ], - "publicPathParams": [ - "image_id" - ], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "publicPositionalParams": [], - "pathParamDetails": [ - { - "name": "image_id", - "required": true, - "style": "simple", - "explode": false - } - ], - "queryParamDetails": [], - "headerParamDetails": [], - "cookieParams": [], - "publicCookieParams": [], - "cookieParamDetails": [], - "paramsModel": { - "publicName": "ImageDeleteParams" + ] }, - "response": { - "status": "200", - "contentType": "application/json", - "encoding": "json", - "contents": [ + { + "path": [ + "machines", + "ports", + "access-keys", + "list" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false + }, { - "contentType": "application/json", - "encoding": "json" + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false } ] }, - "responseModel": { - "name": "image", - "publicAliases": [] - }, - "result": { - "successStatus": "200", - "errorStatuses": [ - "401", - "403", - "default" + { + "path": [ + "machines", + "ports", + "access-keys", + "mint" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false + }, + { + "flags": "--expires-in ", + "mandatory": false + } ] }, - "errorResponses": [ - { - "status": "401", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ] - }, - { - "status": "default", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "model": { - "name": "error", - "publicAliases": [] + { + "path": [ + "machines", + "ports", + "access-keys", + "revoke" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false + }, + { + "flags": "--access-key-id ", + "mandatory": false } - } - ], - "responseLinks": [], - "transport": "http" - }, - { - "resource": "images.uploads", - "publicResource": "images.uploads", - "operation": "create", - "publicOperation": "create", - "deprecated": false, - "method": "POST", - "path": "/v1/images/uploads", - "pathParams": [], - "publicPathParams": [], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [ - "platform", - "sha256", - "size_bytes" - ], - "publicBodyParams": [ - "platform", - "sha256", - "size_bytes" - ], - "bodyParamDetails": [ - { - "name": "platform", - "required": true - }, - { - "name": "sha256", - "required": true - }, - { - "name": "size_bytes", - "required": true - } - ], - "publicPositionalParams": [], - "pathParamDetails": [], - "queryParamDetails": [], - "headerParamDetails": [], - "cookieParams": [], - "publicCookieParams": [], - "cookieParamDetails": [], - "paramsModel": { - "publicName": "UploadCreateParams" + ] }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ + { + "path": [ + "machines", + "ports", + "access-keys", + "rotate" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ { - "contentType": "application/json", - "encoding": "json" + "flags": "--machine-id ", + "mandatory": false + }, + { + "flags": "--port-id ", + "mandatory": false + }, + { + "flags": "--access-key-id ", + "mandatory": false + }, + { + "flags": "--expires-in ", + "mandatory": false } + ] + }, + { + "path": [ + "organization", + "autoresizing", + "retrieve" ], - "required": true, - "publicName": "body", - "publicIdentifier": "body" + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [] }, - "response": { - "status": "200", - "contentType": "application/json", - "encoding": "json", - "contents": [ + { + "path": [ + "organization", + "autoresizing", + "update" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ { - "contentType": "application/json", - "encoding": "json" + "flags": "--cpu ", + "mandatory": false + }, + { + "flags": "--cpu-max-vcpu ", + "mandatory": false + }, + { + "flags": "--memory ", + "mandatory": false + }, + { + "flags": "--memory-max-mib ", + "mandatory": false } ] }, - "responseModel": { - "name": "reservation", - "publicAliases": [] + { + "path": [ + "images", + "list" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--limit ", + "mandatory": false + }, + { + "flags": "--cursor ", + "mandatory": false + } + ] }, - "responseHeadersModel": { - "name": "CreateResponseHeaders", - "publicAliases": [] + { + "path": [ + "images", + "create" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--credential-ref ", + "mandatory": false + }, + { + "flags": "--name ", + "mandatory": false + }, + { + "flags": "--platform ", + "mandatory": false + }, + { + "flags": "--source ", + "mandatory": false + }, + { + "flags": "--source.kind ", + "mandatory": false + }, + { + "flags": "--source.reference ", + "mandatory": false + }, + { + "flags": "--source.sha256 ", + "mandatory": false + }, + { + "flags": "--source.upload-id ", + "mandatory": false + } + ] }, - "result": { - "successStatus": "200", - "errorStatuses": [ - "401", - "403", - "default" + { + "path": [ + "images", + "retrieve" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--image-id ", + "mandatory": false + } ] }, - "errorResponses": [ - { - "status": "401", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus401ResponseHeaders", - "publicAliases": [] + { + "path": [ + "images", + "update" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--image-id ", + "mandatory": false + }, + { + "flags": "--name ", + "mandatory": false } - }, - { - "status": "403", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "headersModel": { - "name": "CreateStatus403ResponseHeaders", - "publicAliases": [] + ] + }, + { + "path": [ + "images", + "delete" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--image-id ", + "mandatory": false } - }, - { - "status": "default", - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - } - ], - "model": { - "name": "error", - "publicAliases": [] + ] + }, + { + "path": [ + "images", + "uploads", + "create" + ], + "source": "generated", + "aliases": [], + "hidden": false, + "arguments": [], + "flags": [ + { + "flags": "--platform ", + "mandatory": false }, - "headersModel": { - "name": "CreateStatusdefaultResponseHeaders", - "publicAliases": [] + { + "flags": "--sha256 ", + "mandatory": false + }, + { + "flags": "--size-bytes ", + "mandatory": false } - } - ], - "responseLinks": [], - "transport": "http" - } - ], - "webhooks": [] + ] + } + ] + } } diff --git a/scripts/package-staging.mjs b/scripts/package-staging.mjs index f429752..da20cf4 100644 --- a/scripts/package-staging.mjs +++ b/scripts/package-staging.mjs @@ -48,8 +48,7 @@ try { const source = join(root, name); if (existsSync(source)) cpSync(source, join(staging, name), { recursive: true }); } - if (!existsSync(join(staging, 'dist/esm/bin.js'))) - throw new Error('build the CLI before packaging'); + if (!existsSync(join(staging, 'dist/esm/bin.js'))) throw new Error('build the CLI before packaging'); patchBuild(join(staging, 'dist')); manifest.version = version; manifest.private = true; diff --git a/scripts/publish-binaries.mjs b/scripts/publish-binaries.mjs index a9d55cf..607c01f 100644 --- a/scripts/publish-binaries.mjs +++ b/scripts/publish-binaries.mjs @@ -1,69 +1,64 @@ // Both release workflows call this after compilation. Published archives stay // immutable; retries fill missing assets and download the bytes Homebrew hashes. -import { spawnSync } from "node:child_process"; -import { createHash } from "node:crypto"; -import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; -import { tmpdir } from "node:os"; -import { join } from "node:path"; +import { spawnSync } from 'node:child_process'; +import { createHash } from 'node:crypto'; +import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; -const { version } = JSON.parse(readFileSync("package.json", "utf8")); +const { version } = JSON.parse(readFileSync('package.json', 'utf8')); const repository = process.env.GITHUB_REPOSITORY; -if (!repository) throw new Error("GITHUB_REPOSITORY is required"); +if (!repository) throw new Error('GITHUB_REPOSITORY is required'); const tag = `v${version}`; const archives = [ - "dedalus-linux-x64.tar.gz", - "dedalus-linux-arm64.tar.gz", - "dedalus-darwin-x64.tar.gz", - "dedalus-darwin-arm64.tar.gz", - "dedalus-windows-x64.zip", + 'dedalus-linux-x64.tar.gz', + 'dedalus-linux-arm64.tar.gz', + 'dedalus-darwin-x64.tar.gz', + 'dedalus-darwin-arm64.tar.gz', + 'dedalus-windows-x64.zip', ]; const run = (args, capture = false) => { - const result = spawnSync("gh", args, { - encoding: "utf8", - stdio: capture ? ["ignore", "pipe", "inherit"] : "inherit", + const result = spawnSync('gh', args, { + encoding: 'utf8', + stdio: capture ? ['ignore', 'pipe', 'inherit'] : 'inherit', }); if (result.error) throw result.error; - if (result.status !== 0) - throw new Error(`gh release failed with exit code ${result.status}`); + if (result.status !== 0) throw new Error(`gh release failed with exit code ${result.status}`); return result.stdout; }; -const { assets } = JSON.parse( - run(["release", "view", tag, "--repo", repository, "--json", "assets"], true), -); +const { assets } = JSON.parse(run(['release', 'view', tag, '--repo', repository, '--json', 'assets'], true)); const published = new Set(assets.map(({ name }) => name)); for (const archive of archives) { if (published.has(archive)) continue; // Never replace an asset: a merged Homebrew formula may already pin its bytes. - run([ - "release", "upload", tag, join("release-binaries", archive), - "--repo", repository, - ]); + run(['release', 'upload', tag, join('release-binaries', archive), '--repo', repository]); } -const directory = mkdtempSync(join(tmpdir(), "dedalus-release-")); +const directory = mkdtempSync(join(tmpdir(), 'dedalus-release-')); try { for (const archive of archives) { - run([ - "release", "download", tag, "--repo", repository, - "--pattern", archive, "--dir", directory, - ]); + run(['release', 'download', tag, '--repo', repository, '--pattern', archive, '--dir', directory]); } // Hash the published assets, including any reused from a previous attempt. for (const archive of archives) { - copyFileSync(join(directory, archive), join("release-binaries", archive)); + copyFileSync(join(directory, archive), join('release-binaries', archive)); } // The standalone upgrade command requires checksums for the published bytes. - const checksums = archives.map(archive => - `${createHash("sha256").update(readFileSync(join(directory, archive))).digest("hex")} ${archive}\n`, - ).join(""); - if (published.has("checksums.txt")) { - run(["release", "download", tag, "--repo", repository, - "--pattern", "checksums.txt", "--dir", directory]); - if (readFileSync(join(directory, "checksums.txt"), "utf8") !== checksums) - throw new Error("Published checksums.txt does not match the release archives"); + const checksums = archives + .map( + (archive) => + `${createHash('sha256') + .update(readFileSync(join(directory, archive))) + .digest('hex')} ${archive}\n`, + ) + .join(''); + if (published.has('checksums.txt')) { + run(['release', 'download', tag, '--repo', repository, '--pattern', 'checksums.txt', '--dir', directory]); + if (readFileSync(join(directory, 'checksums.txt'), 'utf8') !== checksums) + throw new Error('Published checksums.txt does not match the release archives'); } else { - writeFileSync(join(directory, "checksums.txt"), checksums); - run(["release", "upload", tag, join(directory, "checksums.txt"), "--repo", repository]); + writeFileSync(join(directory, 'checksums.txt'), checksums); + run(['release', 'upload', tag, join(directory, 'checksums.txt'), '--repo', repository]); } } finally { rmSync(directory, { recursive: true, force: true }); diff --git a/scripts/update-homebrew.mjs b/scripts/update-homebrew.mjs index cdbd1fa..6739eae 100644 --- a/scripts/update-homebrew.mjs +++ b/scripts/update-homebrew.mjs @@ -1,195 +1,137 @@ -import { createHash } from "node:crypto"; -import { spawnSync } from "node:child_process"; -import { - mkdirSync, - mkdtempSync, - readFileSync, - rmSync, - writeFileSync, -} from "node:fs"; -import { tmpdir } from "node:os"; -import { join, resolve } from "node:path"; -import { pathToFileURL } from "node:url"; +import { createHash } from 'node:crypto'; +import { spawnSync } from 'node:child_process'; +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join, resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; -const tap = "dedalus-labs/homebrew-tap"; +const tap = 'dedalus-labs/homebrew-tap'; const platforms = [ - ["macos", "arm", "darwin-arm64"], - ["macos", "intel", "darwin-x64"], - ["linux", "arm", "linux-arm64"], - ["linux", "intel", "linux-x64"], + ['macos', 'arm', 'darwin-arm64'], + ['macos', 'intel', 'darwin-x64'], + ['linux', 'arm', 'linux-arm64'], + ['linux', 'intel', 'linux-x64'], ]; export function renderFormula(version, repository, directory) { if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) { - throw new Error("Invalid package version"); + throw new Error('Invalid package version'); } if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(repository)) { - throw new Error("Invalid release repository"); + throw new Error('Invalid release repository'); } const lines = [ - "class Dedalus < Formula", + 'class Dedalus < Formula', ' desc "Official CLI for Dedalus"', ' homepage "https://docs.dedaluslabs.ai"', ` version "${version}"`, ' license "Apache-2.0"', ]; - for (const os of ["macos", "linux"]) { - lines.push("", ` on_${os} do`); - for (const [, architecture, target] of platforms.filter( - ([name]) => name === os, - )) { + for (const os of ['macos', 'linux']) { + lines.push('', ` on_${os} do`); + for (const [, architecture, target] of platforms.filter(([name]) => name === os)) { const archive = `dedalus-${target}.tar.gz`; - const digest = createHash("sha256") + const digest = createHash('sha256') .update(readFileSync(join(directory, archive))) - .digest("hex"); + .digest('hex'); lines.push( ` on_${architecture} do`, ` url "https://github.com/${repository}/releases/download/v${version}/${archive}"`, ` sha256 "${digest}"`, - " end", + ' end', ); } - lines.push(" end"); + lines.push(' end'); } lines.push( - "", - " def install", + '', + ' def install', ' bin.install "dedalus"', - " end", - "", - " test do", + ' end', + '', + ' test do', ' assert_match version.to_s, shell_output("#{bin}/dedalus --version")', - " end", - "end", - "", + ' end', + 'end', + '', ); - return lines.join("\n"); + return lines.join('\n'); } export function updateHomebrew() { - const { version } = JSON.parse(readFileSync("package.json", "utf8")); - const formula = renderFormula( - version, - process.env.GITHUB_REPOSITORY, - "release-binaries", - ); - if (process.argv.includes("--dry-run")) { + const { version } = JSON.parse(readFileSync('package.json', 'utf8')); + const formula = renderFormula(version, process.env.GITHUB_REPOSITORY, 'release-binaries'); + if (process.argv.includes('--dry-run')) { process.stdout.write(formula); return; } const token = process.env.HOMEBREW_TAP_TOKEN; - if (!token) throw new Error("HOMEBREW_TAP_TOKEN is required"); - const directory = mkdtempSync(join(tmpdir(), "dedalus-homebrew-")); + if (!token) throw new Error('HOMEBREW_TAP_TOKEN is required'); + const directory = mkdtempSync(join(tmpdir(), 'dedalus-homebrew-')); const env = { ...process.env, GH_TOKEN: token }; const run = (file, args, capture = false) => { const result = spawnSync(file, args, { cwd: directory, env, - encoding: "utf8", - stdio: capture ? ["ignore", "pipe", "inherit"] : "inherit", + encoding: 'utf8', + stdio: capture ? ['ignore', 'pipe', 'inherit'] : 'inherit', }); if (result.error) throw new Error(`${file}: ${result.error.message}`); - if (result.status !== 0) - throw new Error(`${file} failed with exit code ${result.status}`); + if (result.status !== 0) throw new Error(`${file} failed with exit code ${result.status}`); return result.stdout?.trim(); }; try { - run("git", [ - "clone", - `https://x-access-token:${encodeURIComponent(token)}@github.com/${tap}.git`, - ".", - ]); + run('git', ['clone', `https://x-access-token:${encodeURIComponent(token)}@github.com/${tap}.git`, '.']); const branch = `release/dedalus-${version}`; - const remote = run( - "git", - ["ls-remote", "--heads", "origin", `refs/heads/${branch}`], - true, - ); + const remote = run('git', ['ls-remote', '--heads', 'origin', `refs/heads/${branch}`], true); if (remote) { - run("git", ["fetch", "origin", branch]); - run("git", ["checkout", "-b", branch, "FETCH_HEAD"]); + run('git', ['fetch', 'origin', branch]); + run('git', ['checkout', '-b', branch, 'FETCH_HEAD']); } else { - run("git", ["checkout", "-b", branch]); + run('git', ['checkout', '-b', branch]); } - run("git", ["config", "user.name", "github-actions[bot]"]); - run("git", [ - "config", - "user.email", - "41898282+github-actions[bot]@users.noreply.github.com", - ]); - mkdirSync(join(directory, "Formula"), { recursive: true }); - writeFileSync(join(directory, "Formula/dedalus.rb"), formula); - if ( - run("git", ["status", "--porcelain", "--", "Formula/dedalus.rb"], true) - ) { - run("git", ["add", "Formula/dedalus.rb"]); - run("git", [ - "commit", - "-m", - `chore(formula): update dedalus to ${version}`, - ]); - run("git", ["push", "--set-upstream", "origin", branch]); + run('git', ['config', 'user.name', 'github-actions[bot]']); + run('git', ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com']); + mkdirSync(join(directory, 'Formula'), { recursive: true }); + writeFileSync(join(directory, 'Formula/dedalus.rb'), formula); + if (run('git', ['status', '--porcelain', '--', 'Formula/dedalus.rb'], true)) { + run('git', ['add', 'Formula/dedalus.rb']); + run('git', ['commit', '-m', `chore(formula): update dedalus to ${version}`]); + run('git', ['push', '--set-upstream', 'origin', branch]); } - if ( - !run( - "git", - [ - "diff", - "--name-only", - "origin/main", - "HEAD", - "--", - "Formula/dedalus.rb", - ], - true, - ) - ) { + if (!run('git', ['diff', '--name-only', 'origin/main', 'HEAD', '--', 'Formula/dedalus.rb'], true)) { process.stdout.write(`Homebrew already contains dedalus ${version}.\n`); return; } const prs = JSON.parse( run( - "gh", - [ - "pr", - "list", - "--repo", - tap, - "--head", - branch, - "--base", - "main", - "--state", - "open", - "--json", - "url", - ], + 'gh', + ['pr', 'list', '--repo', tap, '--head', branch, '--base', 'main', '--state', 'open', '--json', 'url'], true, ), ); - if (prs.length > 1) - throw new Error(`Multiple open pull requests for ${branch}`); + if (prs.length > 1) throw new Error(`Multiple open pull requests for ${branch}`); if (prs.length === 1) { process.stdout.write(`${prs[0].url}\n`); return; } - const body = join(directory, "release-pr-body.txt"); + const body = join(directory, 'release-pr-body.txt'); writeFileSync( body, `Update the standalone CLI formula to ${version}. All four platform archives are pinned to the SHA-256 digests of the binaries uploaded by this release.\n`, ); - run("gh", [ - "pr", - "create", - "--repo", + run('gh', [ + 'pr', + 'create', + '--repo', tap, - "--base", - "main", - "--head", + '--base', + 'main', + '--head', branch, - "--title", + '--title', `chore(formula): update dedalus to ${version}`, - "--body-file", + '--body-file', body, ]); } finally { @@ -197,9 +139,6 @@ export function updateHomebrew() { } } -if ( - process.argv[1] && - import.meta.url === pathToFileURL(resolve(process.argv[1])).href -) { +if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) { updateHomebrew(); } diff --git a/src/cli/completions.ts b/src/cli/completions.ts index e14e5bd..b812cd4 100644 --- a/src/cli/completions.ts +++ b/src/cli/completions.ts @@ -4,12 +4,12 @@ // built from. `dedalus completion ` prints one of them. const bash = - "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_path_flag() {\n return 1\n}\n\n__dedalus_completion() {\n local cur prev node candidate words line index\n COMPREPLY=()\n cur=\"${COMP_WORDS[COMP_CWORD]}\"\n prev=''\n if (( COMP_CWORD > 0 )); then prev=\"${COMP_WORDS[COMP_CWORD-1]}\"; fi\n node=''\n for (( index = 1; index < COMP_CWORD; index++ )); do\n case \"${COMP_WORDS[index]}\" in\n -*) continue ;;\n esac\n if [ -z \"$node\" ]; then\n candidate=\"${COMP_WORDS[index]}\"\n else\n candidate=\"$node ${COMP_WORDS[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then node=\"$candidate\"; fi\n done\n\n case \"$node\" in\n '') words='machines organization images login logout completion upgrade uninstall help --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --version --help' ;;\n 'completion') words='bash zsh fish --help' ;;\n 'upgrade') words='--check --help' ;;\n 'uninstall') words='--help' ;;\n 'machines') words='list create retrieve update delete sleep wake reboot resize ssh executions autoresizing --help' ;;\n 'machines list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines create') words='--autosleep --image-id --memory-mib --storage-gib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines update') words='--machine-id --autosleep --storage-gib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines delete') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines sleep') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines wake') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines reboot') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines resize') words='--machine-id --memory-mib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh') words='list create retrieve delete --help' ;;\n 'machines ssh list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh create') words='--machine-id --public-key --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh retrieve') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh delete') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions') words='list create retrieve delete output events logs --help' ;;\n 'machines executions list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions create') words='--machine-id --command --cwd --env --stdin --timeout-ms --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions delete') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions output') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions events') words='--machine-id --execution-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs') words='retrieve create-token --help' ;;\n 'machines executions logs retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs create-token') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing') words='retrieve update --help' ;;\n 'machines autoresizing retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing update') words='--machine-id --cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization') words='autoresizing --help' ;;\n 'organization autoresizing') words='retrieve update --help' ;;\n 'organization autoresizing retrieve') words='--base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization autoresizing update') words='--cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images') words='list create retrieve update delete uploads --help' ;;\n 'images list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images create') words='--credential-ref --name --platform --source --source.kind --source.reference --source.sha256 --source.upload-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images retrieve') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images update') words='--image-id --name --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images delete') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images uploads') words='create --help' ;;\n 'images uploads create') words='--platform --sha256 --size-bytes --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'login') words='--base-url --flow --help' ;;\n 'logout') words='--base-url --all --help' ;;\n *) words='' ;;\n esac\n\n if __dedalus_path_flag \"$node $prev\"; then\n compopt -o filenames 2>/dev/null\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -f -- \"$cur\")\n return\n fi\n\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -W \"$words\" -- \"$cur\")\n}\n\ncomplete -F __dedalus_completion 'dedalus'\n"; + "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'machines ports'|'machines ports list'|'machines ports create'|'machines ports retrieve'|'machines ports update'|'machines ports delete'|'machines ports access-keys'|'machines ports access-keys list'|'machines ports access-keys mint'|'machines ports access-keys revoke'|'machines ports access-keys rotate'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_path_flag() {\n return 1\n}\n\n__dedalus_completion() {\n local cur prev node candidate words line index\n COMPREPLY=()\n cur=\"${COMP_WORDS[COMP_CWORD]}\"\n prev=''\n if (( COMP_CWORD > 0 )); then prev=\"${COMP_WORDS[COMP_CWORD-1]}\"; fi\n node=''\n for (( index = 1; index < COMP_CWORD; index++ )); do\n case \"${COMP_WORDS[index]}\" in\n -*) continue ;;\n esac\n if [ -z \"$node\" ]; then\n candidate=\"${COMP_WORDS[index]}\"\n else\n candidate=\"$node ${COMP_WORDS[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then node=\"$candidate\"; fi\n done\n\n case \"$node\" in\n '') words='machines organization images login logout completion upgrade uninstall help --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --version --help' ;;\n 'completion') words='bash zsh fish --help' ;;\n 'upgrade') words='--check --help' ;;\n 'uninstall') words='--help' ;;\n 'machines') words='list create retrieve update delete sleep wake reboot resize ssh executions autoresizing ports --help' ;;\n 'machines list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines create') words='--autosleep --image-id --memory-mib --storage-gib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines update') words='--machine-id --autosleep --storage-gib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines delete') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines sleep') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines wake') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines reboot') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines resize') words='--machine-id --memory-mib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh') words='list create retrieve delete --help' ;;\n 'machines ssh list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh create') words='--machine-id --public-key --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh retrieve') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh delete') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions') words='list create retrieve delete output events logs --help' ;;\n 'machines executions list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions create') words='--machine-id --command --cwd --env --stdin --timeout-ms --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions delete') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions output') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions events') words='--machine-id --execution-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs') words='retrieve create-token --help' ;;\n 'machines executions logs retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs create-token') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing') words='retrieve update --help' ;;\n 'machines autoresizing retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing update') words='--machine-id --cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports') words='list create retrieve update delete access-keys --help' ;;\n 'machines ports list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports create') words='--machine-id --expires --port --protocol --visibility --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports retrieve') words='--machine-id --port-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports update') words='--machine-id --port-id --visibility --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports delete') words='--machine-id --port-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys') words='list mint revoke rotate --help' ;;\n 'machines ports access-keys list') words='--machine-id --port-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys mint') words='--machine-id --port-id --expires-in --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys revoke') words='--machine-id --port-id --access-key-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys rotate') words='--machine-id --port-id --access-key-id --expires-in --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization') words='autoresizing --help' ;;\n 'organization autoresizing') words='retrieve update --help' ;;\n 'organization autoresizing retrieve') words='--base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization autoresizing update') words='--cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images') words='list create retrieve update delete uploads --help' ;;\n 'images list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images create') words='--credential-ref --name --platform --source --source.kind --source.reference --source.sha256 --source.upload-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images retrieve') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images update') words='--image-id --name --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images delete') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images uploads') words='create --help' ;;\n 'images uploads create') words='--platform --sha256 --size-bytes --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'login') words='--base-url --flow --no-input --help' ;;\n 'logout') words='--base-url --all --help' ;;\n *) words='' ;;\n esac\n\n if __dedalus_path_flag \"$node $prev\"; then\n compopt -o filenames 2>/dev/null\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -f -- \"$cur\")\n return\n fi\n\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -W \"$words\" -- \"$cur\")\n}\n\ncomplete -F __dedalus_completion 'dedalus'\n"; const zsh = - "#compdef dedalus\n# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_completion() {\n local node candidate\n local -a subcommands options\n local -i index matched\n node=''\n matched=1\n for (( index = 2; index < CURRENT; index++ )); do\n case ${words[index]} in\n -*) continue ;;\n esac\n if [[ -z $node ]]; then\n candidate=${words[index]}\n else\n candidate=\"$node ${words[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then\n node=$candidate\n matched=$index\n fi\n done\n\n subcommands=()\n options=()\n case \"$node\" in\n '')\n subcommands=('machines:machines commands' 'organization:organization commands' 'images:images commands' 'login:Sign in and save credentials for later commands' 'logout:Forget saved credentials, and revoke them if the provider supports it' 'completion:Print a shell completion script' 'upgrade:Upgrade to the latest release' 'uninstall:Show how to remove this installation' 'help:Show help for a command')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--version[Print the CLI version]' '--help[Show help for this command]')\n ;;\n 'completion')\n subcommands=('bash:Print a bash completion script' 'zsh:Print a zsh completion script' 'fish:Print a fish completion script')\n options=('--help[Show help for this command]')\n ;;\n 'upgrade')\n options=('--check[Report the latest version without installing it]' '--help[Show help for this command]')\n ;;\n 'uninstall')\n options=('--help[Show help for this command]')\n ;;\n 'machines')\n subcommands=('list:List machines' 'create:Create machine' 'retrieve:Get machine' 'update:Update machine' 'delete:Destroy machine' 'sleep:Sleep a running machine' 'wake:Wake a sleeping machine' 'reboot:Reboot a machine with fresh memory' 'resize:Resize machine' 'ssh:ssh commands' 'executions:executions commands' 'autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines create')\n options=('--autosleep[Idle window before autosleep]:value:' '--image-id[Organization-owned ready custom image ID]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--autosleep[The autosleep body parameter]:value:' '--storage-gib[The storage-gib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Destroy from the last published filesystem checkpoint without publishing the Machine'\\''s remaining...]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines sleep')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines wake')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines reboot')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Recover from the last committed filesystem checkpoint without guest cooperation]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines resize')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--memory-mib[RAM in MiB]:value:' '--vcpu[CPU in 0.25-vCPU steps]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh')\n subcommands=('list:List SSH sessions' 'create:Create SSH session' 'retrieve:Get SSH session' 'delete:Delete SSH session')\n options=('--help[Show help for this command]')\n ;;\n 'machines ssh list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--public-key[The public-key body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions')\n subcommands=('list:List executions' 'create:Create execution' 'retrieve:Get execution' 'delete:Delete execution' 'output:Get execution output' 'events:List execution events' 'logs:logs commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--command[The command body parameter]:value:' '--cwd[The cwd body parameter]:value:' '--env[The env body parameter]:value:' '--stdin[The stdin body parameter]:value:' '--timeout-ms[The timeout-ms body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions output')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions events')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs')\n subcommands=('retrieve:Get execution log status' 'create-token:Create execution log read token')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions logs retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs create-token')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing')\n subcommands=('retrieve:Read this machine'\\''s autoresizing settings' 'update:Set this machine'\\''s autoresizing settings')\n options=('--help[Show help for this command]')\n ;;\n 'machines autoresizing retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization')\n subcommands=('autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing')\n subcommands=('retrieve:Read organization autoresizing policy' 'update:Set organization autoresizing policy')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing retrieve')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization autoresizing update')\n options=('--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images')\n subcommands=('list:List image IDs owned by the authenticated organization' 'create:Register an immutable OCI image for preparation' 'retrieve:Read preparation status for an organization-owned image' 'update:Rename an organization-owned image' 'delete:Delete an organization-owned image' 'uploads:uploads commands')\n options=('--help[Show help for this command]')\n ;;\n 'images list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images create')\n options=('--credential-ref[The credential-ref body parameter]:value:' '--name[A label people use to tell images apart]:value:' '--platform[The platform body parameter]:value:' '--source[The source body parameter]:value:' '--source.kind[The source.kind body parameter]:value:' '--source.reference[The source.reference body parameter]:value:' '--source.sha256[The source.sha256 body parameter]:value:' '--source.upload-id[The source.upload-id body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images retrieve')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images update')\n options=('--image-id[The image-id path parameter]:value:' '--name[The new label, or null to clear it]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images delete')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images uploads')\n subcommands=('create:Reserve an immutable Docker image archive upload')\n options=('--help[Show help for this command]')\n ;;\n 'images uploads create')\n options=('--platform[The platform body parameter]:value:' '--sha256[The sha256 body parameter]:value:' '--size-bytes[The size-bytes body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'login')\n options=('--base-url[Sign in against this base URL instead of the default]:value:' '--flow[Sign-in flow to use\\: api-key, x-api-key, oauth-browser]:value:' '--help[Show help for this command]')\n ;;\n 'logout')\n options=('--base-url[Forget the credentials saved for this base URL (not with --all)]:value:' '--all[Forget every saved credential, for every base URL]' '--help[Show help for this command]')\n ;;\n esac\n\n words=( \"$words[1]\" \"${(@)words[matched+1,-1]}\" )\n (( CURRENT -= matched - 1 ))\n\n (( ${#options} )) && _arguments -s -S $options\n (( ${#subcommands} )) && _describe -t commands 'command' subcommands\n}\n\nif [[ ${zsh_eval_context[-1]} == loadautofunc ]]; then\n __dedalus_completion \"$@\"\nelse\n compdef __dedalus_completion 'dedalus'\nfi\n"; + "#compdef dedalus\n# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'machines ports'|'machines ports list'|'machines ports create'|'machines ports retrieve'|'machines ports update'|'machines ports delete'|'machines ports access-keys'|'machines ports access-keys list'|'machines ports access-keys mint'|'machines ports access-keys revoke'|'machines ports access-keys rotate'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_completion() {\n local node candidate\n local -a subcommands options\n local -i index matched\n node=''\n matched=1\n for (( index = 2; index < CURRENT; index++ )); do\n case ${words[index]} in\n -*) continue ;;\n esac\n if [[ -z $node ]]; then\n candidate=${words[index]}\n else\n candidate=\"$node ${words[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then\n node=$candidate\n matched=$index\n fi\n done\n\n subcommands=()\n options=()\n case \"$node\" in\n '')\n subcommands=('machines:machines commands' 'organization:organization commands' 'images:images commands' 'login:Sign in and save credentials for later commands' 'logout:Forget saved credentials, and revoke them if the provider supports it' 'completion:Print a shell completion script' 'upgrade:Upgrade to the latest release' 'uninstall:Show how to remove this installation' 'help:Show help for a command')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--version[Print the CLI version]' '--help[Show help for this command]')\n ;;\n 'completion')\n subcommands=('bash:Print a bash completion script' 'zsh:Print a zsh completion script' 'fish:Print a fish completion script')\n options=('--help[Show help for this command]')\n ;;\n 'upgrade')\n options=('--check[Report the latest version without installing it]' '--help[Show help for this command]')\n ;;\n 'uninstall')\n options=('--help[Show help for this command]')\n ;;\n 'machines')\n subcommands=('list:List machines' 'create:Create machine' 'retrieve:Get machine' 'update:Update machine' 'delete:Destroy machine' 'sleep:Sleep a running machine' 'wake:Wake a sleeping machine' 'reboot:Reboot a machine with fresh memory' 'resize:Resize machine' 'ssh:ssh commands' 'executions:executions commands' 'autoresizing:autoresizing commands' 'ports:ports commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines create')\n options=('--autosleep[Idle window before autosleep]:value:' '--image-id[Organization-owned ready custom image ID]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--autosleep[The autosleep body parameter]:value:' '--storage-gib[The storage-gib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Destroy from the last published filesystem checkpoint without publishing the Machine'\\''s remaining...]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines sleep')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines wake')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines reboot')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Recover from the last committed filesystem checkpoint without guest cooperation]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines resize')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--memory-mib[RAM in MiB]:value:' '--vcpu[CPU in 0.25-vCPU steps]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh')\n subcommands=('list:List SSH sessions' 'create:Create SSH session' 'retrieve:Get SSH session' 'delete:Delete SSH session')\n options=('--help[Show help for this command]')\n ;;\n 'machines ssh list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--public-key[The public-key body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions')\n subcommands=('list:List executions' 'create:Create execution' 'retrieve:Get execution' 'delete:Delete execution' 'output:Get execution output' 'events:List execution events' 'logs:logs commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--command[Program and its arguments as an array of strings, such as \\[\"ls\", \"-la\"\\]]:value:' '--cwd[The cwd body parameter]:value:' '--env[The env body parameter]:value:' '--stdin[The stdin body parameter]:value:' '--timeout-ms[The timeout-ms body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions output')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions events')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs')\n subcommands=('retrieve:Get execution log status' 'create-token:Create execution log read token')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions logs retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs create-token')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing')\n subcommands=('retrieve:Read this machine'\\''s autoresizing settings' 'update:Set this machine'\\''s autoresizing settings')\n options=('--help[Show help for this command]')\n ;;\n 'machines autoresizing retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports')\n subcommands=('list:List ports' 'create:Create port' 'retrieve:Get port' 'update:Update port' 'delete:Delete port' 'access-keys:access-keys commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines ports list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--expires[Port lifetime in integer seconds]:value:' '--port[The port body parameter]:value:' '--protocol[The protocol body parameter]:value:' '--visibility[Who may reach the port]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--visibility[Who may reach the port]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys')\n subcommands=('list:List port access keys' 'mint:Mint port access key' 'revoke:Revoke port access key' 'rotate:Rotate port access key')\n options=('--help[Show help for this command]')\n ;;\n 'machines ports access-keys list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys mint')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--expires-in[Lifetime in integer seconds]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys revoke')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--access-key-id[The access-key-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys rotate')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--access-key-id[The access-key-id path parameter]:value:' '--expires-in[Lifetime in integer seconds]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization')\n subcommands=('autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing')\n subcommands=('retrieve:Read organization autoresizing policy' 'update:Set organization autoresizing policy')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing retrieve')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization autoresizing update')\n options=('--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images')\n subcommands=('list:List images owned by the authenticated organization' 'create:Register an immutable OCI image for preparation' 'retrieve:Read preparation status for an organization-owned image' 'update:Rename an organization-owned image' 'delete:Delete an organization-owned image' 'uploads:uploads commands')\n options=('--help[Show help for this command]')\n ;;\n 'images list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images create')\n options=('--credential-ref[The credential-ref body parameter]:value:' '--name[A label people use to tell images apart]:value:' '--platform[The platform body parameter]:value:' '--source[The source body parameter]:value:' '--source.kind[The source.kind body parameter]:value:' '--source.reference[The source.reference body parameter]:value:' '--source.sha256[The source.sha256 body parameter]:value:' '--source.upload-id[The source.upload-id body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images retrieve')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images update')\n options=('--image-id[The image-id path parameter]:value:' '--name[The new label, or null to clear it]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images delete')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images uploads')\n subcommands=('create:Reserve an immutable Docker image archive upload')\n options=('--help[Show help for this command]')\n ;;\n 'images uploads create')\n options=('--platform[The platform body parameter]:value:' '--sha256[The sha256 body parameter]:value:' '--size-bytes[The size-bytes body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'login')\n options=('--base-url[Sign in against this base URL instead of the default]:value:' '--flow[Sign-in flow to use\\: api-key, x-api-key, oauth-browser]:value:' '--no-input[Never prompt; a command that would ask fails instead]' '--help[Show help for this command]')\n ;;\n 'logout')\n options=('--base-url[Forget the credentials saved for this base URL (not with --all)]:value:' '--all[Forget every saved credential, for every base URL]' '--help[Show help for this command]')\n ;;\n esac\n\n words=( \"$words[1]\" \"${(@)words[matched+1,-1]}\" )\n (( CURRENT -= matched - 1 ))\n\n (( ${#options} )) && _arguments -s -S $options\n (( ${#subcommands} )) && _describe -t commands 'command' subcommands\n}\n\nif [[ ${zsh_eval_context[-1]} == loadautofunc ]]; then\n __dedalus_completion \"$@\"\nelse\n compdef __dedalus_completion 'dedalus'\nfi\n"; const fish = - "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\nset -g __dedalus_paths 'completion' 'upgrade' 'uninstall' 'machines' 'machines list' 'machines create' 'machines retrieve' 'machines update' 'machines delete' 'machines sleep' 'machines wake' 'machines reboot' 'machines resize' 'machines ssh' 'machines ssh list' 'machines ssh create' 'machines ssh retrieve' 'machines ssh delete' 'machines executions' 'machines executions list' 'machines executions create' 'machines executions retrieve' 'machines executions delete' 'machines executions output' 'machines executions events' 'machines executions logs' 'machines executions logs retrieve' 'machines executions logs create-token' 'machines autoresizing' 'machines autoresizing retrieve' 'machines autoresizing update' 'organization' 'organization autoresizing' 'organization autoresizing retrieve' 'organization autoresizing update' 'images' 'images list' 'images create' 'images retrieve' 'images update' 'images delete' 'images uploads' 'images uploads create' 'login' 'logout'\n\nfunction __dedalus_path\n set -l path ''\n set -l tokens (commandline -opc)\n for token in $tokens[2..-1]\n if string match -q -- '-*' $token\n continue\n end\n set -l candidate\n if test -z \"$path\"\n set candidate $token\n else\n set candidate \"$path $token\"\n end\n if contains -- $candidate $__dedalus_paths\n set path $candidate\n end\n end\n echo $path\nend\n\nfunction __dedalus_at --argument-names index\n set -l current (__dedalus_path)\n if test \"$index\" -eq 0\n test -z \"$current\"\n else\n test \"$current\" = \"$__dedalus_paths[$index]\"\n end\nend\n\ncomplete -c 'dedalus' -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines' -d 'machines commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'organization' -d 'organization commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'images' -d 'images commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'login' -d 'Sign in and save credentials for later commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'logout' -d 'Forget saved credentials, and revoke them if the provider supports it'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'completion' -d 'Print a shell completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'upgrade' -d 'Upgrade to the latest release'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'uninstall' -d 'Show how to remove this installation'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'help' -d 'Show help for a command'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'version' -d 'Print the CLI version'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'bash' -d 'Print a bash completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'zsh' -d 'Print a zsh completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'fish' -d 'Print a fish completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'check' -d 'Report the latest version without installing it'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'list' -d 'List machines'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'create' -d 'Create machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'retrieve' -d 'Get machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'update' -d 'Update machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'delete' -d 'Destroy machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'sleep' -d 'Sleep a running machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'wake' -d 'Wake a sleeping machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'reboot' -d 'Reboot a machine with fresh memory'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'resize' -d 'Resize machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ssh' -d 'ssh commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'executions' -d 'executions commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'image-id' -d 'Organization-owned ready custom image ID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'autosleep' -d 'The autosleep body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'storage-gib' -d 'The storage-gib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'force' -d 'Destroy from the last published filesystem checkpoint without publishing the Machine\\'s remaining...'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'force' -d 'Recover from the last committed filesystem checkpoint without guest cooperation'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'memory-mib' -d 'RAM in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'vcpu' -d 'CPU in 0.25-vCPU steps' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'list' -d 'List SSH sessions'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'create' -d 'Create SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'retrieve' -d 'Get SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'delete' -d 'Delete SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'public-key' -d 'The public-key body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'list' -d 'List executions'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'create' -d 'Create execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'retrieve' -d 'Get execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'delete' -d 'Delete execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'output' -d 'Get execution output'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'events' -d 'List execution events'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'logs' -d 'logs commands'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'command' -d 'The command body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'cwd' -d 'The cwd body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'env' -d 'The env body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'stdin' -d 'The stdin body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout-ms' -d 'The timeout-ms body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'retrieve' -d 'Get execution log status'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'create-token' -d 'Create execution log read token'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'retrieve' -d 'Read this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'update' -d 'Set this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -a 'retrieve' -d 'Read organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -a 'update' -d 'Set organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'list' -d 'List image IDs owned by the authenticated organization'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'create' -d 'Register an immutable OCI image for preparation'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'retrieve' -d 'Read preparation status for an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'update' -d 'Rename an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'delete' -d 'Delete an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -a 'uploads' -d 'uploads commands'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'credential-ref' -d 'The credential-ref body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'name' -d 'A label people use to tell images apart' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source' -d 'The source body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.kind' -d 'The source.kind body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.reference' -d 'The source.reference body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.sha256' -d 'The source.sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'source.upload-id' -d 'The source.upload-id body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'name' -d 'The new label, or null to clear it' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -a 'create' -d 'Reserve an immutable Docker image archive upload'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'sha256' -d 'The sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'size-bytes' -d 'The size-bytes body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'base-url' -d 'Sign in against this base URL instead of the default' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'flow' -d 'Sign-in flow to use: api-key, x-api-key, oauth-browser' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'base-url' -d 'Forget the credentials saved for this base URL (not with --all)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'all' -d 'Forget every saved credential, for every base URL'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'help' -d 'Show help for this command'\n"; + "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\nset -g __dedalus_paths 'completion' 'upgrade' 'uninstall' 'machines' 'machines list' 'machines create' 'machines retrieve' 'machines update' 'machines delete' 'machines sleep' 'machines wake' 'machines reboot' 'machines resize' 'machines ssh' 'machines ssh list' 'machines ssh create' 'machines ssh retrieve' 'machines ssh delete' 'machines executions' 'machines executions list' 'machines executions create' 'machines executions retrieve' 'machines executions delete' 'machines executions output' 'machines executions events' 'machines executions logs' 'machines executions logs retrieve' 'machines executions logs create-token' 'machines autoresizing' 'machines autoresizing retrieve' 'machines autoresizing update' 'machines ports' 'machines ports list' 'machines ports create' 'machines ports retrieve' 'machines ports update' 'machines ports delete' 'machines ports access-keys' 'machines ports access-keys list' 'machines ports access-keys mint' 'machines ports access-keys revoke' 'machines ports access-keys rotate' 'organization' 'organization autoresizing' 'organization autoresizing retrieve' 'organization autoresizing update' 'images' 'images list' 'images create' 'images retrieve' 'images update' 'images delete' 'images uploads' 'images uploads create' 'login' 'logout'\n\nfunction __dedalus_path\n set -l path ''\n set -l tokens (commandline -opc)\n for token in $tokens[2..-1]\n if string match -q -- '-*' $token\n continue\n end\n set -l candidate\n if test -z \"$path\"\n set candidate $token\n else\n set candidate \"$path $token\"\n end\n if contains -- $candidate $__dedalus_paths\n set path $candidate\n end\n end\n echo $path\nend\n\nfunction __dedalus_at --argument-names index\n set -l current (__dedalus_path)\n if test \"$index\" -eq 0\n test -z \"$current\"\n else\n test \"$current\" = \"$__dedalus_paths[$index]\"\n end\nend\n\ncomplete -c 'dedalus' -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines' -d 'machines commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'organization' -d 'organization commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'images' -d 'images commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'login' -d 'Sign in and save credentials for later commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'logout' -d 'Forget saved credentials, and revoke them if the provider supports it'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'completion' -d 'Print a shell completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'upgrade' -d 'Upgrade to the latest release'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'uninstall' -d 'Show how to remove this installation'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'help' -d 'Show help for a command'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'version' -d 'Print the CLI version'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'bash' -d 'Print a bash completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'zsh' -d 'Print a zsh completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'fish' -d 'Print a fish completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'check' -d 'Report the latest version without installing it'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'list' -d 'List machines'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'create' -d 'Create machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'retrieve' -d 'Get machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'update' -d 'Update machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'delete' -d 'Destroy machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'sleep' -d 'Sleep a running machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'wake' -d 'Wake a sleeping machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'reboot' -d 'Reboot a machine with fresh memory'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'resize' -d 'Resize machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ssh' -d 'ssh commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'executions' -d 'executions commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ports' -d 'ports commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'image-id' -d 'Organization-owned ready custom image ID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'autosleep' -d 'The autosleep body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'storage-gib' -d 'The storage-gib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'force' -d 'Destroy from the last published filesystem checkpoint without publishing the Machine\\'s remaining...'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'force' -d 'Recover from the last committed filesystem checkpoint without guest cooperation'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'memory-mib' -d 'RAM in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'vcpu' -d 'CPU in 0.25-vCPU steps' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'list' -d 'List SSH sessions'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'create' -d 'Create SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'retrieve' -d 'Get SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'delete' -d 'Delete SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'public-key' -d 'The public-key body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'list' -d 'List executions'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'create' -d 'Create execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'retrieve' -d 'Get execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'delete' -d 'Delete execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'output' -d 'Get execution output'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'events' -d 'List execution events'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'logs' -d 'logs commands'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'command' -d 'Program and its arguments as an array of strings, such as [\"ls\", \"-la\"]' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'cwd' -d 'The cwd body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'env' -d 'The env body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'stdin' -d 'The stdin body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout-ms' -d 'The timeout-ms body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'retrieve' -d 'Get execution log status'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'create-token' -d 'Create execution log read token'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'retrieve' -d 'Read this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'update' -d 'Set this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'list' -d 'List ports'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'create' -d 'Create port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'retrieve' -d 'Get port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'update' -d 'Update port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'delete' -d 'Delete port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'access-keys' -d 'access-keys commands'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'expires' -d 'Port lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'port' -d 'The port body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'protocol' -d 'The protocol body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'visibility' -d 'Who may reach the port' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'visibility' -d 'Who may reach the port' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'list' -d 'List port access keys'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'mint' -d 'Mint port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'revoke' -d 'Revoke port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'rotate' -d 'Rotate port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'expires-in' -d 'Lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'access-key-id' -d 'The access-key-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'access-key-id' -d 'The access-key-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'expires-in' -d 'Lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -a 'retrieve' -d 'Read organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -a 'update' -d 'Set organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'list' -d 'List images owned by the authenticated organization'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'create' -d 'Register an immutable OCI image for preparation'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'retrieve' -d 'Read preparation status for an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'update' -d 'Rename an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'delete' -d 'Delete an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'uploads' -d 'uploads commands'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'credential-ref' -d 'The credential-ref body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'name' -d 'A label people use to tell images apart' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source' -d 'The source body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.kind' -d 'The source.kind body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.reference' -d 'The source.reference body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.sha256' -d 'The source.sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.upload-id' -d 'The source.upload-id body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'name' -d 'The new label, or null to clear it' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 53' -a 'create' -d 'Reserve an immutable Docker image archive upload'\ncomplete -c 'dedalus' -n '__dedalus_at 53' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'sha256' -d 'The sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'size-bytes' -d 'The size-bytes body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'base-url' -d 'Sign in against this base URL instead of the default' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'flow' -d 'Sign-in flow to use: api-key, x-api-key, oauth-browser' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'base-url' -d 'Forget the credentials saved for this base URL (not with --all)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'all' -d 'Forget every saved credential, for every base URL'\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'help' -d 'Show help for this command'\n"; export const completions = { bash, zsh, fish } as const; diff --git a/src/cli/context.ts b/src/cli/context.ts new file mode 100644 index 0000000..e0a7e6f --- /dev/null +++ b/src/cli/context.ts @@ -0,0 +1,241 @@ +// Generated by the Scalar SDK Generator. Edits here are overwritten on the next generation. +import { Command, type Argument, type Option } from 'commander'; + +// The live command tree as JSON, printed by the hidden `context` command. +// +// The generator reads this JSON from the built CLI to render the man pages, the completion scripts, +// the README and SKILL.md and the manifest, so commands added beside the generated ones are +// documented like them. Its shape is versioned by `CLI_CONTEXT_VERSION`. + +/** Bumped when a field changes meaning, so the generator can refuse JSON it cannot read. */ +export const CLI_CONTEXT_VERSION = 1; + +/** A positional argument of a command. */ +export type ContextArgument = { + readonly name: string; + readonly description: string; + readonly required: boolean; + readonly variadic: boolean; + readonly default?: unknown; + readonly choices?: readonly string[]; +}; + +/** An option (flag) of a command. */ +export type ContextOption = { + /** The flags as written in help output, for example `-o, --output `. */ + readonly flags: string; + readonly description: string; + /** Whether the flag takes no value, requires one (``), or accepts one (`[value]`). */ + readonly value: 'none' | 'required' | 'optional'; + readonly variadic: boolean; + /** Whether the command refuses to run without this option. */ + readonly mandatory: boolean; + readonly default?: unknown; + readonly choices?: readonly string[]; + /** Environment variable the option falls back to. */ + readonly env?: string; +}; + +/** Where a command comes from: the API description, the runtime itself, or the CLI's custom code. */ +export type ContextSource = 'generated' | 'builtin' | 'custom'; + +/** + * What a custom command's `cli.command(path)` chain declared beyond Commander's own surface. Each + * field is absent when the chain left it at its default. + */ +export type ContextSwitches = { + readonly auth?: 'required' | 'optional' | 'none'; + readonly globals?: 'api' | 'output' | 'none'; + readonly interactive?: 'never' | 'optional' | 'required'; + readonly longRunning?: boolean; + readonly session?: 'none' | 'read' | 'write'; + /** Exit statuses the command owns, keyed by status, each with what it means. */ + readonly exitCodes?: Readonly>; + readonly examples?: readonly string[]; + /** Whether the command took over the generated command at the same path. */ + readonly replaces?: boolean; + /** Whether the command takes the argv after `--` as it is. */ + readonly passthrough?: boolean; +}; + +/** A command and its subcommands. */ +export type ContextCommand = { + readonly name: string; + /** The command path below the program, for example `["document", "validate"]`. */ + readonly path: readonly string[]; + /** The full invocation, for example `scalar document validate`. */ + readonly command: string; + /** The full usage line, for example `scalar document validate [options] `. */ + readonly usage: string; + readonly description: string; + readonly aliases: readonly string[]; + /** Whether the command does something itself. A group that only holds subcommands is not runnable. */ + readonly runnable: boolean; + /** Left out of `--help`; still described here, so a man page can say so. */ + readonly hidden?: true; + readonly source: ContextSource; + readonly switches?: ContextSwitches; + readonly arguments: readonly ContextArgument[]; + readonly options: readonly ContextOption[]; + readonly commands: readonly ContextCommand[]; +}; + +/** The whole command tree, as printed by ` context`. */ +export type CliContext = { + readonly contextVersion: typeof CLI_CONTEXT_VERSION; + readonly name: string; + readonly version: string; + readonly description: string; + /** Options accepted by the root command. */ + readonly options: readonly ContextOption[]; + readonly commands: readonly ContextCommand[]; +}; + +/** What the runtime records about a command, beside what Commander knows. */ +export type CommandMetadata = { + readonly source: ContextSource; + readonly switches?: ContextSwitches; +}; + +// Rides beside the Commander tree rather than on it, so nothing in Commander's own surface changes: +// a command that was never marked reads as custom, which is what a command added straight on +// `cli.program` is. +const metadata = new WeakMap(); + +// The `context` command itself, left out of the tree it prints: it is how the tree is read, not +// part of the CLI a reader uses. +const contextCommands = new WeakSet(); + +/** Records where a command came from and what its chain declared. A later mark replaces an earlier one. */ +export const markCommand = (command: Command, entry: CommandMetadata): void => { + metadata.set(command, entry); +}; + +/** What {@link markCommand} recorded for a command, if anything. */ +export const commandMetadata = (command: Command): CommandMetadata | undefined => metadata.get(command); + +/** Marks every command under `root` that has no mark yet, depth first. */ +export const markUnmarkedCommands = (root: Command, source: ContextSource): void => { + for (const child of root.commands) { + if (!metadata.has(child)) metadata.set(child, { source }); + markUnmarkedCommands(child, source); + } +}; + +// Commander keeps both of these on private fields with no public reader: `hidden` is only a +// constructor option, and whether a command has an action is not exposed at all. They are read +// through this shape, against the Commander major the generated package pins (`commander` ^14), and +// the generator's tests build a real tree to catch a rename. +type CommandInternals = { + readonly _hidden?: boolean; + readonly _actionHandler?: unknown; +}; + +/** Whether a command is left out of `--help` (`{ hidden: true }`, or `.hidden()` on a custom chain). */ +export const isHiddenCommand = (command: Command): boolean => + (command as unknown as CommandInternals)._hidden === true; + +/** Whether a command has an action of its own, as opposed to a group that only holds subcommands. */ +export const isRunnableCommand = (command: Command): boolean => + typeof (command as unknown as CommandInternals)._actionHandler === 'function'; + +/** Keeps a default only when JSON can carry it, so a parser's accumulator or a function never leaks in. */ +const jsonDefault = (value: unknown): { readonly default?: unknown } => { + if (value === undefined) return {}; + if (value === null || ['string', 'number', 'boolean'].includes(typeof value)) return { default: value }; + if (Array.isArray(value) && value.every((item) => ['string', 'number', 'boolean'].includes(typeof item))) { + return { default: value }; + } + return {}; +}; + +/** Describes one positional argument. */ +const toArgument = (argument: Argument): ContextArgument => ({ + name: argument.name(), + description: argument.description, + required: argument.required, + variadic: argument.variadic, + ...jsonDefault(argument.defaultValue), + ...(argument.argChoices ? { choices: argument.argChoices } : {}), +}); + +/** Describes one option. */ +const toOption = (option: Option): ContextOption => ({ + flags: option.flags, + description: option.description, + value: option.required ? 'required' : option.optional ? 'optional' : 'none', + variadic: option.variadic, + mandatory: option.mandatory, + ...jsonDefault(option.defaultValue), + ...(option.argChoices ? { choices: option.argChoices } : {}), + ...(option.envVar ? { env: option.envVar } : {}), +}); + +/** + * The options a command lists in `--help`, apart from `--help` itself: Commander adds that to every + * command outside `command.options`, so it says nothing about one command in particular. + */ +const visibleOptions = (command: Command): readonly ContextOption[] => + command.options.filter((option) => !option.hidden).map(toOption); + +/** Builds the tree for one command and everything under it. */ +const toCommand = (command: Command, parentPath: readonly string[], binary: string): ContextCommand => { + const path = [...parentPath, command.name()]; + const invocation = [binary, ...path].join(' '); + const entry = metadata.get(command); + return { + name: command.name(), + path, + command: invocation, + usage: `${invocation} ${command.usage()}`, + description: command.description(), + aliases: command.aliases(), + runnable: isRunnableCommand(command), + ...(isHiddenCommand(command) ? { hidden: true as const } : {}), + source: entry?.source ?? 'custom', + ...(entry?.switches ? { switches: entry.switches } : {}), + arguments: command.registeredArguments.map(toArgument), + options: visibleOptions(command), + commands: command.commands.map((child) => toCommand(child, path, binary)), + }; +}; + +/** + * Describes the CLI from its root command: every command with its arguments, options and recorded + * switches. Commands are listed in registration order, the order `--help` uses. + */ +export const buildCliContext = (program: Command): CliContext => ({ + contextVersion: CLI_CONTEXT_VERSION, + name: program.name(), + version: program.version() ?? '', + description: program.description(), + options: visibleOptions(program), + commands: program.commands + .filter((command) => !contextCommands.has(command)) + .map((command) => toCommand(command, [], program.name())), +}); + +/** Flattens the tree into every runnable command, depth first. */ +export const runnableCommands = (commands: readonly ContextCommand[]): readonly ContextCommand[] => + commands.flatMap((command) => [ + ...(command.runnable ? [command] : []), + ...runnableCommands(command.commands), + ]); + +/** Name of the hidden command that prints {@link buildCliContext}; reserved at the root. */ +export const CONTEXT_COMMAND_NAME = 'context'; + +/** + * Registers the hidden `context` command. It prints the tree of the program it is attached to when it + * runs, not when it is registered, so commands added afterwards (by custom code) are part of it. + */ +export const addContextCommand = (program: Command, configure: (command: Command) => Command): void => { + const command = configure(new Command(CONTEXT_COMMAND_NAME)) + .description('Print the command tree as JSON') + .action(() => { + process.stdout.write(`${JSON.stringify(buildCliContext(program), null, 2)}\n`); + }); + markCommand(command, { source: 'builtin' }); + contextCommands.add(command); + program.addCommand(command, { hidden: true }); +}; diff --git a/src/cli/login.ts b/src/cli/login.ts index c0107ac..5f92ff8 100644 --- a/src/cli/login.ts +++ b/src/cli/login.ts @@ -3,7 +3,6 @@ import { spawn } from 'node:child_process'; import { createHash, randomBytes, timingSafeEqual } from 'node:crypto'; import { createServer } from 'node:http'; -import { createInterface } from 'node:readline'; import { stderr as processStderr, stdin as processStdin } from 'node:process'; import { @@ -22,6 +21,7 @@ import { } from './credentials'; import { windowsPowerShell } from './keychain'; import { clip, listRow } from './list'; +import { inputDisabled, promptLine } from './prompt'; /** Which API an OAuth token is for. Mirrors the emitter's `CliOauthTargetDefinition`. */ export type CliOauthTargetDefinition = { @@ -705,7 +705,7 @@ const captureCredentials = async ( return { credentials: { [method.clientKey]: value } }; } if (method.kind === 'basic') { - const username = await promptLine('Username: '); + const username = await promptLoginLine('Username: '); if (!username) throw new UsageError('No username entered; nothing was saved.'); const password = await promptSecret('Password: '); if (!password) throw new UsageError('No password entered; nothing was saved.'); @@ -842,7 +842,7 @@ const runTokenGrant = async ( } if (method.grant === 'deviceAuthorization') return deviceAuthorizationFlow(method, baseUrl); if (method.grant === 'clientCredentials') { - const clientId = method.clientId ?? (await promptLine('Client id: ')); + const clientId = method.clientId ?? (await promptLoginLine('Client id: ')); if (!clientId) throw new UsageError('No client id entered; nothing was saved.'); const clientSecret = await promptSecret('Client secret: '); if (!clientSecret) throw new UsageError('No client secret entered; nothing was saved.'); @@ -860,8 +860,8 @@ const runTokenGrant = async ( // having to be baked into the generated source. It stays optional, unlike there: RFC 6749 lets a // client that authenticates some other way leave it out, so a blank answer omits the parameter // rather than sending an empty one, and the prompt says which it is. - const clientId = method.clientId ?? (await promptLine('Client id (optional): ')); - const username = await promptLine('Username: '); + const clientId = method.clientId ?? (await promptLoginLine('Client id (optional): ')); + const username = await promptLoginLine('Username: '); if (!username) throw new UsageError('No username entered; nothing was saved.'); const password = await promptSecret('Password: '); if (!password) throw new UsageError('No password entered; nothing was saved.'); @@ -969,7 +969,7 @@ const deviceAuthorizationFlow = async ( // Discovered before the client id is asked for, so a provider that cannot run this grant fails // the sign-in before the user has been asked to type anything. const endpoints = 'metadataUrl' in method ? await discoverDeviceEndpoints(method, baseUrl) : method; - const clientId = method.clientId ?? (await promptLine('Client id: ')); + const clientId = method.clientId ?? (await promptLoginLine('Client id: ')); if (!clientId) throw new UsageError('No client id entered; nothing was saved.'); const device = await requestDeviceAuthorization(endpoints.deviceAuthorizationUrl, baseUrl, { client_id: clientId, @@ -1830,7 +1830,8 @@ type HeldRedirect = { * caller answers it through `respond` once the rest of the sign-in has succeeded or failed. * * Anything that is not the redirect — a browser probing `/favicon.ico`, a stray request to the - * port — is answered 404 and ignored, so it cannot resolve or reject the wait. The `state` is + * port — is answered 404 and ignored, so it cannot resolve or reject the wait. A redirect that + * repeats a parameter it reads is rejected first (see {@link repeatedRedirectParameter}). The `state` is * compared in constant time and rejected on mismatch, which is what ties the redirect back to the * request this process started; the `iss` is then held to `issuer` (see {@link redirectIssuerProblem}). */ @@ -1887,7 +1888,7 @@ const awaitRedirect = ( settled = true; // scalar-sdk-generator:custom-code oauth-callback-singletons:start // Reject ambiguous callbacks before selecting any security-sensitive value. - if (['state', 'iss', 'code', 'error'].some((name) => params.getAll(name).length > 1)) { + if (repeatedRedirectParameter(params) !== undefined) { finish( 400, 'Sign-in could not be verified', @@ -1963,6 +1964,24 @@ const awaitRedirect = ( server.on('error', reject); }); +/** The redirect parameters this handler reads, each of which a provider sends at most once. */ +const SINGLE_REDIRECT_PARAMETERS = ['state', 'code', 'iss', 'error'] as const; + +/** + * The first parameter the redirect carries more than once, of those the handler reads, or + * `undefined` when each appears at most once. + * + * RFC 6749 §3.1 says request and response parameters must not be included more than once. The + * check matters because `URLSearchParams.get` returns the first value and silently drops the rest: + * `?state=&state=` would pass the `state` check on a value the provider may never + * have meant as the only one, and `?code=a&code=b` would exchange whichever code came first while + * anything else that sees the callback URL — a local proxy or logger, browser history, an extension — + * may read the other. A redirect that two readers can disagree about is refused before any of it is + * trusted. + */ +const repeatedRedirectParameter = (params: URLSearchParams): string | undefined => + SINGLE_REDIRECT_PARAMETERS.find((name) => params.getAll(name).length > 1); + /** The issuer a browser redirect is held to, and whether it must name one at all. */ type RedirectIssuer = { readonly expected: string | undefined; readonly required: boolean }; @@ -2289,6 +2308,15 @@ export class UsageError extends Error {} const NO_TERMINAL = 'Sign-in needs an interactive terminal. Run it from a terminal, pick a flow that needs no prompt with --flow (see --help), or set the credential through its flag or environment variable instead.'; +const NO_INPUT = + 'Sign-in would prompt, and --no-input turns prompting off. Pick a flow that needs no prompt with --flow (see --help), or set the credential through its flag or environment variable instead.'; + +/** + * Why a sign-in prompt cannot run: `--no-input` when it was passed, since telling a user at a + * terminal to run the command from one would send them in a circle, and otherwise no terminal. + */ +const promptRefused = (): UsageError => new UsageError(inputDisabled() ? NO_INPUT : NO_TERMINAL); + /** Puts the terminal cursor back, for the picker's own exit paths and for a signal that skips them. */ const restoreCursor = (): void => { processStderr.write('\u001b[?25h'); @@ -2316,8 +2344,8 @@ type Choice = { * Drawn on stderr, like every other prompt, so stdout stays machine-readable. */ const promptChoice = async (heading: string, choices: readonly Choice[]): Promise => { - if (!processStdin.isTTY || typeof processStdin.setRawMode !== 'function') { - throw new UsageError(NO_TERMINAL); + if (!processStdin.isTTY || inputDisabled() || typeof processStdin.setRawMode !== 'function') { + throw promptRefused(); } return new Promise((resolve, reject) => { let active = 0; @@ -2452,26 +2480,19 @@ const promptChoice = async (heading: string, choices: readonly Choice[]): Promis }); }; -/** Reads one visible line from the terminal. Prompts go to stderr so stdout stays machine-readable. */ -const promptLine = (label: string): Promise => - new Promise((resolve, reject) => { - if (!processStdin.isTTY) { - reject(new UsageError(NO_TERMINAL)); - return; - } - const rl = createInterface({ input: processStdin, output: processStderr }); - let answered = false; - // Closing the interface emits 'close' synchronously, so the guard is what keeps the end-of-input - // fallback from resolving ahead of the answer that was just typed. - rl.on('close', () => { - if (!answered) resolve(''); - }); - rl.question(label, (answer) => { - answered = true; - resolve(answer.trim()); - rl.close(); - }); - }); +/** + * Reads one visible line for sign-in, through the reader every prompt in the CLI shares. + * + * Sign-in gates on stdin (and `--no-input`) as its other prompts do, rather than on `canPrompt`, + * so a redirected stderr still lets a user type their username. End of input still reads as an empty answer (each caller reports what was not + * entered), while Ctrl-C cancels like it does in the picker and the secret prompt. + */ +const promptLoginLine = async (label: string): Promise => { + if (!processStdin.isTTY || inputDisabled()) throw promptRefused(); + const answer = await promptLine(label); + if (answer === undefined) throw new UsageError('Cancelled.'); + return answer; +}; /** * Reads one secret from the terminal without echoing it. @@ -2483,8 +2504,8 @@ const promptLine = (label: string): Promise => */ const promptSecret = (label: string): Promise => new Promise((resolve, reject) => { - if (!processStdin.isTTY || typeof processStdin.setRawMode !== 'function') { - reject(new UsageError(NO_TERMINAL)); + if (!processStdin.isTTY || inputDisabled() || typeof processStdin.setRawMode !== 'function') { + reject(promptRefused()); return; } processStderr.write(label); diff --git a/src/cli/prompt.ts b/src/cli/prompt.ts new file mode 100644 index 0000000..4fbb5e2 --- /dev/null +++ b/src/cli/prompt.ts @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { stderr as processStderr, stdin as processStdin } from 'node:process'; +import { createInterface } from 'node:readline'; + +// Set by `--no-input`, which the program records before any command runs. +let noInput = false; + +/** + * Records whether `--no-input` was passed, on every parse rather than only when it was: the package + * exports `run`, so one process can parse twice, and a flag from the first run must not carry over. + */ +export const setNoInput = (value: boolean): void => { + noInput = value; +}; + +/** Whether `--no-input` was passed, for a prompt with its own terminal checks (sign-in). */ +export const inputDisabled = (): boolean => noInput; + +/** + * Whether this invocation can put a question to a person. + * + * Not with `--no-input`, which says so outright. Otherwise both ends have to be a terminal: the + * question is written to stderr so stdout stays machine-readable, and an answer has to come from + * stdin. Under CI both can still be terminals (a runner that allocates a pseudo-terminal), and + * nobody is there to answer, so a set `CI` counts as no terminal at all. + */ +export const canPrompt = (): boolean => + !noInput && Boolean(processStdin.isTTY) && Boolean(processStderr.isTTY) && !runningInCi(); + +/** + * Whether `CI` says this is a CI run. `CI=false` and `CI=0` are exported by hand to say the opposite, + * so they count as unset, as does an empty value. + */ +const runningInCi = (): boolean => { + const value = process.env.CI?.trim().toLowerCase(); + return value !== undefined && value !== '' && value !== 'false' && value !== '0'; +}; + +/** + * Reads one visible line from the terminal, writing the question to stderr. + * + * Resolves the trimmed answer, an empty string when the input ends before a line arrives, or + * `undefined` when the user presses Ctrl-C. readline owns the terminal while it reads, so Ctrl-C + * reaches it as a keystroke rather than as a signal, and without a listener of its own it would be + * indistinguishable from end of input. + */ +export const promptLine = (label: string): Promise => + new Promise((resolve) => { + const rl = createInterface({ input: processStdin, output: processStderr }); + let settled = false; + const settle = (answer: string | undefined): void => { + if (settled) return; + settled = true; + resolve(answer); + rl.close(); + }; + rl.on('close', () => { + if (!settled) processStderr.write('\n'); + settle(''); + }); + rl.on('SIGINT', () => { + processStderr.write('\n'); + settle(undefined); + }); + rl.question(label, (answer) => settle(answer.trim())); + }); diff --git a/src/cli/runtime.ts b/src/cli/runtime.ts index 9e2b243..462a7ff 100644 --- a/src/cli/runtime.ts +++ b/src/cli/runtime.ts @@ -4,10 +4,12 @@ import { accessSync, constants as fsConstants, createReadStream, readFileSync } import { stdin as processStdin, stdout as processStdout } from 'node:process'; import as from 'ansis'; -import { Command } from 'commander'; +import { Command, Option } from 'commander'; import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'; +import { addContextCommand, markCommand, markUnmarkedCommands } from './context.js'; import { listRow } from './list'; +import { setNoInput } from './prompt'; import { encodeToon } from './toon.js'; import { takeWarnings } from './credentials'; import { type CliAuthDefinition, UsageError, runLogin, runLogout, storedCredentials } from './login'; @@ -163,6 +165,7 @@ export type GlobalOptions = { readonly transformError?: string; readonly rawOutput?: boolean; readonly debug?: boolean; + readonly noInput?: boolean; readonly maxItems?: string; }; @@ -194,11 +197,7 @@ export const createProgram = ({ .option('--base-url ', 'Override the base URL for API requests') .option('--timeout ', 'Request timeout in milliseconds') .option('--max-retries ', 'Number of retries for retryable failures') - .option( - '--format ', - 'Output format: auto, json, jsonl, pretty, raw, toon, yaml', - defaultFormat, - ) + .option('--format ', 'Output format: auto, json, jsonl, pretty, raw, toon, yaml', defaultFormat) .option( '--format-error ', 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml', @@ -207,7 +206,12 @@ export const createProgram = ({ .option('--transform ', 'Dot-path transform for data output') .option('--transform-error ', 'Dot-path transform for error output') .option('-r, --raw-output', 'Print transformed string values without JSON quotes') - .option('--debug', 'Enable SDK debug logging'); + .option('--debug', 'Enable SDK debug logging') + .addOption(noInputOption()); + + program.hook('preAction', (_program, actionCommand) => { + setNoInput(actionCommand.optsWithGlobals().noInput === true); + }); // Registered only for an API that declares more than one environment, because that is when the // embedded SDK accepts an `environment` option at all. No Commander default is set: the SDK @@ -231,6 +235,12 @@ export const createProgram = ({ if (completions) addCompletionCommand(program, binaryName, completions); if (auth) addAuthCommands(program, auth, selection); + // Everything registered above that `addGeneratedCommand` did not mark is the runtime's own + // (`completion`, `login`, `upgrade`, …), and `context` describes it that way. Registered last, so + // the hidden `context` command never shadows a name the commands above claimed. + markUnmarkedCommands(program, 'builtin'); + addContextCommand(program, usageExitCode); + return program; }; @@ -491,6 +501,7 @@ const addAuthCommands = ( .showHelpAfterError() .option('--base-url ', 'Sign in against this base URL instead of the default') .option('--flow ', 'Sign-in flow to use: ' + flows) + .addOption(noInputOption()) .addHelpText('after', authFlowHelp(auth)) .action(async (_options: unknown, command: Command) => { const options = command.optsWithGlobals(); @@ -572,6 +583,14 @@ const credentialBaseUrl = ( const authFlowHelp = (auth: CliAuthDefinition): string => '\nSign-in flows:\n' + auth.methods.map((method) => ' ' + method.name + ' ' + method.label).join('\n'); +// `--no-input` as a plain switch read as `noInput`, not as Commander's negation of `--input`: a +// spec param named `input` registers `--input `, and a negation would write `false` into it. +const noInputOption = (): Option => { + const option = new Option('--no-input', 'Never prompt; a command that would ask fails instead'); + option.negate = false; + return option; +}; + const clientOptionDescription = (option: CliClientOptionDefinition): string => { const parts: string[] = []; if (option.description) parts.push(option.description); @@ -631,14 +650,12 @@ const addGeneratedCommand = ( .option('--timeout ', 'Request timeout in milliseconds') .option('--max-retries ', 'Number of retries for retryable failures') .option('--format ', 'Output format: auto, json, jsonl, pretty, raw, toon, yaml') - .option( - '--format-error ', - 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml', - ) + .option('--format-error ', 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml') .option('--transform ', 'Dot-path transform for data output') .option('--transform-error ', 'Dot-path transform for error output') .option('-r, --raw-output', 'Print transformed string values without JSON quotes') - .option('--debug', 'Enable SDK debug logging'); + .option('--debug', 'Enable SDK debug logging') + .addOption(noInputOption()); // Mirrored on the subcommand for the same reason the client options below are: so it can be // passed before or after the verb. Registered only when the API declares more than one @@ -653,10 +670,7 @@ const addGeneratedCommand = ( } if (definition.iterable) - command.option( - '--max-items ', - 'Maximum number of streamed items to print; use -1 for unlimited', - ); + command.option('--max-items ', 'Maximum number of streamed items to print; use -1 for unlimited'); // Positionals are registered as optional Commander arguments because each one is also // accepted as an equivalent flag (e.g. `workers retrieve wkr_1` or `workers retrieve --id @@ -709,6 +723,10 @@ const addGeneratedCommand = ( }); parent.addCommand(command); + // Recorded for `context`: the command and every group on its path come from the API description. + markCommand(command, { source: 'generated' }); + for (let group: Command | null = parent; group?.parent; group = group.parent) + markCommand(group, { source: 'generated' }); }; const ensureCommandPath = ( @@ -784,13 +802,14 @@ const runGeneratedCommand = async ( let diagnostics: ReturnType | undefined; try { const clientConfig = await sdkClientOptions( - rootOptions, command, clientOptions, auth, definition.authClientKeyRequirements, environment, - ); - const call = await callArguments( - definition, - command.opts>(), - positionalValues, + rootOptions, + command, + clientOptions, + auth, + definition.authClientKeyRequirements, + environment, ); + const call = await callArguments(definition, command.opts>(), positionalValues); const organization = call.params['X-Dedalus-Org-Id']; const scopeOptions = organization === undefined ? clientConfig : { ...clientConfig, dedalusOrgID: organization }; @@ -798,7 +817,12 @@ const runGeneratedCommand = async ( 'dedalus ' + definition.commandPath.join(' '), diagnosticScope(scopeOptions), ); - const client = buildClient(SDK, { ...clientConfig, fetch: diagnostics.fetch }, clientOptions, environment); + const client = buildClient( + SDK, + { ...clientConfig, fetch: diagnostics.fetch }, + clientOptions, + environment, + ); const method = sdkMethod(client, definition); // Required positionals are validated here (not by Commander) because each one may also be @@ -862,8 +886,11 @@ export const sdkClientOptions = async ( forwarded[option.sdkKey] = typeof value === 'string' ? clientOptionValue(value, option) : value; } await applyStoredCredentials(forwarded, clientOptions, requirements, auth, options.baseUrl, environment); - const organization = commandOptions['xDedalusOrgId'] ?? rootOptions['xDedalusOrgId'] ?? - forwarded['dedalusOrgID'] ?? process.env['DEDALUS_ORG_ID']; + const organization = + commandOptions['xDedalusOrgId'] ?? + rootOptions['xDedalusOrgId'] ?? + forwarded['dedalusOrgID'] ?? + process.env['DEDALUS_ORG_ID']; if (organization !== undefined) forwarded['dedalusOrgID'] = organization; return routeBrowserCredential({ ...(options.baseUrl?.trim() ? { baseURL: options.baseUrl.trim() } : {}), @@ -1014,10 +1041,7 @@ const callArguments = async ( return { args: [...positionalArgs, paramsValue(sdkParams, definition), undefined], params }; }; -const paramsValue = ( - params: Record, - definition: CliCommandDefinition, -): unknown => { +const paramsValue = (params: Record, definition: CliCommandDefinition): unknown => { if (definition.bodyParamKey === undefined) return params; const body = params[definition.bodyParamKey]; if (body === undefined) return params; @@ -1039,9 +1063,7 @@ const bodyValue = (params: Record, definition: CliCommandDefini } // A flattenable body is reassembled from its per-property flags into a single object. Leaf flags // share their parent property key, so keying by paramKey collapses them back onto that property. - const bodyFlags = definition.flags.filter( - (flag) => flag.location === 'body' && flag.paramKey !== 'send', - ); + const bodyFlags = definition.flags.filter((flag) => flag.location === 'body' && flag.paramKey !== 'send'); const body: Record = {}; for (const flag of bodyFlags) { if (params[flag.paramKey] !== undefined) body[flag.paramKey] = params[flag.paramKey]; @@ -1135,10 +1157,7 @@ const mergeObjects = ( ...Object.fromEntries(Object.entries(overlay).filter(([, value]) => value !== undefined)), }); -const omitParams = ( - params: Record, - names: readonly string[], -): Record => { +const omitParams = (params: Record, names: readonly string[]): Record => { const out = { ...params }; for (const name of names) delete out[name]; return out; @@ -1345,7 +1364,8 @@ const coerceValue = ( // marker honest about what follows, and leaves every other format untouched. const streamItemText = (value: unknown, options: OutputOptions): string => { if (options.format !== 'toon') return serializeOutput(value, options); - if (options.rawOutput && typeof value === 'string') return value; + if (options.rawOutput && typeof value === 'string') + return processStdout.isTTY ? stripControls(value) : value; return serializeOutput([value], options); }; @@ -1457,10 +1477,7 @@ export const writeOutput = async (value: unknown, options: OutputOptions): Promi processStdout.write(serializeOutput(transformValue(value, options.transform), options) + '\n'); }; -const collectIterable = async ( - value: AsyncIterable, - maxItems?: number, -): Promise => { +const collectIterable = async (value: AsyncIterable, maxItems?: number): Promise => { const items: unknown[] = []; for await (const item of value) { if (maxItems === 0) break; @@ -1474,17 +1491,45 @@ const collectIterable = async ( // human-readable card view, matching common CLI defaults. const serializeOutput = (value: unknown, options: OutputOptions): string => { const normalized = options.format === 'auto' ? 'json' : options.format; - if (options.rawOutput && typeof value === 'string') return value; + const tty = Boolean(processStdout.isTTY); + if (options.rawOutput && typeof value === 'string') return tty ? stripControls(value) : value; const safeValue = value === undefined ? null : value; - if (normalized === 'raw') return typeof safeValue === 'string' ? safeValue : JSON.stringify(safeValue); - if (normalized === 'yaml') return stringifyYaml(JSON.parse(JSON.stringify(safeValue))).trimEnd(); - if (normalized === 'jsonl') return JSON.stringify(safeValue); + if (normalized === 'raw' && typeof safeValue === 'string') + return tty ? stripControls(safeValue) : safeValue; if (normalized === 'pretty') return prettyCard(safeValue, options); + const text = serializeData(safeValue, normalized); + return tty ? escapeControls(text) : text; +}; + +/** The machine-readable formats, which a pipe receives byte for byte. */ +const serializeData = (value: unknown, format: OutputFormat): string => { + if (format === 'raw' || format === 'jsonl') return JSON.stringify(value); + if (format === 'yaml') return stringifyYaml(JSON.parse(JSON.stringify(value))).trimEnd(); // TOON keeps the JSON data model but drops repeated syntax, so a list response costs an agent // markedly fewer context tokens than the same data as JSON. - if (normalized === 'toon') return encodeToon(JSON.parse(JSON.stringify(safeValue))); - return JSON.stringify(safeValue, null, 2); -}; + if (format === 'toon') return encodeToon(JSON.parse(JSON.stringify(value))); + return JSON.stringify(value, null, 2); +}; + +// Server-supplied text reaching a terminal can carry commands: ESC and U+009B (a one-character +// CSI) start sequences that recolour, move the cursor, retitle the window or overwrite earlier +// output. `JSON.stringify` escapes C0 but passes C1 and DEL through, and YAML quotes but keeps +// them, so text bound for a terminal is cleaned here. Tab, newline and a CRLF line ending are +// layout, not commands; a lone CR is not, since it returns the cursor to overwrite the line. +// A pipe or file still gets the exact bytes, which is what a script reading the output needs; only +// the `pretty` card, laid out for a person, is cleaned wherever it goes. +// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the point. +const TERMINAL_CONTROLS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]|\r(?!\n)/gu; + +/** Replaces every terminal control character in free text, for output a person reads. */ +const stripControls = (text: string): string => text.replace(TERMINAL_CONTROLS, '\ufffd'); + +/** + * Writes every control character a serializer left raw as a `\uXXXX` escape. In JSON and YAML + * they can only sit inside quoted strings, where that escape is valid syntax for the same text. + */ +const escapeControls = (text: string): string => + text.replace(TERMINAL_CONTROLS, (char) => '\\u' + char.charCodeAt(0).toString(16).padStart(4, '0')); // Human-readable `pretty` view: a bordered key/value card titled with the command path, // rendering booleans as yes/no and array entries as numbered items. @@ -1511,20 +1556,25 @@ const prettyLines = (value: unknown, indent: string): string[] => { if (value && typeof value === 'object') { return Object.entries(value as Record).flatMap(([key, entry]) => { if (entry && typeof entry === 'object') - return [indent + key + ':', ...prettyLines(entry, indent + ' ')]; - return [indent + key + ': ' + prettyScalar(entry)]; + return [indent + cardText(key) + ':', ...prettyLines(entry, indent + ' ')]; + return [indent + cardText(key) + ': ' + prettyScalar(entry)]; }); } return [indent + prettyScalar(value)]; }; +// The card is laid out line by line, so a value or key keeps no control character at all: a +// newline would break the frame as surely as an escape sequence would rewrite it. const prettyScalar = (value: unknown): string => { if (value === true) return 'yes'; if (value === false) return 'no'; if (value === null || value === undefined) return ''; - return String(value); + return cardText(String(value)); }; +/** Text for one line of the pretty card: every control character, tab and newline included, removed. */ +const cardText = (text: string): string => stripControls(text).replace(/\r?\n|\t/gu, ' '); + export const writeError = async ( error: unknown, options: OutputOptions, @@ -1533,20 +1583,24 @@ export const writeError = async ( environment: string | undefined = undefined, ): Promise => { const body = transformValue(errorBody(error, clientOptions, SDK, environment), options.transform); + // An error body is the server's text too, so a terminal gets it cleaned like any other output. + const tty = Boolean(process.stderr.isTTY); if (options.rawOutput && typeof body === 'string') { - process.stderr.write(body + '\n'); + process.stderr.write((tty ? stripControls(body) : body) + '\n'); return; } if (options.format === 'raw') { // The hint is appended rather than dropped: before failures were classified, the auth hint // *was* the message, so printing the message alone would lose advice `raw` used to show. const hint = errorHintText(body); - process.stderr.write(String(errorMessage(body)) + (hint ? ' ' + hint : '') + '\n'); + const message = String(errorMessage(body)) + (hint ? ' ' + hint : ''); + process.stderr.write((tty ? stripControls(message) : message) + '\n'); return; } const output = options.format === 'auto' ? 'pretty' : options.format; const safeBody = body === undefined ? null : body; - const serialized = serializeErrorBody(safeBody, output); + const raw = serializeErrorBody(safeBody, output); + const serialized = tty ? escapeControls(raw) : raw; process.stderr.write((output === 'pretty' ? as.red(serialized) : serialized) + '\n'); }; @@ -1617,15 +1671,9 @@ const errorCode = (record: Record, SDK: CreateProgramOptions['S const CONNECTION_ERROR_CODE = /^(ECONN|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|EHOSTUNREACH|ENETUNREACH|EPIPE|UND_ERR)/u; -const isConnectionError = ( - record: Record, - SDK: CreateProgramOptions['SDK'], -): boolean => { +const isConnectionError = (record: Record, SDK: CreateProgramOptions['SDK']): boolean => { const connectionError = (SDK as { APIConnectionError?: unknown }).APIConnectionError; - if ( - typeof connectionError === 'function' && - record instanceof (connectionError as new () => unknown) - ) + if (typeof connectionError === 'function' && record instanceof (connectionError as new () => unknown)) return true; const name = typeof record.name === 'string' ? record.name : ''; const code = typeof record.code === 'string' ? record.code : ''; @@ -1678,6 +1726,7 @@ const authHint = ( ): string | undefined => { const authOptions = clientOptions.filter((option) => option.auth); if (authOptions.length === 0) return undefined; + const flags = authOptions.map((option) => '--' + option.name).join(', '); const env = authOptions .map((option) => option.env) .filter((value): value is string => !!value) @@ -1685,7 +1734,8 @@ const authHint = ( return ( 'Authentication failed. Run `' + loginCommandFor(environment) + - '`' + + '`, pass ' + + flags + (env ? ', or set ' + env : '') + ', and try again.' ); diff --git a/src/cli/upgrade.ts b/src/cli/upgrade.ts index 3eca116..8a3f427 100644 --- a/src/cli/upgrade.ts +++ b/src/cli/upgrade.ts @@ -13,9 +13,10 @@ import { realpathSync, renameSync, rmSync, + statSync, writeFileSync, } from 'node:fs'; -import { tmpdir } from 'node:os'; +import { homedir, tmpdir } from 'node:os'; import { basename, dirname, isAbsolute, join } from 'node:path'; import type { Command } from 'commander'; @@ -33,8 +34,19 @@ const RELEASE = { brewFormula: 'dedalus', windowsArchive: true, } as { - readonly repo: string; + /** + * The destination repository as `owner/repo`, which every GitHub Release request is addressed by. + * Absent for a CLI published to npm alone without one: nothing it ships is downloaded from GitHub. + */ + readonly repo?: string; readonly npmPackage?: string; + /** The dist-tag stable npm releases land on, when the config moves them off `latest`. */ + readonly npmDistTag?: string; + /** + * Set when the npm package is not published `public`. The registry shows such a package only to a + * signed-in npm, and this module sends no credentials, so an npm install of it is never checked. + */ + readonly npmRestricted?: boolean; readonly brewFormula?: string; readonly windowsArchive?: boolean; }; @@ -69,6 +81,11 @@ type InstallKind = * most it can honestly do for an install it did not make and cannot drive. */ readonly run?: ManagerCommand; + /** + * Set for `npx`, `bunx` and `pnpm dlx`, which run the package out of a cache rather than an + * install: there is nothing for `upgrade` to replace or run, and `upgrade` says so. + */ + readonly cached?: boolean; }; /** @@ -88,6 +105,12 @@ type ManagerCommand = { readonly refresh?: readonly string[]; /** Prints ` ...`, so `upgrade` can tell an upgrade from a manager that did nothing. */ readonly installedVersions?: readonly string[]; + /** + * Set for a global install by an npm-registry client (npm, pnpm, Yarn or Bun), whose own command the + * daily notice names in place of `upgrade`: it is the command such a user already knows, and it + * installs exactly what the notice compared against. + */ + readonly registryClient?: boolean; }; /** @@ -119,11 +142,11 @@ const resolvedPath = (path: string): string => { * Symlinks are resolved first because that is what distinguishes the cases: Homebrew links * `/usr/local/bin/` into its Cellar, so only the real path shows which manager owns the file. */ -const detectInstall = (binaryName: string): InstallKind => { +const detectInstall = (binaryName: string, distTag = stableDistTag()): InstallKind => { const executable = process.execPath; // A compiled standalone executable *is* the command; running under `node`/`bun` instead means this // is the npm package (or a checkout of it), and the script's own path says which manager owns it. - if (!runsCompiled(executable, binaryName)) return detectPackageInstall(); + if (!runsCompiled(executable, binaryName)) return detectPackageInstall(distTag); const path = resolvedPath(executable); @@ -182,7 +205,7 @@ const detectInstall = (binaryName: string): InstallKind => { // so the honest answer is to name the archive and let the user put it in place. Reported as // `managed` because the outcome is the same: someone else does the work. if (process.platform === 'win32') { - return RELEASE.windowsArchive + return RELEASE.windowsArchive && RELEASE.repo ? { kind: 'managed', manager: 'a direct download', @@ -198,6 +221,16 @@ const detectInstall = (binaryName: string): InstallKind => { remove: `remove ${path}`, }; } + // A compiled executable with no GitHub Release to replace it from: the config publishes no archive + // this could have come from, so whatever put it here is what has to replace it. + if (!RELEASE.repo) { + return { + kind: 'managed', + manager: 'however it was installed', + upgrade: `reinstall ${binaryName} the way it was installed; no release archive is published for it to download`, + remove: `remove ${path}`, + }; + } return { kind: 'self-managed', path }; }; @@ -236,7 +269,7 @@ const brewProgram = (path: string): string | undefined => { * no fixed marker — its prefix is configurable — so it is what remains once the others are ruled out, * and whether it is global at all is settled by asking npm when `upgrade` actually runs. */ -const detectPackageInstall = (): InstallKind => { +const detectPackageInstall = (distTag: string): InstallKind => { const script = resolvedPath(process.argv[1] ?? ''); const pkg = RELEASE.npmPackage; // Not inside any `node_modules`: this is a checkout being run directly, which only git can update. @@ -247,7 +280,7 @@ const detectPackageInstall = (): InstallKind => { return { kind: 'managed', manager: 'the package manager that installed it', - upgrade: `reinstall ${RELEASE.repo} with the package manager that installed it; no npm package is published for it`, + upgrade: `reinstall ${RELEASE.repo ?? 'it'} with the package manager that installed it; no npm package is published for it`, remove: 'remove it with the package manager that installed it', }; } @@ -274,8 +307,9 @@ const detectPackageInstall = (): InstallKind => { return { kind: 'managed', manager: runner, - upgrade: `${runner} ${pkg}@latest`, + upgrade: `${runner} ${pkg}@${distTag}`, remove: `nothing to remove; ${runner} keeps the package only in its cache`, + cached: true, }; } // Yarn's Plug'n'Play has no `node_modules` tree: it serves each package out of a zip, in the project's @@ -298,14 +332,14 @@ const detectPackageInstall = (): InstallKind => { // Bun's own binary sits beside its global tree (`$BUN_INSTALL/bin/bun`); `bun` on PATH otherwise. const local = join(bunRoot, 'bin', process.platform === 'win32' ? 'bun.exe' : 'bun'); const bun = existsSync(local) ? local : 'bun'; - return managerInstall('Bun', bun, ['add', '-g', `${pkg}@latest`], `bun remove -g ${pkg}`, safe); + return managerInstall('Bun', bun, ['add', '-g', `${pkg}@${distTag}`], `bun remove -g ${pkg}`, safe); } // pnpm's global tree is `/global//`, holding its `.pnpm` store or the // `node_modules` linked from it. Matched on that layout rather than on a `pnpm` segment, because // `PNPM_HOME` is whatever the user set (`~/.pnpm-home`, say), and nothing else nests a numbered // directory under `global` — Bun's and Yarn's trees put `node_modules` directly beneath it. if (/\/\.?pnpm\/global\/|\/global\/\d+\/(?:\.pnpm|node_modules)\//iu.test(script)) { - return managerInstall('pnpm', 'pnpm', ['add', '-g', `${pkg}@latest`], `pnpm remove -g ${pkg}`, safe); + return managerInstall('pnpm', 'pnpm', ['add', '-g', `${pkg}@${distTag}`], `pnpm remove -g ${pkg}`, safe); } // Yarn classic keeps its global tree under `~/.config/yarn/global` and, on Windows, // `%LOCALAPPDATA%\Yarn\Data\global`, hence the optional segment and the case-insensitive match. @@ -313,7 +347,7 @@ const detectPackageInstall = (): InstallKind => { return managerInstall( 'Yarn', 'yarn', - ['global', 'add', `${pkg}@latest`], + ['global', 'add', `${pkg}@${distTag}`], `yarn global remove ${pkg}`, safe, ); @@ -323,10 +357,11 @@ const detectPackageInstall = (): InstallKind => { // already executing this file, which the bin link's shebang resolved the same way. const local = join(dirname(process.execPath), process.platform === 'win32' ? 'npm.cmd' : 'npm'); const npm = existsSync(local) ? local : 'npm'; + // `i`, npm's own short spelling, because this is also the line the daily notice prints. const install = managerInstall( 'npm', npm, - ['install', '-g', `${pkg}@latest`], + ['i', '-g', `${pkg}@${distTag}`], `npm uninstall -g ${pkg}`, safe, ); @@ -347,7 +382,7 @@ const managerInstall = ( manager, upgrade: `${basename(program).replace(/\.(cmd|exe)$/iu, '')} ${args.join(' ')}`, remove, - ...(safe ? { run: { program, args } } : {}), + ...(safe ? { run: { program, args, registryClient: true } } : {}), }); /** @@ -377,17 +412,65 @@ const MANAGER_QUERY_TIMEOUT_MS = 15_000; * Node would only join it unquoted anyway. The program is always quoted, because a profile path can * carry `&`, `(` or `^` as well as spaces; every argument is a fixed word, the charset-checked package * name, or the formula name, so none of them needs quoting. + * + * Every call is about a global install, so it runs from {@link managerDirectory} rather than wherever + * the user is standing, with the switches that stop a Corepack shim or Yarn from deferring to a + * project: one that pins another client in `packageManager` otherwise makes the shim refuse the + * command. A project's own `.npmrc`, `.yarnrc` or `bunfig.toml` is left unread for the same reason: a + * repository must not get to name the registry a global install is fetched from, so a private + * registry has to be in the user's own configuration. The same goes for a version manager's + * per-directory pin (`.tool-versions`, `mise.toml`): the client that owns a global install is the one + * the user's own configuration selects. On Windows the move also keeps `cmd.exe`, which looks in the + * working directory before `PATH`, from running a `pnpm.cmd` a repository carries. None of this holds + * on {@link managerDirectory}'s fallback, which is wherever the running executable lives. */ const spawnManager = ( program: string, args: readonly string[], options: SpawnSyncOptions, ): SpawnSyncReturns => { - if (process.platform !== 'win32') return spawnSync(program, [...args], options); + const isolated: SpawnSyncOptions = { + ...options, + cwd: managerDirectory(), + env: { + ...process.env, + COREPACK_ENABLE_STRICT: '0', + COREPACK_ENABLE_PROJECT_SPEC: '0', + YARN_IGNORE_PATH: '1', + // Stops `cmd.exe` looking in the working directory at all, so a shim sitting in the home or + // fallback directory is not run ahead of `PATH` either. + ...(process.platform === 'win32' ? { NoDefaultCurrentDirectoryInExePath: '1' } : {}), + }, + }; + if (process.platform !== 'win32') return spawnSync(program, [...args], isolated); // A `"` cannot be escaped inside a `cmd.exe` quoted string, and no Windows path contains one, so // refusing it costs nothing and keeps the quoting sound. if (program.includes('"')) throw new Error(`refusing to run ${program}: its path contains a quote`); - return spawnSync([`"${program}"`, ...args].join(' '), { ...options, shell: true }); + return spawnSync([`"${program}"`, ...args].join(' '), { ...isolated, shell: true }); +}; + +/** + * The directory package managers are started in: the user's home, which is no project's tree. + * + * Falls back to the directory of the running executable (Node.js, Bun, or the compiled command) when + * there is no home this process can start a child in: unset with no account entry (`homedir` throws), + * missing, a file, or not searchable by this user, as under `sudo -E -u`. Any of those would fail the + * spawn with an error naming the program. + * A UNC home is skipped on Windows too, because `cmd.exe` cannot start in one and says so on the + * output a caller may be parsing. + */ +const managerDirectory = (): string => { + try { + const home = homedir(); + const unc = process.platform === 'win32' && /^[\\/]{2}/u.test(home); + if (isAbsolute(home) && !unc && statSync(home).isDirectory()) { + accessSync(home, constants.X_OK); + return home; + } + } catch { + // No usable home; the fallback below is always there. + } + return dirname(process.execPath); }; /** @@ -425,8 +508,9 @@ const projectManager = (project: string, script: string): string => { * * npm links a project dependency and a global install the same way, so the path alone cannot tell * them apart; only `npm root -g` can. Asked by `upgrade`, `upgrade --check` and `uninstall` — explicit - * commands, where one subprocess is cheap — and never by the daily notice, which only ever says to run - * `upgrade`, where this is settled before anything is done. + * commands, where one subprocess is cheap — and never by the daily notice, which runs on every + * invocation. The notice uses {@link dependencyOf}, the file check half of this, and names `upgrade` + * for a project's dependency, where this is settled before anything is done. * * A `package.json` beside the `node_modules` makes it a project's dependency: that project's lockfile * decides its version, so neither a global upgrade nor a global uninstall is right for it — the global @@ -440,7 +524,7 @@ const settledInstall = (install: InstallKind): InstallKind => { const root = npmGlobalRoot(install.run.program); if (!root || isInside(script, root)) return install; const project = script.slice(0, script.indexOf('/node_modules/')); - if (existsSync(join(project, 'package.json'))) { + if (dependencyOf(script)) { const manager = projectManager(project, script); return { kind: 'managed', @@ -457,6 +541,20 @@ const settledInstall = (install: InstallKind): InstallKind => { }; }; +/** + * The project `script` is installed into as a dependency, or undefined for anything else. + * + * Read off the `package.json` beside the first `node_modules` on the path. A global tree has none + * there — npm's sits under `/lib`, which holds no manifest — while a project always does. A + * file check rather than a subprocess, so the daily notice can afford it on every run. + */ +const dependencyOf = (script: string): string | undefined => { + const index = script.indexOf('/node_modules/'); + if (index < 0) return undefined; + const project = script.slice(0, index); + return existsSync(join(project, 'package.json')) ? project : undefined; +}; + /** * Runs the owning manager's upgrade, with its output on this terminal. * @@ -560,6 +658,7 @@ const detectTarget = (): string => { /** Latest published release tag, read from the GitHub API so the command can report the version. */ const latestTag = async (signal?: AbortSignal): Promise => { + if (!RELEASE.repo) throw new Error('no GitHub release is published for this CLI'); const response = await fetch(`https://api.github.com/repos/${RELEASE.repo}/releases/latest`, { // `connection: close` because the abort below bounds the *request*, not the process. Node keeps // a pooled keep-alive socket referenced after the response resolves, so an unawaited check still @@ -600,6 +699,211 @@ const latestTag = async (signal?: AbortSignal): Promise => { return body.tag_name; }; +/** The public npm registry, asked when the environment names no other. */ +const DEFAULT_NPM_REGISTRY = 'https://registry.npmjs.org'; + +/** + * The registry an npm install is compared against: `npm_config_registry` (npm's own spelling, which + * it also exports to every script it runs), then `NPM_CONFIG_REGISTRY`, then the public registry. + * + * Only the environment is read, not `.npmrc`: npm's config files have their own precedence, includes + * and per-scope registries, and reproducing a part of that would answer from a registry npm itself + * might not use. The README and man page say so, and name the variable to set for a mirror. + * + * A value that is set but is not an http(s) URL throws rather than falling back to the public + * registry, because a variable naming a registry is a request not to use the default; the caller + * treats a throw as "no answer". + */ +const npmRegistry = (): string => { + const configured = process.env['npm_config_registry'] || process.env['NPM_CONFIG_REGISTRY']; + if (!configured) return DEFAULT_NPM_REGISTRY; + let url: URL; + try { + url = new URL(configured); + } catch { + throw new Error('the configured npm registry is not a URL'); + } + if (url.protocol !== 'https:' && url.protocol !== 'http:') { + throw new Error('the configured npm registry is not an http(s) URL'); + } + // Credentials in the URL are dropped, not sent: `fetch` refuses a URL carrying them, and the URL is + // also printed when `upgrade --check` cannot read it. A registry that needs them answers 401, which + // is reported like any other refusal. + url.username = ''; + url.password = ''; + // Kept with its path, since a mirror is often served below one (`/api/npm//`), and without + // the trailing slash the request path is appended after. + return url.href.replace(/\/+$/u, ''); +}; + +/** + * The npm dist-tag an install of `version` follows, derived the way the publish script assigned it. + * + * A stable version follows the tag stable releases land on — `latest`, unless the config moved them. + * A prerelease (`1.3.0-beta.2`, which a `prereleaseType` channel releases) follows the tag its own + * identifier published it under, with the same fallback to `next` and the same `-prerelease` suffix + * where that would name a stable line. Derived from the running version rather than fixed at + * generation, because the channel is only known once a release has been cut. + */ +const npmDistTag = (version: string): string => { + const stable = stableDistTag(); + // Only a numeric three-part core followed by `-` is a prerelease, as in the publish script, so a + // calendar version such as `2026-02-23` stays on the stable line. + const prerelease = /^\d+\.\d+\.\d+-([^+]+)(?:\+.*)?$/u.exec(version)?.[1]; + if (!prerelease) return stable; + const candidate = prerelease.split('.')[0] ?? ''; + const derived = DIST_TAG.test(candidate) ? candidate : 'next'; + return derived === stable || derived === 'latest' ? `${derived}-prerelease` : derived; +}; + +/** + * npm's dist-tag charset. A tag reaches the spawned upgrade command, which on Windows runs through + * `cmd.exe`, so one read from the config or the cache is used only when it passes. + */ +const DIST_TAG = /^[a-z][a-z0-9-]*$/u; + +/** The dist-tag stable releases land on: the configured one, or npm's own `latest`. */ +const stableDistTag = (): string => { + const configured = RELEASE.npmDistTag; + return configured && DIST_TAG.test(configured) ? configured : 'latest'; +}; + +/** The newest version a source knows of, and for the npm registry the dist-tag that carries it. */ +type Latest = { readonly version: string; readonly distTag?: string }; + +/** + * The newest version any of `distTags` points at for this package, and the tag that points at it. + * + * Asked of the registry, never of GitHub: a release is cut on GitHub before the npm publish that + * follows it finishes, so a release-based answer tells an npm user about a version `npm i -g` cannot + * install yet. Reads the dist-tags document alone, which is a few bytes and holds every tag, rather + * than the packument, which grows with every version ever published. The name is escaped as npm + * escapes it in a request path: a scoped `@scope/name` becomes `@scope%2fname`. + * + * Several tags because a prerelease line ends: once `1.1.0` ships on `latest`, the `beta` tag a + * `1.1.0-beta.3` install follows stays where it was, and asking it alone would never say so. + */ +const latestNpmVersion = async (distTags: readonly string[], signal?: AbortSignal): Promise => { + const pkg = RELEASE.npmPackage; + // Already true wherever `versionSource` chose this; checked again because it narrows the type. + if (!pkg || !NPM_PACKAGE_NAME.test(pkg)) throw new Error('no npm package is published for this CLI'); + const registry = npmRegistry(); + const response = await fetch(`${registry}/-/package/${pkg.replace('/', '%2f')}/dist-tags`, { + // `connection: close` for the reason `latestTag` gives: a pooled socket would hold the process open. + headers: { accept: 'application/json', connection: 'close' }, + ...(signal ? { signal } : {}), + }); + if (!response.ok) { + throw new Error(`could not read the dist-tags of ${pkg} from ${registry} (HTTP ${response.status})`); + } + const body: unknown = JSON.parse( + (await readCapped(response, response.url || registry, MAX_METADATA_BYTES)).toString('utf8'), + ); + const tags = body && typeof body === 'object' ? (body as Record) : {}; + let best: Latest | undefined; + for (const distTag of distTags) { + const found = tags[distTag]; + // The same charset check a release tag gets, for the same reason: this value reaches the terminal, + // and npm versions are semver, which never needs a control character. A tag failing it, or absent, + // is skipped rather than fatal, since another tag asked for may still answer. + if (typeof found !== 'string' || !RELEASE_TAG.test(found)) continue; + if (!best || isNewerRelease(found, best.version)) best = { version: found, distTag }; + } + if (!best) throw new Error(`${pkg} has no ${distTags.join(' or ')} release on ${registry}`); + return best; +}; + +/** + * Where an install's latest version is read from: the npm registry under one dist-tag, or GitHub + * Releases. Also the key the update-check cache is filed under, so a binary install and an npm install + * of the same command on one machine never read each other's answer. + */ +type VersionSource = { + readonly key: string; + readonly latest: (signal?: AbortSignal) => Promise; + /** Whether this is the npm registry, whose answer also decides which dist-tag `upgrade` installs. */ + readonly npm: boolean; + /** + * Whether the daily notice may ask it. False for a restricted npm package, which the registry hides + * from an unauthenticated request, so a daily check could only ever fail. + */ + readonly daily: boolean; +}; + +/** + * The version source for the running install, or undefined when there is none to ask. + * + * Decided by what is running rather than by which channels the config publishes. The npm package — + * run by `node` or `bun` rather than as a compiled executable — is compared against the registry it + * was installed from, whatever else the release ships; the compiled executable, from a direct + * download, the install script or Homebrew, against the GitHub Release its archive came from. + */ +const versionSource = (binaryName: string, version: string): VersionSource | undefined => { + const pkg = RELEASE.npmPackage; + if (!runsCompiled(process.execPath, binaryName) && pkg) { + // A name outside npm's charset could not be put in a request path, and asking GitHub instead is + // the mistake this function exists to avoid, so such a package has no source at all. + if (!NPM_PACKAGE_NAME.test(pkg)) return undefined; + const channel = npmDistTag(version); + const stable = stableDistTag(); + // A prerelease install also asks the stable tag, so the stable release it was leading up to is + // offered once it ships; a stable install has no reason to look at a prerelease line. + const distTags = channel === stable ? [stable] : [channel, stable]; + if (RELEASE.npmRestricted) { + return { + key: `npm:${channel}`, + latest: () => + Promise.reject( + new Error( + `${pkg} is not a public package, and the registry shows it only to a signed-in npm; run: npm view ${pkg} dist-tags`, + ), + ), + npm: true, + daily: false, + }; + } + return { + key: `npm:${channel}`, + latest: (signal) => latestNpmVersion(distTags, signal), + npm: true, + daily: true, + }; + } + return RELEASE.repo + ? { + key: 'github', + latest: (signal) => latestTag(signal).then((version) => ({ version })), + npm: false, + daily: true, + } + : undefined; +}; + +/** One bounded ask of a version source: the answer, or why there is none. */ +type LatestResult = { readonly latest: Latest } | { readonly error: Error }; + +/** + * Asks `source` once, under the interactive deadline, without reporting anything. + * + * Kept apart from {@link resolveLatest} so `upgrade` on a prerelease npm install can ask before it + * chooses which line to install, then reuse that one answer — or that one failure — for `--check` + * rather than asking again and making a stalled registry cost the deadline twice. + */ +const askLatest = async (source: VersionSource | undefined): Promise => { + try { + if (!source) throw new Error('no release is published for this CLI to compare against'); + return { + latest: await withTimeout( + (signal) => source.latest(signal), + UPGRADE_CHECK_TIMEOUT_MS, + 'the release check', + ), + }; + } catch (error) { + return { error: error as Error }; + } +}; + /** * Fetches one release asset, bounded by both a deadline and a size cap. * @@ -724,6 +1028,9 @@ const withTimeout = async ( * than a compromised release. */ const replaceExecutable = async (executable: string, tag: string, binaryName: string): Promise => { + // Unreachable without one, since `detectInstall` reports no self-managed install then; checked + // rather than asserted so a download URL is never built around `undefined`. + if (!RELEASE.repo) throw new Error('no GitHub release is published for this CLI'); const asset = `${binaryName}-${detectTarget()}.tar.gz`; const base = `https://github.com/${RELEASE.repo}/releases/download/${tag}`; @@ -969,15 +1276,20 @@ const CHECK_TIMEOUT_MS = 2_000; const versionLine = (binaryName: string, version: string, tag: string): string => `${binaryName} ${version} is installed; ${tag} is available.\n`; -/** Resolves the latest tag, reporting and setting a failing exit code rather than throwing. */ -const resolveLatestTag = async (): Promise => { - try { - return await withTimeout((signal) => latestTag(signal), UPGRADE_CHECK_TIMEOUT_MS, 'the release check'); - } catch (error) { - process.stderr.write(`error: ${(error as Error).message}\n`); - process.exitCode = 1; - return undefined; - } +/** + * Resolves the latest version from `source`, reporting and setting a failing exit code rather than + * throwing. + */ +const resolveLatest = async ( + source: VersionSource | undefined, + /** An answer {@link askLatest} already has, reported instead of asking again. */ + asked?: LatestResult, +): Promise => { + const result = asked ?? (await askLatest(source)); + if ('latest' in result) return result.latest; + process.stderr.write(`error: ${result.error.message}\n`); + process.exitCode = 1; + return undefined; }; /** Where the last check is remembered, so every invocation does not hit the network. */ @@ -1047,9 +1359,9 @@ const notificationsAllowed = (): boolean => { * * Fire-and-forget on purpose: it is started before the command runs and never awaited, so a slow or * unreachable network never delays the command's own work. The process can still be held open for up - * to {@link CHECK_TIMEOUT_MS} after it finishes, on a stalled connection, at most once a day. Every failure path is silent — a version check that cannot - * reach GitHub is not something the user asked about, and reporting it would turn a courtesy into - * noise on every offline run. + * to {@link CHECK_TIMEOUT_MS} after it finishes, on a stalled connection, at most once a day. Every + * failure path is silent — a version check that cannot reach the npm registry or GitHub is not + * something the user asked about, and reporting it would turn a courtesy into noise on every offline run. * * The notice is printed on the *next* run rather than this one when the cache is cold: the check * resolves after the command has usually finished, and interleaving a notice with output already in @@ -1073,8 +1385,12 @@ export const notifyIfOutdated = ( // terminal below. Skipping the check entirely is the cheap, safe answer. const path = cachePath(binaryName); if (!path) return; + // Nothing to compare against — a compiled executable with no GitHub Release, or an npm package whose + // name a request path could not carry — so there is nothing to check or to say. + const source = versionSource(binaryName, version); + if (!source?.daily) return; - let cached: { checkedAt?: number; latest?: string } = {}; + let cached: { checkedAt?: number; latest?: string; distTag?: string; source?: string } = {}; try { const parsed: unknown = JSON.parse(readFileSync(path, 'utf8')); // `JSON.parse` returns `null` for the literal `null` without throwing, and `typeof null` is @@ -1085,6 +1401,11 @@ export const notifyIfOutdated = ( } catch { // No cache yet, or an unreadable one: treated as "never checked". } + // An answer from another source is not an answer here. A binary install and an npm install of one + // command share this file, and GitHub can announce a release the registry does not have yet, so an + // npm install reading the binary's answer would be told to install a version npm cannot find. A + // cache from before the source was recorded came from GitHub, the only source there was. + if ((cached.source ?? 'github') !== source.key) cached = {}; // Report what the last check found before starting another, so a known-stale version is surfaced // immediately rather than a day later. @@ -1093,10 +1414,10 @@ export const notifyIfOutdated = ( // raw would let cursor-control sequences rewrite the surrounding lines and forge an instruction // that appears to come from the CLI itself. if (cached.latest && RELEASE_TAG.test(cached.latest) && isNewerRelease(cached.latest, version)) { - const install = detectInstall(binaryName); - // ` upgrade` wherever it can do the work itself — in place, or by running the owning manager - // — and the manager's own instruction only where it can do neither. - const how = install.kind === 'managed' && !install.run ? install.upgrade : `${binaryName} upgrade`; + // The dist-tag that carried the newer version, so a prerelease install whose stable release has + // shipped is told to install the stable line rather than its own, which has not moved. + const distTag = cached.distTag && DIST_TAG.test(cached.distTag) ? cached.distTag : npmDistTag(version); + const how = noticeCommand(binaryName, detectInstall(binaryName, distTag)); process.stderr.write( `\nA new release of ${binaryName} is available: ${version} → ${cached.latest}\n ${how}\n\n`, ); @@ -1114,7 +1435,13 @@ export const notifyIfOutdated = ( // it can write anything — so a user who mostly types `--help` would issue one unauthenticated API // request per invocation forever, never cache a result, and eventually exhaust GitHub's 60/hr // limit for their whole NAT. Writing up front costs one stale-by-a-day notice at worst. - recordCheck(path, cached.latest); + recordCheck( + path, + source.key, + cached.latest + ? { version: cached.latest, ...(cached.distTag ? { distTag: cached.distTag } : {}) } + : undefined, + ); const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS); @@ -1122,8 +1449,9 @@ export const notifyIfOutdated = ( // and Bun timers but not in the DOM typing, hence the guarded call. (timeout as unknown as { unref?: () => void }).unref?.(); - void latestTag(controller.signal) - .then((tag) => recordCheck(path, tag)) + void source + .latest(controller.signal) + .then((latest) => recordCheck(path, source.key, latest)) // Failure needs no second write: the attempt was already recorded above, so the throttle holds // whether the check succeeded, failed, or never finished. .catch(() => {}) @@ -1142,11 +1470,43 @@ const answeredWithoutRunning = (args: readonly string[]): boolean => { return options.includes('-h') || options.includes('--help'); }; -/** Remembers when the check last ran, and what it found, so the throttle above can engage. */ -const recordCheck = (path: string, latest: string | undefined): void => { +/** + * The command the daily notice names for this install. + * + * An npm-registry client's own global add where one owns the install — `npm i -g @latest`, or + * pnpm's, Yarn's or Bun's — because that is the command such a user already runs, and it installs + * from the registry the notice compared against. ` upgrade` wherever this CLI does more than one + * command could say: replacing a download in place, or a Homebrew upgrade it refreshes and confirms. + * The manager's own instruction where `upgrade` can do neither. + * + * An npm install inside a project is the one npm-registry case sent to `upgrade`: npm links it the + * way it links a global install, so the global command would add a second copy rather than upgrade + * this one, and `upgrade` is what tells the two apart. + */ +const noticeCommand = (binaryName: string, install: InstallKind): string => { + if (install.kind !== 'managed') return `${binaryName} upgrade`; + if (!install.run) return install.upgrade; + if (!install.run.registryClient) return `${binaryName} upgrade`; + const npmGlobal = install.run.npmGlobal; + return npmGlobal && dependencyOf(npmGlobal.script) ? `${binaryName} upgrade` : install.upgrade; +}; + +/** + * Remembers when the check last ran, against which source, and what it found, so the throttle above + * can engage. + */ +const recordCheck = (path: string, source: string, latest: Latest | undefined): void => { try { mkdirSync(dirname(path), { recursive: true }); - writeFileSync(path, JSON.stringify({ checkedAt: Date.now(), ...(latest ? { latest } : {}) })); + writeFileSync( + path, + JSON.stringify({ + checkedAt: Date.now(), + source, + ...(latest ? { latest: latest.version } : {}), + ...(latest?.distTag ? { distTag: latest.distTag } : {}), + }), + ); } catch { // An unwritable cache directory is not worth reporting: the check is a courtesy, and the only // consequence is that it runs again next time. @@ -1212,14 +1572,27 @@ export const addUpgradeCommands = (program: Command, binaryName: string, version .description('Upgrade to the latest release') .option('--check', 'Report the latest version without installing it') .action(async (options: { check?: boolean }) => { - const install = settledInstall(detectInstall(binaryName)); + const source = versionSource(binaryName, version); + // A prerelease npm install asks first which line is ahead, because its own dist-tag stops moving + // once the stable release ships, and installing from it would then do nothing. Asked only then: + // every other install runs the same command whatever the registry says. A failure is kept, not + // reported: the install's own line is still right to run, and `--check` reports it below. + const asked = + source?.npm && npmDistTag(version) !== stableDistTag() ? await askLatest(source) : undefined; + // Followed only to something newer: with the install's own tag gone from the registry, the answer + // is the stable line alone, and installing from it would be a quiet downgrade. + const ahead = + asked && 'latest' in asked && isNewerRelease(asked.latest.version, version) + ? asked.latest.distTag + : undefined; + const install = settledInstall(detectInstall(binaryName, ahead ?? npmDistTag(version))); // A managed install returns unconditionally, which is also what narrows `install` to the // self-managed variant for the replace below — the alternative, testing `kind` again further // down, reads as a guard against a state that cannot happen. if (install.kind === 'managed') { if (options.check) { - const tag = await resolveLatestTag(); + const tag = (await resolveLatest(source, asked))?.version; if (!tag) return; process.stderr.write(`${binaryName} was installed with ${install.manager}.\n`); // A manager only ever moves forward, so a `releases/latest` that went backwards is nothing @@ -1233,6 +1606,21 @@ export const addUpgradeCommands = (program: Command, binaryName: string, version ); return; } + // The registry already said nothing newer exists for this prerelease, so there is nothing to run: + // its own tag may be gone (an abandoned line), and installing from it would fail for no reason. + if (asked && 'latest' in asked && !isNewerRelease(asked.latest.version, version)) { + reportCheck(binaryName, version, asked.latest.version, install.upgrade, false); + return; + } + // Run from a cache, not installed: there is no install to replace and no manager to run, and the + // runner already fetches whatever its tag points at when asked to. + if (install.cached) { + process.stderr.write( + `${binaryName} is running from the ${install.manager} cache, so there is nothing installed to upgrade.\n` + + `Run the latest release with:\n ${install.upgrade}\n`, + ); + return; + } if (install.run) { const upgraded = runManagerUpgrade(binaryName, install, install.run); if (upgraded && install.run.installedVersions) { @@ -1253,7 +1641,7 @@ export const addUpgradeCommands = (program: Command, binaryName: string, version return; } - const tag = await resolveLatestTag(); + const tag = (await resolveLatest(source))?.version; if (!tag) return; if (options.check) { reportCheck(binaryName, version, tag, `${binaryName} upgrade`, true); @@ -1302,7 +1690,7 @@ export const addUpgradeCommands = (program: Command, binaryName: string, version .command('uninstall') .description('Show how to remove this installation') .action(() => { - const install = settledInstall(detectInstall(binaryName)); + const install = settledInstall(detectInstall(binaryName, npmDistTag(version))); if (install.kind === 'managed') { process.stderr.write( `${binaryName} was installed with ${install.manager}, which owns the installed files.\n` + diff --git a/src/commands/index.ts b/src/commands/index.ts index bcc5abb..b34225d 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -549,6 +549,8 @@ const commands = [ paramKey: 'command', location: 'body', required: true, + description: + 'Program and its arguments as an array of strings, such as ["ls", "-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "-c", ""].', valueKind: 'array', }, { @@ -858,6 +860,371 @@ const commands = [ }, ], }, + { + resourcePath: ['machines', 'ports'], + commandPath: ['machines', 'ports', 'list'], + methodName: 'list', + summary: 'List ports', + transport: 'http', + iterable: true, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'limit', + optionKey: 'limit', + paramKey: 'limit', + location: 'query', + required: false, + valueKind: 'integer', + }, + { + name: 'cursor', + optionKey: 'cursor', + paramKey: 'cursor', + location: 'query', + required: false, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports'], + commandPath: ['machines', 'ports', 'create'], + methodName: 'create', + summary: 'Create port', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'expires', + optionKey: 'expires', + paramKey: 'expires', + location: 'body', + required: false, + description: 'Port lifetime in integer seconds. Omit for no expiry.', + valueKind: 'integer', + }, + { + name: 'port', + optionKey: 'port', + paramKey: 'port', + location: 'body', + required: true, + valueKind: 'integer', + }, + { + name: 'protocol', + optionKey: 'protocol', + paramKey: 'protocol', + location: 'body', + required: false, + valueKind: 'string', + }, + { + name: 'visibility', + optionKey: 'visibility', + paramKey: 'visibility', + location: 'body', + required: false, + description: + 'Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges.', + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports'], + commandPath: ['machines', 'ports', 'retrieve'], + methodName: 'retrieve', + summary: 'Get port', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports'], + commandPath: ['machines', 'ports', 'update'], + methodName: 'update', + summary: 'Update port', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'visibility', + optionKey: 'visibility', + paramKey: 'visibility', + location: 'body', + required: true, + description: + 'Who may reach the port. private requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges.', + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports'], + commandPath: ['machines', 'ports', 'delete'], + methodName: 'delete', + summary: 'Delete port', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports', 'accessKeys'], + commandPath: ['machines', 'ports', 'access-keys', 'list'], + methodName: 'list', + summary: 'List port access keys', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'limit', + optionKey: 'limit', + paramKey: 'limit', + location: 'query', + required: false, + valueKind: 'integer', + }, + { + name: 'cursor', + optionKey: 'cursor', + paramKey: 'cursor', + location: 'query', + required: false, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports', 'accessKeys'], + commandPath: ['machines', 'ports', 'access-keys', 'mint'], + methodName: 'mint', + summary: 'Mint port access key', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'expires-in', + optionKey: 'expiresIn', + paramKey: 'expires_in', + location: 'body', + required: true, + description: 'Lifetime in integer seconds.', + valueKind: 'integer', + }, + ], + }, + { + resourcePath: ['machines', 'ports', 'accessKeys'], + commandPath: ['machines', 'ports', 'access-keys', 'revoke'], + methodName: 'revoke', + summary: 'Revoke port access key', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'access-key-id', + optionKey: 'accessKeyId', + paramKey: 'access_key_id', + location: 'path', + required: true, + valueKind: 'string', + }, + ], + }, + { + resourcePath: ['machines', 'ports', 'accessKeys'], + commandPath: ['machines', 'ports', 'access-keys', 'rotate'], + methodName: 'rotate', + summary: 'Rotate port access key', + transport: 'http', + iterable: false, + callShape: 'params', + authClientKeyRequirements: [['browserToken'], ['apiKey'], ['xAPIKey']], + positional: [], + flags: [ + { + name: 'machine-id', + optionKey: 'machineId', + paramKey: 'machine_id', + location: 'path', + required: true, + description: 'Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.', + valueKind: 'string', + }, + { + name: 'port-id', + optionKey: 'portId', + paramKey: 'port_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'access-key-id', + optionKey: 'accessKeyId', + paramKey: 'access_key_id', + location: 'path', + required: true, + valueKind: 'string', + }, + { + name: 'expires-in', + optionKey: 'expiresIn', + paramKey: 'expires_in', + location: 'body', + required: true, + description: 'Lifetime in integer seconds.', + valueKind: 'integer', + }, + ], + }, { resourcePath: ['organization', 'autoresizing'], commandPath: ['organization', 'autoresizing', 'retrieve'], @@ -920,9 +1287,9 @@ const commands = [ resourcePath: ['images'], commandPath: ['images', 'list'], methodName: 'list', - summary: 'List image IDs owned by the authenticated organization', + summary: 'List images owned by the authenticated organization', description: - "Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID.", + "Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID.", transport: 'http', iterable: false, callShape: 'params', diff --git a/src/custom/browser-routing.ts b/src/custom/browser-routing.ts index 14cb5c5..b30dbbf 100644 --- a/src/custom/browser-routing.ts +++ b/src/custom/browser-routing.ts @@ -7,7 +7,8 @@ const API = 'https://dcs.dedaluslabs.ai'; /** Names the API-key credential that competes with a browser token, so the user knows what to unset. */ const competingAPIKey = (options: Record): string | undefined => { if (options['apiKey'] || process.env['DEDALUS_API_KEY']?.trim()) return '--api-key or DEDALUS_API_KEY'; - if (options['xAPIKey'] || process.env['DEDALUS_X_API_KEY']?.trim()) return '--x-api-key or DEDALUS_X_API_KEY'; + if (options['xAPIKey'] || process.env['DEDALUS_X_API_KEY']?.trim()) + return '--x-api-key or DEDALUS_X_API_KEY'; return undefined; }; @@ -26,9 +27,7 @@ const competingHeader = (): string | undefined => .find((name) => CREDENTIAL_HEADERS.has(name)); /** Keeps browser tokens on their production API and rejects competing credentials. */ -export const routeBrowserCredential = ( - options: Record, -): Record => { +export const routeBrowserCredential = (options: Record): Record => { const browserToken = options['browserToken'] ?? process.env['DEDALUS_BROWSER_TOKEN']?.trim(); if (!browserToken) return options; const apiKey = competingAPIKey(options); diff --git a/src/custom/machines.ts b/src/custom/machines.ts index 8341b8d..428a02e 100644 --- a/src/custom/machines.ts +++ b/src/custom/machines.ts @@ -1,87 +1,110 @@ /** SSH selection that shares the CLI's authentication and error settings. */ -import { Command, Option } from 'commander' -import SDK from '../sdk/index.js' -import type { CliAuthDefinition } from '../cli/login.js' +import { Command, Option } from 'commander'; +import SDK from '../sdk/index.js'; +import type { CliAuthDefinition } from '../cli/login.js'; import { - type CliClientOptionDefinition, type GlobalOptions, - sdkClientOptions, writeError, errorExitCode, normalizeFormat, usageExitCode, -} from '../cli/runtime.js' -import { pickSSHMachine } from './ssh-picker.js' -import { connectMachine, type SSHAPI } from './ssh.js' + type CliClientOptionDefinition, + type GlobalOptions, + sdkClientOptions, + writeError, + errorExitCode, + normalizeFormat, + usageExitCode, +} from '../cli/runtime.js'; +import { pickSSHMachine } from './ssh-picker.js'; +import { connectMachine, type SSHAPI } from './ssh.js'; export type MachineAPI = SSHAPI & { - readonly listMachines: (cursor: string | undefined, signal: AbortSignal) => Promise -} + readonly listMachines: (cursor: string | undefined, signal: AbortSignal) => Promise; +}; type AliasOptions = { - readonly auth?: CliAuthDefinition - readonly api?: (client: SDK) => MachineAPI - readonly connect?: (api: SSHAPI, machineID: string) => Promise - readonly pick?: (api: MachineAPI) => Promise - readonly interactive?: () => boolean -} + readonly auth?: CliAuthDefinition; + readonly api?: (client: SDK) => MachineAPI; + readonly connect?: (api: SSHAPI, machineID: string) => Promise; + readonly pick?: (api: MachineAPI) => Promise; + readonly interactive?: () => boolean; +}; export const createMachineAPI = (client: SDK): MachineAPI => ({ - listMachines: (cursor, signal) => client.get('/v1/machines', { - query: cursor === undefined ? {} : { cursor }, signal, - }), - createSSHSession: (machineID, publicKey) => client.machines.ssh.create({ - machine_id: machineID, public_key: publicKey, - }), - getMachineSSHSession: (machineID, sessionID) => client.machines.ssh.retrieve({ - machine_id: machineID, session_id: sessionID, - }), -}) + listMachines: (cursor, signal) => + client.get('/v1/machines', { + query: cursor === undefined ? {} : { cursor }, + signal, + }), + createSSHSession: (machineID, publicKey) => + client.machines.ssh.create({ + machine_id: machineID, + public_key: publicKey, + }), + getMachineSSHSession: (machineID, sessionID) => + client.machines.ssh.retrieve({ + machine_id: machineID, + session_id: sessionID, + }), +}); export const addMachineAliases = ( program: Command, clientOptions: readonly CliClientOptionDefinition[], options: AliasOptions = {}, ): Command => { - const makeAPI = options.api ?? createMachineAPI - const connect = options.connect ?? connectMachine - const pick = options.pick ?? pickSSHMachine - const interactive = options.interactive ?? (() => Boolean( - process.stdin.isTTY && process.stdout.isTTY && process.stderr.isTTY, - )) + const makeAPI = options.api ?? createMachineAPI; + const connect = options.connect ?? connectMachine; + const pick = options.pick ?? pickSSHMachine; + const interactive = + options.interactive ?? + (() => Boolean(process.stdin.isTTY && process.stdout.isTTY && process.stderr.isTTY)); const ssh = aliasCommand(program, 'ssh') .description('Choose a machine and connect over SSH, or supply its UUID') .argument('[machine-id]', 'Machine UUID; omitted to open the interactive picker') .action(async (target: string | undefined, _flags: unknown, command: Command) => { - if (target !== undefined && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u.test(target)) { - command.error('machine ID must be a bare UUID', { exitCode: 2 }) + if ( + target !== undefined && + !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u.test(target) + ) { + command.error('machine ID must be a bare UUID', { exitCode: 2 }); } if (!target && !interactive()) { - command.error('machine ID is required without an interactive terminal; usage: dedalus ssh ', { exitCode: 2 }) + command.error( + 'machine ID is required without an interactive terminal; usage: dedalus ssh ', + { exitCode: 2 }, + ); } - await runAlias(command, clientOptions, async (client) => { - const api = makeAPI(client) - const machineID = target ?? await pick(api) - if (machineID !== undefined) await connect(api, machineID) - }, options.auth) - }) - program.addCommand(ssh) - return program -} + await runAlias( + command, + clientOptions, + async (client) => { + const api = makeAPI(client); + const machineID = target ?? (await pick(api)); + if (machineID !== undefined) await connect(api, machineID); + }, + options.auth, + ); + }); + program.addCommand(ssh); + return program; +}; const aliasCommand = (program: Command, name: string): Command => { if (program.commands.some((command) => command.name() === name)) { - throw new Error(`the reserved '${name}' command is already registered`) + throw new Error(`the reserved '${name}' command is already registered`); } - const command = usageExitCode(new Command(name)).showHelpAfterError() + const command = usageExitCode(new Command(name)).showHelpAfterError(); // Mirror global flags so both `--api-key … ssh` and `ssh --api-key …` work. for (const option of program.options) { - if (option.long !== '--version') command.addOption(new Option(option.flags, option.description)) + if (option.long !== '--version') command.addOption(new Option(option.flags, option.description)); } - const organization = program.commands.find((entry) => entry.name() === 'machines') + const organization = program.commands + .find((entry) => entry.name() === 'machines') ?.commands.find((entry) => entry.name() === 'retrieve') - ?.options.find((option) => option.long === '--x-dedalus-org-id') + ?.options.find((option) => option.long === '--x-dedalus-org-id'); if (organization && !command.options.some((option) => option.long === organization.long)) { - command.addOption(new Option(organization.flags, organization.description)) + command.addOption(new Option(organization.flags, organization.description)); } - return command -} + return command; +}; const runAlias = async ( command: Command, @@ -89,16 +112,21 @@ const runAlias = async ( action: (client: SDK) => Promise, auth: CliAuthDefinition | undefined, ): Promise => { - const flags = command.optsWithGlobals() + const flags = command.optsWithGlobals(); try { - const client = new SDK(await sdkClientOptions(flags, command, clientOptions, auth)) - await action(client) + const client = new SDK(await sdkClientOptions(flags, command, clientOptions, auth)); + await action(client); } catch (error) { - await writeError(error, { - format: normalizeFormat(command.opts().formatError ?? flags.formatError, 'auto'), - ...(flags.transformError ? { transform: flags.transformError } : {}), - ...(flags.rawOutput ? { rawOutput: true } : {}), - }, clientOptions, SDK) - process.exitCode = errorExitCode(error, SDK) + await writeError( + error, + { + format: normalizeFormat(command.opts().formatError ?? flags.formatError, 'auto'), + ...(flags.transformError ? { transform: flags.transformError } : {}), + ...(flags.rawOutput ? { rawOutput: true } : {}), + }, + clientOptions, + SDK, + ); + process.exitCode = errorExitCode(error, SDK); } -} +}; diff --git a/src/custom/ssh-picker.ts b/src/custom/ssh-picker.ts index 295241a..12517a8 100644 --- a/src/custom/ssh-picker.ts +++ b/src/custom/ssh-picker.ts @@ -1,153 +1,171 @@ /** Search machine names while retaining stable IDs for the SSH request. */ -import { emitKeypressEvents, type Key } from 'node:readline' -import type { MachineAPI } from './machines.js' +import { emitKeypressEvents, type Key } from 'node:readline'; +import type { MachineAPI } from './machines.js'; export type MachineChoice = { - readonly id: string - readonly name: string | null - readonly status: string -} + readonly id: string; + readonly name: string | null; + readonly status: string; +}; export type PickerState = { - readonly machines: readonly MachineChoice[] - readonly query: string - readonly cursor: number -} + readonly machines: readonly MachineChoice[]; + readonly query: string; + readonly cursor: number; +}; export const matchingMachines = (state: PickerState): readonly MachineChoice[] => { - const query = state.query.toLowerCase().trim() + const query = state.query.toLowerCase().trim(); return state.machines.filter((machine) => - `${machine.name ?? ''} ${machine.id} ${machine.status}`.toLowerCase().includes(query)) -} + `${machine.name ?? ''} ${machine.id} ${machine.status}`.toLowerCase().includes(query), + ); +}; export const updatePicker = (state: PickerState, text: string, key: Key): PickerState => { - const count = matchingMachines(state).length - if (key.name === 'up') return { ...state, cursor: Math.max(0, state.cursor - 1) } - if (key.name === 'down') return { ...state, cursor: Math.max(0, Math.min(count - 1, state.cursor + 1)) } - if (key.name === 'backspace') return { ...state, query: [...state.query].slice(0, -1).join(''), cursor: 0 } - if (key.ctrl && key.name === 'u') return { ...state, query: '', cursor: 0 } + const count = matchingMachines(state).length; + if (key.name === 'up') return { ...state, cursor: Math.max(0, state.cursor - 1) }; + if (key.name === 'down') return { ...state, cursor: Math.max(0, Math.min(count - 1, state.cursor + 1)) }; + if (key.name === 'backspace') return { ...state, query: [...state.query].slice(0, -1).join(''), cursor: 0 }; + if (key.ctrl && key.name === 'u') return { ...state, query: '', cursor: 0 }; if (!key.ctrl && !key.meta && text && !/[\x00-\x1f\x7f-\x9f]/u.test(text)) { - return { ...state, query: state.query + text, cursor: 0 } + return { ...state, query: state.query + text, cursor: 0 }; } - return state -} + return state; +}; export const renderPicker = (state: PickerState, rows: number, columns: number): string => { - const matches = matchingMachines(state) - const count = Math.max(1, Math.floor((rows - 8) / 2)) - const start = Math.max(0, state.cursor - count + 1) - const lines = ['Select a machine for SSH', '', `/ ${state.query}`, ''] + const matches = matchingMachines(state); + const count = Math.max(1, Math.floor((rows - 8) / 2)); + const start = Math.max(0, state.cursor - count + 1); + const lines = ['Select a machine for SSH', '', `/ ${state.query}`, '']; for (let index = start; index < Math.min(matches.length, start + count); index += 1) { - const machine = matches[index]! - lines.push(`${index === state.cursor ? '>' : ' '} ${machine.name ?? 'Unnamed machine'} [${machine.status}]`) - lines.push(` ${machine.id}`) + const machine = matches[index]!; + lines.push( + `${index === state.cursor ? '>' : ' '} ${machine.name ?? 'Unnamed machine'} [${machine.status}]`, + ); + lines.push(` ${machine.id}`); } - if (matches.length === 0) lines.push('No matching machines') - lines.push('', `${matches.length} of ${state.machines.length} machines · ↑/↓ select · Enter connect · Esc cancel`) - return lines.map((line) => terminalText(line).slice(0, Math.max(1, columns - 1))).join('\n') + '\n' -} + if (matches.length === 0) lines.push('No matching machines'); + lines.push( + '', + `${matches.length} of ${state.machines.length} machines · ↑/↓ select · Enter connect · Esc cancel`, + ); + return lines.map((line) => terminalText(line).slice(0, Math.max(1, columns - 1))).join('\n') + '\n'; +}; export const loadMachineChoices = async (api: MachineAPI, signal: AbortSignal): Promise => { - const machines: MachineChoice[] = [] - const cursors = new Set() - let cursor: string | undefined + const machines: MachineChoice[] = []; + const cursors = new Set(); + let cursor: string | undefined; do { - const page = record(await api.listMachines(cursor, signal), 'machine list') - if (!Array.isArray(page.items)) throw new Error('machine list response omitted items') + const page = record(await api.listMachines(cursor, signal), 'machine list'); + if (!Array.isArray(page.items)) throw new Error('machine list response omitted items'); for (const value of page.items) { - const machine = record(value, 'machine') - if (machine.desired_state === 'destroyed' || machine.phase === 'destroyed') continue + const machine = record(value, 'machine'); + if (machine.desired_state === 'destroyed' || machine.phase === 'destroyed') continue; if (typeof machine.machine_id !== 'string' || !machine.machine_id) { - throw new Error('machine list response omitted machine_id') + throw new Error('machine list response omitted machine_id'); } if (typeof machine.phase !== 'string' || !machine.phase) { - throw new Error(`machine ${machine.machine_id} response omitted lifecycle status`) + throw new Error(`machine ${machine.machine_id} response omitted lifecycle status`); } if (machine.name !== undefined && machine.name !== null && typeof machine.name !== 'string') { - throw new Error(`machine ${machine.machine_id} response returned an invalid name`) + throw new Error(`machine ${machine.machine_id} response returned an invalid name`); } - machines.push({ id: machine.machine_id, name: machine.name as string | null | undefined ?? null, status: machine.phase }) + machines.push({ + id: machine.machine_id, + name: (machine.name as string | null | undefined) ?? null, + status: machine.phase, + }); } - if (page.next_cursor === null || page.next_cursor === undefined || page.next_cursor === '') break + if (page.next_cursor === null || page.next_cursor === undefined || page.next_cursor === '') break; if (typeof page.next_cursor !== 'string' || cursors.has(page.next_cursor)) { - throw new Error('machine list response returned an invalid or repeated cursor') + throw new Error('machine list response returned an invalid or repeated cursor'); } - cursor = page.next_cursor - cursors.add(cursor) - } while (!signal.aborted) - signal.throwIfAborted() - if (machines.length === 0) throw new Error('No machines available for SSH. Create one with dedalus machines create.') - return machines -} + cursor = page.next_cursor; + cursors.add(cursor); + } while (!signal.aborted); + signal.throwIfAborted(); + if (machines.length === 0) + throw new Error('No machines available for SSH. Create one with dedalus machines create.'); + return machines; +}; export const pickSSHMachine = (api: MachineAPI): Promise => { - const input = process.stdin - const output = process.stderr + const input = process.stdin; + const output = process.stderr; if (!input.isTTY || !process.stdout.isTTY || !output.isTTY) { - return Promise.reject(new Error('machine ID is required without an interactive terminal; usage: dedalus ssh ')) + return Promise.reject( + new Error('machine ID is required without an interactive terminal; usage: dedalus ssh '), + ); } return new Promise((resolve, reject) => { - const controller = new AbortController() - const wasRaw = input.isRaw - const wasFlowing = input.readableFlowing - let done = false - let loading = true - let state: PickerState = { machines: [], query: '', cursor: 0 } + const controller = new AbortController(); + const wasRaw = input.isRaw; + const wasFlowing = input.readableFlowing; + let done = false; + let loading = true; + let state: PickerState = { machines: [], query: '', cursor: 0 }; const render = (): void => { - const view = loading ? 'Loading machines…\n\nEsc cancel\n' : renderPicker(state, output.rows || 24, output.columns || 80) - output.write('\x1b[H\x1b[2J' + view) - } + const view = loading + ? 'Loading machines…\n\nEsc cancel\n' + : renderPicker(state, output.rows || 24, output.columns || 80); + output.write('\x1b[H\x1b[2J' + view); + }; const finish = (id?: string, error?: unknown): void => { - if (done) return - done = true - controller.abort() - input.off('keypress', onKey) - input.off('error', onError) - input.off('end', onEnd) - output.off('resize', render) - input.setRawMode(wasRaw) - if (!wasFlowing) input.pause() - output.write('\x1b[?25h\x1b[?1049l') - if (error) reject(error) - else resolve(id) - } + if (done) return; + done = true; + controller.abort(); + input.off('keypress', onKey); + input.off('error', onError); + input.off('end', onEnd); + output.off('resize', render); + input.setRawMode(wasRaw); + if (!wasFlowing) input.pause(); + output.write('\x1b[?25h\x1b[?1049l'); + if (error) reject(error); + else resolve(id); + }; const onKey = (text: string, key: Key): void => { - if (key.name === 'escape' || (key.ctrl && key.name === 'c')) return finish() - if (loading) return + if (key.name === 'escape' || (key.ctrl && key.name === 'c')) return finish(); + if (loading) return; if (key.name === 'return') { - const selected = matchingMachines(state)[state.cursor] - if (selected) finish(selected.id) - return + const selected = matchingMachines(state)[state.cursor]; + if (selected) finish(selected.id); + return; } - state = updatePicker(state, text, key) - render() - } - const onError = (error: Error): void => finish(undefined, error) - const onEnd = (): void => finish() - emitKeypressEvents(input) - input.setRawMode(true) - input.on('keypress', onKey) - input.once('error', onError) - input.once('end', onEnd) - output.on('resize', render) - input.resume() - output.write('\x1b[?1049h\x1b[?25l') - render() - void loadMachineChoices(api, controller.signal).then((machines) => { - if (done) return - loading = false - state = { ...state, machines } - render() - }, (error: unknown) => finish(undefined, error)) - }) -} + state = updatePicker(state, text, key); + render(); + }; + const onError = (error: Error): void => finish(undefined, error); + const onEnd = (): void => finish(); + emitKeypressEvents(input); + input.setRawMode(true); + input.on('keypress', onKey); + input.once('error', onError); + input.once('end', onEnd); + output.on('resize', render); + input.resume(); + output.write('\x1b[?1049h\x1b[?25l'); + render(); + void loadMachineChoices(api, controller.signal).then( + (machines) => { + if (done) return; + loading = false; + state = { ...state, machines }; + render(); + }, + (error: unknown) => finish(undefined, error), + ); + }); +}; const record = (value: unknown, label: string): Record => { if (!value || typeof value !== 'object' || Array.isArray(value)) { - throw new Error(`${label} response must be an object`) + throw new Error(`${label} response must be an object`); } - return value as Record -} + return value as Record; +}; -const terminalText = (text: string): string => text.replace(/[\x00-\x1f\x7f-\x9f]/gu, '') +const terminalText = (text: string): string => text.replace(/[\x00-\x1f\x7f-\x9f]/gu, ''); diff --git a/src/custom/ssh.ts b/src/custom/ssh.ts index 8ae983f..5bf9fb8 100644 --- a/src/custom/ssh.ts +++ b/src/custom/ssh.ts @@ -1,195 +1,207 @@ /** Connect with an ephemeral key and the server's SSH certificate and host CA. */ -import { spawn } from 'node:child_process' -import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' +import { spawn } from 'node:child_process'; +import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; export type SSHAPI = { - readonly createSSHSession: (machineID: string, publicKey: string) => Promise - readonly getMachineSSHSession: (machineID: string, sessionID: string) => Promise -} + readonly createSSHSession: (machineID: string, publicKey: string) => Promise; + readonly getMachineSSHSession: (machineID: string, sessionID: string) => Promise; +}; -const pollIntervalMilliseconds = 500 -const pollLimit = 120 +const pollIntervalMilliseconds = 500; +const pollLimit = 120; type SSHConnection = { - readonly endpoint: string - readonly hostPattern: string - readonly hostPublicKey: string - readonly port: number - readonly sshUsername: string - readonly userCertificate: string -} + readonly endpoint: string; + readonly hostPattern: string; + readonly hostPublicKey: string; + readonly port: number; + readonly sshUsername: string; + readonly userCertificate: string; +}; type SSHSession = { - readonly machine_id?: unknown - readonly connection?: unknown - readonly error_code?: unknown - readonly error_message?: unknown - readonly retry_after_ms?: unknown - readonly session_id?: unknown - readonly status?: unknown -} + readonly machine_id?: unknown; + readonly connection?: unknown; + readonly error_code?: unknown; + readonly error_message?: unknown; + readonly retry_after_ms?: unknown; + readonly session_id?: unknown; + readonly status?: unknown; +}; export const connectMachine = async (api: SSHAPI, machineID: string): Promise => { - const directory = await mkdtemp(join(tmpdir(), 'dedalus-ssh-')) + const directory = await mkdtemp(join(tmpdir(), 'dedalus-ssh-')); try { - const keyPath = join(directory, 'key') - await runProcess('ssh-keygen', ['-q', '-t', 'ed25519', '-N', '', '-C', '', '-f', keyPath], 'ignore') - const publicKey = (await readFile(`${keyPath}.pub`, 'utf8')).trim() - if (!publicKey) throw new Error('ssh-keygen returned an empty public key') - - const session = await awaitSSHSession(api, machineID, publicKey) - const connection = readyConnection(session) - const certificatePath = `${keyPath}-cert.pub` - const knownHostsPath = join(directory, 'known_hosts') - await writeFile(certificatePath, `${connection.userCertificate.trim()}\n`, { mode: 0o600 }) - await writeFile(knownHostsPath, - `@cert-authority ${connection.hostPattern} ${connection.hostPublicKey}\n`, { mode: 0o600 }) + const keyPath = join(directory, 'key'); + await runProcess('ssh-keygen', ['-q', '-t', 'ed25519', '-N', '', '-C', '', '-f', keyPath], 'ignore'); + const publicKey = (await readFile(`${keyPath}.pub`, 'utf8')).trim(); + if (!publicKey) throw new Error('ssh-keygen returned an empty public key'); + + const session = await awaitSSHSession(api, machineID, publicKey); + const connection = readyConnection(session); + const certificatePath = `${keyPath}-cert.pub`; + const knownHostsPath = join(directory, 'known_hosts'); + await writeFile(certificatePath, `${connection.userCertificate.trim()}\n`, { mode: 0o600 }); + await writeFile( + knownHostsPath, + `@cert-authority ${connection.hostPattern} ${connection.hostPublicKey}\n`, + { mode: 0o600 }, + ); process.stderr.write( `connecting to ${connection.sshUsername}@${connection.endpoint}:${connection.port}\n`, - ) - const code = await runProcess('ssh', [ - '-i', keyPath, - '-o', `CertificateFile=${quoteSSHPath(certificatePath)}`, - '-o', `UserKnownHostsFile=${quoteSSHPath(knownHostsPath)}`, - '-o', 'GlobalKnownHostsFile=/dev/null', - '-o', 'StrictHostKeyChecking=yes', - '-o', 'IdentitiesOnly=yes', - '-p', String(connection.port), - '--', `${connection.sshUsername}@${connection.endpoint}`, - ], 'inherit') - if (code !== 0) process.exitCode = code + ); + const code = await runProcess( + 'ssh', + [ + '-i', + keyPath, + '-o', + `CertificateFile=${quoteSSHPath(certificatePath)}`, + '-o', + `UserKnownHostsFile=${quoteSSHPath(knownHostsPath)}`, + '-o', + 'GlobalKnownHostsFile=/dev/null', + '-o', + 'StrictHostKeyChecking=yes', + '-o', + 'IdentitiesOnly=yes', + '-p', + String(connection.port), + '--', + `${connection.sshUsername}@${connection.endpoint}`, + ], + 'inherit', + ); + if (code !== 0) process.exitCode = code; } finally { - await rm(directory, { recursive: true, force: true }) + await rm(directory, { recursive: true, force: true }); } -} +}; export const awaitSSHSession = async ( api: SSHAPI, machineID: string, publicKey: string, ): Promise => { - let session = sessionFrom(await api.createSSHSession(machineID, publicKey)) + let session = sessionFrom(await api.createSSHSession(machineID, publicKey)); // Pin polling to the machine ID returned with the session. - machineID = requiredString(session.machine_id, 'SSH session response omitted machine_id') + machineID = requiredString(session.machine_id, 'SSH session response omitted machine_id'); for (let poll = 0; poll <= pollLimit; poll += 1) { - const sessionID = requiredString(session.session_id, 'SSH session response omitted session_id') - const status = requiredString(session.status, `SSH session ${sessionID} omitted status`) - process.stderr.write(`ssh ${sessionID}: ${status}\n`) + const sessionID = requiredString(session.session_id, 'SSH session response omitted session_id'); + const status = requiredString(session.status, `SSH session ${sessionID} omitted status`); + process.stderr.write(`ssh ${sessionID}: ${status}\n`); switch (status) { case 'ready': - return session + return session; case 'wake_in_progress': case 'ssh_in_progress': if (poll === pollLimit) { - throw new Error(`SSH session did not become ready after ${pollLimit} polls`) + throw new Error(`SSH session did not become ready after ${pollLimit} polls`); } - break + break; case 'failed': throw new Error( `SSH session failed: ${optionalString(session.error_message) ?? 'no detail from server'}` + - ` (error_code=${optionalString(session.error_code) ?? 'unknown'})`, - ) + ` (error_code=${optionalString(session.error_code) ?? 'unknown'})`, + ); case 'expired': - throw new Error('SSH session expired before it became ready; try again with a fresh session') + throw new Error('SSH session expired before it became ready; try again with a fresh session'); case 'closed': - throw new Error('SSH session was closed before it became ready') + throw new Error('SSH session was closed before it became ready'); default: - throw new Error(`SSH session ${sessionID} returned unknown status '${status}'`) + throw new Error(`SSH session ${sessionID} returned unknown status '${status}'`); } - await sleep(retryDelay(session.retry_after_ms)) - session = sessionFrom(await api.getMachineSSHSession(machineID, sessionID)) + await sleep(retryDelay(session.retry_after_ms)); + session = sessionFrom(await api.getMachineSSHSession(machineID, sessionID)); } - throw new Error('SSH session polling ended without a terminal state') -} + throw new Error('SSH session polling ended without a terminal state'); +}; const readyConnection = (session: SSHSession): SSHConnection => { - const sessionID = requiredString(session.session_id, 'SSH session response omitted session_id') + const sessionID = requiredString(session.session_id, 'SSH session response omitted session_id'); if (!session.connection || typeof session.connection !== 'object') { - throw new Error(`SSH session ${sessionID} is ready but the server returned no connection`) + throw new Error(`SSH session ${sessionID} is ready but the server returned no connection`); } - const connection = session.connection as Record - const trust = connection.host_trust + const connection = session.connection as Record; + const trust = connection.host_trust; if (!trust || typeof trust !== 'object') { - throw new Error(`SSH session ${sessionID} is ready but the server returned no host trust`) + throw new Error(`SSH session ${sessionID} is ready but the server returned no host trust`); } - const hostTrust = trust as Record - const endpoint = singleLine(connection.endpoint, 'endpoint', sessionID) - const sshUsername = singleLine(connection.ssh_username, 'SSH username', sessionID) - const userCertificate = singleLine(connection.user_certificate, 'user certificate', sessionID) - const hostPattern = singleLine(hostTrust.host_pattern, 'host pattern', sessionID) - const hostPublicKey = singleLine(hostTrust.public_key, 'host CA public key', sessionID) + const hostTrust = trust as Record; + const endpoint = singleLine(connection.endpoint, 'endpoint', sessionID); + const sshUsername = singleLine(connection.ssh_username, 'SSH username', sessionID); + const userCertificate = singleLine(connection.user_certificate, 'user certificate', sessionID); + const hostPattern = singleLine(hostTrust.host_pattern, 'host pattern', sessionID); + const hostPublicKey = singleLine(hostTrust.public_key, 'host CA public key', sessionID); if (/\s/u.test(hostPattern)) { - throw new Error(`SSH session ${sessionID} returned an invalid host pattern`) + throw new Error(`SSH session ${sessionID} returned an invalid host pattern`); } - const port = connection.port + const port = connection.port; if (!Number.isSafeInteger(port) || (port as number) < 1 || (port as number) > 65_535) { - throw new Error(`SSH session ${sessionID} returned an invalid port`) + throw new Error(`SSH session ${sessionID} returned an invalid port`); } - return { endpoint, hostPattern, hostPublicKey, port: port as number, sshUsername, userCertificate } -} + return { endpoint, hostPattern, hostPublicKey, port: port as number, sshUsername, userCertificate }; +}; const sessionFrom = (value: unknown): SSHSession => { - if (!value || typeof value !== 'object') throw new Error('server returned an empty SSH session') - return value as SSHSession -} + if (!value || typeof value !== 'object') throw new Error('server returned an empty SSH session'); + return value as SSHSession; +}; const singleLine = (value: unknown, name: string, sessionID: string): string => { - const result = requiredString(value, `SSH session ${sessionID} is ready but returned no ${name}`) + const result = requiredString(value, `SSH session ${sessionID} is ready but returned no ${name}`); if (/[\r\n\0]/u.test(result)) { - throw new Error(`SSH session ${sessionID} returned an invalid ${name}`) + throw new Error(`SSH session ${sessionID} returned an invalid ${name}`); } - return result -} + return result; +}; const requiredString = (value: unknown, message: string): string => { - if (typeof value !== 'string' || !value) throw new Error(message) - return value -} + if (typeof value !== 'string' || !value) throw new Error(message); + return value; +}; const optionalString = (value: unknown): string | undefined => - typeof value === 'string' && value ? value : undefined + typeof value === 'string' && value ? value : undefined; const retryDelay = (value: unknown): number => { - if (value === undefined || value === 0) return pollIntervalMilliseconds + if (value === undefined || value === 0) return pollIntervalMilliseconds; if (!Number.isSafeInteger(value) || (value as number) <= 0 || (value as number) > 60_000) { - throw new Error('SSH session returned an invalid retry_after_ms') + throw new Error('SSH session returned an invalid retry_after_ms'); } - return value as number -} + return value as number; +}; const sleep = (milliseconds: number): Promise => - new Promise((resolve) => setTimeout(resolve, milliseconds)) + new Promise((resolve) => setTimeout(resolve, milliseconds)); // OpenSSH parses -o values as configuration text even when spawn receives an argv array. -const quoteSSHPath = (path: string): string => `"${path.replace(/[\\"]/gu, '\\$&')}"` - -const runProcess = ( - command: string, - args: readonly string[], - stdio: 'ignore' | 'inherit', -): Promise => new Promise((resolve, reject) => { - const child = spawn(command, args, { stdio }) - child.once('error', (error) => { - reject(new Error(`${command} is required but was not found in PATH`, { cause: error })) - }) - child.once('close', (code, signal) => { - if (signal) { - reject(new Error(`${command} terminated by ${signal}`)) - return - } - if (code === null) { - reject(new Error(`${command} exited without a status`)) - return - } - if (command === 'ssh-keygen' && code !== 0) { - reject(new Error(`ssh-keygen exited with status ${code}`)) - return - } - resolve(code) - }) -}) +const quoteSSHPath = (path: string): string => `"${path.replace(/[\\"]/gu, '\\$&')}"`; + +const runProcess = (command: string, args: readonly string[], stdio: 'ignore' | 'inherit'): Promise => + new Promise((resolve, reject) => { + const child = spawn(command, args, { stdio }); + child.once('error', (error) => { + reject(new Error(`${command} is required but was not found in PATH`, { cause: error })); + }); + child.once('close', (code, signal) => { + if (signal) { + reject(new Error(`${command} terminated by ${signal}`)); + return; + } + if (code === null) { + reject(new Error(`${command} exited without a status`)); + return; + } + if (command === 'ssh-keygen' && code !== 0) { + reject(new Error(`ssh-keygen exited with status ${code}`)); + return; + } + resolve(code); + }); + }); diff --git a/src/feedback/bundle.ts b/src/feedback/bundle.ts index 59949e5..bcf0a75 100644 --- a/src/feedback/bundle.ts +++ b/src/feedback/bundle.ts @@ -72,9 +72,7 @@ export const buildFeedbackBundle = ( try { selection = selectDiagnostics(scope, directory); } catch { - process.stderr.write( - 'Recent local diagnostics could not be read; no saved logs will be attached.\n', - ); + process.stderr.write('Recent local diagnostics could not be read; no saved logs will be attached.\n'); selection = { events: [] }; } if (mode === 'false') return { selection: { ...selection, events: [] }, attachments: [] }; diff --git a/src/feedback/command.ts b/src/feedback/command.ts index c1f1a98..d581c99 100644 --- a/src/feedback/command.ts +++ b/src/feedback/command.ts @@ -70,9 +70,7 @@ export const registerFeedbackCommands = ( source: 'cli', ...(bundle.selection.command ? { command: bundle.selection.command } : {}), ...(bundle.selection.receipt ? { reported_request_id: bundle.selection.receipt } : {}), - ...(bundle.selection.failure - ? { diagnostics: { last_api_failure: bundle.selection.failure } } - : {}), + ...(bundle.selection.failure ? { diagnostics: { last_api_failure: bundle.selection.failure } } : {}), client: { name: 'dedalus-cli', version: VERSION }, debug: { included: bundle.attachments.length > 0, diff --git a/src/feedback/diagnostics.ts b/src/feedback/diagnostics.ts index fb5ecb1..9452a18 100644 --- a/src/feedback/diagnostics.ts +++ b/src/feedback/diagnostics.ts @@ -127,8 +127,7 @@ export const pruneDiagnostics = (directory = debugDirectory(), now = Date.now()) const parseEvent = (value: unknown): DiagnosticEvent | undefined => { if (!value || typeof value !== 'object') return undefined; const row = value as Record; - if (typeof row['kind'] !== 'string' || !kinds.some((kind) => kind === row['kind'])) - return undefined; + if (typeof row['kind'] !== 'string' || !kinds.some((kind) => kind === row['kind'])) return undefined; if (typeof row['command'] !== 'string' || !/^dedalus(?: [a-z-]+){1,5}$/.test(row['command'])) return undefined; if (row['command'].split(' ').some((word) => !commandWords.has(word))) return undefined; @@ -138,10 +137,7 @@ const parseEvent = (value: unknown): DiagnosticEvent | undefined => { kind: row['kind'] as DiagnosticEvent['kind'], command: row['command'], }; - if ( - typeof row['route'] === 'string' && - /^\/v1(?:\/(?:[a-z-]+|\{[a-z_]+\})){1,9}$/.test(row['route']) - ) + if (typeof row['route'] === 'string' && /^\/v1(?:\/(?:[a-z-]+|\{[a-z_]+\})){1,9}$/.test(row['route'])) result.route = row['route']; if (typeof row['request_id'] === 'string' && receiptPattern.test(row['request_id'])) result.request_id = row['request_id']; @@ -182,9 +178,7 @@ const routeTemplate = (input: RequestInfo | URL): string => { if ( parts .slice(6) - .some( - (part) => !['events', 'logs', 'output', 'token', 'reauthorize', 'stream'].includes(part), - ) + .some((part) => !['events', 'logs', 'output', 'token', 'reauthorize', 'stream'].includes(part)) ) return '/v1/machines/{machine_id}/{resource}'; return parts.join('/'); @@ -200,11 +194,9 @@ export const createDiagnostics = (command: string, scope: string, directory = de const safe = parseEvent({ ...event, command, ts: new Date().toISOString() }); if (!safe) throw new Error('invalid diagnostic event'); mkdirSync(directory, { recursive: true, mode: 0o700 }); - if (lstatSync(directory).isSymbolicLink()) - throw new Error('diagnostic directory is a symlink'); + if (lstatSync(directory).isSymbolicLink()) throw new Error('diagnostic directory is a symlink'); const line = JSON.stringify(safe) + '\n'; - if (existsSync(path) && statSync(path).size + Buffer.byteLength(line) > partitionLimit) - return; + if (existsSync(path) && statSync(path).size + Buffer.byteLength(line) > partitionLimit) return; const fd = openSync( path, constants.O_WRONLY | constants.O_CREAT | constants.O_APPEND | constants.O_NOFOLLOW, @@ -258,9 +250,7 @@ export const selectDiagnostics = ( const candidates = files(directory) .filter( (file) => - file.name.startsWith(scope + '.') && - file.time >= now - recentMS && - file.size <= partitionLimit, + file.name.startsWith(scope + '.') && file.time >= now - recentMS && file.size <= partitionLimit, ) .sort((a, b) => b.time - a.time); for (const file of candidates) { @@ -278,9 +268,7 @@ export const selectDiagnostics = ( .flatMap((line) => { try { const event = parseEvent(JSON.parse(line)); - return event && - event.command !== 'dedalus feedback' && - Date.parse(event.ts) >= now - recentMS + return event && event.command !== 'dedalus feedback' && Date.parse(event.ts) >= now - recentMS ? [event] : []; } catch { diff --git a/src/sdk/client.ts b/src/sdk/client.ts index 0ea072b..136f2e8 100644 --- a/src/sdk/client.ts +++ b/src/sdk/client.ts @@ -38,7 +38,6 @@ import { type CreateParams, type UpdateParams, type LifecycleStatus, - type AutoresizingSwitch, type MachineListItemsCursorPage, type MachineRetrieveResponse, type MachineResizeResponse, @@ -492,7 +491,8 @@ export class Dedalus { // A redirect the SDK refused to follow fails the same way on every attempt, so it is not retried. if (isRefusedRedirect(response)) throw response; const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; - if (options.signal?.aborted) { + // The signal the request was sent with, so an aborted `fetchOptions.signal` reads as a cancel too. + if (req.signal?.aborted) { throw new Errors.APIUserAbortError(); } // detect native connection timeout errors @@ -515,7 +515,7 @@ export class Dedalus { message: response.message, }), ); - return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, req.signal); } loggerFor(this).info( `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`, @@ -562,6 +562,7 @@ export class Dedalus { options, retriesRemaining, retryOfRequestLogID ?? requestLogID, + req.signal, response.headers, ); } @@ -851,6 +852,7 @@ export class Dedalus { options: FinalRequestOptions, retriesRemaining: number, requestLogID: string, + signal: RequestInit['signal'], responseHeaders?: Headers | undefined, ): Promise { let timeoutMillis: number | undefined; @@ -890,7 +892,11 @@ export class Dedalus { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } - await sleep(timeoutMillis); + // Cancelling during the backoff ends the call now, rather than after the delay and one more request. + await sleep(timeoutMillis, signal); + if (signal?.aborted) { + throw new Errors.APIUserAbortError(); + } return this.makeRequest(options, retriesRemaining - 1, requestLogID); } @@ -935,13 +941,14 @@ export class Dedalus { const req: FinalizedRequestInit = { method, headers: reqHeaders, - ...(options.signal && { signal: options.signal }), ...((globalThis as any).ReadableStream && body instanceof (globalThis as any).ReadableStream && { duplex: 'half' }), // `buildBody` already collapses no-body into `undefined`; here we only need to drop that // sentinel. A truthiness spread would also strip an intentional empty-string body. ...(body !== undefined && { body }), ...((this.fetchOptions as any) ?? {}), + // The call's own signal beats the client's `fetchOptions.signal`; the call's `fetchOptions` beats both. + ...(options.signal && { signal: options.signal }), ...((options.fetchOptions as any) ?? {}), }; return { req, url, timeout: options.timeout }; @@ -1198,7 +1205,6 @@ export declare namespace Dedalus { type CreateParams as CreateParams, type UpdateParams as UpdateParams, type LifecycleStatus as LifecycleStatus, - type AutoresizingSwitch as AutoresizingSwitch, type MachineListItemsCursorPage as MachineListItemsCursorPage, type MachineRetrieveResponse as MachineRetrieveResponse, type MachineResizeResponse as MachineResizeResponse, diff --git a/src/sdk/internal/qs/LICENSE.md b/src/sdk/internal/qs/LICENSE.md deleted file mode 100644 index 3fda157..0000000 --- a/src/sdk/internal/qs/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/sdk/internal/qs/README.md b/src/sdk/internal/qs/README.md deleted file mode 100644 index 67ae04e..0000000 --- a/src/sdk/internal/qs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# qs - -This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library. diff --git a/src/sdk/internal/qs/formats.ts b/src/sdk/internal/qs/formats.ts deleted file mode 100644 index e76a742..0000000 --- a/src/sdk/internal/qs/formats.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Format } from './types'; - -export const default_format: Format = 'RFC3986'; -export const default_formatter = (v: PropertyKey) => String(v); -export const formatters: Record string> = { - RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'), - RFC3986: default_formatter, -}; -export const RFC1738 = 'RFC1738'; -export const RFC3986 = 'RFC3986'; diff --git a/src/sdk/internal/qs/index.ts b/src/sdk/internal/qs/index.ts deleted file mode 100644 index c3a3620..0000000 --- a/src/sdk/internal/qs/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { default_format, formatters, RFC1738, RFC3986 } from './formats'; - -const formats = { - formatters, - RFC1738, - RFC3986, - default: default_format, -}; - -export { stringify } from './stringify'; -export { formats }; - -export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types'; diff --git a/src/sdk/internal/qs/stringify.ts b/src/sdk/internal/qs/stringify.ts deleted file mode 100644 index 66ef9a4..0000000 --- a/src/sdk/internal/qs/stringify.ts +++ /dev/null @@ -1,384 +0,0 @@ -import { encode, is_buffer, maybe_map, has } from './utils'; -import { default_format, default_formatter, formatters } from './formats'; -import type { NonNullableProperties, StringifyOptions } from './types'; -import { isArray } from '../utils/values'; - -const array_prefix_generators = { - brackets(prefix: PropertyKey) { - return String(prefix) + '[]'; - }, - comma: 'comma', - indices(prefix: PropertyKey, key: string) { - return String(prefix) + '[' + key + ']'; - }, - repeat(prefix: PropertyKey) { - return String(prefix); - }, -}; - -const push_to_array = function (arr: any[], value_or_array: any) { - Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]); -}; - -let toISOString; - -const defaults = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: 'indices', - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encodeDotInKeys: false, - encoder: encode, - encodeValuesOnly: false, - format: default_format, - formatter: default_formatter, - /** @deprecated */ - indices: false, - serializeDate(date) { - return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date); - }, - skipNulls: false, - strictNullHandling: false, -} as NonNullableProperties; - -function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint { - return ( - typeof v === 'string' || - typeof v === 'number' || - typeof v === 'boolean' || - typeof v === 'symbol' || - typeof v === 'bigint' - ); -} - -const sentinel = {}; - -function inner_stringify( - object: any, - prefix: PropertyKey, - generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string), - commaRoundTrip: boolean, - allowEmptyArrays: boolean, - strictNullHandling: boolean, - skipNulls: boolean, - encodeDotInKeys: boolean, - encoder: StringifyOptions['encoder'], - filter: StringifyOptions['filter'], - sort: StringifyOptions['sort'], - allowDots: StringifyOptions['allowDots'], - serializeDate: StringifyOptions['serializeDate'], - format: StringifyOptions['format'], - formatter: StringifyOptions['formatter'], - encodeValuesOnly: boolean, - charset: StringifyOptions['charset'], - sideChannel: WeakMap, -) { - let obj = object; - - let tmp_sc = sideChannel; - let step = 0; - let find_flag = false; - while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) { - // Where object last appeared in the ref tree - const pos = tmp_sc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - find_flag = true; // Break while - } - } - if (typeof tmp_sc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate?.(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = maybe_map(obj, function (value) { - if (value instanceof Date) { - return serializeDate?.(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly - ? // @ts-expect-error - encoder(prefix, defaults.encoder, charset, 'key', format) - : prefix; - } - - obj = ''; - } - - if (is_non_nullish_primitive(obj) || is_buffer(obj)) { - if (encoder) { - const key_value = encodeValuesOnly - ? prefix - : // @ts-expect-error - encoder(prefix, defaults.encoder, charset, 'key', format); - return [ - formatter?.(key_value) + - '=' + - // @ts-expect-error - formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)), - ]; - } - return [formatter?.(prefix) + '=' + formatter?.(String(obj))]; - } - - const values: string[] = []; - - if (typeof obj === 'undefined') { - return values; - } - - let obj_keys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - if (encodeValuesOnly && encoder) { - // @ts-expect-error values only - obj = maybe_map(obj, encoder); - } - obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - obj_keys = filter; - } else { - const keys = Object.keys(obj); - obj_keys = sort ? keys.sort(sort) : keys; - } - - const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); - - const adjusted_prefix = - commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix; - - if (allowEmptyArrays && isArray(obj) && obj.length === 0) { - return adjusted_prefix + '[]'; - } - - for (let j = 0; j < obj_keys.length; ++j) { - const key = obj_keys[j]; - const value = - // @ts-ignore - typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any]; - - if (skipNulls && value === null) { - continue; - } - - // @ts-ignore - const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key; - const key_prefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' - ? generateArrayPrefix(adjusted_prefix, encoded_key) - : adjusted_prefix - : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']'); - - sideChannel.set(object, step); - const valueSideChannel = new WeakMap(); - valueSideChannel.set(sentinel, sideChannel); - push_to_array( - values, - inner_stringify( - value, - key_prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - // @ts-ignore - generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel, - ), - ); - } - - return values; -} - -function normalize_stringify_options( - opts: StringifyOptions = defaults, -): NonNullableProperties> & { indices?: boolean } { - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { - throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - const charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - let format = default_format; - if (typeof opts.format !== 'undefined') { - if (!has(formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - const formatter = formatters[format]; - - let filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - let arrayFormat: StringifyOptions['arrayFormat']; - if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { - arrayFormat = opts.arrayFormat; - } else if ('indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = defaults.arrayFormat; - } - - if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - - const allowDots = - typeof opts.allowDots === 'undefined' - ? !!opts.encodeDotInKeys === true - ? true - : defaults.allowDots - : !!opts.allowDots; - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - // @ts-ignore - allowDots: allowDots, - allowEmptyArrays: - typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - arrayFormat: arrayFormat, - charset: charset, - charsetSentinel: - typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - commaRoundTrip: !!opts.commaRoundTrip, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encodeDotInKeys: - typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: - typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - // @ts-ignore - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: - typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, - }; -} - -export function stringify(object: any, opts: StringifyOptions = {}) { - let obj = object; - const options = normalize_stringify_options(opts); - - let obj_keys: PropertyKey[] | undefined; - let filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - obj_keys = filter; - } - - const keys: string[] = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; - const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; - - if (!obj_keys) { - obj_keys = Object.keys(obj); - } - - if (options.sort) { - obj_keys.sort(options.sort); - } - - const sideChannel = new WeakMap(); - for (let i = 0; i < obj_keys.length; ++i) { - const key = obj_keys[i]!; - - if (options.skipNulls && obj[key] === null) { - continue; - } - push_to_array( - keys, - inner_stringify( - obj[key], - key, - // @ts-expect-error - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel, - ), - ); - } - - const joined = keys.join(options.delimiter); - let prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -} diff --git a/src/sdk/internal/qs/types.ts b/src/sdk/internal/qs/types.ts deleted file mode 100644 index 7c28dbb..0000000 --- a/src/sdk/internal/qs/types.ts +++ /dev/null @@ -1,71 +0,0 @@ -export type Format = 'RFC1738' | 'RFC3986'; - -export type DefaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string; -export type DefaultDecoder = (str: string, decoder?: any, charset?: string) => string; - -export type BooleanOptional = boolean | undefined; - -export type StringifyBaseOptions = { - delimiter?: string; - allowDots?: boolean; - encodeDotInKeys?: boolean; - strictNullHandling?: boolean; - skipNulls?: boolean; - encode?: boolean; - encoder?: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format?: Format, - ) => string; - filter?: Array | ((prefix: PropertyKey, value: any) => any); - arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma'; - indices?: boolean; - sort?: ((a: PropertyKey, b: PropertyKey) => number) | null; - serializeDate?: (d: Date) => string; - format?: 'RFC1738' | 'RFC3986'; - formatter?: (str: PropertyKey) => string; - encodeValuesOnly?: boolean; - addQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - allowEmptyArrays?: boolean; - commaRoundTrip?: boolean; -}; - -export type StringifyOptions = StringifyBaseOptions; - -export type ParseBaseOptions = { - comma?: boolean; - delimiter?: string | RegExp; - depth?: number | false; - decoder?: (str: string, defaultDecoder: DefaultDecoder, charset: string, type: 'key' | 'value') => any; - arrayLimit?: number; - parseArrays?: boolean; - plainObjects?: boolean; - allowPrototypes?: boolean; - allowSparse?: boolean; - parameterLimit?: number; - strictDepth?: boolean; - strictNullHandling?: boolean; - ignoreQueryPrefix?: boolean; - charset?: 'utf-8' | 'iso-8859-1'; - charsetSentinel?: boolean; - interpretNumericEntities?: boolean; - allowEmptyArrays?: boolean; - duplicates?: 'combine' | 'first' | 'last'; - allowDots?: boolean; - decodeDotInKeys?: boolean; -}; - -export type ParseOptions = ParseBaseOptions; - -export type ParsedQs = { - [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[]; -}; - -// Type to remove null or undefined union from each property -export type NonNullableProperties = { - [K in keyof T]-?: Exclude; -}; diff --git a/src/sdk/internal/qs/utils.ts b/src/sdk/internal/qs/utils.ts deleted file mode 100644 index 4cd5657..0000000 --- a/src/sdk/internal/qs/utils.ts +++ /dev/null @@ -1,265 +0,0 @@ -import { RFC1738 } from './formats'; -import type { DefaultEncoder, Format } from './types'; -import { isArray } from '../utils/values'; - -export let has = (obj: object, key: PropertyKey): boolean => ( - (has = (Object as any).hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty)), - has(obj, key) -); - -const hex_table = /* @__PURE__ */ (() => { - const array = []; - for (let i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -})(); - -function compact_queue>(queue: Array<{ obj: T; prop: string }>) { - while (queue.length > 1) { - const item = queue.pop(); - if (!item) continue; - - const obj = item.obj[item.prop]; - - if (isArray(obj)) { - const compacted: unknown[] = []; - - for (let j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - // @ts-ignore - item.obj[item.prop] = compacted; - } - } -} - -function array_to_object(source: any[], options: { plainObjects: boolean }) { - const obj = options && options.plainObjects ? Object.create(null) : {}; - for (let i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -} - -export function merge( - target: any, - source: any, - options: { plainObjects?: boolean; allowPrototypes?: boolean } = {}, -) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - let mergeTarget = target; - if (isArray(target) && !isArray(source)) { - // @ts-ignore - mergeTarget = array_to_object(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has(target, i)) { - const targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - const value = source[key]; - - if (has(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -} - -export function assign_single_source(target: any, source: any) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -} - -export function decode(str: string, _: any, charset: string) { - const strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -} - -const limit = 1024; - -export const encode: ( - str: any, - defaultEncoder: DefaultEncoder, - charset: string, - type: 'key' | 'value', - format: Format, -) => string = (str, _defaultEncoder, charset, _kind, format: Format) => { - // This code was originally written by Brian White for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - let string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - let out = ''; - for (let j = 0; j < string.length; j += limit) { - const segment = string.length >= limit ? string.slice(j, j + limit) : string; - const arr = []; - - for (let i = 0; i < segment.length; ++i) { - let c = segment.charCodeAt(i); - if ( - c === 0x2d || // - - c === 0x2e || // . - c === 0x5f || // _ - c === 0x7e || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5a) || // a-z - (c >= 0x61 && c <= 0x7a) || // A-Z - (format === RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - arr[arr.length] = segment.charAt(i); - continue; - } - - if (c < 0x80) { - arr[arr.length] = hex_table[c]; - continue; - } - - if (c < 0x800) { - arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - if (c < 0xd800 || c >= 0xe000) { - arr[arr.length] = - hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)]; - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff)); - - arr[arr.length] = - hex_table[0xf0 | (c >> 18)]! + - hex_table[0x80 | ((c >> 12) & 0x3f)] + - hex_table[0x80 | ((c >> 6) & 0x3f)] + - hex_table[0x80 | (c & 0x3f)]; - } - - out += arr.join(''); - } - - return out; -}; - -export function compact(value: any) { - const queue = [{ obj: { o: value }, prop: 'o' }]; - const refs = []; - - for (let i = 0; i < queue.length; ++i) { - const item = queue[i]; - // @ts-ignore - const obj = item.obj[item.prop]; - - const keys = Object.keys(obj); - for (let j = 0; j < keys.length; ++j) { - const key = keys[j]!; - const val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compact_queue(queue); - - return value; -} - -export function is_regexp(obj: any) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -} - -export function is_buffer(obj: any) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -} - -export function combine(a: any, b: any) { - return [].concat(a, b); -} - -export function maybe_map(val: T[], fn: (v: T) => T) { - if (isArray(val)) { - const mapped = []; - for (let i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i]!)); - } - return mapped; - } - return fn(val); -} diff --git a/src/sdk/internal/to-file.ts b/src/sdk/internal/to-file.ts index 30eada3..f6552c5 100644 --- a/src/sdk/internal/to-file.ts +++ b/src/sdk/internal/to-file.ts @@ -100,7 +100,9 @@ export async function toFile( if (isResponseLike(value)) { const blob = await value.blob(); - name ||= new URL(value.url).pathname.split(/[\\/]/).pop(); + // A Response a caller built (`new Response(bytes)`) has an empty `url`, which `new URL` throws on; + // it has no name to offer, so the file falls back to the default one. + name ||= value.url ? new URL(value.url).pathname.split(/[\\/]/).pop() : undefined; return makeFile(await getBytes(blob), name, options); } diff --git a/src/sdk/internal/utils/sleep.ts b/src/sdk/internal/utils/sleep.ts index f8d0a12..ad4a275 100644 --- a/src/sdk/internal/utils/sleep.ts +++ b/src/sdk/internal/utils/sleep.ts @@ -1,3 +1,25 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); +/** + * Waits `ms` milliseconds, or until `signal` aborts, whichever comes first. + * + * An abort resolves the wait early instead of rejecting it, so each caller turns a cancelled wait into + * its own error. Without the signal a caller that cancels during a retry backoff would still sit out + * the whole delay, however long the server asked for. The listener is removed once the wait ends, so + * a long-lived signal shared across many requests does not collect one per retry. + */ +export const sleep = (ms: number, signal?: AbortSignal | null | undefined) => + new Promise((resolve) => { + if (signal?.aborted) { + resolve(); + return; + } + /** Ends the wait once, from the timer or the abort, and releases whichever did not fire. */ + const done = () => { + clearTimeout(timer); + signal?.removeEventListener('abort', done); + resolve(); + }; + const timer = setTimeout(done, ms); + signal?.addEventListener('abort', done, { once: true }); + }); diff --git a/src/sdk/resources.ts b/src/sdk/resources.ts index b6221b7..19daf38 100644 --- a/src/sdk/resources.ts +++ b/src/sdk/resources.ts @@ -8,7 +8,6 @@ export type { CreateParams, UpdateParams, LifecycleStatus, - AutoresizingSwitch, MachineListParams, MachineListItemsCursorPage, MachineCreateParams, diff --git a/src/sdk/resources/images/images.ts b/src/sdk/resources/images/images.ts index db6ae33..18731dc 100644 --- a/src/sdk/resources/images/images.ts +++ b/src/sdk/resources/images/images.ts @@ -11,7 +11,7 @@ export class Images extends APIResource { uploads: UploadsAPI.Uploads = new UploadsAPI.Uploads(this._client); /** - * Pages through the organization's images in ID order. A deleted image is left out; it still reads by ID. + * Pages through the organization's images in ID order. Each item has the same shape as a single image read. A deleted image is left out; it still reads by ID. * * @param {ImageListParams} [query] - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. @@ -19,7 +19,7 @@ export class Images extends APIResource { * * @example * ```ts - * const imageList = await client.images.list({ + * const images = await client.images.list({ * limit: 100, * }); * ``` @@ -149,7 +149,7 @@ export namespace Image { } export interface ImageList { - image_ids: Array | null; + items: Array | null; next_cursor?: string; } diff --git a/src/sdk/resources/index.ts b/src/sdk/resources/index.ts index dbb5548..283f989 100644 --- a/src/sdk/resources/index.ts +++ b/src/sdk/resources/index.ts @@ -8,7 +8,6 @@ export type { CreateParams, UpdateParams, LifecycleStatus, - AutoresizingSwitch, MachineListParams, MachineListItemsCursorPage, MachineCreateParams, diff --git a/src/sdk/resources/machines/autoresizing.ts b/src/sdk/resources/machines/autoresizing.ts index 1d43296..07c4a90 100644 --- a/src/sdk/resources/machines/autoresizing.ts +++ b/src/sdk/resources/machines/autoresizing.ts @@ -4,7 +4,6 @@ import { APIResource } from '../../resource'; import { APIPromise } from '../../api-promise'; import type { RequestOptions } from '../../internal/request-options'; import { path as __scalarPath } from '../../internal/utils/path'; -import type * as MachinesAPI from './machines'; export class Autoresizing extends APIResource { /** @@ -50,7 +49,7 @@ export interface Policy { /** * Permit automatic CPU growth independently of RAM. */ - cpu: MachinesAPI.AutoresizingSwitch; + cpu: 'on' | 'off'; cpu_limit_source: 'plan' | 'configured' | 'platform'; /** * Configured CPU growth limit in 0.25-vCPU steps. Null uses the plan limit. @@ -75,7 +74,7 @@ export interface Policy { /** * Permit automatic RAM growth. Automatic shrink remains internal. */ - memory: MachinesAPI.AutoresizingSwitch; + memory: 'on' | 'off'; memory_limit_source: 'plan' | 'configured' | 'platform'; /** * Configured RAM growth limit in MiB. Null uses the plan limit. @@ -105,7 +104,7 @@ export interface AutoresizingUpdateParams { /** * Body param */ - cpu?: MachinesAPI.AutoresizingSwitch; + cpu?: 'on' | 'off'; /** * Body param * @format double @@ -116,7 +115,7 @@ export interface AutoresizingUpdateParams { /** * Body param */ - memory?: MachinesAPI.AutoresizingSwitch; + memory?: 'on' | 'off'; /** * Body param * @format int64 diff --git a/src/sdk/resources/machines/executions/executions.ts b/src/sdk/resources/machines/executions/executions.ts index 8647db7..c02c797 100644 --- a/src/sdk/resources/machines/executions/executions.ts +++ b/src/sdk/resources/machines/executions/executions.ts @@ -146,6 +146,9 @@ export class Executions extends APIResource { } export interface ExecutionCreateParams { + /** + * Program and its arguments as an array of strings, such as ["ls", "-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "-c", ""]. + */ command: Array | null; cwd?: string; env?: Record; @@ -305,7 +308,7 @@ export interface ExecutionCreateParams { */ machine_id: string; /** - * Body param + * Body param: Program and its arguments as an array of strings, such as ["ls", "-la"]. A single string is not split into arguments. To run a shell command line, pass ["sh", "-c", ""]. */ command: Array | null; /** diff --git a/src/sdk/resources/machines/index.ts b/src/sdk/resources/machines/index.ts index 9c753eb..9ea9432 100644 --- a/src/sdk/resources/machines/index.ts +++ b/src/sdk/resources/machines/index.ts @@ -8,7 +8,6 @@ export type { CreateParams, UpdateParams, LifecycleStatus, - AutoresizingSwitch, MachineListParams, MachineListItemsCursorPage, MachineCreateParams, @@ -54,3 +53,14 @@ export type { } from './executions/executions'; export { Autoresizing } from './autoresizing'; export type { Policy, AutoresizingRetrieveParams, AutoresizingUpdateParams } from './autoresizing'; +export { Ports } from './ports/ports'; +export type { + PortCreateParams, + PortUpdateParams, + Port, + PortList, + PortListParams, + PortsCursorPage, + PortRetrieveParams, + PortDeleteParams, +} from './ports/ports'; diff --git a/src/sdk/resources/machines/machines.ts b/src/sdk/resources/machines/machines.ts index fe68a21..4d96922 100644 --- a/src/sdk/resources/machines/machines.ts +++ b/src/sdk/resources/machines/machines.ts @@ -45,11 +45,24 @@ import { type AutoresizingRetrieveParams, type AutoresizingUpdateParams, } from './autoresizing'; +import * as PortsAPI from './ports/ports'; +import { + Ports, + type PortCreateParams, + type PortUpdateParams, + type Port, + type PortList, + type PortsCursorPage, + type PortListParams, + type PortRetrieveParams, + type PortDeleteParams, +} from './ports/ports'; export class Machines extends APIResource { ssh: SSHAPI.SSH = new SSHAPI.SSH(this._client); executions: ExecutionsAPI.Executions = new ExecutionsAPI.Executions(this._client); autoresizing: AutoresizingAPI.Autoresizing = new AutoresizingAPI.Autoresizing(this._client); + ports: PortsAPI.Ports = new PortsAPI.Ports(this._client); /** * List machines @@ -433,8 +446,6 @@ export namespace LifecycleStatus { } } -export type AutoresizingSwitch = 'on' | 'off'; - export interface MachineListParams extends CursorPageParams {} export type MachineListItemsCursorPage = CursorPage; @@ -633,6 +644,7 @@ export interface MachineResizeResponse { Machines.SSH = SSH; Machines.Executions = Executions; Machines.Autoresizing = Autoresizing; +Machines.Ports = Ports; export declare namespace Machines { export { @@ -642,7 +654,6 @@ export declare namespace Machines { type CreateParams as CreateParams, type UpdateParams as UpdateParams, type LifecycleStatus as LifecycleStatus, - type AutoresizingSwitch as AutoresizingSwitch, type MachineListItemsCursorPage as MachineListItemsCursorPage, type MachineRetrieveResponse as MachineRetrieveResponse, type MachineResizeResponse as MachineResizeResponse, @@ -695,4 +706,16 @@ export declare namespace Machines { type AutoresizingRetrieveParams as AutoresizingRetrieveParams, type AutoresizingUpdateParams as AutoresizingUpdateParams, }; + + export { + Ports as Ports, + type PortCreateParams as PortCreateParams, + type PortUpdateParams as PortUpdateParams, + type Port as Port, + type PortList as PortList, + type PortsCursorPage as PortsCursorPage, + type PortListParams as PortListParams, + type PortRetrieveParams as PortRetrieveParams, + type PortDeleteParams as PortDeleteParams, + }; } diff --git a/src/sdk/resources/machines/ports.ts b/src/sdk/resources/machines/ports.ts new file mode 100644 index 0000000..d55103a --- /dev/null +++ b/src/sdk/resources/machines/ports.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export * from './ports/index'; diff --git a/src/sdk/resources/machines/ports/access-keys.ts b/src/sdk/resources/machines/ports/access-keys.ts new file mode 100644 index 0000000..d62eb10 --- /dev/null +++ b/src/sdk/resources/machines/ports/access-keys.ts @@ -0,0 +1,316 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from '../../../resource'; +import { APIPromise } from '../../../api-promise'; +import type { RequestOptions } from '../../../internal/request-options'; +import { path as __scalarPath } from '../../../internal/utils/path'; + +export class AccessKeys extends APIResource { + /** + * List port access keys + * + * @param {AccessKeyListParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const accessKey = await client.machines.ports.accessKeys.list({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * }); + * ``` + */ + list(params: AccessKeyListParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id, ...query } = params; + return this._client.get(__scalarPath`/v1/machines/${machine_id}/ports/${port_id}/access-keys`, { + query, + ...options, + }); + } + + /** + * Mint port access key + * + * @param {AccessKeyMintParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const accessKey = await client.machines.ports.accessKeys.mint({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * expires_in: 1, + * }); + * ``` + */ + mint(params: AccessKeyMintParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id, ...body } = params; + return this._client.post(__scalarPath`/v1/machines/${machine_id}/ports/${port_id}/access-keys`, { + body, + ...options, + }); + } + + /** + * Revoke port access key + * + * @param {AccessKeyRevokeParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const accessKey = await client.machines.ports.accessKeys.revoke({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * access_key_id: 'accessKeyID', + * }); + * ``` + */ + revoke(params: AccessKeyRevokeParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id, access_key_id } = params; + return this._client.delete( + __scalarPath`/v1/machines/${machine_id}/ports/${port_id}/access-keys/${access_key_id}`, + options, + ); + } + + /** + * Rotate port access key + * + * @param {AccessKeyRotateParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const accessKey = await client.machines.ports.accessKeys.rotate({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * access_key_id: 'accessKeyID', + * expires_in: 1, + * }); + * ``` + */ + rotate(params: AccessKeyRotateParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id, access_key_id, ...body } = params; + return this._client.post( + __scalarPath`/v1/machines/${machine_id}/ports/${port_id}/access-keys/${access_key_id}/rotate`, + { body, ...options }, + ); + } +} + +export interface AccessKeyListParams { + /** + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * Path param + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; + /** + * Query param + * @format int64 + */ + limit?: number; + /** + * Query param + */ + cursor?: string; +} + +export interface AccessKeyListResponse { + items: Array | null; + next_cursor?: string; +} + +export namespace AccessKeyListResponse { + export interface Item { + access_key_id: string; + /** + * @format date-time + */ + created_at: string; + /** + * @format date-time + */ + expires_at: string; + port_id: string; + /** + * Most recent durably recorded use, coalesced to five-minute resolution. + * @format date-time + */ + last_used_at?: string; + /** + * @format date-time + */ + revoked_at?: string; + } +} + +export interface AccessKeyMintParams { + /** + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * Path param + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; + /** + * Body param: Lifetime in integer seconds. + * @format int32 + * @minimum 1 + * @maximum 2147483647 + */ + expires_in: number; +} + +export interface AccessKeyMintResponse { + access_key: string; + access_key_id: string; + /** + * @format date-time + */ + created_at: string; + /** + * @format date-time + */ + expires_at: string; + port_id: string; + /** + * Most recent durably recorded use, coalesced to five-minute resolution. + * @format date-time + */ + last_used_at?: string; + /** + * @format date-time + */ + revoked_at?: string; +} + +export interface AccessKeyRevokeParams { + /** + * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; + /** + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + access_key_id: string; +} + +export interface AccessKeyRevokeResponse { + access_key_id: string; + /** + * @format date-time + */ + created_at: string; + /** + * @format date-time + */ + expires_at: string; + port_id: string; + /** + * Most recent durably recorded use, coalesced to five-minute resolution. + * @format date-time + */ + last_used_at?: string; + /** + * @format date-time + */ + revoked_at?: string; +} + +export interface AccessKeyRotateParams { + /** + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * Path param + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; + /** + * Path param + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + access_key_id: string; + /** + * Body param: Lifetime in integer seconds. + * @format int32 + * @minimum 1 + * @maximum 2147483647 + */ + expires_in: number; +} + +export interface AccessKeyRotateResponse { + access_key: string; + access_key_id: string; + /** + * @format date-time + */ + created_at: string; + /** + * @format date-time + */ + expires_at: string; + port_id: string; + /** + * Most recent durably recorded use, coalesced to five-minute resolution. + * @format date-time + */ + last_used_at?: string; + /** + * @format date-time + */ + revoked_at?: string; +} +export declare namespace AccessKeys { + export { + type AccessKeyListResponse as AccessKeyListResponse, + type AccessKeyMintResponse as AccessKeyMintResponse, + type AccessKeyRevokeResponse as AccessKeyRevokeResponse, + type AccessKeyRotateResponse as AccessKeyRotateResponse, + type AccessKeyListParams as AccessKeyListParams, + type AccessKeyMintParams as AccessKeyMintParams, + type AccessKeyRevokeParams as AccessKeyRevokeParams, + type AccessKeyRotateParams as AccessKeyRotateParams, + }; +} diff --git a/src/sdk/resources/machines/ports/index.ts b/src/sdk/resources/machines/ports/index.ts new file mode 100644 index 0000000..2f57978 --- /dev/null +++ b/src/sdk/resources/machines/ports/index.ts @@ -0,0 +1,24 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export { Ports } from './ports'; +export type { + PortCreateParams, + PortUpdateParams, + Port, + PortList, + PortListParams, + PortsCursorPage, + PortRetrieveParams, + PortDeleteParams, +} from './ports'; +export { AccessKeys } from './access-keys'; +export type { + AccessKeyListParams, + AccessKeyListResponse, + AccessKeyMintParams, + AccessKeyMintResponse, + AccessKeyRevokeParams, + AccessKeyRevokeResponse, + AccessKeyRotateParams, + AccessKeyRotateResponse, +} from './access-keys'; diff --git a/src/sdk/resources/machines/ports/ports.ts b/src/sdk/resources/machines/ports/ports.ts new file mode 100644 index 0000000..b522441 --- /dev/null +++ b/src/sdk/resources/machines/ports/ports.ts @@ -0,0 +1,362 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from '../../../resource'; +import { APIPromise } from '../../../api-promise'; +import { CursorPage, type CursorPageParams, type PagePromise } from '../../../core/pagination'; +import type { RequestOptions } from '../../../internal/request-options'; +import { path as __scalarPath } from '../../../internal/utils/path'; +import * as AccessKeysAPI from './access-keys'; +import { + AccessKeys, + type AccessKeyListResponse, + type AccessKeyMintResponse, + type AccessKeyRevokeResponse, + type AccessKeyRotateResponse, + type AccessKeyListParams, + type AccessKeyMintParams, + type AccessKeyRevokeParams, + type AccessKeyRotateParams, +} from './access-keys'; + +export class Ports extends APIResource { + accessKeys: AccessKeysAPI.AccessKeys = new AccessKeysAPI.AccessKeys(this._client); + + /** + * List ports + * + * @param {PortListParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {PagePromise} OK + * + * @example + * ```ts + * const page = await client.machines.ports.list({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * }); + * ``` + */ + list(params: PortListParams, options?: RequestOptions): PagePromise { + const { machine_id, ...query } = params; + return this._client.getAPIList(__scalarPath`/v1/machines/${machine_id}/ports`, CursorPage, { + query, + ...options, + }); + } + + /** + * Create port + * + * @param {PortCreateParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const port = await client.machines.ports.create({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port: 0, + * protocol: 'http', + * visibility: 'private', + * }); + * ``` + */ + create(params: PortCreateParams, options?: RequestOptions): APIPromise { + const { machine_id, ...body } = params; + return this._client.post(__scalarPath`/v1/machines/${machine_id}/ports`, { body, ...options }); + } + + /** + * Get port + * + * @param {PortRetrieveParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const port = await client.machines.ports.retrieve({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * }); + * ``` + */ + retrieve(params: PortRetrieveParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id } = params; + return this._client.get(__scalarPath`/v1/machines/${machine_id}/ports/${port_id}`, options); + } + + /** + * Update port + * + * @param {PortUpdateParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const port = await client.machines.ports.update({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * visibility: 'public', + * }); + * ``` + */ + update(params: PortUpdateParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id, ...body } = params; + return this._client.patch(__scalarPath`/v1/machines/${machine_id}/ports/${port_id}`, { + body, + ...options, + }); + } + + /** + * Delete port + * + * @param {PortDeleteParams} params - The parameters to send with the request. + * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. + * @returns {APIPromise} OK + * + * @example + * ```ts + * const port = await client.machines.ports.delete({ + * machine_id: '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + * port_id: 'portID', + * }); + * ``` + */ + delete(params: PortDeleteParams, options?: RequestOptions): APIPromise { + const { machine_id, port_id } = params; + return this._client.delete(__scalarPath`/v1/machines/${machine_id}/ports/${port_id}`, options); + } +} + +export interface PortCreateParams { + /** + * @format int64 + */ + port: number; + /** + * Port lifetime in integer seconds. Omit for no expiry. + * @format int32 + * @minimum 1 + * @maximum 2147483647 + */ + expires?: number; + /** + * @default http + */ + protocol?: 'http'; + /** + * Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges. + * @default private + */ + visibility?: 'public' | 'key_required' | 'private'; +} + +export interface PortUpdateParams { + /** + * Who may reach the port. private requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges. + */ + visibility: 'public' | 'key_required' | 'private'; +} + +export interface Port { + /** + * Isolated guest application origin. Direct clients preserve their HTTP method and body and send any required Dedalus credential in headers. + */ + application_url: string; + /** + * @format date-time + */ + created_at: string; + /** + * @format uuid + */ + machine_id: string; + /** + * @format int64 + */ + port: number; + port_id: string; + /** + * Unavailable is a recoverable failure reaching the guest service. See error_code and error_message for the diagnosis. + */ + status: 'wake_in_progress' | 'ready' | 'unavailable' | 'closed' | 'expired' | 'failed'; + visibility: 'public' | 'key_required' | 'private'; + error_code?: string; + error_message?: string; + /** + * @format date-time + */ + expires_at?: string; + /** + * Initial key for a newly created key_required port. Plaintext is returned once and omitted on replay. + */ + initial_access_key?: Port.InitialAccessKey; + protocol?: 'http'; + /** + * @format date-time + */ + ready_at?: string; + /** + * @format int64 + */ + retry_after_ms?: number; + /** + * Stable browser share URL. Browser navigation only; use application_url for APIs, webhooks, and WebSockets. + */ + url?: string; +} + +export namespace Port { + export interface InitialAccessKey { + access_key: string; + access_key_id: string; + /** + * @format date-time + */ + created_at: string; + /** + * @format date-time + */ + expires_at: string; + port_id: string; + /** + * Most recent durably recorded use, coalesced to five-minute resolution. + * @format date-time + */ + last_used_at?: string; + /** + * @format date-time + */ + revoked_at?: string; + } +} + +export interface PortList { + items: Array | null; + next_cursor?: string; +} + +export interface PortListParams extends CursorPageParams { + /** + * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; +} + +export type PortsCursorPage = CursorPage; + +export interface PortCreateParams { + /** + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * Body param: Port lifetime in integer seconds. Omit for no expiry. + * @format int32 + * @minimum 1 + * @maximum 2147483647 + */ + expires?: number; + /** + * Body param + * @format int64 + */ + port: number; + /** + * Body param + * @default http + */ + protocol?: 'http'; + /** + * Body param: Who may reach the port. private, the default, requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header, and creating the port returns its first key once. public accepts anonymous requests, which can wake the machine and incur compute charges. + * @default private + */ + visibility?: 'public' | 'key_required' | 'private'; +} + +export interface PortRetrieveParams { + /** + * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; +} + +export interface PortUpdateParams { + /** + * Path param: Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * Path param + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; + /** + * Body param: Who may reach the port. private requires a Dedalus API key from the owning organization in the X-Dedalus-API-Key header. key_required requires a port access key in the X-Dedalus-Port-Key header. public accepts anonymous requests, which can wake the machine and incur compute charges. + */ + visibility: 'public' | 'key_required' | 'private'; +} + +export interface PortDeleteParams { + /** + * Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged. + * @minLength 36 + * @maxLength 39 + * @pattern ^(dm-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + */ + machine_id: string; + /** + * @minLength 1 + * @maxLength 253 + * @pattern ^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$ + */ + port_id: string; +} +Ports.AccessKeys = AccessKeys; + +export declare namespace Ports { + export { + type PortCreateParams as PortCreateParams, + type PortUpdateParams as PortUpdateParams, + type Port as Port, + type PortList as PortList, + type PortsCursorPage as PortsCursorPage, + type PortListParams as PortListParams, + type PortRetrieveParams as PortRetrieveParams, + type PortDeleteParams as PortDeleteParams, + }; + + export { + AccessKeys as AccessKeys, + type AccessKeyListResponse as AccessKeyListResponse, + type AccessKeyMintResponse as AccessKeyMintResponse, + type AccessKeyRevokeResponse as AccessKeyRevokeResponse, + type AccessKeyRotateResponse as AccessKeyRotateResponse, + type AccessKeyListParams as AccessKeyListParams, + type AccessKeyMintParams as AccessKeyMintParams, + type AccessKeyRevokeParams as AccessKeyRevokeParams, + type AccessKeyRotateParams as AccessKeyRotateParams, + }; +} diff --git a/src/sdk/resources/organization/autoresizing.ts b/src/sdk/resources/organization/autoresizing.ts index a90d475..9bef817 100644 --- a/src/sdk/resources/organization/autoresizing.ts +++ b/src/sdk/resources/organization/autoresizing.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { APIPromise } from '../../api-promise'; import type { RequestOptions } from '../../internal/request-options'; -import type * as MachinesAPI from '../machines/machines'; export class Autoresizing extends APIResource { /** @@ -42,7 +41,7 @@ export interface Policy { /** * Permit automatic CPU growth independently of RAM. */ - cpu: MachinesAPI.AutoresizingSwitch; + cpu: 'on' | 'off'; cpu_limit_source: 'plan' | 'configured' | 'platform'; /** * Configured CPU growth limit in 0.25-vCPU steps. Null uses the plan limit. @@ -67,7 +66,7 @@ export interface Policy { /** * Permit automatic RAM growth. Automatic shrink remains internal. */ - memory: MachinesAPI.AutoresizingSwitch; + memory: 'on' | 'off'; memory_limit_source: 'plan' | 'configured' | 'platform'; /** * Configured RAM growth limit in MiB. Null uses the plan limit. @@ -77,14 +76,14 @@ export interface Policy { } export interface AutoresizingUpdateParams { - cpu?: MachinesAPI.AutoresizingSwitch; + cpu?: 'on' | 'off'; /** * @format double * @minimum 0.25 * @multipleOf 0.25 */ cpu_max_vcpu?: number | null; - memory?: MachinesAPI.AutoresizingSwitch; + memory?: 'on' | 'off'; /** * @format int64 * @minimum 256 diff --git a/tests/browser-login.test.mjs b/tests/browser-login.test.mjs index 24064ef..8586f29 100644 --- a/tests/browser-login.test.mjs +++ b/tests/browser-login.test.mjs @@ -12,12 +12,22 @@ const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.'); const { auth } = await import(pathToFileURL(join(root, 'dist/esm/commands/index.js'))); const { runLogin, runLogout } = await import(pathToFileURL(join(root, 'dist/esm/cli/login.js'))); const { takeWarnings } = await import(pathToFileURL(join(root, 'dist/esm/cli/credentials.js'))); -const browserMethod = { name: 'browser', label: 'Browser', kind: 'oauth', grant: 'authorizationCode', - clientKey: 'apiKey', clientId: 'dedalus-cli', redirectPort: 0, scopes: ['dedalus:cli', 'offline_access'], - authorizationUrl: '', tokenUrl: '', refreshUrl: '' }; +const browserMethod = { + name: 'browser', + label: 'Browser', + kind: 'oauth', + grant: 'authorizationCode', + clientKey: 'apiKey', + clientId: 'dedalus-cli', + redirectPort: 0, + scopes: ['dedalus:cli', 'offline_access'], + authorizationUrl: '', + tokenUrl: '', + refreshUrl: '', +}; test('invariant_public_browser_flow_contains_production_provider_configuration', () => { - const method = auth.methods.find(method => method.kind === 'oauth'); + const method = auth.methods.find((method) => method.kind === 'oauth'); assert.equal(method.name, 'oauth-browser'); assert.equal(method.clientKey, 'browserToken'); assert.equal(method.issuer, 'https://clerk.dedaluslabs.ai'); @@ -33,10 +43,22 @@ test('invariant_public_browser_flow_contains_production_provider_configuration', assert.deepEqual(auth.requirements, [['browserToken'], ['xAPIKey'], ['apiKey']]); }); -for (const callbackCase of ['valid', 'wrong-issuer', 'missing-issuer', 'duplicate-issuer', 'wrong-state', 'duplicate-state', 'duplicate-code', 'duplicate-error']) { +for (const callbackCase of [ + 'valid', + 'wrong-issuer', + 'missing-issuer', + 'duplicate-issuer', + 'wrong-state', + 'duplicate-state', + 'duplicate-code', + 'duplicate-error', +]) { const invalid = callbackCase !== 'valid'; - test(invalid ? `invariant_unbound_callback_never_exchanges_or_stores_tokens (${callbackCase})` : 'invariant_browser_session_persists_refreshes_and_revokes_credentials', { - skip: process.platform === 'win32', timeout: 15000, + test(invalid + ? `invariant_unbound_callback_never_exchanges_or_stores_tokens (${callbackCase})` + : 'invariant_browser_session_persists_refreshes_and_revokes_credentials', { + skip: process.platform === 'win32', + timeout: 15000, }, async (t) => { const directory = mkdtempSync(join(tmpdir(), 'dedalus-browser-test-')); t.after(() => rmSync(directory, { recursive: true, force: true })); @@ -65,7 +87,8 @@ for (const callbackCase of ['valid', 'wrong-issuer', 'missing-issuer', 'duplicat callback.searchParams.append('error', 'server_error'); } if (callbackCase === 'wrong-state') callback.searchParams.set('state', 'unbound-state'); - if (callbackCase === 'duplicate-state') callback.searchParams.append('state', authorization.get('state')); + if (callbackCase === 'duplicate-state') + callback.searchParams.append('state', authorization.get('state')); res.writeHead(302, { location: callback.href }).end(); } else if (req.url === '/oauth2/revoke') { let body = ''; @@ -78,26 +101,50 @@ for (const callbackCase of ['valid', 'wrong-issuer', 'missing-issuer', 'duplicat for await (const chunk of req) body += chunk; const form = new URLSearchParams(body); exchanges.push(form); - res.writeHead(200, { 'content-type': 'application/json' }).end(JSON.stringify({ - access_token: exchanges.length === 1 ? 'test-access' : 'test-refreshed', - refresh_token: exchanges.length === 1 ? 'test-refresh' : 'test-rotated', - token_type: 'Bearer', expires_in: 3600, - })); + res.writeHead(200, { 'content-type': 'application/json' }).end( + JSON.stringify({ + access_token: exchanges.length === 1 ? 'test-access' : 'test-refreshed', + refresh_token: exchanges.length === 1 ? 'test-refresh' : 'test-rotated', + token_type: 'Bearer', + expires_in: 3600, + }), + ); } else { requests.push(req.headers.authorization); - res.writeHead(200, { 'content-type': 'application/json' }) + res + .writeHead(200, { 'content-type': 'application/json' }) .end(JSON.stringify({ items: [], next_cursor: null })); } }); await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); - t.after(() => { server.closeAllConnections(); server.close(); }); + t.after(() => { + server.closeAllConnections(); + server.close(); + }); const origin = 'http://127.0.0.1:' + server.address().port; const store = join(directory, 'credentials.json'); - const env = { ...process.env, PATH: directory + ':' + process.env.PATH, - DEDALUS_CREDENTIALS_FILE: store, TEST_API_ORIGIN: origin }; - for (const key of ['DEDALUS_API_KEY', 'DEDALUS_X_API_KEY', 'DEDALUS_BASE_URL', 'DEDALUS_CUSTOM_HEADERS', 'DEDALUS_BROWSER_TOKEN']) delete env[key]; - const run = (args, browser = false) => new Promise((resolve, reject) => { - const child = spawn(process.execPath, ['--input-type=module', '-e', ` + const env = { + ...process.env, + PATH: directory + ':' + process.env.PATH, + DEDALUS_CREDENTIALS_FILE: store, + TEST_API_ORIGIN: origin, + }; + for (const key of [ + 'DEDALUS_API_KEY', + 'DEDALUS_X_API_KEY', + 'DEDALUS_BASE_URL', + 'DEDALUS_CUSTOM_HEADERS', + 'DEDALUS_BROWSER_TOKEN', + ]) + delete env[key]; + const run = (args, browser = false) => + new Promise((resolve, reject) => { + const child = spawn( + process.execPath, + [ + '--input-type=module', + '-e', + ` import { auth, getProgram } from './dist/esm/commands/index.js'; const origin = process.env.TEST_API_ORIGIN; auth.backend = 'file'; @@ -106,21 +153,36 @@ for (const callbackCase of ['valid', 'wrong-issuer', 'missing-issuer', 'duplicat authorizationUrl: origin + '/oauth2/auth', tokenUrl: origin + '/oauth2/token', refreshUrl: origin + '/oauth2/token', revocationUrl: origin + '/oauth2/revoke' }]; await getProgram().parseAsync(JSON.parse(process.env.TEST_ARGS), { from: 'user' }); - `], { cwd: root, env: { ...env, TEST_ARGS: JSON.stringify([...args, '--base-url', origin]) }, stdio: ['ignore', 'pipe', 'pipe'] }); - t.after(() => { if (child.exitCode === null) child.kill(); }); - let stdout = '', stderr = '', opened = false; - child.stdout.on('data', (chunk) => { stdout += chunk; }); - child.stderr.on('data', (chunk) => { - stderr += chunk; - const match = stderr.match(/ (http:\/\/127\.0\.0\.1:[^\s]+)/); - if (browser && match && !opened) { - opened = true; - fetch(match[1]).then((response) => response.text()).catch(reject); - } + `, + ], + { + cwd: root, + env: { ...env, TEST_ARGS: JSON.stringify([...args, '--base-url', origin]) }, + stdio: ['ignore', 'pipe', 'pipe'], + }, + ); + t.after(() => { + if (child.exitCode === null) child.kill(); + }); + let stdout = '', + stderr = '', + opened = false; + child.stdout.on('data', (chunk) => { + stdout += chunk; + }); + child.stderr.on('data', (chunk) => { + stderr += chunk; + const match = stderr.match(/ (http:\/\/127\.0\.0\.1:[^\s]+)/); + if (browser && match && !opened) { + opened = true; + fetch(match[1]) + .then((response) => response.text()) + .catch(reject); + } + }); + child.on('error', reject); + child.on('exit', (code) => resolve({ code, stdout, stderr })); }); - child.on('error', reject); - child.on('exit', (code) => resolve({ code, stdout, stderr })); - }); const login = await run(['login', '--flow', 'browser'], true); if (invalid) { assert.notEqual(login.code, 0); @@ -135,8 +197,10 @@ for (const callbackCase of ['valid', 'wrong-issuer', 'missing-issuer', 'duplicat assert.equal(authorization.get('scope'), 'dedalus:cli offline_access'); assert.ok(Buffer.from(authorization.get('state'), 'base64url').length >= 16); assert.equal(authorization.get('code_challenge_method'), 'S256'); - assert.equal(createHash('sha256').update(exchanges[0].get('code_verifier')).digest('base64url'), - authorization.get('code_challenge')); + assert.equal( + createHash('sha256').update(exchanges[0].get('code_verifier')).digest('base64url'), + authorization.get('code_challenge'), + ); assert.equal(exchanges[0].get('redirect_uri'), authorization.get('redirect_uri')); assert.deepEqual(exchanges[0].getAll('resource'), [origin]); assert.equal(statSync(store).mode & 0o777, 0o600); @@ -150,7 +214,10 @@ for (const callbackCase of ['valid', 'wrong-issuer', 'missing-issuer', 'duplicat assert.equal(exchanges[1].get('refresh_token'), 'test-refresh'); assert.deepEqual(exchanges[1].getAll('resource'), [origin]); assert.equal(requests.at(-1), 'Bearer test-refreshed'); - assert.equal(JSON.parse(readFileSync(store, 'utf8')).profiles[origin].oauth.apiKey.refreshToken, 'test-rotated'); + assert.equal( + JSON.parse(readFileSync(store, 'utf8')).profiles[origin].oauth.apiKey.refreshToken, + 'test-rotated', + ); assert.equal((await run(['machines', 'list', '--api-key', 'explicit'])).code, 0); assert.equal(requests.at(-1), 'Bearer explicit'); const logout = await run(['logout']); @@ -170,7 +237,10 @@ test('design_logout_clears_local_credentials_despite_revocation_failure', { time const store = join(directory, 'credentials.json'); const variable = 'DEDALUS_LOGOUT_TEST_STORE'; process.env[variable] = store; - t.after(() => { delete process.env[variable]; rmSync(directory, { recursive: true, force: true }); }); + t.after(() => { + delete process.env[variable]; + rmSync(directory, { recursive: true, force: true }); + }); const config = { ...auth, methods: [browserMethod], backend: 'file', storeEnv: variable }; let behavior = 'success'; let warnings = ''; @@ -179,7 +249,10 @@ test('design_logout_clears_local_credentials_despite_revocation_failure', { time let body = ''; for await (const chunk of req) body += chunk; requests.push(Object.fromEntries(new URLSearchParams(body))); - if (behavior === 'offline') { req.socket.destroy(); return; } + if (behavior === 'offline') { + req.socket.destroy(); + return; + } if (behavior === 'timeout') return; if (behavior === 'replace') { const data = { version: 1, profiles: { [origin]: { credentials: { apiKey: 'new-access' } } } }; @@ -187,19 +260,36 @@ test('design_logout_clears_local_credentials_despite_revocation_failure', { time } res.writeHead(behavior === 'failure' ? 503 : 204).end(); }); - await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)); - t.after(() => { server.closeAllConnections(); server.close(); }); + await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); + t.after(() => { + server.closeAllConnections(); + server.close(); + }); const origin = 'http://127.0.0.1:' + server.address().port; - const oauth = { credentials: { apiKey: 'access-secret' }, oauth: { apiKey: { - refreshToken: 'refresh-secret', clientId: 'client', revocationUrl: origin + '/revoke', - } } }; + const oauth = { + credentials: { apiKey: 'access-secret' }, + oauth: { + apiKey: { + refreshToken: 'refresh-secret', + clientId: 'client', + revocationUrl: origin + '/revoke', + }, + }, + }; const save = (profile = oauth) => { warnings = ''; takeWarnings(); requests.length = 0; - writeFileSync(store, JSON.stringify({ version: 1, profiles: { - [origin]: profile, 'https://manual.example': { credentials: { apiKey: 'manual' } }, - } })); + writeFileSync( + store, + JSON.stringify({ + version: 1, + profiles: { + [origin]: profile, + 'https://manual.example': { credentials: { apiKey: 'manual' } }, + }, + }), + ); }; const profiles = () => JSON.parse(readFileSync(store, 'utf8')).profiles; for (behavior of ['success', 'failure', 'offline', 'timeout', 'replace']) { @@ -212,19 +302,24 @@ test('design_logout_clears_local_credentials_despite_revocation_failure', { time assert.deepEqual(requests, [ { token: 'refresh-secret', token_type_hint: 'refresh_token', client_id: 'client' }, ...(['success', 'replace'].includes(behavior) - ? [{ token: 'access-secret', token_type_hint: 'access_token', client_id: 'client' }] : []), + ? [{ token: 'access-secret', token_type_hint: 'access_token', client_id: 'client' }] + : []), ]); - if (['failure', 'offline', 'timeout'].includes(behavior)) assert.match(warnings, /could not revoke|not revoked/); + if (['failure', 'offline', 'timeout'].includes(behavior)) + assert.match(warnings, /could not revoke|not revoked/); else assert.equal(warnings, ''); assert.doesNotMatch(warnings, /access-secret|refresh-secret/); - if (behavior === 'timeout') assert.ok(Date.now() - started < 9000, 'revocation must finish near its 5-second timeout'); + if (behavior === 'timeout') + assert.ok(Date.now() - started < 9000, 'revocation must finish near its 5-second timeout'); } behavior = 'success'; const accessOnly = structuredClone(oauth); delete accessOnly.oauth.apiKey.refreshToken; save(accessOnly); await runLogout(config, origin, false); - assert.deepEqual(requests, [{ token: 'access-secret', token_type_hint: 'access_token', client_id: 'client' }]); + assert.deepEqual(requests, [ + { token: 'access-secret', token_type_hint: 'access_token', client_id: 'client' }, + ]); assert.equal(profiles()[origin], undefined); assert.ok(profiles()['https://manual.example']); const legacy = structuredClone(oauth); diff --git a/tests/browser-routing.test.mjs b/tests/browser-routing.test.mjs index eebc97c..5372835 100644 --- a/tests/browser-routing.test.mjs +++ b/tests/browser-routing.test.mjs @@ -7,19 +7,42 @@ import { Command } from 'commander'; const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.'); const { sdkClientOptions } = await import(pathToFileURL(join(root, 'dist/esm/cli/runtime.js'))); const clientOptions = [ - { clientKey: 'browserToken', sdkKey: 'browserToken', name: 'browser-token', optionKey: 'browserToken', auth: true }, - { clientKey: 'apiKey', sdkKey: 'apiKey', name: 'api-key', optionKey: 'apiKey', auth: true, env: 'DEDALUS_API_KEY' }, - { clientKey: 'xAPIKey', sdkKey: 'xAPIKey', name: 'x-api-key', optionKey: 'xApiKey', auth: true, env: 'DEDALUS_X_API_KEY' }, + { + clientKey: 'browserToken', + sdkKey: 'browserToken', + name: 'browser-token', + optionKey: 'browserToken', + auth: true, + }, + { + clientKey: 'apiKey', + sdkKey: 'apiKey', + name: 'api-key', + optionKey: 'apiKey', + auth: true, + env: 'DEDALUS_API_KEY', + }, + { + clientKey: 'xAPIKey', + sdkKey: 'xAPIKey', + name: 'x-api-key', + optionKey: 'xApiKey', + auth: true, + env: 'DEDALUS_X_API_KEY', + }, ]; const cleanEnvironment = (t) => { for (const key of ['DEDALUS_API_KEY', 'DEDALUS_X_API_KEY', 'DEDALUS_BASE_URL', 'DEDALUS_BROWSER_TOKEN']) { const previous = process.env[key]; delete process.env[key]; - t.after(() => { if (previous === undefined) delete process.env[key]; else process.env[key] = previous; }); + t.after(() => { + if (previous === undefined) delete process.env[key]; + else process.env[key] = previous; + }); } }; -const options = (values, environment) => sdkClientOptions(values, - new Command('dedalus').version('test'), clientOptions, undefined, [], environment); +const options = (values, environment) => + sdkClientOptions(values, new Command('dedalus').version('test'), clientOptions, undefined, [], environment); test('invariant_browser_credentials_are_routed_only_to_the_production_api', async (t) => { cleanEnvironment(t); @@ -28,27 +51,52 @@ test('invariant_browser_credentials_are_routed_only_to_the_production_api', asyn assert.equal(result.baseURL, 'https://dcs.dedaluslabs.ai'); assert.equal(result.browserToken, 'fixture-browser-token'); } - for (const baseUrl of ['https://gateway.invalid/dcs', 'https://other.invalid', 'http://dcs.dedaluslabs.ai', - 'https://dcs.dedaluslabs.ai.attacker.invalid', 'https://dcs.dedaluslabs.ai/private']) { - await assert.rejects(options({ browserToken: 'fixture-browser-token', baseUrl }), - new RegExp(`production DCS API .*--base-url is ${baseUrl.replace(/[.\/]/g, '\\$&')}\\. Unset --base-url`)); + for (const baseUrl of [ + 'https://gateway.invalid/dcs', + 'https://other.invalid', + 'http://dcs.dedaluslabs.ai', + 'https://dcs.dedaluslabs.ai.attacker.invalid', + 'https://dcs.dedaluslabs.ai/private', + ]) { + await assert.rejects( + options({ browserToken: 'fixture-browser-token', baseUrl }), + new RegExp( + `production DCS API .*--base-url is ${baseUrl.replace(/[.\/]/g, '\\$&')}\\. Unset --base-url`, + ), + ); } process.env.DEDALUS_BASE_URL = 'https://other.invalid'; - await assert.rejects(options({ browserToken: 'fixture-browser-token' }), - /DEDALUS_BASE_URL is https:\/\/other\.invalid\. Unset DEDALUS_BASE_URL/); + await assert.rejects( + options({ browserToken: 'fixture-browser-token' }), + /DEDALUS_BASE_URL is https:\/\/other\.invalid\. Unset DEDALUS_BASE_URL/, + ); }); test('invariant_mixed_authentication_and_other_environments_fail_before_request_construction', async (t) => { cleanEnvironment(t); - for (const [credential, source] of [[{ apiKey: 'fixture-key' }, 'DEDALUS_API_KEY'], [{ xApiKey: 'fixture-key' }, 'DEDALUS_X_API_KEY']]) { - await assert.rejects(options({ browserToken: 'fixture-browser-token', ...credential }), new RegExp(`${source}\\), not both`)); + for (const [credential, source] of [ + [{ apiKey: 'fixture-key' }, 'DEDALUS_API_KEY'], + [{ xApiKey: 'fixture-key' }, 'DEDALUS_X_API_KEY'], + ]) { + await assert.rejects( + options({ browserToken: 'fixture-browser-token', ...credential }), + new RegExp(`${source}\\), not both`), + ); } for (const key of ['DEDALUS_API_KEY', 'DEDALUS_X_API_KEY']) { process.env[key] = 'fixture-key'; - await assert.rejects(options({ browserToken: 'fixture-browser-token' }), new RegExp(`${key}\\), not both`)); + await assert.rejects( + options({ browserToken: 'fixture-browser-token' }), + new RegExp(`${key}\\), not both`), + ); delete process.env[key]; } - await assert.rejects(options({ browserToken: 'fixture-browser-token' }, 'staging'), /production environment/); - assert.equal((await options({ browserToken: 'fixture-browser-token' }, 'production')).baseURL, - 'https://dcs.dedaluslabs.ai'); + await assert.rejects( + options({ browserToken: 'fixture-browser-token' }, 'staging'), + /production environment/, + ); + assert.equal( + (await options({ browserToken: 'fixture-browser-token' }, 'production')).baseURL, + 'https://dcs.dedaluslabs.ai', + ); }); diff --git a/tests/credential-boundary.test.mjs b/tests/credential-boundary.test.mjs index b630e57..8f07731 100644 --- a/tests/credential-boundary.test.mjs +++ b/tests/credential-boundary.test.mjs @@ -16,34 +16,72 @@ const fixture = async (t) => { requests.push(req.headers.authorization); const rejected = req.headers.authorization === 'Bearer rejected-key'; res.writeHead(rejected ? 401 : 200, { 'content-type': 'application/json' }); - res.end(JSON.stringify(rejected - ? { error_code: 'UNAUTHORIZED', message: 'fixture rejected credential' } - : { items: [], next_cursor: null })); + res.end( + JSON.stringify( + rejected + ? { error_code: 'UNAUTHORIZED', message: 'fixture rejected credential' } + : { items: [], next_cursor: null }, + ), + ); }); await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); const origin = `http://127.0.0.1:${server.address().port}`; - t.after(() => { server.closeAllConnections(); server.close(); rmSync(directory, { recursive: true, force: true }); }); - const cleanEnv = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith('DEDALUS_'))); - const run = (args = [], extraEnv = {}) => new Promise((resolve, reject) => { - const child = spawn(process.execPath, [join(root, 'dist/esm/bin.js'), - 'machines', 'list', '--base-url', origin, '--max-retries', '0', ...args], { - env: { ...cleanEnv, DEDALUS_CREDENTIALS_FILE: store, ...extraEnv }, - stdio: ['ignore', 'pipe', 'pipe'], - }); - let stdout = '', stderr = ''; - child.stdout.on('data', (chunk) => { stdout += chunk; }); - child.stderr.on('data', (chunk) => { stderr += chunk; }); - child.on('error', reject); - child.on('close', (code) => resolve({ code, stdout, stderr })); - t.after(() => { if (child.exitCode === null) child.kill(); }); + t.after(() => { + server.closeAllConnections(); + server.close(); + rmSync(directory, { recursive: true, force: true }); }); - const save = (base = origin) => writeFileSync(store, JSON.stringify({ - version: 1, profiles: { [base]: { credentials: { apiKey: 'saved-key' }, backend: 'file' } }, - }), { mode: 0o600 }); + const cleanEnv = Object.fromEntries( + Object.entries(process.env).filter(([key]) => !key.startsWith('DEDALUS_')), + ); + const run = (args = [], extraEnv = {}) => + new Promise((resolve, reject) => { + const child = spawn( + process.execPath, + [ + join(root, 'dist/esm/bin.js'), + 'machines', + 'list', + '--base-url', + origin, + '--max-retries', + '0', + ...args, + ], + { + env: { ...cleanEnv, DEDALUS_CREDENTIALS_FILE: store, ...extraEnv }, + stdio: ['ignore', 'pipe', 'pipe'], + }, + ); + let stdout = '', + stderr = ''; + child.stdout.on('data', (chunk) => { + stdout += chunk; + }); + child.stderr.on('data', (chunk) => { + stderr += chunk; + }); + child.on('error', reject); + child.on('close', (code) => resolve({ code, stdout, stderr })); + t.after(() => { + if (child.exitCode === null) child.kill(); + }); + }); + const save = (base = origin) => + writeFileSync( + store, + JSON.stringify({ + version: 1, + profiles: { [base]: { credentials: { apiKey: 'saved-key' }, backend: 'file' } }, + }), + { mode: 0o600 }, + ); return { run, save, requests, store }; }; -test('invariant_installed_entrypoint_uses_the_selected_credential_without_exposing_it', { timeout: 10000 }, async (t) => { +test('invariant_installed_entrypoint_uses_the_selected_credential_without_exposing_it', { + timeout: 10000, +}, async (t) => { const f = await fixture(t); f.save(); for (const [args, env, expected] of [ @@ -58,7 +96,9 @@ test('invariant_installed_entrypoint_uses_the_selected_credential_without_exposi } }); -test('invariant_rejected_explicit_credentials_never_fall_back_to_saved_credentials', { timeout: 10000 }, async (t) => { +test('invariant_rejected_explicit_credentials_never_fall_back_to_saved_credentials', { + timeout: 10000, +}, async (t) => { const f = await fixture(t); f.save(); const result = await f.run(['--api-key', 'rejected-key']); @@ -75,7 +115,9 @@ test('invariant_credentials_for_another_api_never_reach_the_request', { timeout: assert.deepEqual(f.requests, []); }); -test('invariant_corrupt_saved_credentials_do_not_block_explicit_authentication', { timeout: 10000 }, async (t) => { +test('invariant_corrupt_saved_credentials_do_not_block_explicit_authentication', { + timeout: 10000, +}, async (t) => { const f = await fixture(t); writeFileSync(f.store, '{invalid'); const result = await f.run(['--api-key', 'flag-key']); diff --git a/tests/feedback-bundles.test.mjs b/tests/feedback-bundles.test.mjs index ceb939a..a282d39 100644 --- a/tests/feedback-bundles.test.mjs +++ b/tests/feedback-bundles.test.mjs @@ -45,8 +45,7 @@ test('invariant auto selects only recent failures for the same credential and ho log.record({ kind: 'transport_failure', route: '/v1/machines', duration_ms: 3 }); log.record({ kind: 'command_failure' }); assert.ok( - buildFeedbackBundle('auto', scope, 'https://staging.invalid', '1.0.0', dir).attachments.length > - 0, + buildFeedbackBundle('auto', scope, 'https://staging.invalid', '1.0.0', dir).attachments.length > 0, ); assert.equal(selectDiagnostics(diagnosticScope({ apiKey: 'other-key' }), dir).events.length, 0); assert.equal(selectDiagnostics(scope, dir, Date.now() + 16 * 60 * 1000).events.length, 0); @@ -80,8 +79,7 @@ test('invariant attachments contain only allowlisted fields and exact byte hashe for (const file of bundle.attachments) { assert.equal(file.manifest.sha256, createHash('sha256').update(file.bytes).digest('hex')); assert.equal(file.manifest.size_bytes, file.bytes.length); - const content = - file.manifest.format === 'application/gzip' ? gunzipSync(file.bytes) : file.bytes; + const content = file.manifest.format === 'application/gzip' ? gunzipSync(file.bytes) : file.bytes; assert.doesNotMatch( Buffer.from(content).toString(), /super-secret|secret-password|private workspace|user:password|token=secret/, diff --git a/tests/feedback-command.test.mjs b/tests/feedback-command.test.mjs index 8b72003..7a071aa 100644 --- a/tests/feedback-command.test.mjs +++ b/tests/feedback-command.test.mjs @@ -120,43 +120,40 @@ for (const [status, exitCode] of [ [429, 12], [422, 13], ]) { - test( - 'invariant installed CLI reports HTTP ' + status + ' without claiming acceptance', - async (t) => { - const envelope = { - error_code: status === 429 ? 'RATE_LIMITED' : 'INVALID_REQUEST', - message: 'fixture rejection', - retryable: status === 429, - ...(status === 429 ? { retry_after_ms: 1000, details: { rate_limit_scope: 'organization' } } : {}), - }; - const server = createServer((req, res) => { - req.resume(); - res.writeHead(status, { 'content-type': 'application/json' }); - res.end(JSON.stringify(envelope)); - }); - await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); - t.after(() => server.close()); - const result = await runCLI([ - 'feedback', - 'rejection check', - '--include-logs=false', - '--api-key', - 'test-key', - '--base-url', - 'http://127.0.0.1:' + server.address().port, - '--max-retries', - '0', - '--format', - 'json', - ]); - assert.equal(result.code, exitCode, result.stderr); - assert.equal(result.stdout, ''); - assert.match(result.stderr, /fixture rejection/); - const error = JSON.parse(result.stderr); - assert.equal(error.status, status); - assert.deepEqual(error.body, envelope); - }, - ); + test('invariant installed CLI reports HTTP ' + status + ' without claiming acceptance', async (t) => { + const envelope = { + error_code: status === 429 ? 'RATE_LIMITED' : 'INVALID_REQUEST', + message: 'fixture rejection', + retryable: status === 429, + ...(status === 429 ? { retry_after_ms: 1000, details: { rate_limit_scope: 'organization' } } : {}), + }; + const server = createServer((req, res) => { + req.resume(); + res.writeHead(status, { 'content-type': 'application/json' }); + res.end(JSON.stringify(envelope)); + }); + await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); + t.after(() => server.close()); + const result = await runCLI([ + 'feedback', + 'rejection check', + '--include-logs=false', + '--api-key', + 'test-key', + '--base-url', + 'http://127.0.0.1:' + server.address().port, + '--max-retries', + '0', + '--format', + 'json', + ]); + assert.equal(result.code, exitCode, result.stderr); + assert.equal(result.stdout, ''); + assert.match(result.stderr, /fixture rejection/); + const error = JSON.parse(result.stderr); + assert.equal(error.status, status); + assert.deepEqual(error.body, envelope); + }); } test('invariant installed CLI retries one submission with the same idempotency key', async (t) => { @@ -211,51 +208,58 @@ test('invariant invalid include-logs values fail before submission', async () => }); for (const failsDecoding of [false, true]) { - test('invariant feedback follows the terminal command outcome after HTTP responses: ' + (failsDecoding ? 'decoding failure' : 'recovered retry'), async (t) => { - const home = mkdtempSync(join(tmpdir(), 'dedalus-command-outcome-')); - t.after(() => rmSync(home, { recursive: true, force: true })); - let attempts = 0; - let report; - const server = createServer(async (req, res) => { - const chunks = []; - for await (const chunk of req) chunks.push(chunk); - if (req.url === '/v1/feedback') { - const wire = new Request('http://fixture/v1/feedback', { - method: 'POST', headers: req.headers, body: Buffer.concat(chunks), - }); - report = req.headers['content-type'].startsWith('multipart/') - ? JSON.parse((await wire.formData()).get('metadata')) - : await wire.json(); - res.writeHead(201, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ id: receipt, source: 'cli', debug: report.debug })); - return; - } - attempts++; - res.setHeader('content-type', 'application/json'); - res.setHeader('x-request-id', receipt); - if (!failsDecoding && attempts === 1) { - res.writeHead(503, { 'retry-after-ms': '1' }); - res.end('{"message":"retry fixture"}'); - } else { - res.writeHead(200); - res.end(failsDecoding ? '{' : '{"data":[]}'); - } - }); - await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); - t.after(() => server.close()); - const options = ['--api-key', 'test-key', '--base-url', 'http://127.0.0.1:' + server.address().port]; - const command = await runCLI(['machines', 'list', ...options], { HOME: home }); - assert.equal(command.code, failsDecoding ? 1 : 0, command.stderr); - assert.equal(attempts, failsDecoding ? 1 : 2); - const feedback = await runCLI([ - 'feedback', 'command outcome', '--include-logs=' + (failsDecoding ? 'false' : 'auto'), ...options, - ], { HOME: home }); - assert.equal(feedback.code, 0, feedback.stderr); - assert.equal(report.debug.included, false); - assert.deepEqual(report.debug.files, []); - assert.equal(report.reported_request_id, failsDecoding ? receipt : undefined); - assert.equal(report.diagnostics, undefined); - }); + test( + 'invariant feedback follows the terminal command outcome after HTTP responses: ' + + (failsDecoding ? 'decoding failure' : 'recovered retry'), + async (t) => { + const home = mkdtempSync(join(tmpdir(), 'dedalus-command-outcome-')); + t.after(() => rmSync(home, { recursive: true, force: true })); + let attempts = 0; + let report; + const server = createServer(async (req, res) => { + const chunks = []; + for await (const chunk of req) chunks.push(chunk); + if (req.url === '/v1/feedback') { + const wire = new Request('http://fixture/v1/feedback', { + method: 'POST', + headers: req.headers, + body: Buffer.concat(chunks), + }); + report = req.headers['content-type'].startsWith('multipart/') + ? JSON.parse((await wire.formData()).get('metadata')) + : await wire.json(); + res.writeHead(201, { 'content-type': 'application/json' }); + res.end(JSON.stringify({ id: receipt, source: 'cli', debug: report.debug })); + return; + } + attempts++; + res.setHeader('content-type', 'application/json'); + res.setHeader('x-request-id', receipt); + if (!failsDecoding && attempts === 1) { + res.writeHead(503, { 'retry-after-ms': '1' }); + res.end('{"message":"retry fixture"}'); + } else { + res.writeHead(200); + res.end(failsDecoding ? '{' : '{"data":[]}'); + } + }); + await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); + t.after(() => server.close()); + const options = ['--api-key', 'test-key', '--base-url', 'http://127.0.0.1:' + server.address().port]; + const command = await runCLI(['machines', 'list', ...options], { HOME: home }); + assert.equal(command.code, failsDecoding ? 1 : 0, command.stderr); + assert.equal(attempts, failsDecoding ? 1 : 2); + const feedback = await runCLI( + ['feedback', 'command outcome', '--include-logs=' + (failsDecoding ? 'false' : 'auto'), ...options], + { HOME: home }, + ); + assert.equal(feedback.code, 0, feedback.stderr); + assert.equal(report.debug.included, false); + assert.deepEqual(report.debug.files, []); + assert.equal(report.reported_request_id, failsDecoding ? receipt : undefined); + assert.equal(report.diagnostics, undefined); + }, + ); } test('invariant generated and custom commands share scoped stored credentials and request headers', async (t) => { @@ -272,12 +276,22 @@ test('invariant generated and custom commands share scoped stored credentials an t.after(() => server.close()); const baseURL = 'http://127.0.0.1:' + server.address().port; const store = join(directory, 'credentials.json'); - writeFileSync(store, JSON.stringify({ version: 1, profiles: { - [baseURL]: { backend: 'file', credentials: { apiKey: 'stored-key' } }, - 'https://other.invalid': { backend: 'file', credentials: { apiKey: 'other-host-key' } }, - } }), { mode: 0o600 }); - const env = { HOME: directory, DEDALUS_CREDENTIALS_FILE: store, - DEDALUS_CUSTOM_HEADERS: 'x-request-id: ' + receipt }; + writeFileSync( + store, + JSON.stringify({ + version: 1, + profiles: { + [baseURL]: { backend: 'file', credentials: { apiKey: 'stored-key' } }, + 'https://other.invalid': { backend: 'file', credentials: { apiKey: 'other-host-key' } }, + }, + }), + { mode: 0o600 }, + ); + const env = { + HOME: directory, + DEDALUS_CREDENTIALS_FILE: store, + DEDALUS_CUSTOM_HEADERS: 'x-request-id: ' + receipt, + }; for (const args of [ ['machines', 'list'], ['feedback', 'stored credential', '--include-logs=false'], @@ -292,8 +306,18 @@ test('invariant generated and custom commands share scoped stored credentials an assert.match(headers['user-agent'], /^Dedalus\/CLI /); assert.ok(headers['x-dedalus-cli-command'].startsWith('dedalus ')); } - const explicit = await runCLI(['feedback', 'explicit credential', '--include-logs=false', - '--base-url', baseURL, '--api-key', 'explicit-key'], env); + const explicit = await runCLI( + [ + 'feedback', + 'explicit credential', + '--include-logs=false', + '--base-url', + baseURL, + '--api-key', + 'explicit-key', + ], + env, + ); assert.equal(explicit.code, 0, explicit.stderr); assert.equal(requests.at(-1).headers.authorization, 'Bearer explicit-key'); }); diff --git a/tests/feedback-diagnostics.test.mjs b/tests/feedback-diagnostics.test.mjs index 6c3617e..d702fb9 100644 --- a/tests/feedback-diagnostics.test.mjs +++ b/tests/feedback-diagnostics.test.mjs @@ -6,8 +6,9 @@ import { pathToFileURL } from 'node:url'; import { test } from 'node:test'; const root = resolve(process.env.FEEDBACK_PACKAGE_ROOT ?? '.'); -const { createDiagnostics, diagnosticScope, selectDiagnostics, pruneDiagnostics } = - await import(pathToFileURL(join(root, 'dist/esm/feedback/diagnostics.js'))); +const { createDiagnostics, diagnosticScope, selectDiagnostics, pruneDiagnostics } = await import( + pathToFileURL(join(root, 'dist/esm/feedback/diagnostics.js')) +); const scope = diagnosticScope({ apiKey: 'test-key', baseURL: 'https://staging.invalid' }); const receipt = '01973f7b7cf6726a9a9f4f37d4b47a21'; const directory = (t) => { @@ -35,9 +36,14 @@ test('invariant recording drops fields outside the diagnostic contract', (t) => const dir = directory(t); const log = createDiagnostics('dedalus machines create', scope, dir); log.record({ - kind: 'response', status_code: 500, route: '/v1/machines', request_id: receipt, - duration_ms: 7, authorization: 'Bearer super-secret', - body: { password: 'secret-password' }, error: 'private workspace content', + kind: 'response', + status_code: 500, + route: '/v1/machines', + request_id: receipt, + duration_ms: 7, + authorization: 'Bearer super-secret', + body: { password: 'secret-password' }, + error: 'private workspace content', }); const raw = readFileSync(join(dir, readdirSync(dir)[0]), 'utf8'); assert.doesNotMatch(raw, /super-secret|secret-password|private workspace/); @@ -58,8 +64,13 @@ test('invariant feedback logs and symlinked files cannot be selected', (t) => { test('invariant local SSH failure retains the last session API receipt', (t) => { const dir = directory(t); const log = createDiagnostics('dedalus ssh', scope, dir); - log.record({ kind: 'response', route: '/v1/machines/{machine_id}/ssh', - status_code: 200, duration_ms: 10, request_id: receipt }); + log.record({ + kind: 'response', + route: '/v1/machines/{machine_id}/ssh', + status_code: 200, + duration_ms: 10, + request_id: receipt, + }); log.record({ kind: 'command_failure' }); const selection = selectDiagnostics(scope, dir); assert.equal(selection.receipt, receipt); @@ -70,10 +81,19 @@ test('invariant local SSH failure retains the last session API receipt', (t) => test('invariant a later response without a receipt does not reuse an older receipt', (t) => { const dir = directory(t); const log = createDiagnostics('dedalus ssh', scope, dir); - log.record({ kind: 'response', route: '/v1/machines/{machine_id}/ssh', - status_code: 500, duration_ms: 10, request_id: receipt }); - log.record({ kind: 'response', route: '/v1/machines/{machine_id}/ssh/{resource_id}', - status_code: 200, duration_ms: 5 }); + log.record({ + kind: 'response', + route: '/v1/machines/{machine_id}/ssh', + status_code: 500, + duration_ms: 10, + request_id: receipt, + }); + log.record({ + kind: 'response', + route: '/v1/machines/{machine_id}/ssh/{resource_id}', + status_code: 200, + duration_ms: 5, + }); log.record({ kind: 'command_failure' }); const selection = selectDiagnostics(scope, dir); assert.equal(selection.receipt, undefined); @@ -94,9 +114,15 @@ test('invariant partitions are capped and expired logs are pruned', (t) => { test('invariant transport capture preserves receipts without request data', async (t) => { const dir = directory(t); - t.mock.method(globalThis, 'fetch', async () => new Response('private response body', { - status: 500, headers: { 'X-Request-ID': receipt }, - })); + t.mock.method( + globalThis, + 'fetch', + async () => + new Response('private response body', { + status: 500, + headers: { 'X-Request-ID': receipt }, + }), + ); const diagnostics = createDiagnostics('dedalus machines retrieve', scope, dir); await diagnostics.fetch('https://staging.invalid/v1/machines/private-machine?token=secret-query', { headers: { Authorization: 'Bearer secret-key' }, @@ -123,8 +149,20 @@ test('invariant client processing failures retain the latest valid response rece const dir = directory(t); const latestReceipt = '01973f7b7cf6726a9a9f4f37d4b47a22'; const log = createDiagnostics('dedalus machines list', scope, dir); - log.record({ kind: 'response', status_code: 503, route: '/v1/machines', request_id: receipt, duration_ms: 1 }); - log.record({ kind: 'response', status_code: 200, route: '/v1/machines', request_id: latestReceipt, duration_ms: 2 }); + log.record({ + kind: 'response', + status_code: 503, + route: '/v1/machines', + request_id: receipt, + duration_ms: 1, + }); + log.record({ + kind: 'response', + status_code: 200, + route: '/v1/machines', + request_id: latestReceipt, + duration_ms: 2, + }); log.record({ kind: 'command_failure' }); const selection = selectDiagnostics(scope, dir); assert.equal(selection.receipt, latestReceipt); diff --git a/tests/feedback-retry-keys.test.mjs b/tests/feedback-retry-keys.test.mjs index 22a2e73..a46f9d8 100644 --- a/tests/feedback-retry-keys.test.mjs +++ b/tests/feedback-retry-keys.test.mjs @@ -2,21 +2,27 @@ import assert from 'node:assert/strict'; import { pathToFileURL } from 'node:url'; import { join, resolve } from 'node:path'; import { test } from 'node:test'; -const { default: SDK } = await import(pathToFileURL(join(resolve(process.env.FEEDBACK_PACKAGE_ROOT ?? '.'), 'dist/esm/sdk/index.js'))); +const { default: SDK } = await import( + pathToFileURL(join(resolve(process.env.FEEDBACK_PACKAGE_ROOT ?? '.'), 'dist/esm/sdk/index.js')) +); test('invariant automatic retries preserve a valid feedback identity', async () => { const keys = []; const uuid7 = /^[0-9a-f]{12}7[0-9a-f]{3}[89ab][0-9a-f]{15}$/; - const client = new SDK({ baseURL: 'https://feedback.invalid', apiKey: 'fixture-key', maxRetries: 1, logLevel: 'off', + const client = new SDK({ + baseURL: 'https://feedback.invalid', + apiKey: 'fixture-key', + maxRetries: 1, + logLevel: 'off', fetch: async (_url, options) => { const key = new Headers(options.headers).get('Idempotency-Key'); keys.push(key); assert.match(key, uuid7, 'automatic feedback key must match the API contract'); - if (keys.length === 1) return Response.json({}, {status: 503, headers: {'retry-after-ms': '1'}}); - return Response.json({id: key}, {status: 201}); + if (keys.length === 1) return Response.json({}, { status: 503, headers: { 'retry-after-ms': '1' } }); + return Response.json({ id: key }, { status: 201 }); }, }); - await client.post('/v1/feedback', {body: {message: 'fixture', source: 'cli'}}); - await client.post('/v1/feedback', {body: {message: 'new submission', source: 'cli'}}); + await client.post('/v1/feedback', { body: { message: 'fixture', source: 'cli' } }); + await client.post('/v1/feedback', { body: { message: 'new submission', source: 'cli' } }); assert.equal(keys.length, 3); assert.equal(keys[0], keys[1], 'automatic retry must preserve identity'); assert.notEqual(keys[1], keys[2], 'new submission must receive its own identity'); diff --git a/tests/feedback-runtime.test.mjs b/tests/feedback-runtime.test.mjs index a280686..02928f0 100644 --- a/tests/feedback-runtime.test.mjs +++ b/tests/feedback-runtime.test.mjs @@ -10,7 +10,10 @@ const { default: SDK } = await import(pathToFileURL(join(root, 'dist/esm/sdk/ind test('invariant error formatting preserves errors with an explicit response body', async (t) => { let output = ''; - t.mock.method(process.stderr, 'write', (chunk) => { output += chunk; return true; }); + t.mock.method(process.stderr, 'write', (chunk) => { + output += chunk; + return true; + }); const body = { error_code: 'INVALID_REQUEST', message: 'fixture rejection', retryable: false }; await writeError({ message: body.message, status: 422, body }, { format: 'json' }, [], SDK); assert.deepEqual(JSON.parse(output).body, body); @@ -24,9 +27,16 @@ test('invariant SDK requests preserve organization scope without forwarding rece else process.env.DEDALUS_CUSTOM_HEADERS = previous; }); const command = new Command('dedalus').version('1.0.0').command('machines').command('create'); - const options = await sdkClientOptions({ - baseUrl: 'https://staging.invalid', apiKey: 'test-key', xDedalusOrgId: 'org-current', - }, command, [{ name: 'api-key', optionKey: 'apiKey', sdkKey: 'apiKey' }], undefined); + const options = await sdkClientOptions( + { + baseUrl: 'https://staging.invalid', + apiKey: 'test-key', + xDedalusOrgId: 'org-current', + }, + command, + [{ name: 'api-key', optionKey: 'apiKey', sdkKey: 'apiKey' }], + undefined, + ); let headers; const client = new SDK({ ...options, diff --git a/tests/fixtures/production-oauth-entrypoint.mjs b/tests/fixtures/production-oauth-entrypoint.mjs index 40ee860..e6b7ada 100644 --- a/tests/fixtures/production-oauth-entrypoint.mjs +++ b/tests/fixtures/production-oauth-entrypoint.mjs @@ -15,14 +15,20 @@ childProcess.spawnSync = (file, ...args) => { }; syncBuiltinESMExports(); -const json = (value, status = 200) => new Response(JSON.stringify(value), { - status, headers: { 'content-type': 'application/json' }, -}); +const json = (value, status = 200) => + new Response(JSON.stringify(value), { + status, + headers: { 'content-type': 'application/json' }, + }); globalThis.fetch = async (input, init) => { const request = new Request(input, init); const form = new URLSearchParams(await request.clone().text()); - const record = { url: request.url, method: request.method, - authorization: request.headers.get('authorization'), form: Object.fromEntries(form) }; + const record = { + url: request.url, + method: request.method, + authorization: request.headers.get('authorization'), + form: Object.fromEntries(form), + }; appendFileSync(process.env.TEST_REQUESTS, JSON.stringify(record) + '\n'); if (request.url === 'https://clerk.dedaluslabs.ai/oauth/token') { assert.equal(request.method, 'POST'); @@ -33,9 +39,12 @@ globalThis.fetch = async (input, init) => { assert.equal(form.get('grant_type'), refresh ? 'refresh_token' : 'authorization_code'); if (refresh) assert.equal(form.get('refresh_token'), 'fixture-refresh'); else assert.equal(form.get('code'), 'fixture-code'); - return json({ access_token: refresh ? 'fixture-renewed' : 'fixture-access', + return json({ + access_token: refresh ? 'fixture-renewed' : 'fixture-access', refresh_token: refresh ? 'fixture-rotated' : 'fixture-refresh', - token_type: 'Bearer', expires_in: 3600 }); + token_type: 'Bearer', + expires_in: 3600, + }); } if (request.url === 'https://clerk.dedaluslabs.ai/oauth/token/revoke') { assert.equal(request.method, 'POST'); diff --git a/tests/homebrew-release.test.mjs b/tests/homebrew-release.test.mjs index a39d7f1..db8df41 100644 --- a/tests/homebrew-release.test.mjs +++ b/tests/homebrew-release.test.mjs @@ -1,126 +1,106 @@ -import assert from "node:assert/strict"; -import { spawnSync } from "node:child_process"; -import { createHash } from "node:crypto"; -import { - chmodSync, - cpSync, - mkdirSync, - mkdtempSync, - readFileSync, - rmSync, - writeFileSync, -} from "node:fs"; -import { tmpdir } from "node:os"; -import { join } from "node:path"; -import { test } from "node:test"; -import { parse } from "yaml"; -import { renderFormula } from "../scripts/update-homebrew.mjs"; +import assert from 'node:assert/strict'; +import { spawnSync } from 'node:child_process'; +import { createHash } from 'node:crypto'; +import { chmodSync, cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { test } from 'node:test'; +import { parse } from 'yaml'; +import { renderFormula } from '../scripts/update-homebrew.mjs'; -const targets = ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"]; +const targets = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64']; -test("invariant_formulas_pin_every_platform_archive_before_updating_the_tap", () => { - const directory = mkdtempSync(join(tmpdir(), "homebrew-archives-")); +test('invariant_formulas_pin_every_platform_archive_before_updating_the_tap', () => { + const directory = mkdtempSync(join(tmpdir(), 'homebrew-archives-')); try { - for (const target of targets) - writeFileSync(join(directory, `dedalus-${target}.tar.gz`), target); - const formula = renderFormula( - "0.7.0", - "dedalus-labs/dedalus-cli", - directory, - ); + for (const target of targets) writeFileSync(join(directory, `dedalus-${target}.tar.gz`), target); + const formula = renderFormula('0.7.0', 'dedalus-labs/dedalus-cli', directory); for (const target of targets) { assert.ok(formula.includes(`/v0.7.0/dedalus-${target}.tar.gz`)); - assert.ok( - formula.includes(createHash("sha256").update(target).digest("hex")), - ); + assert.ok(formula.includes(createHash('sha256').update(target).digest('hex'))); } - rmSync(join(directory, "dedalus-linux-arm64.tar.gz")); - assert.throws( - () => renderFormula("0.7.0", "dedalus-labs/dedalus-cli", directory), - /ENOENT/, - ); + rmSync(join(directory, 'dedalus-linux-arm64.tar.gz')); + assert.throws(() => renderFormula('0.7.0', 'dedalus-labs/dedalus-cli', directory), /ENOENT/); } finally { rmSync(directory, { recursive: true, force: true }); } }); function verifyPublication(workflow) { - const root = mkdtempSync(join(tmpdir(), "homebrew-review-")); - const bare = join(root, "remote.git"); - const seed = join(root, "seed"); - const release = join(root, "release"); - const binaries = join(root, "bin"); - const published = join(root, "published"); - const definition = parse(readFileSync( - new URL(`../.github/workflows/${workflow}.yml`, import.meta.url), "utf8", - )); - const steps = definition.jobs[workflow === "release-please" ? "publish" : "release"].steps; - const compile = steps.find(step => step.name === "Compile standalone binaries").run; - const upload = steps.find(step => step.name === "Attach binaries to the release").run; - const homebrew = steps.find(step => step.name === "Open Homebrew release PR").run; - const state = join(root, "prs.json"); + const root = mkdtempSync(join(tmpdir(), 'homebrew-review-')); + const bare = join(root, 'remote.git'); + const seed = join(root, 'seed'); + const release = join(root, 'release'); + const binaries = join(root, 'bin'); + const published = join(root, 'published'); + const definition = parse( + readFileSync(new URL(`../.github/workflows/${workflow}.yml`, import.meta.url), 'utf8'), + ); + const steps = definition.jobs[workflow === 'release-please' ? 'publish' : 'release'].steps; + const compile = steps.find((step) => step.name === 'Compile standalone binaries').run; + const upload = steps.find((step) => step.name === 'Attach binaries to the release').run; + const homebrew = steps.find((step) => step.name === 'Open Homebrew release PR').run; + const state = join(root, 'prs.json'); const env = { ...process.env, - GIT_CONFIG_GLOBAL: "/dev/null", - GIT_CONFIG_NOSYSTEM: "1", - GIT_CONFIG_COUNT: "1", + GIT_CONFIG_GLOBAL: '/dev/null', + GIT_CONFIG_NOSYSTEM: '1', + GIT_CONFIG_COUNT: '1', GIT_CONFIG_KEY_0: `url.file://${bare}.insteadOf`, - GIT_CONFIG_VALUE_0: - "https://x-access-token:fixture@github.com/dedalus-labs/homebrew-tap.git", - GIT_TERMINAL_PROMPT: "0", - HOMEBREW_TAP_TOKEN: "fixture", - GITHUB_REPOSITORY: "dedalus-labs/dedalus-cli", + GIT_CONFIG_VALUE_0: 'https://x-access-token:fixture@github.com/dedalus-labs/homebrew-tap.git', + GIT_TERMINAL_PROMPT: '0', + HOMEBREW_TAP_TOKEN: 'fixture', + GITHUB_REPOSITORY: 'dedalus-labs/dedalus-cli', HOMEBREW_TEST_PR_STATE: state, RELEASE_TEST_ASSETS: published, - PKG_VERSION: "0.7.0", - BUILD_EPOCH: "1700000000", + PKG_VERSION: '0.7.0', + BUILD_EPOCH: '1700000000', PATH: `${binaries}:${process.env.PATH}`, }; const run = (file, args, cwd = root) => { - const result = spawnSync(file, args, { cwd, env, encoding: "utf8" }); - assert.equal( - result.status, - 0, - `${file}: ${result.stderr}\n${result.stdout}`, - ); + const result = spawnSync(file, args, { cwd, env, encoding: 'utf8' }); + assert.equal(result.status, 0, `${file}: ${result.stderr}\n${result.stdout}`); return result.stdout.trim(); }; - const git = (args, cwd = root) => run("git", args, cwd); + const git = (args, cwd = root) => run('git', args, cwd); try { mkdirSync(seed); mkdirSync(release); mkdirSync(binaries); mkdirSync(published); - cpSync(new URL("../scripts", import.meta.url), join(release, "scripts"), { + cpSync(new URL('../scripts', import.meta.url), join(release, 'scripts'), { recursive: true, }); - const bun = join(binaries, "bun"); - writeFileSync(bun, `#!${process.execPath} + const bun = join(binaries, 'bun'); + writeFileSync( + bun, + `#!${process.execPath} const fs = require('node:fs'); const args = process.argv.slice(2); const output = args[args.indexOf('--outfile') + 1]; fs.writeFileSync(output, args.find(arg => arg.startsWith('--target='))); fs.utimesSync(output, Number(process.env.BUILD_EPOCH), Number(process.env.BUILD_EPOCH)); -`); +`, + ); chmodSync(bun, 0o755); - git(["init", "--bare", "--initial-branch=main", bare]); - git(["init", "--initial-branch=main"], seed); - git(["config", "user.name", "Fixture"], seed); - git(["config", "user.email", "fixture@example.com"], seed); - writeFileSync(join(seed, "README.md"), "fixture\n"); - git(["add", "README.md"], seed); - git(["commit", "-m", "fixture"], seed); - git(["remote", "add", "origin", bare], seed); - git(["push", "origin", "main"], seed); - const main = git(["--git-dir", bare, "rev-parse", "main"]); - const hook = join(bare, "hooks/pre-receive"); + git(['init', '--bare', '--initial-branch=main', bare]); + git(['init', '--initial-branch=main'], seed); + git(['config', 'user.name', 'Fixture'], seed); + git(['config', 'user.email', 'fixture@example.com'], seed); + writeFileSync(join(seed, 'README.md'), 'fixture\n'); + git(['add', 'README.md'], seed); + git(['commit', '-m', 'fixture'], seed); + git(['remote', 'add', 'origin', bare], seed); + git(['push', 'origin', 'main'], seed); + const main = git(['--git-dir', bare, 'rev-parse', 'main']); + const hook = join(bare, 'hooks/pre-receive'); writeFileSync( hook, '#!/bin/sh\nwhile read old new ref; do\n if [ "$ref" = refs/heads/main ]; then exit 1; fi\ndone\n', ); chmodSync(hook, 0o755); writeFileSync(state, JSON.stringify({ creates: 0, url: null })); - const gh = join(binaries, "gh"); + const gh = join(binaries, 'gh'); writeFileSync( gh, `#!${process.execPath} @@ -155,79 +135,85 @@ else if (action === 'create') { `, ); chmodSync(gh, 0o755); - writeFileSync(join(release, "package.json"), '{"version":"0.7.0"}\n'); - const shell = command => run("bash", ["-e", "-o", "pipefail", "-c", command], release); - const archive = "dedalus-linux-x64.tar.gz"; + writeFileSync(join(release, 'package.json'), '{"version":"0.7.0"}\n'); + const shell = (command) => run('bash', ['-e', '-o', 'pipefail', '-c', command], release); + const archive = 'dedalus-linux-x64.tar.gz'; // A previous attempt published only one platform before failing. shell(compile); - const original = readFileSync(join(release, "release-binaries", archive)); - if (workflow === "release-please") - cpSync(join(release, "release-binaries", archive), join(published, archive)); - env.BUILD_EPOCH = "1700000060"; + const original = readFileSync(join(release, 'release-binaries', archive)); + if (workflow === 'release-please') + cpSync(join(release, 'release-binaries', archive), join(published, archive)); + env.BUILD_EPOCH = '1700000060'; shell(compile); shell(upload); shell(homebrew); const assets = new Map( - [...targets.map(target => `dedalus-${target}.tar.gz`), "dedalus-windows-x64.zip"] - .map(name => [name, readFileSync(join(published, name))]), + [...targets.map((target) => `dedalus-${target}.tar.gz`), 'dedalus-windows-x64.zip'].map((name) => [ + name, + readFileSync(join(published, name)), + ]), ); - if (workflow === "release-please") - assert.deepEqual(assets.get(archive), original, "partial release retains its original archive"); + if (workflow === 'release-please') + assert.deepEqual(assets.get(archive), original, 'partial release retains its original archive'); const assertPublishedBytes = () => { - const checksums = readFileSync(join(published, "checksums.txt"), "utf8"); + const checksums = readFileSync(join(published, 'checksums.txt'), 'utf8'); for (const [name, bytes] of assets) { assert.deepEqual(readFileSync(join(published, name)), bytes, `${name}: published bytes`); - assert.deepEqual(readFileSync(join(release, "release-binaries", name)), bytes, `${name}: formula input`); - assert.ok(checksums.includes(`${createHash("sha256").update(bytes).digest("hex")} ${name}\n`)); + assert.deepEqual( + readFileSync(join(release, 'release-binaries', name)), + bytes, + `${name}: formula input`, + ); + assert.ok(checksums.includes(`${createHash('sha256').update(bytes).digest('hex')} ${name}\n`)); } }; assertPublishedBytes(); - const branch = "refs/heads/release/dedalus-0.7.0"; - const first = git(["--git-dir", bare, "rev-parse", branch]); - assert.equal(git(["--git-dir", bare, "rev-parse", "main"]), main); - assert.equal(JSON.parse(readFileSync(state, "utf8")).creates, 1); + const branch = 'refs/heads/release/dedalus-0.7.0'; + const first = git(['--git-dir', bare, 'rev-parse', branch]); + assert.equal(git(['--git-dir', bare, 'rev-parse', 'main']), main); + assert.equal(JSON.parse(readFileSync(state, 'utf8')).creates, 1); // The same compiled payload gets a different archive timestamp on retry. - const retry = epoch => { + const retry = (epoch) => { env.BUILD_EPOCH = String(epoch); shell(compile); assert.notDeepEqual( - readFileSync(join(release, "release-binaries/dedalus-darwin-arm64.tar.gz")), - assets.get("dedalus-darwin-arm64.tar.gz"), + readFileSync(join(release, 'release-binaries/dedalus-darwin-arm64.tar.gz')), + assets.get('dedalus-darwin-arm64.tar.gz'), ); shell(upload); assertPublishedBytes(); return shell(homebrew); }; retry(1700000120); - assert.equal(git(["--git-dir", bare, "rev-parse", branch]), first); - assert.equal(git(["--git-dir", bare, "rev-parse", "main"]), main); - assert.equal(JSON.parse(readFileSync(state, "utf8")).creates, 1); + assert.equal(git(['--git-dir', bare, 'rev-parse', branch]), first); + assert.equal(git(['--git-dir', bare, 'rev-parse', 'main']), main); + assert.equal(JSON.parse(readFileSync(state, 'utf8')).creates, 1); // Simulate the reviewed merge, then verify another run creates no empty PR. - git(["--git-dir", bare, "update-ref", "refs/heads/main", first]); + git(['--git-dir', bare, 'update-ref', 'refs/heads/main', first]); writeFileSync(state, JSON.stringify({ creates: 1, url: null })); - if (workflow === "sdk-release") - git(["--git-dir", bare, "update-ref", "-d", branch]); + if (workflow === 'sdk-release') git(['--git-dir', bare, 'update-ref', '-d', branch]); assert.match(retry(1700000240), /already contains/); - const formula = git(["--git-dir", bare, "show", "main:Formula/dedalus.rb"]); + const formula = git(['--git-dir', bare, 'show', 'main:Formula/dedalus.rb']); for (const target of targets) { - const digest = createHash("sha256") - .update(assets.get(`dedalus-${target}.tar.gz`)).digest("hex"); + const digest = createHash('sha256') + .update(assets.get(`dedalus-${target}.tar.gz`)) + .digest('hex'); assert.ok(formula.includes(digest), `${target}: merged formula checksum`); } - assert.equal(git(["--git-dir", bare, "rev-parse", "main"]), first); - assert.equal(JSON.parse(readFileSync(state, "utf8")).creates, 1); + assert.equal(git(['--git-dir', bare, 'rev-parse', 'main']), first); + assert.equal(JSON.parse(readFileSync(state, 'utf8')).creates, 1); // Never silently replace an existing checksum manifest, even if it is wrong. - writeFileSync(join(published, "checksums.txt"), "invalid checksum manifest\n"); + writeFileSync(join(published, 'checksums.txt'), 'invalid checksum manifest\n'); assert.throws(() => shell(upload), /Published checksums.txt does not match/); - assert.equal(readFileSync(join(published, "checksums.txt"), "utf8"), "invalid checksum manifest\n"); + assert.equal(readFileSync(join(published, 'checksums.txt'), 'utf8'), 'invalid checksum manifest\n'); } finally { rmSync(root, { recursive: true, force: true }); } } -for (const workflow of ["release-please", "sdk-release"]) { +for (const workflow of ['release-please', 'sdk-release']) { test(`invariant_publication_retries_preserve_published_assets_and_merged_formulas (${workflow})`, () => { verifyPublication(workflow); }); diff --git a/tests/legacy-installer.test.mjs b/tests/legacy-installer.test.mjs index 7b5afb2..1b3a04a 100644 --- a/tests/legacy-installer.test.mjs +++ b/tests/legacy-installer.test.mjs @@ -1,6 +1,15 @@ import assert from 'node:assert/strict'; import { spawnSync } from 'node:child_process'; -import { chmodSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'; +import { + chmodSync, + mkdirSync, + mkdtempSync, + readFileSync, + readdirSync, + rmSync, + symlinkSync, + writeFileSync, +} from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { test } from 'node:test'; @@ -19,18 +28,29 @@ function fixture(t, { os = 'Darwin', arch = 'arm64', failure = '', version = 'v0 writeFileSync(path, content); chmodSync(path, 0o755); }; - executable(join(payload, 'dedalus'), failure === 'timeout' - ? '#!/bin/sh\nwhile :; do :; done\n' - : failure === 'cannot-run' - ? '#!/bin/sh\nexit 126\n' - : `#!/bin/sh\nprintf '%s\\n' '${failure === 'wrong-version' ? '9.9.9' : '0.7.0'}'\n`); + executable( + join(payload, 'dedalus'), + failure === 'timeout' + ? '#!/bin/sh\nwhile :; do :; done\n' + : failure === 'cannot-run' + ? '#!/bin/sh\nexit 126\n' + : `#!/bin/sh\nprintf '%s\\n' '${failure === 'wrong-version' ? '9.9.9' : '0.7.0'}'\n`, + ); const archive = join(root, 'archive.tar.gz'); if (failure === 'missing-binary') rmSync(join(payload, 'dedalus')); - const packed = spawnSync('tar', ['-czf', archive, '-C', payload, failure === 'missing-binary' ? '.' : 'dedalus']); + const packed = spawnSync('tar', [ + '-czf', + archive, + '-C', + payload, + failure === 'missing-binary' ? '.' : 'dedalus', + ]); assert.equal(packed.status, 0); if (failure === 'corrupt') writeFileSync(archive, 'not an archive'); executable(join(bin, 'uname'), `#!/bin/sh\ncase "$1" in -s) echo '${os}';; -m) echo '${arch}';; esac\n`); - executable(join(bin, 'curl'), `#!${process.execPath} + executable( + join(bin, 'curl'), + `#!${process.execPath} const fs = require('node:fs'); const args = process.argv.slice(2); const url = args.find(arg => arg.startsWith('https://')); @@ -41,7 +61,8 @@ if (url.endsWith('/releases/latest')) { } else { fs.copyFileSync(process.env.INSTALL_TEST_ARCHIVE, args[args.indexOf('-o') + 1]); } -`); +`, + ); const env = { ...process.env, PATH: `${bin}:${process.env.PATH}`, @@ -53,7 +74,12 @@ if (url.endsWith('/releases/latest')) { }; return { destination, - run: () => spawnSync('bash', ['-c', 'bash < "$1"', 'installer-test', installer.pathname], { env, encoding: 'utf8', timeout: 20000 }), + run: () => + spawnSync('bash', ['-c', 'bash < "$1"', 'installer-test', installer.pathname], { + env, + encoding: 'utf8', + timeout: 20000, + }), requests: () => readFileSync(env.INSTALL_TEST_LOG, 'utf8'), }; } @@ -64,18 +90,24 @@ for (const [os, arch, target] of [ ['Linux', 'aarch64', 'linux-arm64'], ['Linux', 'x86_64', 'linux-x64'], ]) { - test(`legacy installer replaces the pinned ${target} executable in its original directory`, t => { + test(`legacy installer replaces the pinned ${target} executable in its original directory`, (t) => { const f = fixture(t, { os, arch }); const result = f.run(); assert.equal(result.status, 0, result.stderr); - assert.equal(f.requests(), `https://github.com/dedalus-labs/dedalus-cli/releases/download/v0.7.0/dedalus-${target}.tar.gz\n`); - assert.equal(spawnSync(join(f.destination, 'dedalus'), ['--version'], { encoding: 'utf8' }).stdout.trim(), '0.7.0'); + assert.equal( + f.requests(), + `https://github.com/dedalus-labs/dedalus-cli/releases/download/v0.7.0/dedalus-${target}.tar.gz\n`, + ); + assert.equal( + spawnSync(join(f.destination, 'dedalus'), ['--version'], { encoding: 'utf8' }).stdout.trim(), + '0.7.0', + ); assert.deepEqual(readdirSync(f.destination), ['dedalus']); }); } for (const failure of ['download', 'corrupt', 'missing-binary', 'cannot-run', 'wrong-version', 'timeout']) { - test(`legacy installer preserves the working binary after ${failure} failure`, t => { + test(`legacy installer preserves the working binary after ${failure} failure`, (t) => { const f = fixture(t, { failure }); const result = f.run(); assert.equal(result.error, undefined); @@ -86,21 +118,21 @@ for (const failure of ['download', 'corrupt', 'missing-binary', 'cannot-run', 'w }); } -test('an unpinned install resolves latest before choosing its archive', t => { +test('an unpinned install resolves latest before choosing its archive', (t) => { const f = fixture(t, { version: '' }); const result = f.run(); assert.equal(result.status, 0, result.stderr); assert.match(f.requests(), /releases\/latest\n.*\/v0\.7\.0\/dedalus-darwin-arm64.tar.gz\n/); }); -test('an unsupported platform fails without replacing the executable', t => { +test('an unsupported platform fails without replacing the executable', (t) => { const f = fixture(t, { os: 'FreeBSD' }); const result = f.run(); assert.notEqual(result.status, 0); assert.equal(readFileSync(join(f.destination, 'dedalus'), 'utf8'), 'old executable'); }); -test('installer refuses a package-manager symlink', t => { +test('installer refuses a package-manager symlink', (t) => { const f = fixture(t); const managed = join(f.destination, 'managed'); writeFileSync(managed, 'managed executable'); @@ -110,7 +142,7 @@ test('installer refuses a package-manager symlink', t => { assert.equal(readFileSync(managed, 'utf8'), 'managed executable'); }); -test('installer rejects invalid release tags before downloading', t => { +test('installer rejects invalid release tags before downloading', (t) => { const f = fixture(t, { version: '../../latest' }); assert.notEqual(f.run().status, 0); assert.throws(f.requests, { code: 'ENOENT' }); diff --git a/tests/machine-aliases.test.mjs b/tests/machine-aliases.test.mjs index 6672b25..dfb8fb9 100644 --- a/tests/machine-aliases.test.mjs +++ b/tests/machine-aliases.test.mjs @@ -1,187 +1,312 @@ -import assert from 'node:assert/strict' -import { spawnSync } from 'node:child_process' -import { afterEach, test } from 'node:test' -import { Command } from 'commander' -import { join, resolve } from 'node:path' -import { pathToFileURL } from 'node:url' - -const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.') -const load = (path) => import(pathToFileURL(join(root, 'dist/esm', path))) -const { default: SDK } = await load('sdk/index.js') -const { getProgram } = await load('index.js') -const { addMachineAliases, createMachineAPI } = await load('custom/machines.js') -const { loadMachineChoices, matchingMachines, renderPicker, updatePicker } = await load('custom/ssh-picker.js') -const { awaitSSHSession } = await load('custom/ssh.js') - -afterEach(() => { process.exitCode = undefined }) +import assert from 'node:assert/strict'; +import { spawnSync } from 'node:child_process'; +import { afterEach, test } from 'node:test'; +import { Command } from 'commander'; +import { join, resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; + +const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.'); +const load = (path) => import(pathToFileURL(join(root, 'dist/esm', path))); +const { default: SDK } = await load('sdk/index.js'); +const { getProgram } = await load('index.js'); +const { addMachineAliases, createMachineAPI } = await load('custom/machines.js'); +const { loadMachineChoices, matchingMachines, renderPicker, updatePicker } = + await load('custom/ssh-picker.js'); +const { awaitSSHSession } = await load('custom/ssh.js'); + +afterEach(() => { + process.exitCode = undefined; +}); const machine = (id, name, phase = 'running') => ({ - machine_id: id, name, desired_state: 'running', phase, -}) + machine_id: id, + name, + desired_state: 'running', + phase, +}); const capture = async (action) => { - let stdout = '' - let stderr = '' - const originalOut = process.stdout.write - const originalErr = process.stderr.write + let stdout = ''; + let stderr = ''; + const originalOut = process.stdout.write; + const originalErr = process.stderr.write; process.stdout.write = (value, ...args) => { - if (typeof value !== 'string') return originalOut.call(process.stdout, value, ...args) - stdout += value; return true - } + if (typeof value !== 'string') return originalOut.call(process.stdout, value, ...args); + stdout += value; + return true; + }; process.stderr.write = (value, ...args) => { - if (typeof value !== 'string') return originalErr.call(process.stderr, value, ...args) - stderr += value; return true + if (typeof value !== 'string') return originalErr.call(process.stderr, value, ...args); + stderr += value; + return true; + }; + try { + await action(); + } finally { + process.stdout.write = originalOut; + process.stderr.write = originalErr; } - try { await action() } finally { - process.stdout.write = originalOut - process.stderr.write = originalErr - } - return { stdout, stderr } -} - -const aliases = (options) => addMachineAliases(new Command() - .enablePositionalOptions() - .option('--format ', '', 'auto') - .option('--format-error ', '', 'auto') - .option('--transform ') - .option('--raw-output') - .option('--api-key ', '', 'test') - .option('--x-dedalus-org-id ') - .option('--base-url '), [ - { clientKey: 'apiKey', sdkKey: 'apiKey', name: 'api-key', optionKey: 'apiKey', auth: true }, -], options) + return { stdout, stderr }; +}; + +const aliases = (options) => + addMachineAliases( + new Command() + .enablePositionalOptions() + .option('--format ', '', 'auto') + .option('--format-error ', '', 'auto') + .option('--transform ') + .option('--raw-output') + .option('--api-key ', '', 'test') + .option('--x-dedalus-org-id ') + .option('--base-url '), + [{ clientKey: 'apiKey', sdkKey: 'apiKey', name: 'api-key', optionKey: 'apiKey', auth: true }], + options, + ); test('public program includes custom aliases alongside generated commands', () => { - const program = getProgram() - assert.ok(program.commands.some((command) => command.name() === 'ssh')) - assert.equal(program.commands.some((command) => command.name() === 'rename'), false) - assert.ok(program.commands.find((command) => command.name() === 'machines').commands.some((command) => command.name() === 'update')) -}) + const program = getProgram(); + assert.ok(program.commands.some((command) => command.name() === 'ssh')); + assert.equal( + program.commands.some((command) => command.name() === 'rename'), + false, + ); + assert.ok( + program.commands + .find((command) => command.name() === 'machines') + .commands.some((command) => command.name() === 'update'), + ); +}); test('SSH explicit IDs bypass the picker even without a TTY', async () => { for (const target of ['00000000-0000-4000-8000-000000000111', '00000000-0000-4000-8000-000000000123']) { - const connected = [] - const program = aliases({ api: () => ({}), interactive: () => false, - pick: () => { throw new Error('unexpected picker') }, - connect: async (_api, id) => { connected.push(id) }, - }) - await program.parseAsync(['ssh', target], { from: 'user' }) - assert.deepEqual(connected, [target]) + const connected = []; + const program = aliases({ + api: () => ({}), + interactive: () => false, + pick: () => { + throw new Error('unexpected picker'); + }, + connect: async (_api, id) => { + connected.push(id); + }, + }); + await program.parseAsync(['ssh', target], { from: 'user' }); + assert.deepEqual(connected, [target]); } -}) +}); test('SSH picker selection transmits stable ID and cancellation creates no session', async () => { for (const selected of ['00000000-0000-4000-8000-000000000111', undefined]) { - const connected = [] - const program = aliases({ api: () => ({}), interactive: () => true, - pick: async () => selected, connect: async (_api, id) => { connected.push(id) }, - }) - await program.parseAsync(['ssh'], { from: 'user' }) - assert.deepEqual(connected, selected === undefined ? [] : [selected]) + const connected = []; + const program = aliases({ + api: () => ({}), + interactive: () => true, + pick: async () => selected, + connect: async (_api, id) => { + connected.push(id); + }, + }); + await program.parseAsync(['ssh'], { from: 'user' }); + assert.deepEqual(connected, selected === undefined ? [] : [selected]); } -}) +}); test('SSH without a TTY or target exits promptly with actionable usage', () => { - const result = spawnSync(process.execPath, [join(root, 'dist/esm/bin.js'), 'ssh'], { encoding: 'utf8', timeout: 3000 }) - assert.equal(result.status, 2) - assert.match(result.stderr, /interactive terminal.*dedalus ssh /u) - assert.equal(result.stdout, '') -}) + const result = spawnSync(process.execPath, [join(root, 'dist/esm/bin.js'), 'ssh'], { + encoding: 'utf8', + timeout: 3000, + }); + assert.equal(result.status, 2); + assert.match(result.stderr, /interactive terminal.*dedalus ssh /u); + assert.equal(result.stdout, ''); +}); test('aliases retain CLI usage exit codes', () => { - const result = spawnSync(process.execPath, [join(root, 'dist/esm/bin.js'), 'ssh', 'not-a-uuid'], { encoding: 'utf8' }) - assert.equal(result.status, 2) -}) + const result = spawnSync(process.execPath, [join(root, 'dist/esm/bin.js'), 'ssh', 'not-a-uuid'], { + encoding: 'utf8', + }); + assert.equal(result.status, 2); +}); test('organization flag is exposed only when the generated commands expose it', () => { - const plain = addMachineAliases(new Command(), []) - assert.equal(plain.commands.find((command) => command.name() === 'ssh').options.some((option) => - option.long === '--x-dedalus-org-id'), false) - const source = new Command() - source.command('machines').command('retrieve').option('--x-dedalus-org-id ') - const generated = addMachineAliases(source, []) - assert.equal(generated.commands.find((command) => command.name() === 'ssh').options.some((option) => - option.long === '--x-dedalus-org-id'), true) - assert.equal(getProgram().commands.find((command) => command.name() === 'ssh').options.some((option) => - option.long === '--x-dedalus-org-id'), false) -}) + const plain = addMachineAliases(new Command(), []); + assert.equal( + plain.commands + .find((command) => command.name() === 'ssh') + .options.some((option) => option.long === '--x-dedalus-org-id'), + false, + ); + const source = new Command(); + source.command('machines').command('retrieve').option('--x-dedalus-org-id '); + const generated = addMachineAliases(source, []); + assert.equal( + generated.commands + .find((command) => command.name() === 'ssh') + .options.some((option) => option.long === '--x-dedalus-org-id'), + true, + ); + assert.equal( + getProgram() + .commands.find((command) => command.name() === 'ssh') + .options.some((option) => option.long === '--x-dedalus-org-id'), + false, + ); +}); test('invariant_picker_reads_list_phases_keeps_unnamed_and_skips_destroyed', async () => { - const cursors = [] + const cursors = []; const pages = [ - { items: [machine('00000000-0000-4000-8000-000000000001', 'one'), { ...machine('00000000-0000-4000-8000-000000000003', 'dying'), desired_state: 'destroyed' }], next_cursor: 'page-2' }, + { + items: [ + machine('00000000-0000-4000-8000-000000000001', 'one'), + { ...machine('00000000-0000-4000-8000-000000000003', 'dying'), desired_state: 'destroyed' }, + ], + next_cursor: 'page-2', + }, { items: [], next_cursor: 'page-3' }, - { items: [machine('00000000-0000-4000-8000-000000000002', null, 'sleeping'), machine('00000000-0000-4000-8000-000000000004', 'gone', 'destroyed')], next_cursor: null }, - ] - const choices = await loadMachineChoices({ listMachines: async (cursor) => { - cursors.push(cursor) - return pages.shift() - } }, new AbortController().signal) - assert.deepEqual(cursors, [undefined, 'page-2', 'page-3']) + { + items: [ + machine('00000000-0000-4000-8000-000000000002', null, 'sleeping'), + machine('00000000-0000-4000-8000-000000000004', 'gone', 'destroyed'), + ], + next_cursor: null, + }, + ]; + const choices = await loadMachineChoices( + { + listMachines: async (cursor) => { + cursors.push(cursor); + return pages.shift(); + }, + }, + new AbortController().signal, + ); + assert.deepEqual(cursors, [undefined, 'page-2', 'page-3']); assert.deepEqual(choices, [ { id: '00000000-0000-4000-8000-000000000001', name: 'one', status: 'running' }, { id: '00000000-0000-4000-8000-000000000002', name: null, status: 'sleeping' }, - ]) -}) + ]); +}); test('picker propagates load errors and reports empty fleet', async () => { - await assert.rejects(loadMachineChoices({ listMachines: async () => { - throw new Error('access denied') - } }, new AbortController().signal), /access denied/u) - await assert.rejects(loadMachineChoices({ listMachines: async () => ({ items: [], next_cursor: null }) }, - new AbortController().signal), /No machines available.*dedalus machines create/u) -}) + await assert.rejects( + loadMachineChoices( + { + listMachines: async () => { + throw new Error('access denied'); + }, + }, + new AbortController().signal, + ), + /access denied/u, + ); + await assert.rejects( + loadMachineChoices( + { listMachines: async () => ({ items: [], next_cursor: null }) }, + new AbortController().signal, + ), + /No machines available.*dedalus machines create/u, + ); +}); test('picker refuses malformed names and repeating pagination cursors', async () => { - await assert.rejects(loadMachineChoices({ listMachines: async () => ({ items: [machine('not-a-uuid', 123)] }) }, - new AbortController().signal), /invalid name/u) - await assert.rejects(loadMachineChoices({ listMachines: async () => ({ items: [], next_cursor: 'repeat' }) }, - new AbortController().signal), /repeated cursor/u) -}) + await assert.rejects( + loadMachineChoices( + { listMachines: async () => ({ items: [machine('not-a-uuid', 123)] }) }, + new AbortController().signal, + ), + /invalid name/u, + ); + await assert.rejects( + loadMachineChoices( + { listMachines: async () => ({ items: [], next_cursor: 'repeat' }) }, + new AbortController().signal, + ), + /repeated cursor/u, + ); +}); test('picker search covers names, IDs, status; navigation and editing keep a valid selection', () => { - let state = { machines: [ - { id: '00000000-0000-4000-8000-000000000001', name: 'alpha', status: 'running' }, - { id: '00000000-0000-4000-8000-000000000002', name: 'beta', status: 'sleeping' }, - ], query: '', cursor: 0 } - state = updatePicker(state, '', { name: 'down' }) - assert.equal(matchingMachines(state)[state.cursor].id, '00000000-0000-4000-8000-000000000002') - state = updatePicker(state, 'ALPHA', {}) - assert.deepEqual(matchingMachines(state).map(({ id }) => id), ['00000000-0000-4000-8000-000000000001']) - assert.equal(state.cursor, 0) + let state = { + machines: [ + { id: '00000000-0000-4000-8000-000000000001', name: 'alpha', status: 'running' }, + { id: '00000000-0000-4000-8000-000000000002', name: 'beta', status: 'sleeping' }, + ], + query: '', + cursor: 0, + }; + state = updatePicker(state, '', { name: 'down' }); + assert.equal(matchingMachines(state)[state.cursor].id, '00000000-0000-4000-8000-000000000002'); + state = updatePicker(state, 'ALPHA', {}); + assert.deepEqual( + matchingMachines(state).map(({ id }) => id), + ['00000000-0000-4000-8000-000000000001'], + ); + assert.equal(state.cursor, 0); for (const query of ['00000000-0000-4000-8000-000000000002', 'SLEEPING', 'beta']) { - assert.deepEqual(matchingMachines({ ...state, query }).map(({ id }) => id), ['00000000-0000-4000-8000-000000000002']) + assert.deepEqual( + matchingMachines({ ...state, query }).map(({ id }) => id), + ['00000000-0000-4000-8000-000000000002'], + ); } - state = updatePicker(state, '', { name: 'u', ctrl: true }) - assert.equal(state.query, '') - state = updatePicker(state, 'z', {}) - assert.deepEqual(matchingMachines(state), []) - assert.match(renderPicker(state, 24, 100), /No matching machines/u) - state = updatePicker(state, '', { name: 'backspace' }) - assert.equal(matchingMachines(state).length, 2) - const view = renderPicker(state, 24, 100) - assert.match(view, /> alpha \[running\]\n 00000000-0000-4000-8000-000000000001/u) - assert.match(view, /beta \[sleeping\]\n 00000000-0000-4000-8000-000000000002/u) -}) + state = updatePicker(state, '', { name: 'u', ctrl: true }); + assert.equal(state.query, ''); + state = updatePicker(state, 'z', {}); + assert.deepEqual(matchingMachines(state), []); + assert.match(renderPicker(state, 24, 100), /No matching machines/u); + state = updatePicker(state, '', { name: 'backspace' }); + assert.equal(matchingMachines(state).length, 2); + const view = renderPicker(state, 24, 100); + assert.match(view, /> alpha \[running\]\n 00000000-0000-4000-8000-000000000001/u); + assert.match(view, /beta \[sleeping\]\n 00000000-0000-4000-8000-000000000002/u); +}); test('SSH session creation and polling use the returned canonical ID', async () => { - const requests = [] - const api = createMachineAPI(new SDK({ apiKey: 'test', maxRetries: 0, fetch: async (url, init) => { - requests.push({ url: String(url), method: init.method, body: init.body }) - return Response.json({ machine_id: '00000000-0000-4000-8000-000000000111', session_id: '00000000-0000-4000-8000-000000000010', - status: ['wake_in_progress', 'ssh_in_progress', 'ready'][requests.length - 1], retry_after_ms: 1 }) - } })) - await capture(() => awaitSSHSession(api, '00000000-0000-4000-8000-000000000111', 'ssh-ed25519 public')) - assert.ok(requests[0].url.endsWith('/v1/machines/00000000-0000-4000-8000-000000000111/ssh')) - assert.deepEqual(JSON.parse(requests[0].body), { public_key: 'ssh-ed25519 public' }) - assert.equal(requests.length, 3) + const requests = []; + const api = createMachineAPI( + new SDK({ + apiKey: 'test', + maxRetries: 0, + fetch: async (url, init) => { + requests.push({ url: String(url), method: init.method, body: init.body }); + return Response.json({ + machine_id: '00000000-0000-4000-8000-000000000111', + session_id: '00000000-0000-4000-8000-000000000010', + status: ['wake_in_progress', 'ssh_in_progress', 'ready'][requests.length - 1], + retry_after_ms: 1, + }); + }, + }), + ); + await capture(() => awaitSSHSession(api, '00000000-0000-4000-8000-000000000111', 'ssh-ed25519 public')); + assert.ok(requests[0].url.endsWith('/v1/machines/00000000-0000-4000-8000-000000000111/ssh')); + assert.deepEqual(JSON.parse(requests[0].body), { public_key: 'ssh-ed25519 public' }); + assert.equal(requests.length, 3); for (const request of requests.slice(1)) { - assert.ok(request.url.endsWith('/v1/machines/00000000-0000-4000-8000-000000000111/ssh/00000000-0000-4000-8000-000000000010')) + assert.ok( + request.url.endsWith( + '/v1/machines/00000000-0000-4000-8000-000000000111/ssh/00000000-0000-4000-8000-000000000010', + ), + ); } -}) +}); test('SSH refuses to poll without a canonical ID', async () => { - await assert.rejects(awaitSSHSession({ createSSHSession: async () => ({ session_id: '00000000-0000-4000-8000-000000000010', status: 'wake_in_progress' }), - getMachineSSHSession: async () => { throw new Error('must not poll') }, - }, 'name', 'key'), /omitted machine_id/u) -}) + await assert.rejects( + awaitSSHSession( + { + createSSHSession: async () => ({ + session_id: '00000000-0000-4000-8000-000000000010', + status: 'wake_in_progress', + }), + getMachineSSHSession: async () => { + throw new Error('must not poll'); + }, + }, + 'name', + 'key', + ), + /omitted machine_id/u, + ); +}); diff --git a/tests/ports-commands.test.mjs b/tests/ports-commands.test.mjs new file mode 100644 index 0000000..a46eb33 --- /dev/null +++ b/tests/ports-commands.test.mjs @@ -0,0 +1,77 @@ +import assert from 'node:assert/strict'; +import { execFile } from 'node:child_process'; +import { createServer } from 'node:http'; +import { once } from 'node:events'; +import { resolve } from 'node:path'; +import { test } from 'node:test'; +import { promisify } from 'node:util'; + +const run = promisify(execFile); +const bin = resolve(process.env.CLI_PACKAGE_ROOT ?? '.', 'dist/esm/bin.js'); +const machine = '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'; +const port = 'port-3000'; +const key = 'fixture-key'; +const portFlags = ['--port-id', port]; +const keyFlags = [...portFlags, '--access-key-id', key]; +const keys = '/' + port + '/access-keys'; +const cases = [ + ['list', [], 'GET', '', null], + ['create', ['--port', '3000', '--expires', '300'], 'POST', '', { port: 3000, expires: 300 }], + ['retrieve', portFlags, 'GET', '/' + port, null], + ['update', [...portFlags, '--visibility', 'private'], 'PATCH', '/' + port, { visibility: 'private' }], + ['delete', portFlags, 'DELETE', '/' + port, null], + ['access-keys list', portFlags, 'GET', keys, null], + ['access-keys mint', [...portFlags, '--expires-in', '120'], 'POST', keys, { expires_in: 120 }], + [ + 'access-keys rotate', + [...keyFlags, '--expires-in', '120'], + 'POST', + keys + '/' + key + '/rotate', + { expires_in: 120 }, + ], + ['access-keys revoke', keyFlags, 'DELETE', keys + '/' + key, null], +]; + +for (const [command, flags, method, suffix, body] of cases) { + test('machines ports ' + command + ' sends the documented request', async (t) => { + const requests = []; + const server = createServer(async (req, res) => { + const chunks = []; + for await (const chunk of req) chunks.push(chunk); + const raw = Buffer.concat(chunks).toString(); + requests.push({ + method: req.method, + path: req.url, + auth: req.headers.authorization, + body: raw ? JSON.parse(raw) : null, + }); + res.writeHead(200, { 'content-type': 'application/json' }); + res.end('{}'); + }); + server.listen(0, '127.0.0.1'); + await once(server, 'listening'); + t.after(() => new Promise((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())))); + await run( + process.execPath, + [ + bin, + '--base-url', + 'http://127.0.0.1:' + server.address().port, + '--api-key', + 'fixture', + '--max-retries', + '0', + 'machines', + 'ports', + ...command.split(' '), + '--machine-id', + machine, + ...flags, + ], + { timeout: 10000 }, + ); + assert.deepEqual(requests, [ + { method, path: '/v1/machines/' + machine + '/ports' + suffix, auth: 'Bearer fixture', body }, + ]); + }); +} diff --git a/tests/production-auth-routing.test.mjs b/tests/production-auth-routing.test.mjs index 2ffea6e..23d1d41 100644 --- a/tests/production-auth-routing.test.mjs +++ b/tests/production-auth-routing.test.mjs @@ -31,26 +31,97 @@ test('invariant_packaged_commands_route_each_credential_to_its_compatible_endpoi [{ browserToken: 'fixture-browser' }, {}, [], 'https://dcs.dedaluslabs.ai', 'fixture-browser', null], [{ apiKey: 'fixture-api-key' }, {}, [], 'https://dcs.dedaluslabs.ai', 'fixture-api-key', null], [{ xAPIKey: 'fixture-x-key' }, {}, [], 'https://dcs.dedaluslabs.ai', null, 'fixture-x-key'], - [{ apiKey: 'old-api-key', browserToken: 'fixture-browser' }, {}, [], 'https://dcs.dedaluslabs.ai', 'fixture-browser', null], - [{}, { DEDALUS_BROWSER_TOKEN: 'fixture-browser' }, [], 'https://dcs.dedaluslabs.ai', 'fixture-browser', null], - [{}, { DEDALUS_API_KEY: 'fixture-api-key', DEDALUS_BASE_URL: 'https://alternate-api.invalid' }, [], 'https://alternate-api.invalid', 'fixture-api-key', null], - [{}, {}, ['--x-api-key', 'fixture-x-key', '--base-url', 'https://alternate-api.invalid'], 'https://alternate-api.invalid', null, 'fixture-x-key'], - [{ browserToken: 'saved-browser' }, { DEDALUS_API_KEY: 'fixture-api-key' }, [], 'https://dcs.dedaluslabs.ai', 'fixture-api-key', null], - [{ browserToken: 'saved-browser' }, { DEDALUS_X_API_KEY: 'fixture-x-key' }, [], 'https://dcs.dedaluslabs.ai', null, 'fixture-x-key'], - [{ browserToken: 'saved-browser' }, {}, ['--api-key', 'fixture-api-key'], 'https://dcs.dedaluslabs.ai', 'fixture-api-key', null], - [{ browserToken: 'saved-browser' }, {}, ['--x-api-key', 'fixture-x-key'], 'https://dcs.dedaluslabs.ai', null, 'fixture-x-key'], + [ + { apiKey: 'old-api-key', browserToken: 'fixture-browser' }, + {}, + [], + 'https://dcs.dedaluslabs.ai', + 'fixture-browser', + null, + ], + [ + {}, + { DEDALUS_BROWSER_TOKEN: 'fixture-browser' }, + [], + 'https://dcs.dedaluslabs.ai', + 'fixture-browser', + null, + ], + [ + {}, + { DEDALUS_API_KEY: 'fixture-api-key', DEDALUS_BASE_URL: 'https://alternate-api.invalid' }, + [], + 'https://alternate-api.invalid', + 'fixture-api-key', + null, + ], + [ + {}, + {}, + ['--x-api-key', 'fixture-x-key', '--base-url', 'https://alternate-api.invalid'], + 'https://alternate-api.invalid', + null, + 'fixture-x-key', + ], + [ + { browserToken: 'saved-browser' }, + { DEDALUS_API_KEY: 'fixture-api-key' }, + [], + 'https://dcs.dedaluslabs.ai', + 'fixture-api-key', + null, + ], + [ + { browserToken: 'saved-browser' }, + { DEDALUS_X_API_KEY: 'fixture-x-key' }, + [], + 'https://dcs.dedaluslabs.ai', + null, + 'fixture-x-key', + ], + [ + { browserToken: 'saved-browser' }, + {}, + ['--api-key', 'fixture-api-key'], + 'https://dcs.dedaluslabs.ai', + 'fixture-api-key', + null, + ], + [ + { browserToken: 'saved-browser' }, + {}, + ['--x-api-key', 'fixture-x-key'], + 'https://dcs.dedaluslabs.ai', + null, + 'fixture-x-key', + ], ]) { - writeFileSync(store, JSON.stringify({ version: 1, profiles: { - 'https://dcs.dedaluslabs.ai': { credentials: saved, backend: 'file' }, - } }), { mode: 0o600 }); + writeFileSync( + store, + JSON.stringify({ + version: 1, + profiles: { + 'https://dcs.dedaluslabs.ai': { credentials: saved, backend: 'file' }, + }, + }), + { mode: 0o600 }, + ); const result = spawnSync(process.execPath, ['--input-type=module', '-e', script], { env: { ...env, ...extraEnv, DEDALUS_CREDENTIALS_FILE: store, TEST_ARGS: JSON.stringify(args) }, - encoding: 'utf8', timeout: 10000, + encoding: 'utf8', + timeout: 10000, }); assert.equal(result.status, 0, result.stderr); - const requests = result.stderr.split('\n').filter(line => line.startsWith('REQUEST ')).map(line => JSON.parse(line.slice(8))); + const requests = result.stderr + .split('\n') + .filter((line) => line.startsWith('REQUEST ')) + .map((line) => JSON.parse(line.slice(8))); assert.equal(requests.length, 1, result.stderr); - assert.deepEqual(requests[0], { url: origin + '/v1/machines', authorization: bearer && 'Bearer ' + bearer, apiKey }); + assert.deepEqual(requests[0], { + url: origin + '/v1/machines', + authorization: bearer && 'Bearer ' + bearer, + apiKey, + }); } }); @@ -66,12 +137,21 @@ test('invariant_browser_credentials_reject_custom_authentication_headers', (t) = process.argv = [process.execPath, 'dedalus', 'machines', 'list']; await import(${JSON.stringify(entry)}); `; - for (const headers of ['x-api-key: other-key', 'X-API-Key: other-key', 'Authorization: Bearer other-token', - 'Accept: application/json\nauthorization: Bearer other-token']) { + for (const headers of [ + 'x-api-key: other-key', + 'X-API-Key: other-key', + 'Authorization: Bearer other-token', + 'Accept: application/json\nauthorization: Bearer other-token', + ]) { const result = spawnSync(process.execPath, ['--input-type=module', '-e', script], { - env: { ...env, DEDALUS_CREDENTIALS_FILE: join(directory, 'credentials.json'), - DEDALUS_BROWSER_TOKEN: 'fixture-browser', DEDALUS_CUSTOM_HEADERS: headers }, - encoding: 'utf8', timeout: 10_000, + env: { + ...env, + DEDALUS_CREDENTIALS_FILE: join(directory, 'credentials.json'), + DEDALUS_BROWSER_TOKEN: 'fixture-browser', + DEDALUS_CUSTOM_HEADERS: headers, + }, + encoding: 'utf8', + timeout: 10_000, }); assert.notEqual(result.status, 0, headers); assert.doesNotMatch(result.stderr, /REQUEST/, headers); diff --git a/tests/production-oauth-lifecycle.test.mjs b/tests/production-oauth-lifecycle.test.mjs index ebb794a..1acae03 100644 --- a/tests/production-oauth-lifecycle.test.mjs +++ b/tests/production-oauth-lifecycle.test.mjs @@ -26,37 +26,54 @@ const fixture = (t) => { const readStore = () => JSON.parse(readFileSync(store, 'utf8')); const requests = () => readFileSync(trace, 'utf8').trim().split('\n').map(JSON.parse); let authorization; - const run = (args, browser = false) => new Promise((resolve, reject) => { - const child = spawn(process.execPath, [entrypoint], { - env: { ...env, PATH: directory + ':' + env.PATH, CLI_PACKAGE_ROOT: root, - DEDALUS_CREDENTIALS_FILE: store, TEST_REQUESTS: trace, TEST_REVOKED: revoked, - TEST_ARGS: JSON.stringify(args) }, stdio: ['ignore', 'pipe', 'pipe'], + const run = (args, browser = false) => + new Promise((resolve, reject) => { + const child = spawn(process.execPath, [entrypoint], { + env: { + ...env, + PATH: directory + ':' + env.PATH, + CLI_PACKAGE_ROOT: root, + DEDALUS_CREDENTIALS_FILE: store, + TEST_REQUESTS: trace, + TEST_REVOKED: revoked, + TEST_ARGS: JSON.stringify(args), + }, + stdio: ['ignore', 'pipe', 'pipe'], + }); + t.after(() => { + if (child.exitCode === null) child.kill(); + }); + let stdout = '', + stderr = '', + opened = false; + child.stdout.on('data', (chunk) => { + stdout += chunk; + }); + child.stderr.on('data', (chunk) => { + stderr += chunk; + const match = stderr.match(/ (https:\/\/clerk\.dedaluslabs\.ai\/oauth\/authorize\?[^\s]+)/); + if (!browser || !match || opened) return; + opened = true; + authorization = new URL(match[1]).searchParams; + const callback = new URL(authorization.get('redirect_uri')); + assert.equal(callback.hostname, '127.0.0.1'); + callback.searchParams.set('code', 'fixture-code'); + callback.searchParams.set('state', authorization.get('state')); + callback.searchParams.set('iss', issuer); + fetch(callback) + .then((response) => response.text()) + .catch(reject); + }); + child.on('error', reject); + child.on('close', (code) => resolve({ code, stdout, stderr })); }); - t.after(() => { if (child.exitCode === null) child.kill(); }); - let stdout = '', stderr = '', opened = false; - child.stdout.on('data', chunk => { stdout += chunk; }); - child.stderr.on('data', chunk => { - stderr += chunk; - const match = stderr.match(/ (https:\/\/clerk\.dedaluslabs\.ai\/oauth\/authorize\?[^\s]+)/); - if (!browser || !match || opened) return; - opened = true; - authorization = new URL(match[1]).searchParams; - const callback = new URL(authorization.get('redirect_uri')); - assert.equal(callback.hostname, '127.0.0.1'); - callback.searchParams.set('code', 'fixture-code'); - callback.searchParams.set('state', authorization.get('state')); - callback.searchParams.set('iss', issuer); - fetch(callback).then(response => response.text()).catch(reject); - }); - child.on('error', reject); - child.on('close', code => resolve({ code, stdout, stderr })); - }); return { run, store, revoked, readStore, requests, authorization: () => authorization }; }; test('invariant_production_browser_configuration_drives_the_complete_credential_lifecycle', { - skip: process.platform === 'win32', timeout: 15000, + skip: process.platform === 'win32', + timeout: 15000, }, async (t) => { const { run, store, revoked, readStore, requests, authorization: readAuthorization } = fixture(t); const login = await run(['login', '--flow', 'oauth-browser'], true); @@ -67,8 +84,10 @@ test('invariant_production_browser_configuration_drives_the_complete_credential_ assert.equal(authorization.get('scope'), 'offline_access user:org:read'); assert.equal(authorization.get('code_challenge_method'), 'S256'); const exchange = requests()[0].form; - assert.equal(createHash('sha256').update(exchange.code_verifier).digest('base64url'), - authorization.get('code_challenge')); + assert.equal( + createHash('sha256').update(exchange.code_verifier).digest('base64url'), + authorization.get('code_challenge'), + ); assert.equal(exchange.redirect_uri, authorization.get('redirect_uri')); assert.equal(statSync(store).mode & 0o777, 0o600); assert.equal(readStore().profiles[api].credentials.browserToken, 'fixture-access'); @@ -85,8 +104,17 @@ test('invariant_production_browser_configuration_drives_the_complete_credential_ assert.equal(logout.code, 0, logout.stderr); assert.equal(readStore().profiles[api], undefined); assert.deepEqual(JSON.parse(readFileSync(revoked, 'utf8')), ['fixture-rotated', 'fixture-renewed']); - const rejected = await run(['machines', 'list', '--browser-token', 'fixture-renewed', '--max-retries', '0']); + const rejected = await run([ + 'machines', + 'list', + '--browser-token', + 'fixture-renewed', + '--max-retries', + '0', + ]); assert.equal(rejected.code, 10, rejected.stderr); - assert.doesNotMatch(login.stdout + login.stderr + logout.stdout + logout.stderr + rejected.stderr, - /fixture-access|fixture-renewed|fixture-refresh|fixture-rotated/); + assert.doesNotMatch( + login.stdout + login.stderr + logout.stdout + logout.stderr + rejected.stderr, + /fixture-access|fixture-renewed|fixture-refresh|fixture-rotated/, + ); }); diff --git a/tests/smoke-test.ts b/tests/smoke-test.ts index f294e9b..e2ff248 100644 --- a/tests/smoke-test.ts +++ b/tests/smoke-test.ts @@ -48,6 +48,7 @@ const cases: { operation: string; method: string; path: string; label?: string; operation: 'create', method: 'POST', path: '/v1/machines', + label: 'required params', args: [ 'machines', 'create', @@ -62,6 +63,27 @@ const cases: { operation: string; method: string; path: string; label?: string; ], }, + { + operation: 'create', + method: 'POST', + path: '/v1/machines', + label: 'all params', + args: [ + 'machines', + 'create', + '--autosleep', + '300s', + '--image-id', + 'x', + '--memory-mib', + '4096', + '--storage-gib', + '10', + '--vcpu', + '1', + ], + }, + { operation: 'retrieve', method: 'GET', @@ -89,12 +111,8 @@ const cases: { operation: string; method: string; path: string; label?: string; '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--autosleep', '', - '--memory-mib', - '0', '--storage-gib', '0', - '--vcpu', - '0', ], }, @@ -102,9 +120,18 @@ const cases: { operation: string; method: string; path: string; label?: string; operation: 'delete', method: 'DELETE', path: '/v1/machines/{machine_id}', + label: 'required params', args: ['machines', 'delete', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], }, + { + operation: 'delete', + method: 'DELETE', + path: '/v1/machines/{machine_id}', + label: 'all params', + args: ['machines', 'delete', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--force'], + }, + { operation: 'sleep', method: 'POST', @@ -135,6 +162,31 @@ const cases: { operation: string; method: string; path: string; label?: string; args: ['machines', 'reboot', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--force'], }, + { + operation: 'resize', + method: 'POST', + path: '/v1/machines/{machine_id}/resize', + label: 'required params', + args: ['machines', 'resize', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + }, + + { + operation: 'resize', + method: 'POST', + path: '/v1/machines/{machine_id}/resize', + label: 'all params', + args: [ + 'machines', + 'resize', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--memory-mib', + '0', + '--vcpu', + '0', + ], + }, + { operation: 'list', method: 'GET', @@ -329,14 +381,14 @@ const cases: { operation: string; method: string; path: string; label?: string; }, { - operation: 'reauthorize', + operation: 'createToken', method: 'POST', - path: '/v1/machines/{machine_id}/executions/{execution_id}/logs/reauthorize', + path: '/v1/machines/{machine_id}/executions/{execution_id}/logs/token', args: [ 'machines', 'executions', 'logs', - 'reauthorize', + 'create-token', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', '--execution-id', @@ -345,39 +397,237 @@ const cases: { operation: string; method: string; path: string; label?: string; }, { - operation: 'createToken', + operation: 'retrieve', + method: 'GET', + path: '/v1/machines/{machine_id}/autoresizing', + args: ['machines', 'autoresizing', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + }, + + { + operation: 'update', + method: 'PATCH', + path: '/v1/machines/{machine_id}/autoresizing', + label: 'required params', + args: ['machines', 'autoresizing', 'update', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + }, + + { + operation: 'update', + method: 'PATCH', + path: '/v1/machines/{machine_id}/autoresizing', + label: 'all params', + args: [ + 'machines', + 'autoresizing', + 'update', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--cpu', + 'on', + '--cpu-max-vcpu', + '0.25', + '--memory', + 'on', + '--memory-max-mib', + '256', + ], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/machines/{machine_id}/ports', + args: [ + 'machines', + 'ports', + 'list', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--max-items', + '10', + ], + }, + + { + operation: 'create', method: 'POST', - path: '/v1/machines/{machine_id}/executions/{execution_id}/logs/token', + path: '/v1/machines/{machine_id}/ports', + label: 'required params', args: [ 'machines', - 'executions', - 'logs', - 'create-token', + 'ports', + 'create', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', - '--execution-id', - 'execution_id', + '--port', + '0', + '--protocol', + 'http', + '--visibility', + 'private', + ], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/machines/{machine_id}/ports', + label: 'all params', + args: [ + 'machines', + 'ports', + 'create', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--expires', + '1', + '--port', + '0', + '--protocol', + 'http', + '--visibility', + 'private', ], }, { operation: 'retrieve', method: 'GET', - path: '/v1/machines/{machine_id}/autoresizing', - args: ['machines', 'autoresizing', 'retrieve', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f'], + path: '/v1/machines/{machine_id}/ports/{port_id}', + args: [ + 'machines', + 'ports', + 'retrieve', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + ], }, { operation: 'update', - method: 'PUT', - path: '/v1/machines/{machine_id}/autoresizing', + method: 'PATCH', + path: '/v1/machines/{machine_id}/ports/{port_id}', args: [ 'machines', - 'autoresizing', + 'ports', 'update', '--machine-id', '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', - '--enabled', + '--port-id', + 'port_id', + '--visibility', + 'public', + ], + }, + + { + operation: 'delete', + method: 'DELETE', + path: '/v1/machines/{machine_id}/ports/{port_id}', + args: [ + 'machines', + 'ports', + 'delete', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + ], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/machines/{machine_id}/ports/{port_id}/access-keys', + label: 'required params', + args: [ + 'machines', + 'ports', + 'access-keys', + 'list', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + ], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/machines/{machine_id}/ports/{port_id}/access-keys', + label: 'all params', + args: [ + 'machines', + 'ports', + 'access-keys', + 'list', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + '--limit', + '1', + '--cursor', + 'cursor', + ], + }, + + { + operation: 'mint', + method: 'POST', + path: '/v1/machines/{machine_id}/ports/{port_id}/access-keys', + args: [ + 'machines', + 'ports', + 'access-keys', + 'mint', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + '--expires-in', + '1', + ], + }, + + { + operation: 'revoke', + method: 'DELETE', + path: '/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}', + args: [ + 'machines', + 'ports', + 'access-keys', + 'revoke', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + '--access-key-id', + 'access_key_id', + ], + }, + + { + operation: 'rotate', + method: 'POST', + path: '/v1/machines/{machine_id}/ports/{port_id}/access-keys/{access_key_id}/rotate', + args: [ + 'machines', + 'ports', + 'access-keys', + 'rotate', + '--machine-id', + '017f22e2-79b0-7cc3-98c4-dc0c0c07398f', + '--port-id', + 'port_id', + '--access-key-id', + 'access_key_id', + '--expires-in', + '1', ], }, @@ -390,9 +640,101 @@ const cases: { operation: string; method: string; path: string; label?: string; { operation: 'update', - method: 'PUT', + method: 'PATCH', + path: '/v1/organization/autoresizing', + label: 'required params', + args: ['organization', 'autoresizing', 'update'], + }, + + { + operation: 'update', + method: 'PATCH', path: '/v1/organization/autoresizing', - args: ['organization', 'autoresizing', 'update', '--enabled'], + label: 'all params', + args: [ + 'organization', + 'autoresizing', + 'update', + '--cpu', + 'on', + '--cpu-max-vcpu', + '0.25', + '--memory', + 'on', + '--memory-max-mib', + '256', + ], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/images', + label: 'required params', + args: ['images', 'list', '--limit', '100'], + }, + + { + operation: 'list', + method: 'GET', + path: '/v1/images', + label: 'all params', + args: ['images', 'list', '--limit', '100', '--cursor', 'cursor'], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/images', + label: 'required params', + args: ['images', 'create', '--platform', 'linux/amd64', '--source', '{"kind":""}'], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/images', + label: 'all params', + args: [ + 'images', + 'create', + '--credential-ref', + '', + '--name', + '', + '--platform', + 'linux/amd64', + '--source', + '{"kind":"","reference":"","sha256":"","upload_id":""}', + ], + }, + + { + operation: 'retrieve', + method: 'GET', + path: '/v1/images/{image_id}', + args: ['images', 'retrieve', '--image-id', 'image_id'], + }, + + { + operation: 'update', + method: 'PATCH', + path: '/v1/images/{image_id}', + args: ['images', 'update', '--image-id', 'image_id', '--name', ''], + }, + + { + operation: 'delete', + method: 'DELETE', + path: '/v1/images/{image_id}', + args: ['images', 'delete', '--image-id', 'image_id'], + }, + + { + operation: 'create', + method: 'POST', + path: '/v1/images/uploads', + args: ['images', 'uploads', 'create', '--platform', '', '--sha256', '', '--size-bytes', '0'], }, ]; diff --git a/tests/ssh-paths.test.mjs b/tests/ssh-paths.test.mjs index 5c2e2c5..db073af 100644 --- a/tests/ssh-paths.test.mjs +++ b/tests/ssh-paths.test.mjs @@ -1,52 +1,65 @@ -import assert from 'node:assert/strict' -import childProcess from 'node:child_process' -import { mkdtemp, rm } from 'node:fs/promises' -import { syncBuiltinESMExports } from 'node:module' -import os from 'node:os' -import { join, resolve } from 'node:path' -import { pathToFileURL } from 'node:url' -import { test } from 'node:test' +import assert from 'node:assert/strict'; +import childProcess from 'node:child_process'; +import { mkdtemp, rm } from 'node:fs/promises'; +import { syncBuiltinESMExports } from 'node:module'; +import os from 'node:os'; +import { join, resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { test } from 'node:test'; -const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.') -const { connectMachine } = await import(pathToFileURL(join(root, 'dist/esm/custom/ssh.js'))) +const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.'); +const { connectMachine } = await import(pathToFileURL(join(root, 'dist/esm/custom/ssh.js'))); test('invariant_ssh_preserves_temporary_file_paths', async (t) => { - const prefix = process.platform === 'win32' ? 'dedalus ssh paths-' : 'dedalus ssh "paths" \\-' - const directory = await mkdtemp(join(os.tmpdir(), prefix)) - const spawn = childProcess.spawn - let config = '' - let diagnostics = '' - let keyPath - t.mock.method(os, 'tmpdir', () => directory) + const prefix = process.platform === 'win32' ? 'dedalus ssh paths-' : 'dedalus ssh "paths" \\-'; + const directory = await mkdtemp(join(os.tmpdir(), prefix)); + const spawn = childProcess.spawn; + let config = ''; + let diagnostics = ''; + let keyPath; + t.mock.method(os, 'tmpdir', () => directory); t.mock.method(childProcess, 'spawn', (command, args, options) => { - if (command !== 'ssh') return spawn(command, args, options) - keyPath = args[args.indexOf('-i') + 1] + if (command !== 'ssh') return spawn(command, args, options); + keyPath = args[args.indexOf('-i') + 1]; // Parse the production arguments with OpenSSH without opening a connection. - const child = spawn(command, ['-G', '-F', 'none', ...args], { stdio: ['ignore', 'pipe', 'pipe'] }) - child.stdout.on('data', (chunk) => { config += chunk }) - child.stderr.on('data', (chunk) => { diagnostics += chunk }) - return child - }) - syncBuiltinESMExports() + const child = spawn(command, ['-G', '-F', 'none', ...args], { stdio: ['ignore', 'pipe', 'pipe'] }); + child.stdout.on('data', (chunk) => { + config += chunk; + }); + child.stderr.on('data', (chunk) => { + diagnostics += chunk; + }); + return child; + }); + syncBuiltinESMExports(); try { - await connectMachine({ createSSHSession: async () => ({ - machine_id: '00000000-0000-4000-8000-000000000111', - session_id: '00000000-0000-4000-8000-000000000012', status: 'ready', - connection: { - endpoint: 'localhost', port: 22, ssh_username: 'test', user_certificate: 'test-certificate', - host_trust: { host_pattern: 'localhost', public_key: 'test-host-key' }, + await connectMachine( + { + createSSHSession: async () => ({ + machine_id: '00000000-0000-4000-8000-000000000111', + session_id: '00000000-0000-4000-8000-000000000012', + status: 'ready', + connection: { + endpoint: 'localhost', + port: 22, + ssh_username: 'test', + user_certificate: 'test-certificate', + host_trust: { host_pattern: 'localhost', public_key: 'test-host-key' }, + }, + }), }, - }) }, 'machine') - assert.equal(process.exitCode, undefined, diagnostics) - assert.ok(keyPath.startsWith(directory)) - const lines = config.split('\n') - assert.ok(lines.includes(`identityfile ${keyPath}`), config) - assert.ok(lines.includes(`certificatefile ${keyPath}-cert.pub`), config) - assert.ok(lines.includes(`userknownhostsfile ${join(keyPath, '..', 'known_hosts')}`), config) + 'machine', + ); + assert.equal(process.exitCode, undefined, diagnostics); + assert.ok(keyPath.startsWith(directory)); + const lines = config.split('\n'); + assert.ok(lines.includes(`identityfile ${keyPath}`), config); + assert.ok(lines.includes(`certificatefile ${keyPath}-cert.pub`), config); + assert.ok(lines.includes(`userknownhostsfile ${join(keyPath, '..', 'known_hosts')}`), config); } finally { - t.mock.restoreAll() - syncBuiltinESMExports() - process.exitCode = undefined - await rm(directory, { recursive: true, force: true }) + t.mock.restoreAll(); + syncBuiltinESMExports(); + process.exitCode = undefined; + await rm(directory, { recursive: true, force: true }); } -}) +}); From c66aa46054e1d8c5e3a401a0ca0995c346196fb6 Mon Sep 17 00:00:00 2001 From: Shengming Liang <132429369+LiangShengming@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:15:39 -0800 Subject: [PATCH 03/12] feat(machines): connect after creation with --ssh --- README.md | 21 +++ src/cli/runtime.ts | 33 ++++- src/commands/index.ts | 7 +- src/custom/README.md | 15 ++ src/custom/machines.ts | 92 ++++++++++++ src/custom/ssh.ts | 8 +- tests/create-ssh.test.mjs | 283 +++++++++++++++++++++++++++++++++++++ tests/fixtures/terminal.py | 54 +++++++ 8 files changed, 506 insertions(+), 7 deletions(-) create mode 100644 tests/create-ssh.test.mjs create mode 100644 tests/fixtures/terminal.py diff --git a/README.md b/README.md index 1518293..63b92d4 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,27 @@ dedalus machines create \ Every command accepts the global flags below, so the examples that follow show only what is specific to them. +Create a machine with API defaults and open an interactive SSH shell: + +```sh +dedalus machines create --ssh +``` + +`--ssh` reuses the connection flow from `dedalus ssh `, including +the selected API endpoint, credentials, and organization. OpenSSH (`ssh` and +`ssh-keygen`) must be in PATH. SSH owns the terminal output and exit status. +Without `--ssh`, creation prints the usual response in the selected format. +If SSH fails or is cancelled, the machine remains available. The CLI prints +its ID and a reconnect command on stderr before opening the session. + +Piped JSON can supply machine options while SSH reads from the controlling +terminal. A missing controlling terminal is reported before creating a machine. + +The reconnect command retains the selected API endpoint and organization. +Credential flags use environment-variable references. Set each variable to the +credential used for creation before running the command. Credential file +references are retained. Environment credentials and saved login remain in use. + See the [API reference](./api.md) for every available operation.
diff --git a/src/cli/runtime.ts b/src/cli/runtime.ts index 462a7ff..af47cbb 100644 --- a/src/cli/runtime.ts +++ b/src/cli/runtime.ts @@ -141,6 +141,10 @@ export type CreateProgramOptions = { readonly environmentEnv?: string; readonly baseUrlEnv?: string; readonly auth?: CliAuthDefinition; + // @custom start + // A handled result owns output while retaining the request's authenticated client. + readonly handleResult?: (result: unknown, client: unknown, command: Command) => Promise; + // @custom end }; type OutputOptions = { @@ -185,6 +189,9 @@ export const createProgram = ({ environmentEnv, baseUrlEnv, auth, + // @custom start + handleResult, + // @custom end }: CreateProgramOptions): Command => { const selection: EnvironmentSelection = { environments, defaultEnvironment, environmentEnv, baseUrlEnv }; const program = usageExitCode(new Command()); @@ -227,8 +234,10 @@ export const createProgram = ({ program.option('--' + option.name + ' ', clientOptionDescription(option)); } + // @custom start for (const definition of commands) - addGeneratedCommand(program, SDK, clientOptions, definition, groups, selection, auth); + addGeneratedCommand(program, SDK, clientOptions, definition, groups, selection, auth, handleResult); + // @custom end if (environments.length > 0) addEnvironmentsCommand(program, selection, defaultFormat); @@ -640,6 +649,9 @@ const addGeneratedCommand = ( groups: readonly CliCommandGroup[] | undefined, selection: EnvironmentSelection, auth: CliAuthDefinition | undefined, + // @custom start + handleResult: CreateProgramOptions['handleResult'], + // @custom end ): void => { const parent = ensureCommandPath(program, definition.commandPath.slice(0, -1), groups); const commandName = definition.commandPath.at(-1) ?? definition.methodName; @@ -719,7 +731,18 @@ const addGeneratedCommand = ( const command = args.at(-1); if (!(command instanceof Command)) throw new Error('Expected Commander command context'); const positionalValues = args.slice(0, -1); - await runGeneratedCommand(SDK, clientOptions, definition, command, positionalValues, selection, auth); + // @custom start + await runGeneratedCommand( + SDK, + clientOptions, + definition, + command, + positionalValues, + selection, + auth, + handleResult, + ); + // @custom end }); parent.addCommand(command); @@ -774,6 +797,9 @@ const runGeneratedCommand = async ( positionalValues: readonly unknown[], selection: EnvironmentSelection, auth: CliAuthDefinition | undefined, + // @custom start + handleResult: CreateProgramOptions['handleResult'], + // @custom end ): Promise => { const rootOptions = command.optsWithGlobals(); const commandOptions = command.opts(); @@ -851,6 +877,9 @@ const runGeneratedCommand = async ( return; } + // @custom start + if (await handleResult?.(resolved, client, command)) return; + // @custom end await writeOutput(resolved, outputOptions); } catch (error) { diagnostics?.record({ kind: 'command_failure' }); diff --git a/src/commands/index.ts b/src/commands/index.ts index b34225d..fc54dce 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -12,7 +12,9 @@ import { completions } from '../cli/completions'; import type { CliAuthDefinition } from '../cli/login'; import { addUpgradeCommands } from '../cli/upgrade.js'; import { addImageImport } from '../custom/images.js'; -import { addMachineAliases } from '../custom/machines.js'; +// @custom start +import { addMachineAliases, handleMachineResult } from '../custom/machines.js'; +// @custom end import { registerFeedbackCommands } from '../feedback/command.js'; const clientOptions = [ @@ -1584,6 +1586,9 @@ export const getProgram = (): Command => { groups, completions, auth, + // @custom start + handleResult: handleMachineResult, + // @custom end }), clientOptions, { auth }, diff --git a/src/custom/README.md b/src/custom/README.md index de39bee..d3bbc5d 100644 --- a/src/custom/README.md +++ b/src/custom/README.md @@ -1,5 +1,20 @@ # SSH shortcut +`dedalus machines create --ssh` creates a machine, then connects through the +same SSH flow as `dedalus ssh `. The generated command owns the create flags, +piped JSON, API defaults, and authentication. Its result hook passes the raw +machine ID and the existing client to SSH before output transforms run. +Creation errors skip SSH. Session errors retain the usual CLI error format. + +With piped JSON, SSH reads from the controlling terminal after the create command +consumes stdin. If the terminal cannot be opened, the command rejects `--ssh` +before creating a machine. The terminal descriptor closes after command execution. + +Reconnect hints use the SDK's resolved endpoint and organization. Explicit +credential flags become environment-variable references with instructions to +reuse the same credential. File references remain file references. Endpoint URLs +containing credentials or query parameters also use an environment reference. + `dedalus ssh` opens a searchable machine picker in an interactive terminal. Filter by machine ID or lifecycle status, then use the arrow keys and Enter to connect. Escape and Ctrl-C cancel, including while machines are loading. diff --git a/src/custom/machines.ts b/src/custom/machines.ts index 428a02e..1dea351 100644 --- a/src/custom/machines.ts +++ b/src/custom/machines.ts @@ -1,10 +1,12 @@ /** SSH selection that shares the CLI's authentication and error settings. */ import { Command, Option } from 'commander'; +import { closeSync, openSync } from 'node:fs'; import SDK from '../sdk/index.js'; import type { CliAuthDefinition } from '../cli/login.js'; import { type CliClientOptionDefinition, + type CreateProgramOptions, type GlobalOptions, sdkClientOptions, writeError, @@ -27,6 +29,8 @@ type AliasOptions = { readonly interactive?: () => boolean; }; +const terminalInputs = new WeakMap(); + export const createMachineAPI = (client: SDK): MachineAPI => ({ listMachines: (cursor, signal) => client.get('/v1/machines', { @@ -50,6 +54,27 @@ export const addMachineAliases = ( clientOptions: readonly CliClientOptionDefinition[], options: AliasOptions = {}, ): Command => { + const create = program.commands + .find((command) => command.name() === 'machines') + ?.commands.find((command) => command.name() === 'create'); + create + ?.option('--ssh', 'Open an interactive SSH shell after creating the machine') + .hook('preAction', (command) => { + if (!command.opts<{ ssh?: boolean }>().ssh || process.stdin.isTTY) return; + try { + terminalInputs.set(command, openSync(process.platform === 'win32' ? 'CONIN$' : '/dev/tty', 'r')); + } catch { + command.error( + '--ssh requires a controlling terminal; run create without --ssh for noninteractive use', + { exitCode: 2 }, + ); + } + }) + .hook('postAction', (command) => { + const input = terminalInputs.get(command); + if (input !== undefined) closeSync(input); + terminalInputs.delete(command); + }); const makeAPI = options.api ?? createMachineAPI; const connect = options.connect ?? connectMachine; const pick = options.pick ?? pickSSHMachine; @@ -87,6 +112,73 @@ export const addMachineAliases = ( return program; }; +export const handleMachineResult: NonNullable = async ( + result, + client, + command, +) => { + if ( + command.parent?.name() !== 'machines' || + command.name() !== 'create' || + !command.opts<{ ssh?: boolean }>().ssh + ) { + return false; + } + if (!(client instanceof SDK)) throw new Error('machine SSH requires the generated SDK client'); + if ( + !result || + typeof result !== 'object' || + !('machine_id' in result) || + typeof result.machine_id !== 'string' || + !result.machine_id + ) { + throw new Error('create machine: server returned no machine_id'); + } + process.stderr.write(reconnectHint(client, command, result.machine_id)); + await connectMachine(createMachineAPI(client), result.machine_id, terminalInputs.get(command)); + return true; +}; + +const reconnectHint = (client: SDK, command: Command, machineID: string): string => { + const settings = ['dedalus', 'ssh', shellQuote(machineID), '--base-url']; + const instructions: string[] = []; + const endpoint = new URL(client.baseURL); + if (endpoint.username || endpoint.password || endpoint.search || endpoint.hash) { + settings.push(environmentReference('DEDALUS_BASE_URL')); + instructions.push('Set DEDALUS_BASE_URL to the same endpoint used for creation.'); + } else { + settings.push(shellQuote(client.baseURL)); + } + if (client.dedalusOrgID) settings.push('--dedalus-org-id', shellQuote(client.dedalusOrgID)); + const flags = command.optsWithGlobals>(); + for (const [key, flag, variable] of [ + ['apiKey', '--api-key', 'DEDALUS_API_KEY'], + ['xApiKey', '--x-api-key', 'DEDALUS_X_API_KEY'], + ['browserToken', '--browser-token', 'DEDALUS_BROWSER_TOKEN'], + ] as const) { + const value = flags[key]; + if (typeof value !== 'string') continue; + if (value.startsWith('@')) { + settings.push(flag, shellQuote(value)); + } else { + settings.push(flag, environmentReference(variable)); + instructions.push(`Set ${variable} to the same credential supplied with ${flag}.`); + } + } + instructions.push('Reuse the environment credentials or saved login from the same shell.'); + return `Created machine ${machineID}. Reconnect with: ${settings.join(' ')}\n${instructions.join('\n')}\n`; +}; + +const shellQuote = (value: string): string => { + if (/^[\w./:@=-]+$/u.test(value)) return value; + const escaped = + process.platform === 'win32' ? value.replaceAll("'", "''") : value.replaceAll("'", "'\"'\"'"); + return `'${escaped}'`; +}; + +const environmentReference = (name: string): string => + process.platform === 'win32' ? `"$env:${name}"` : `"$${name}"`; + const aliasCommand = (program: Command, name: string): Command => { if (program.commands.some((command) => command.name() === name)) { throw new Error(`the reserved '${name}' command is already registered`); diff --git a/src/custom/ssh.ts b/src/custom/ssh.ts index 5bf9fb8..6b476f0 100644 --- a/src/custom/ssh.ts +++ b/src/custom/ssh.ts @@ -1,6 +1,6 @@ /** Connect with an ephemeral key and the server's SSH certificate and host CA. */ -import { spawn } from 'node:child_process'; +import { spawn, type StdioOptions } from 'node:child_process'; import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; @@ -32,7 +32,7 @@ type SSHSession = { readonly status?: unknown; }; -export const connectMachine = async (api: SSHAPI, machineID: string): Promise => { +export const connectMachine = async (api: SSHAPI, machineID: string, input?: number): Promise => { const directory = await mkdtemp(join(tmpdir(), 'dedalus-ssh-')); try { const keyPath = join(directory, 'key'); @@ -74,7 +74,7 @@ export const connectMachine = async (api: SSHAPI, machineID: string): Promise => // OpenSSH parses -o values as configuration text even when spawn receives an argv array. const quoteSSHPath = (path: string): string => `"${path.replace(/[\\"]/gu, '\\$&')}"`; -const runProcess = (command: string, args: readonly string[], stdio: 'ignore' | 'inherit'): Promise => +const runProcess = (command: string, args: readonly string[], stdio: StdioOptions): Promise => new Promise((resolve, reject) => { const child = spawn(command, args, { stdio }); child.once('error', (error) => { diff --git a/tests/create-ssh.test.mjs b/tests/create-ssh.test.mjs new file mode 100644 index 0000000..d9aba89 --- /dev/null +++ b/tests/create-ssh.test.mjs @@ -0,0 +1,283 @@ +import assert from 'node:assert/strict'; +import { spawn } from 'node:child_process'; +import { + existsSync, + mkdirSync, + mkdtempSync, + readFileSync, + rmSync, + symlinkSync, + writeFileSync, +} from 'node:fs'; +import { createServer } from 'node:http'; +import { tmpdir } from 'node:os'; +import { join, resolve } from 'node:path'; +import { test } from 'node:test'; + +const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.'); +const machineID = '00000000-0000-4000-8000-000000000111'; +const sessionMachineID = '00000000-0000-4000-8000-000000000222'; +const ready = { + machine_id: sessionMachineID, + session_id: 'session', + status: 'ready', + connection: { + endpoint: 'localhost', + port: 2222, + ssh_username: 'root', + user_certificate: 'test-certificate', + host_trust: { host_pattern: 'localhost', public_key: 'test-host-key' }, + }, +}; + +const fixture = async ( + t, + { create = { machine_id: machineID }, createStatus = 200, session = ready } = {}, +) => { + const directory = mkdtempSync(join(tmpdir(), "dedalus create ssh's test-")); + const bin = join(directory, 'bin'); + const receipt = join(directory, 'ssh.json'); + const credentialFile = join(directory, 'credential.txt'); + writeFileSync(credentialFile, 'private-credential', { mode: 0o600 }); + mkdirSync(bin); + symlinkSync(join(root, 'dist/esm/bin.js'), join(bin, 'dedalus')); + writeFileSync( + join(bin, 'ssh'), + `#!${process.execPath} + const { readFileSync, statSync, writeFileSync } = require('node:fs'); + const args = process.argv.slice(2); + const key = args[args.indexOf('-i') + 1]; + const knownHosts = require('node:path').join(key, '..', 'known_hosts'); + writeFileSync(process.env.SSH_RECEIPT, JSON.stringify({ args, key, + certificate: readFileSync(key + '-cert.pub', 'utf8'), + knownHosts: readFileSync(knownHosts, 'utf8'), + modes: [key, key + '-cert.pub', knownHosts].map((path) => statSync(path).mode & 0o777), + })); + if (process.env.TEST_TTY_INPUT) { + console.log('INPUT_READY:' + Boolean(process.stdin.isTTY)); + process.stdin.once('data', (data) => { + console.log('TTY:' + Boolean(process.stdin.isTTY) + ':' + data.toString().trim()); + process.exit(0); + }); + } else { + console.log('attached shell'); + process.exit(Number(process.env.SSH_EXIT ?? 0)); + } + `, + { mode: 0o700 }, + ); + const requests = []; + const server = createServer(async (req, res) => { + let body = ''; + for await (const chunk of req) body += chunk; + requests.push({ path: req.url, headers: req.headers, body: body ? JSON.parse(body) : undefined }); + res.writeHead(req.url === '/v1/machines' ? createStatus : 200, { 'content-type': 'application/json' }); + const response = req.url === '/v1/machines' ? create : req.method === 'POST' ? session : ready; + res.end(JSON.stringify(response)); + }); + await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); + t.after(() => { + server.closeAllConnections(); + server.close(); + rmSync(directory, { recursive: true, force: true }); + }); + const cleanEnv = Object.fromEntries( + Object.entries(process.env).filter(([name]) => !name.startsWith('DEDALUS_')), + ); + const run = (args = [], input = '', env = {}, terminal = true, shellCommand) => + new Promise((resolve, reject) => { + const argv = shellCommand ?? [ + process.execPath, + join(root, 'dist/esm/bin.js'), + 'machines', + 'create', + '--base-url', + `http://127.0.0.1:${server.address().port}`, + '--max-retries', + '0', + ...args, + ]; + const executable = terminal ? 'python3' : argv[0]; + const values = terminal ? [join('tests', 'fixtures', 'terminal.py'), ...argv] : argv.slice(1); + const child = spawn(executable, values, { + env: { + ...cleanEnv, + DEDALUS_API_KEY: 'test-key', + DEDALUS_CREDENTIALS_FILE: join(directory, 'credentials.json'), + PATH: `${bin}:${process.env.PATH}`, + TMPDIR: directory, + SSH_RECEIPT: receipt, + ...env, + }, + stdio: ['pipe', 'pipe', 'pipe'], + }); + t.after(() => { + if (child.exitCode === null) child.kill('SIGTERM'); + }); + let stdout = '', + stderr = ''; + child.stdout.on('data', (chunk) => { + stdout += chunk; + }); + child.stderr.on('data', (chunk) => { + stderr += chunk; + }); + child.once('error', reject); + child.once('close', (code) => resolve({ code, stdout, stderr })); + child.stdin.end(input); + }); + return { + run, + requests, + receipt, + credentialFile, + baseURL: `http://127.0.0.1:${server.address().port}`, + reconnect: (command, env) => run([], '', env, true, ['sh', '-c', command]), + }; +}; + +test('invariant_create_ssh_preserves_request_options_and_attaches_to_the_created_machine', { + timeout: 10000, + skip: process.platform === 'win32', +}, async (t) => { + const f = await fixture(t, { session: { ...ready, status: 'wake_in_progress', retry_after_ms: 1 } }); + const result = await f.run( + [ + '--ssh', + '--api-key', + 'explicit-key', + '--dedalus-org-id', + 'selected-org', + '--vcpu', + '0.5', + '--memory-mib', + '2048', + '--format', + 'yaml', + '--transform', + 'machine_id', + ], + '{"storage_gib":12}', + ); + assert.equal(result.code, 0, result.stderr); + assert.equal(result.stdout, 'attached shell\n'); + assert.deepEqual( + f.requests.map(({ path }) => path), + ['/v1/machines', `/v1/machines/${machineID}/ssh`, `/v1/machines/${sessionMachineID}/ssh/session`], + ); + assert.deepEqual(f.requests[0].body, { storage_gib: 12, vcpu: 0.5, memory_mib: 2048 }); + for (const { headers } of f.requests) { + assert.equal(headers.authorization, 'Bearer explicit-key'); + assert.equal(headers['x-dedalus-org-id'], 'selected-org'); + } + assert.match(f.requests[1].body.public_key, /^ssh-ed25519 /u); + const ssh = JSON.parse(readFileSync(f.receipt, 'utf8')); + assert.equal(ssh.args.at(-1), 'root@localhost'); + assert.ok(ssh.args.includes('StrictHostKeyChecking=yes')); + assert.deepEqual(ssh.modes, [0o600, 0o600, 0o600]); + assert.equal(ssh.knownHosts, '@cert-authority localhost test-host-key\n'); + assert.equal(existsSync(ssh.key), false); + assert.match(result.stderr, new RegExp(`dedalus ssh ${machineID}`, 'u')); +}); + +test('invariant_plain_create_preserves_machine_output_and_server_defaults', async (t) => { + const f = await fixture(t); + const result = await f.run(['--transform', 'machine_id', '--raw-output'], '', {}, false); + assert.equal(result.code, 0, result.stderr); + assert.equal(result.stdout.trim(), machineID); + assert.deepEqual( + f.requests.map(({ body }) => body), + [{}], + ); + assert.equal(existsSync(f.receipt), false); +}); + +test('invariant_create_ssh_uses_server_defaults_and_propagates_shell_exit_status', { + skip: process.platform === 'win32', +}, async (t) => { + const f = await fixture(t); + const result = await f.run(['--ssh'], '', { SSH_EXIT: '23' }); + assert.equal(result.code, 23, result.stderr); + assert.deepEqual(f.requests[0].body, {}); + assert.equal(existsSync(JSON.parse(readFileSync(f.receipt, 'utf8')).key), false); +}); + +test('invariant_failed_creation_never_starts_ssh', { skip: process.platform === 'win32' }, async (t) => { + for (const options of [{ create: {} }, { createStatus: 401, create: { message: 'denied' } }]) { + const f = await fixture(t, options); + const result = await f.run(['--ssh']); + assert.notEqual(result.code, 0); + assert.equal(result.stdout, ''); + assert.equal(f.requests.length, 1); + assert.equal(existsSync(f.receipt), false); + } +}); + +test('invariant_failed_ssh_keeps_the_machine_recoverable', { + skip: process.platform === 'win32', +}, async (t) => { + for (const status of ['failed', 'closed', 'expired', 'unknown']) { + const f = await fixture(t, { session: { ...ready, status } }); + const result = await f.run(['--ssh']); + assert.notEqual(result.code, 0); + assert.equal(result.stdout, ''); + assert.match(result.stderr, new RegExp(`dedalus ssh ${machineID}`, 'u')); + assert.equal(f.requests.length, 2); + assert.equal(existsSync(f.receipt), false); + } +}); + +test('invariant_piped_create_input_leaves_ssh_attached_to_the_terminal', { + timeout: 10000, + skip: process.platform === 'win32', +}, async (t) => { + const f = await fixture(t); + const result = await f.run(['--ssh'], '{"vcpu":0.5}', { TEST_TTY_INPUT: 'interactive-input\n' }); + assert.equal(result.code, 0, result.stderr); + assert.match(result.stdout, /TTY:true:interactive-input/u); + assert.deepEqual(f.requests[0].body, { vcpu: 0.5 }); +}); + +test('invariant_noninteractive_create_ssh_rejects_before_creating_a_machine', { + skip: process.platform === 'win32', +}, async (t) => { + const f = await fixture(t); + const result = await f.run(['--ssh'], '{"vcpu":0.5}', {}, false); + assert.equal(result.code, 2, result.stderr); + assert.match(result.stderr, /controlling terminal/u); + assert.deepEqual(f.requests, []); +}); + +test('invariant_reconnect_hint_preserves_scope_without_disclosing_credentials', { + timeout: 15000, + skip: process.platform === 'win32', +}, async (t) => { + for (const [flag, variable, header, prefix] of [ + ['--api-key', 'DEDALUS_API_KEY', 'authorization', 'Bearer '], + ['--x-api-key', 'DEDALUS_X_API_KEY', 'x-api-key', ''], + ['--api-key', undefined, 'authorization', 'Bearer '], + ]) { + const f = await fixture(t); + const credential = variable ? 'private-credential' : '@' + f.credentialFile; + const failed = await f.run(['--ssh', flag, credential, '--dedalus-org-id', 'selected-org'], '', { + SSH_EXIT: '23', + DEDALUS_API_KEY: '', + }); + assert.equal(failed.code, 23, failed.stderr); + const command = failed.stderr.match(/Reconnect with: (.+)/u)?.[1]; + assert.ok(command, failed.stderr); + assert.doesNotMatch(failed.stderr, /private-credential|test-key/u); + const reconnect = await f.reconnect(command, { + DEDALUS_BASE_URL: f.baseURL + '/wrong', + DEDALUS_ORG_ID: 'wrong-org', + DEDALUS_API_KEY: '', + ...(variable ? { [variable]: 'private-credential' } : {}), + }); + assert.equal(reconnect.code, 0, reconnect.stderr); + assert.equal(f.requests.length, 3); + assert.equal(f.requests[2].path, `/v1/machines/${machineID}/ssh`); + assert.equal(f.requests[2].headers['x-dedalus-org-id'], 'selected-org'); + assert.equal(f.requests[2].headers[header], prefix + 'private-credential'); + if (variable) assert.ok(failed.stderr.includes('Set ' + variable)); + } +}); diff --git a/tests/fixtures/terminal.py b/tests/fixtures/terminal.py new file mode 100644 index 0000000..86a2439 --- /dev/null +++ b/tests/fixtures/terminal.py @@ -0,0 +1,54 @@ +"""Run a command with piped stdin and a separate controlling terminal.""" + +import errno +import fcntl +import os +import pty +import selectors +import signal +import subprocess +import sys +import termios + +master, slave = pty.openpty() + + +def attach(): + os.setsid() + fcntl.ioctl(slave, termios.TIOCSCTTY, 0) + + +child = subprocess.Popen(sys.argv[1:], stdin=sys.stdin, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, preexec_fn=attach, pass_fds=(slave,)) +os.close(slave) +signal.signal(signal.SIGTERM, lambda *_: os.killpg(child.pid, signal.SIGTERM)) +selector = selectors.DefaultSelector() +selector.register(child.stdout, selectors.EVENT_READ, 1) +selector.register(child.stderr, selectors.EVENT_READ, 2) +selector.register(master, selectors.EVENT_READ, None) +pending = b'' +try: + while selector.get_map(): + for key, _ in selector.select(): + try: + data = os.read(key.fd, 65536) + except OSError as error: + if error.errno != errno.EIO: + raise + data = b'' + if not data: + selector.unregister(key.fileobj) + continue + if key.data is None: + continue + os.write(key.data, data) + pending += data + if b'INPUT_READY' in pending and os.environ.get('TEST_TTY_INPUT'): + data = os.environ.pop('TEST_TTY_INPUT').encode() + os.write(master, data) + sys.exit(child.wait()) +finally: + if child.poll() is None: + child.terminate() + child.wait() + os.close(master) From ea489b81b772a8384cbdca0f02de4decbca05824 Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:02:18 -0800 Subject: [PATCH 04/12] fix(cli): label windows ssh reconnect hints for powershell --- README.md | 1 + src/custom/machines.ts | 34 ++++++++++++++++++++-------------- tests/machine-aliases.test.mjs | 16 +++++++++++++++- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 63b92d4..8e79869 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ Piped JSON can supply machine options while SSH reads from the controlling terminal. A missing controlling terminal is reported before creating a machine. The reconnect command retains the selected API endpoint and organization. +On Windows, run the printed command in PowerShell, not Command Prompt. Credential flags use environment-variable references. Set each variable to the credential used for creation before running the command. Credential file references are retained. Environment credentials and saved login remain in use. diff --git a/src/custom/machines.ts b/src/custom/machines.ts index 1dea351..76d474e 100644 --- a/src/custom/machines.ts +++ b/src/custom/machines.ts @@ -134,12 +134,23 @@ export const handleMachineResult: NonNullable { +export const reconnectHint = ( + client: SDK, + command: Command, + machineID: string, + platform: NodeJS.Platform, +): string => { + const powershell = platform === 'win32'; + const environmentReference = (name: string): string => (powershell ? `"$env:${name}"` : `"$${name}"`); + const shellQuote = (value: string): string => { + if (/^[\w./:@=-]+$/u.test(value) && !(powershell && value.startsWith('@'))) return value; + return "'" + value.replaceAll("'", powershell ? "''" : "'\"'\"'") + "'"; + }; const settings = ['dedalus', 'ssh', shellQuote(machineID), '--base-url']; const instructions: string[] = []; const endpoint = new URL(client.baseURL); @@ -165,20 +176,15 @@ const reconnectHint = (client: SDK, command: Command, machineID: string): string instructions.push(`Set ${variable} to the same credential supplied with ${flag}.`); } } - instructions.push('Reuse the environment credentials or saved login from the same shell.'); - return `Created machine ${machineID}. Reconnect with: ${settings.join(' ')}\n${instructions.join('\n')}\n`; -}; - -const shellQuote = (value: string): string => { - if (/^[\w./:@=-]+$/u.test(value)) return value; - const escaped = - process.platform === 'win32' ? value.replaceAll("'", "''") : value.replaceAll("'", "'\"'\"'"); - return `'${escaped}'`; + instructions.push( + powershell + ? 'Use the same environment credentials or saved login in PowerShell.' + : 'Reuse the environment credentials or saved login from the same shell.', + ); + const label = powershell ? 'Reconnect in PowerShell (not Command Prompt):' : 'Reconnect with:'; + return `Created machine ${machineID}. ${label} ${settings.join(' ')}\n${instructions.join('\n')}\n`; }; -const environmentReference = (name: string): string => - process.platform === 'win32' ? `"$env:${name}"` : `"$${name}"`; - const aliasCommand = (program: Command, name: string): Command => { if (program.commands.some((command) => command.name() === name)) { throw new Error(`the reserved '${name}' command is already registered`); diff --git a/tests/machine-aliases.test.mjs b/tests/machine-aliases.test.mjs index dfb8fb9..0fd896e 100644 --- a/tests/machine-aliases.test.mjs +++ b/tests/machine-aliases.test.mjs @@ -9,7 +9,7 @@ const root = resolve(process.env.CLI_PACKAGE_ROOT ?? '.'); const load = (path) => import(pathToFileURL(join(root, 'dist/esm', path))); const { default: SDK } = await load('sdk/index.js'); const { getProgram } = await load('index.js'); -const { addMachineAliases, createMachineAPI } = await load('custom/machines.js'); +const { addMachineAliases, createMachineAPI, reconnectHint } = await load('custom/machines.js'); const { loadMachineChoices, matchingMachines, renderPicker, updatePicker } = await load('custom/ssh-picker.js'); const { awaitSSHSession } = await load('custom/ssh.js'); @@ -310,3 +310,17 @@ test('SSH refuses to poll without a canonical ID', async () => { /omitted machine_id/u, ); }); + +test('invariant_windows_reconnect_hint_labels_the_shell_that_expands_the_credential', () => { + const client = new SDK({ baseURL: 'https://example.test', dedalusOrgID: "Dev's Team" }); + const command = new Command().option('--api-key '); + command.setOptionValue('apiKey', 'secret-not-for-output'); + const hint = reconnectHint(client, command, 'machine', 'win32'); + assert.equal( + hint.split('\n')[0], + `Created machine machine. Reconnect in PowerShell (not Command Prompt): dedalus ssh machine --base-url https://example.test --dedalus-org-id 'Dev''s Team' --api-key "$env:DEDALUS_API_KEY"`, + ); + assert.doesNotMatch(hint, /secret-not-for-output/u); + command.setOptionValue('apiKey', '@credential'); + assert.ok(reconnectHint(client, command, 'machine', 'win32').includes("--api-key '@credential'")); +}); From 4ff0ffbd6b106c31fa0509d83f1f25036086c90c Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:03:37 -0800 Subject: [PATCH 05/12] fix(cli): shorten the powershell reconnect prompt --- src/custom/machines.ts | 2 +- tests/machine-aliases.test.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/custom/machines.ts b/src/custom/machines.ts index 76d474e..90d2aa2 100644 --- a/src/custom/machines.ts +++ b/src/custom/machines.ts @@ -181,7 +181,7 @@ export const reconnectHint = ( ? 'Use the same environment credentials or saved login in PowerShell.' : 'Reuse the environment credentials or saved login from the same shell.', ); - const label = powershell ? 'Reconnect in PowerShell (not Command Prompt):' : 'Reconnect with:'; + const label = powershell ? 'Reconnect in PowerShell:' : 'Reconnect with:'; return `Created machine ${machineID}. ${label} ${settings.join(' ')}\n${instructions.join('\n')}\n`; }; diff --git a/tests/machine-aliases.test.mjs b/tests/machine-aliases.test.mjs index 0fd896e..dcdaa43 100644 --- a/tests/machine-aliases.test.mjs +++ b/tests/machine-aliases.test.mjs @@ -318,7 +318,7 @@ test('invariant_windows_reconnect_hint_labels_the_shell_that_expands_the_credent const hint = reconnectHint(client, command, 'machine', 'win32'); assert.equal( hint.split('\n')[0], - `Created machine machine. Reconnect in PowerShell (not Command Prompt): dedalus ssh machine --base-url https://example.test --dedalus-org-id 'Dev''s Team' --api-key "$env:DEDALUS_API_KEY"`, + `Created machine machine. Reconnect in PowerShell: dedalus ssh machine --base-url https://example.test --dedalus-org-id 'Dev''s Team' --api-key "$env:DEDALUS_API_KEY"`, ); assert.doesNotMatch(hint, /secret-not-for-output/u); command.setOptionValue('apiKey', '@credential'); From ee6f9acc35a7c6df5ac3e4bc657a9d57e09d670c Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:45:30 -0800 Subject: [PATCH 06/12] fix(feedback): restore CLI diagnostics --- .github/workflows/sdk-ci.yml | 7 ++++++ ci/sdk-ci.ts | 9 +++++++ scripts/verify-staging-package.mjs | 1 + scripts/verify-standalone.mjs | 17 +++++++++++++ src/feedback/bundle.ts | 5 +++- src/feedback/command.ts | 11 ++++++++- src/feedback/diagnostics.ts | 38 +++++------------------------ tests/feedback-bundles.test.mjs | 2 ++ tests/feedback-diagnostics.test.mjs | 25 ++++++++++++++++++- tests/ports-commands.test.mjs | 17 ++++++++++--- 10 files changed, 94 insertions(+), 38 deletions(-) create mode 100644 scripts/verify-standalone.mjs diff --git a/.github/workflows/sdk-ci.yml b/.github/workflows/sdk-ci.yml index 670ba82..df11bf3 100644 --- a/.github/workflows/sdk-ci.yml +++ b/.github/workflows/sdk-ci.yml @@ -33,6 +33,13 @@ jobs: - name: Install and test staging package run: node scripts/verify-staging-package.mjs shell: bash + - name: Set up Bun + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 + with: + bun-version: 1.4.0 + - name: Test native standalone binary + run: node scripts/verify-standalone.mjs + shell: bash - name: Upload tested staging package uses: actions/upload-artifact@v7 with: diff --git a/ci/sdk-ci.ts b/ci/sdk-ci.ts index cd536fd..dae0f74 100644 --- a/ci/sdk-ci.ts +++ b/ci/sdk-ci.ts @@ -41,6 +41,15 @@ export const sdkCI = workflow({ name: 'Install and test staging package', run: command({ file: 'node', args: ['scripts/verify-staging-package.mjs'] }), }, + { + name: 'Set up Bun', + uses: 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6', + with: { 'bun-version': '1.4.0' }, + }, + { + name: 'Test native standalone binary', + run: command({ file: 'node', args: ['scripts/verify-standalone.mjs'] }), + }, { name: 'Upload tested staging package', uses: 'actions/upload-artifact@v7', diff --git a/scripts/verify-staging-package.mjs b/scripts/verify-staging-package.mjs index 5f78ff5..86b404c 100644 --- a/scripts/verify-staging-package.mjs +++ b/scripts/verify-staging-package.mjs @@ -26,6 +26,7 @@ try { const cleanEnv = { PATH: process.env.PATH }; assert.equal(run(process.execPath, [binary, '--version'], { env: cleanEnv }).trim(), version); const doctor = JSON.parse(run(process.execPath, [binary, 'doctor', '--json'], { env: cleanEnv })); + assert.equal(doctor.install_method, 'node-package'); assert.equal(doctor.api_origin, 'https://dcs.dedaluslabs.ai'); const sdkModule = JSON.stringify(pathToFileURL(join(installed, 'dist/esm/sdk/index.js')).href); const sdkOrigin = run( diff --git a/scripts/verify-standalone.mjs b/scripts/verify-standalone.mjs new file mode 100644 index 0000000..bb8b926 --- /dev/null +++ b/scripts/verify-standalone.mjs @@ -0,0 +1,17 @@ +import assert from 'node:assert/strict'; +import { execFileSync } from 'node:child_process'; +import { mkdtempSync, rmSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; + +const directory = mkdtempSync(join(tmpdir(), 'dedalus-standalone-')); +try { + const binary = join(directory, process.platform === 'win32' ? 'dedalus.exe' : 'dedalus'); + execFileSync('bun', ['build', 'src/bin.ts', '--compile', '--minify', '--outfile', binary], { stdio: 'inherit' }); + const output = execFileSync(binary, ['doctor', '--json'], { + env: { PATH: process.env.PATH, HOME: directory, USERPROFILE: directory }, encoding: 'utf8', + }); + assert.equal(JSON.parse(output).install_method, 'standalone'); +} finally { + rmSync(directory, { recursive: true, force: true }); +} diff --git a/src/feedback/bundle.ts b/src/feedback/bundle.ts index bcf0a75..a10c84e 100644 --- a/src/feedback/bundle.ts +++ b/src/feedback/bundle.ts @@ -26,7 +26,10 @@ export const doctorReport = (baseURL: string, version: string) => ({ runtime: { os: platform(), arch: arch(), node: process.versions.node }, api_origin: new URL(baseURL).origin, auth_mode: 'api_key', - install_method: 'node-package', + // A compiled Bun entry point lives in its embedded filesystem, even if the binary is renamed. + install_method: /^(?:\/\$bunfs\/|[A-Za-z]:[\\/]~BUN[\\/])/u.test(process.argv[1] ?? '') + ? 'standalone' + : 'node-package', proxy_environment: [ 'HTTPS_PROXY', 'HTTP_PROXY', diff --git a/src/feedback/command.ts b/src/feedback/command.ts index d581c99..7bf2e20 100644 --- a/src/feedback/command.ts +++ b/src/feedback/command.ts @@ -6,6 +6,7 @@ import { randomBytes } from 'node:crypto'; import { Command, Option } from 'commander'; import SDK from '../sdk/index.js'; +import { commandMetadata } from '../cli/context.js'; import type { CliAuthDefinition } from '../cli/login.js'; import { VERSION } from '../sdk/version.js'; import { @@ -17,7 +18,7 @@ import { type GlobalOptions, } from '../cli/runtime.js'; import { buildFeedbackBundle, doctorReport, type IncludeLogs } from './bundle.js'; -import { debugDirectory, diagnosticScope } from './diagnostics.js'; +import { debugDirectory, diagnosticScope, registerDiagnosticCommand } from './diagnostics.js'; export const feedbackIdempotencyKey = (): string => { // UUIDv7: bytes 0..5 hold Unix milliseconds; byte 6 holds version 7; @@ -35,6 +36,14 @@ export const registerFeedbackCommands = ( auth: CliAuthDefinition | undefined, directory = debugDirectory(), ): Command => { + const registerPaths = (parent: Command, path: string): void => { + for (const child of parent.commands) { + const command = path + ' ' + child.name(); + if (commandMetadata(child)?.source === 'generated') registerDiagnosticCommand(command); + registerPaths(child, command); + } + }; + registerPaths(program, program.name()); const feedback = program .command('feedback ') .description('Send feedback with optional scrubbed CLI diagnostics') diff --git a/src/feedback/diagnostics.ts b/src/feedback/diagnostics.ts index 9452a18..a9624f9 100644 --- a/src/feedback/diagnostics.ts +++ b/src/feedback/diagnostics.ts @@ -33,35 +33,11 @@ const kinds = [ 'command_failure', 'command_complete', ] as const; -const commandWords = new Set([ - 'dedalus', - 'machines', - 'networks', - 'usage', - 'list', - 'create', - 'retrieve', - 'update', - 'delete', - 'watch', - 'sleep', - 'wake', - 'network', - 'artifacts', - 'ports', - 'ssh', - 'executions', - 'events', - 'output', - 'logs', - 'token', - 'reauthorize', - 'terminals', - 'connect', - 'machine-compute', - 'machine-storage', - 'feedback', -]); +// Only canonical paths from the command registry may enter diagnostics, never argv. +const diagnosticCommands = new Set(['dedalus ssh', 'dedalus feedback']); +export const registerDiagnosticCommand = (command: string): void => { + diagnosticCommands.add(command); +}; export type DiagnosticEvent = { ts: string; @@ -128,9 +104,7 @@ const parseEvent = (value: unknown): DiagnosticEvent | undefined => { if (!value || typeof value !== 'object') return undefined; const row = value as Record; if (typeof row['kind'] !== 'string' || !kinds.some((kind) => kind === row['kind'])) return undefined; - if (typeof row['command'] !== 'string' || !/^dedalus(?: [a-z-]+){1,5}$/.test(row['command'])) - return undefined; - if (row['command'].split(' ').some((word) => !commandWords.has(word))) return undefined; + if (typeof row['command'] !== 'string' || !diagnosticCommands.has(row['command'])) return undefined; if (typeof row['ts'] !== 'string' || !Number.isFinite(Date.parse(row['ts']))) return undefined; const result: DiagnosticEvent = { ts: new Date(row['ts']).toISOString(), diff --git a/tests/feedback-bundles.test.mjs b/tests/feedback-bundles.test.mjs index a282d39..e28b7da 100644 --- a/tests/feedback-bundles.test.mjs +++ b/tests/feedback-bundles.test.mjs @@ -10,6 +10,8 @@ const root = resolve(process.env.FEEDBACK_PACKAGE_ROOT ?? '.'); const load = (name) => import(pathToFileURL(join(root, 'dist/esm/feedback', name + '.js'))); const { createDiagnostics, diagnosticScope, selectDiagnostics } = await load('diagnostics'); const { buildFeedbackBundle } = await load('bundle'); +const { getProgram } = await import(pathToFileURL(join(root, 'dist/esm/commands/index.js'))); +getProgram(); const scope = diagnosticScope({ apiKey: 'test-key', baseURL: 'https://staging.invalid' }); const receipt = '01973f7b7cf6726a9a9f4f37d4b47a21'; const directory = (t) => { diff --git a/tests/feedback-diagnostics.test.mjs b/tests/feedback-diagnostics.test.mjs index d702fb9..822d323 100644 --- a/tests/feedback-diagnostics.test.mjs +++ b/tests/feedback-diagnostics.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict'; -import { mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, utimesSync } from 'node:fs'; +import { mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, utimesSync, appendFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join, resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; @@ -9,6 +9,9 @@ const root = resolve(process.env.FEEDBACK_PACKAGE_ROOT ?? '.'); const { createDiagnostics, diagnosticScope, selectDiagnostics, pruneDiagnostics } = await import( pathToFileURL(join(root, 'dist/esm/feedback/diagnostics.js')) ); +const { getProgram } = await import(pathToFileURL(join(root, 'dist/esm/commands/index.js'))); +const { buildCliContext, runnableCommands } = await import(pathToFileURL(join(root, 'dist/esm/cli/context.js'))); +const generated = runnableCommands(buildCliContext(getProgram()).commands).filter((c) => c.source === 'generated'); const scope = diagnosticScope({ apiKey: 'test-key', baseURL: 'https://staging.invalid' }); const receipt = '01973f7b7cf6726a9a9f4f37d4b47a21'; const directory = (t) => { @@ -169,3 +172,23 @@ test('invariant client processing failures retain the latest valid response rece assert.equal(selection.command, 'dedalus machines list'); assert.equal(selection.failure, undefined); }); + +test('every generated command can record a failure for feedback', (t) => { + assert.ok(generated.some((c) => c.command === 'dedalus machines ports access-keys rotate')); + for (const { command } of generated) { + const dir = directory(t); + createDiagnostics(command, scope, dir).record({ kind: 'command_failure' }); + assert.equal(selectDiagnostics(scope, dir).command, command); + } +}); + +test('unregistered paths in a local diagnostic file do not enter feedback', (t) => { + const dir = directory(t); + const log = createDiagnostics('dedalus images list', scope, dir); + log.record({ kind: 'command_failure' }); + const file = join(dir, readdirSync(dir)[0]); + for (const command of ['dedalus images list secret-value', 'dedalus machines machines']) { + appendFileSync(file, JSON.stringify({ ts: new Date().toISOString(), command, kind: 'command_failure' }) + '\n'); + } + assert.ok(selectDiagnostics(scope, dir).events.every((e) => e.command === 'dedalus images list')); +}); diff --git a/tests/ports-commands.test.mjs b/tests/ports-commands.test.mjs index a46eb33..30cdcc4 100644 --- a/tests/ports-commands.test.mjs +++ b/tests/ports-commands.test.mjs @@ -2,7 +2,9 @@ import assert from 'node:assert/strict'; import { execFile } from 'node:child_process'; import { createServer } from 'node:http'; import { once } from 'node:events'; -import { resolve } from 'node:path'; +import { mkdtempSync, rmSync, readFileSync, readdirSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { resolve, join } from 'node:path'; import { test } from 'node:test'; import { promisify } from 'node:util'; @@ -51,7 +53,9 @@ for (const [command, flags, method, suffix, body] of cases) { server.listen(0, '127.0.0.1'); await once(server, 'listening'); t.after(() => new Promise((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())))); - await run( + const home = mkdtempSync(join(tmpdir(), 'dedalus-ports-')); + t.after(() => rmSync(home, { recursive: true, force: true })); + const { stderr } = await run( process.execPath, [ bin, @@ -68,8 +72,15 @@ for (const [command, flags, method, suffix, body] of cases) { machine, ...flags, ], - { timeout: 10000 }, + { timeout: 10000, env: { HOME: home, USERPROFILE: home, PATH: process.env.PATH } }, ); + assert.equal(stderr, ''); + const debug = join(home, '.dedalus', 'debug'); + const files = readdirSync(debug); + assert.equal(files.length, 1); + const events = readFileSync(join(debug, files[0]), 'utf8').trim().split('\n').map((s) => JSON.parse(s)); + assert.equal(events.at(-1).kind, 'command_complete'); + assert.ok(events.every((e) => e.command === 'dedalus machines ports ' + command)); assert.deepEqual(requests, [ { method, path: '/v1/machines/' + machine + '/ports' + suffix, auth: 'Bearer fixture', body }, ]); From aa530aa341c61ebbd7a41facb1ea79c5e4920ec5 Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Fri, 20 Nov 2026 17:36:01 -0800 Subject: [PATCH 07/12] feat(login): simplify interactive sign-in choices --- src/cli/login.ts | 28 +++++++++++++++---- src/commands/index.ts | 6 +++++ tests/fixtures/login-menu.py | 52 ++++++++++++++++++++++++++++++++++++ tests/login-menu.test.mjs | 12 +++++++++ 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 tests/fixtures/login-menu.py create mode 100644 tests/login-menu.test.mjs diff --git a/src/cli/login.ts b/src/cli/login.ts index 5f92ff8..d4c4bd4 100644 --- a/src/cli/login.ts +++ b/src/cli/login.ts @@ -116,6 +116,10 @@ export type CliAuthDefinition = { readonly requirements: readonly (readonly string[])[]; readonly envByKey: Readonly>; readonly methods: readonly CliAuthMethodDefinition[]; + // @custom start + /** Interactive choices only. Explicit --flow names still resolve against methods. */ + readonly menu?: readonly { readonly name: string; readonly label: string }[]; + // @custom end /** Publisher logo for the browser sign-in page; absent means the page shows none. */ readonly logo?: string; }; @@ -682,6 +686,15 @@ const chooseMethod = async ( throw new UsageError("Unknown sign-in flow '" + flow + "'. Available: " + names.join(', ') + '.'); return chosen; } + // @custom start + if (auth.menu) { + const index = await promptChoice('How would you like to sign in?', auth.menu); + const name = auth.menu[index]?.name; + const chosen = auth.methods.find((method) => method.name === name); + if (!chosen) throw new Error('Login menu selected an unconfigured sign-in method.'); + return chosen; + } + // @custom end const first = auth.methods[0]; if (!first) throw new Error('This CLI has no sign-in flow.'); if (auth.methods.length === 1) return first; @@ -2325,7 +2338,9 @@ const restoreCursor = (): void => { /** One row of the sign-in picker: what it reads as, and the `--flow` value that skips the prompt. */ type Choice = { readonly label: string; - readonly hint: string; + // @custom start + readonly hint?: string; + // @custom end }; /** @@ -2373,7 +2388,9 @@ const promptChoice = async (heading: string, choices: readonly Choice[]): Promis for (const choice of shown) { const selected = choice === choices[active]; const head = (selected ? '> ' : ' ') + choice.label; - const tail = ' (--flow ' + choice.hint + ')'; + // @custom start + const tail = choice.hint ? ' (--flow ' + choice.hint + ')' : ''; + // @custom end const plain = clip(head + tail, columns); // The flow name is kept on every row rather than only the highlighted one, because labels // are not unique: an API key in a header, in a query parameter and in a cookie all read as @@ -2460,9 +2477,10 @@ const promptChoice = async (heading: string, choices: readonly Choice[]): Promis return; } const chosen = choices[active]; - processStderr.write( - heading + ' ' + (chosen?.label ?? '') + ' (--flow ' + (chosen?.hint ?? '') + ')\n', - ); + // @custom start + const hint = chosen?.hint ? ' (--flow ' + chosen.hint + ')' : ''; + processStderr.write(heading + ' ' + (chosen?.label ?? '') + hint + '\n'); + // @custom end resolve(active); }; // Hidden for the duration: the cursor would otherwise sit at the end of the last row drawn, diff --git a/src/commands/index.ts b/src/commands/index.ts index 267cfaf..9aacb57 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -1522,6 +1522,12 @@ export const auth = { loginPath: ['login'], logoutPath: ['logout'], loginCommand: 'dedalus login', + // @custom start + menu: [ + { name: 'oauth-browser', label: 'Sign in with a browser' }, + { name: 'x-api-key', label: 'Use an API key' }, + ], + // @custom end storeName: 'dedalus', storeEnv: 'DEDALUS_CREDENTIALS_FILE', baseUrlEnv: 'DEDALUS_BASE_URL', diff --git a/tests/fixtures/login-menu.py b/tests/fixtures/login-menu.py new file mode 100644 index 0000000..fc24389 --- /dev/null +++ b/tests/fixtures/login-menu.py @@ -0,0 +1,52 @@ +"""Drive the packaged CLI at a terminal; never open a real browser or submit a key.""" +import os +import pty +import re +import select +import subprocess +import sys +import tempfile +import time +from pathlib import Path + +node, cli = sys.argv[1:] +with tempfile.TemporaryDirectory() as home: + for opener in ('open', 'xdg-open'): + script = Path(home, opener) + script.write_text('#!/bin/sh\nexit 0\n') + script.chmod(0o700) + env = {'HOME': home, 'PATH': home + ':' + os.environ['PATH'], 'TERM': 'xterm'} + menu = b'> Sign in with a browser\n Use an API key\n arrows to move, enter to choose' + + def check(args, keys, expected): + master, slave = pty.openpty() + child = subprocess.Popen([node, cli, 'login', *args], env=env, stdin=slave, stderr=slave, stdout=slave) + os.close(slave) + output = b'' + sent = False + try: + deadline = time.monotonic() + 4 + while time.monotonic() < deadline: + if not select.select([master], [], [], 0.1)[0]: + continue + output += os.read(master, 32768) + plain = re.sub(rb'\x1b\[[0-9;?]*[A-Za-z]', b'', output).replace(b'\r', b'') + if keys and not sent and menu in plain: + assert b'--flow' not in plain and b'Enter your access token' not in plain + os.write(master, keys) + sent = True + if expected in plain: + assert sent if keys else b'How would you like to sign in?' not in plain + return + raise AssertionError('login never reached expected prompt: ' + expected.decode()) + finally: + if child.poll() is None: + child.kill() + child.wait() + os.close(master) + + check([], b'\r', b'Opening your browser to sign in.') + check([], b'\x1b[B\r', b'API key: ') + check(['--flow', 'api-key'], None, b'Access token: ') + check(['--flow', 'x-api-key'], None, b'API key: ') + check(['--flow', 'oauth-browser'], None, b'Opening your browser to sign in.') diff --git a/tests/login-menu.test.mjs b/tests/login-menu.test.mjs new file mode 100644 index 0000000..d8e9183 --- /dev/null +++ b/tests/login-menu.test.mjs @@ -0,0 +1,12 @@ +import { execFileSync } from 'node:child_process'; +import { resolve } from 'node:path'; +import { test } from 'node:test'; +import { fileURLToPath } from 'node:url'; + +test('login shows two interactive choices and preserves explicit flows', { + skip: process.platform === 'win32' && 'requires a POSIX pseudo-terminal', +}, () => { + const cli = resolve(process.env.CLI_PACKAGE_ROOT ?? '.', 'dist/esm/bin.js'); + execFileSync('python3', [fileURLToPath(new URL('./fixtures/login-menu.py', import.meta.url)), process.execPath, cli], + { timeout: 30000 }); +}); From d82afd5ab0a81f94574a37e9a4fbfda84de8cf6c Mon Sep 17 00:00:00 2001 From: Shengming Liang <231182611+AgentWings@users.noreply.github.com> Date: Fri, 20 Nov 2026 17:43:37 -0800 Subject: [PATCH 08/12] fix(login): show only public sign-in choices in help --- README.md | 2 +- man/dedalus-login.1 | 13 +++++-------- src/cli/completions.ts | 4 ++-- src/cli/login.ts | 9 ++++++++- src/cli/runtime.ts | 11 +++++++++-- src/commands/index.ts | 6 ++++-- tests/fixtures/login-menu.py | 2 +- tests/login-menu.test.mjs | 14 +++++++++++++- 8 files changed, 43 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 8e79869..88676bc 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ See the [API reference](./api.md) for every available operation. Run `dedalus login` and select “Sign in with a browser” at the prompt. -`dedalus login` signs you in and saves the credential for later commands, so it does not have to be passed every time. It goes into your operating system's credential store — the Keychain on macOS, the system keyring on Linux, Credential Manager on Windows — and falls back to a file in your state directory, readable only by you, when no such store is available. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. `dedalus logout` forgets it. It also asks the provider to revoke a saved OAuth token when a revocation endpoint is known. The local copy is removed first, so if the provider cannot be reached the credential is still gone from this machine; the failure is printed as a warning and the command still succeeds. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. Sign-in methods: api-key, x-api-key, oauth-browser. Pass `--flow ` to pick one without being asked. +`dedalus login` signs you in and saves the credential for later commands, so it does not have to be passed every time. It goes into your operating system's credential store — the Keychain on macOS, the system keyring on Linux, Credential Manager on Windows — and falls back to a file in your state directory, readable only by you, when no such store is available. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. `dedalus logout` forgets it. It also asks the provider to revoke a saved OAuth token when a revocation endpoint is known. The local copy is removed first, so if the provider cannot be reached the credential is still gone from this machine; the failure is printed as a warning and the command still succeeds. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. Choose **Sign in with a browser** or **Use an API key**. To skip the menu, pass `--flow oauth-browser` or `--flow api-key`. ```sh dedalus login diff --git a/man/dedalus-login.1 b/man/dedalus-login.1 index 1f4f4ee..2004f20 100644 --- a/man/dedalus-login.1 +++ b/man/dedalus-login.1 @@ -10,7 +10,7 @@ Obtains a credential and saves it so later commands do not have to carry one. It .SH "OPTIONS" .TP \fB\-\-flow\fR \fIname\fR -Sign\-in flow to use, skipping the prompt. One of: api\-key, x\-api\-key, oauth\-browser. +Sign\-in flow to use, skipping the prompt. One of: oauth\-browser or api\-key. .TP \fB\-\-base\-url\fR \fIurl\fR Sign in against this base URL instead of the default. @@ -19,14 +19,11 @@ Sign in against this base URL instead of the default. Never prompt; a command that would ask fails instead. .SH "SIGN\-IN FLOWS" .TP -\fBapi\-key\fR -Enter your access token. -.TP -\fBx\-api\-key\fR -Enter your API key. -.TP \fBoauth\-browser\fR -Sign in with a browser (OAuth authorization code). +Sign in with a browser. +.TP +\fBapi\-key\fR +Use an API key. .SH "EXAMPLES" .PP .RS 4 diff --git a/src/cli/completions.ts b/src/cli/completions.ts index b812cd4..d6282c1 100644 --- a/src/cli/completions.ts +++ b/src/cli/completions.ts @@ -7,9 +7,9 @@ const bash = "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'machines ports'|'machines ports list'|'machines ports create'|'machines ports retrieve'|'machines ports update'|'machines ports delete'|'machines ports access-keys'|'machines ports access-keys list'|'machines ports access-keys mint'|'machines ports access-keys revoke'|'machines ports access-keys rotate'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_path_flag() {\n return 1\n}\n\n__dedalus_completion() {\n local cur prev node candidate words line index\n COMPREPLY=()\n cur=\"${COMP_WORDS[COMP_CWORD]}\"\n prev=''\n if (( COMP_CWORD > 0 )); then prev=\"${COMP_WORDS[COMP_CWORD-1]}\"; fi\n node=''\n for (( index = 1; index < COMP_CWORD; index++ )); do\n case \"${COMP_WORDS[index]}\" in\n -*) continue ;;\n esac\n if [ -z \"$node\" ]; then\n candidate=\"${COMP_WORDS[index]}\"\n else\n candidate=\"$node ${COMP_WORDS[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then node=\"$candidate\"; fi\n done\n\n case \"$node\" in\n '') words='machines organization images login logout completion upgrade uninstall help --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --version --help' ;;\n 'completion') words='bash zsh fish --help' ;;\n 'upgrade') words='--check --help' ;;\n 'uninstall') words='--help' ;;\n 'machines') words='list create retrieve update delete sleep wake reboot resize ssh executions autoresizing ports --help' ;;\n 'machines list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines create') words='--autosleep --image-id --memory-mib --storage-gib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines update') words='--machine-id --autosleep --storage-gib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines delete') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines sleep') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines wake') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines reboot') words='--machine-id --force --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines resize') words='--machine-id --memory-mib --vcpu --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh') words='list create retrieve delete --help' ;;\n 'machines ssh list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh create') words='--machine-id --public-key --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh retrieve') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ssh delete') words='--machine-id --session-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions') words='list create retrieve delete output events logs --help' ;;\n 'machines executions list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions create') words='--machine-id --command --cwd --env --stdin --timeout-ms --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions delete') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions output') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions events') words='--machine-id --execution-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs') words='retrieve create-token --help' ;;\n 'machines executions logs retrieve') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines executions logs create-token') words='--machine-id --execution-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing') words='retrieve update --help' ;;\n 'machines autoresizing retrieve') words='--machine-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines autoresizing update') words='--machine-id --cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports') words='list create retrieve update delete access-keys --help' ;;\n 'machines ports list') words='--machine-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --max-items --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports create') words='--machine-id --expires --port --protocol --visibility --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports retrieve') words='--machine-id --port-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports update') words='--machine-id --port-id --visibility --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports delete') words='--machine-id --port-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys') words='list mint revoke rotate --help' ;;\n 'machines ports access-keys list') words='--machine-id --port-id --limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys mint') words='--machine-id --port-id --expires-in --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys revoke') words='--machine-id --port-id --access-key-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'machines ports access-keys rotate') words='--machine-id --port-id --access-key-id --expires-in --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization') words='autoresizing --help' ;;\n 'organization autoresizing') words='retrieve update --help' ;;\n 'organization autoresizing retrieve') words='--base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'organization autoresizing update') words='--cpu --cpu-max-vcpu --memory --memory-max-mib --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images') words='list create retrieve update delete uploads --help' ;;\n 'images list') words='--limit --cursor --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images create') words='--credential-ref --name --platform --source --source.kind --source.reference --source.sha256 --source.upload-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images retrieve') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images update') words='--image-id --name --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images delete') words='--image-id --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'images uploads') words='create --help' ;;\n 'images uploads create') words='--platform --sha256 --size-bytes --base-url --timeout --max-retries --format --format-error --transform --transform-error --raw-output --debug --no-input --api-key --x-api-key --browser-token --dedalus-org-id --help' ;;\n 'login') words='--base-url --flow --no-input --help' ;;\n 'logout') words='--base-url --all --help' ;;\n *) words='' ;;\n esac\n\n if __dedalus_path_flag \"$node $prev\"; then\n compopt -o filenames 2>/dev/null\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -f -- \"$cur\")\n return\n fi\n\n while IFS= read -r line; do\n COMPREPLY+=( \"$line\" )\n done < <(compgen -W \"$words\" -- \"$cur\")\n}\n\ncomplete -F __dedalus_completion 'dedalus'\n"; const zsh = - "#compdef dedalus\n# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'machines ports'|'machines ports list'|'machines ports create'|'machines ports retrieve'|'machines ports update'|'machines ports delete'|'machines ports access-keys'|'machines ports access-keys list'|'machines ports access-keys mint'|'machines ports access-keys revoke'|'machines ports access-keys rotate'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_completion() {\n local node candidate\n local -a subcommands options\n local -i index matched\n node=''\n matched=1\n for (( index = 2; index < CURRENT; index++ )); do\n case ${words[index]} in\n -*) continue ;;\n esac\n if [[ -z $node ]]; then\n candidate=${words[index]}\n else\n candidate=\"$node ${words[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then\n node=$candidate\n matched=$index\n fi\n done\n\n subcommands=()\n options=()\n case \"$node\" in\n '')\n subcommands=('machines:machines commands' 'organization:organization commands' 'images:images commands' 'login:Sign in and save credentials for later commands' 'logout:Forget saved credentials, and revoke them if the provider supports it' 'completion:Print a shell completion script' 'upgrade:Upgrade to the latest release' 'uninstall:Show how to remove this installation' 'help:Show help for a command')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--version[Print the CLI version]' '--help[Show help for this command]')\n ;;\n 'completion')\n subcommands=('bash:Print a bash completion script' 'zsh:Print a zsh completion script' 'fish:Print a fish completion script')\n options=('--help[Show help for this command]')\n ;;\n 'upgrade')\n options=('--check[Report the latest version without installing it]' '--help[Show help for this command]')\n ;;\n 'uninstall')\n options=('--help[Show help for this command]')\n ;;\n 'machines')\n subcommands=('list:List machines' 'create:Create machine' 'retrieve:Get machine' 'update:Update machine' 'delete:Destroy machine' 'sleep:Sleep a running machine' 'wake:Wake a sleeping machine' 'reboot:Reboot a machine with fresh memory' 'resize:Resize machine' 'ssh:ssh commands' 'executions:executions commands' 'autoresizing:autoresizing commands' 'ports:ports commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines create')\n options=('--autosleep[Idle window before autosleep]:value:' '--image-id[Organization-owned ready custom image ID]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--autosleep[The autosleep body parameter]:value:' '--storage-gib[The storage-gib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Destroy from the last published filesystem checkpoint without publishing the Machine'\\''s remaining...]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines sleep')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines wake')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines reboot')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Recover from the last committed filesystem checkpoint without guest cooperation]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines resize')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--memory-mib[RAM in MiB]:value:' '--vcpu[CPU in 0.25-vCPU steps]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh')\n subcommands=('list:List SSH sessions' 'create:Create SSH session' 'retrieve:Get SSH session' 'delete:Delete SSH session')\n options=('--help[Show help for this command]')\n ;;\n 'machines ssh list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--public-key[The public-key body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions')\n subcommands=('list:List executions' 'create:Create execution' 'retrieve:Get execution' 'delete:Delete execution' 'output:Get execution output' 'events:List execution events' 'logs:logs commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--command[Program and its arguments as an array of strings, such as \\[\"ls\", \"-la\"\\]]:value:' '--cwd[The cwd body parameter]:value:' '--env[The env body parameter]:value:' '--stdin[The stdin body parameter]:value:' '--timeout-ms[The timeout-ms body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions output')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions events')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs')\n subcommands=('retrieve:Get execution log status' 'create-token:Create execution log read token')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions logs retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs create-token')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing')\n subcommands=('retrieve:Read this machine'\\''s autoresizing settings' 'update:Set this machine'\\''s autoresizing settings')\n options=('--help[Show help for this command]')\n ;;\n 'machines autoresizing retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports')\n subcommands=('list:List ports' 'create:Create port' 'retrieve:Get port' 'update:Update port' 'delete:Delete port' 'access-keys:access-keys commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines ports list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--expires[Port lifetime in integer seconds]:value:' '--port[The port body parameter]:value:' '--protocol[The protocol body parameter]:value:' '--visibility[Who may reach the port]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--visibility[Who may reach the port]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys')\n subcommands=('list:List port access keys' 'mint:Mint port access key' 'revoke:Revoke port access key' 'rotate:Rotate port access key')\n options=('--help[Show help for this command]')\n ;;\n 'machines ports access-keys list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys mint')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--expires-in[Lifetime in integer seconds]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys revoke')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--access-key-id[The access-key-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys rotate')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--access-key-id[The access-key-id path parameter]:value:' '--expires-in[Lifetime in integer seconds]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization')\n subcommands=('autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing')\n subcommands=('retrieve:Read organization autoresizing policy' 'update:Set organization autoresizing policy')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing retrieve')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization autoresizing update')\n options=('--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images')\n subcommands=('list:List images owned by the authenticated organization' 'create:Register an immutable OCI image for preparation' 'retrieve:Read preparation status for an organization-owned image' 'update:Rename an organization-owned image' 'delete:Delete an organization-owned image' 'uploads:uploads commands')\n options=('--help[Show help for this command]')\n ;;\n 'images list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images create')\n options=('--credential-ref[The credential-ref body parameter]:value:' '--name[A label people use to tell images apart]:value:' '--platform[The platform body parameter]:value:' '--source[The source body parameter]:value:' '--source.kind[The source.kind body parameter]:value:' '--source.reference[The source.reference body parameter]:value:' '--source.sha256[The source.sha256 body parameter]:value:' '--source.upload-id[The source.upload-id body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images retrieve')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images update')\n options=('--image-id[The image-id path parameter]:value:' '--name[The new label, or null to clear it]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images delete')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images uploads')\n subcommands=('create:Reserve an immutable Docker image archive upload')\n options=('--help[Show help for this command]')\n ;;\n 'images uploads create')\n options=('--platform[The platform body parameter]:value:' '--sha256[The sha256 body parameter]:value:' '--size-bytes[The size-bytes body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'login')\n options=('--base-url[Sign in against this base URL instead of the default]:value:' '--flow[Sign-in flow to use\\: api-key, x-api-key, oauth-browser]:value:' '--no-input[Never prompt; a command that would ask fails instead]' '--help[Show help for this command]')\n ;;\n 'logout')\n options=('--base-url[Forget the credentials saved for this base URL (not with --all)]:value:' '--all[Forget every saved credential, for every base URL]' '--help[Show help for this command]')\n ;;\n esac\n\n words=( \"$words[1]\" \"${(@)words[matched+1,-1]}\" )\n (( CURRENT -= matched - 1 ))\n\n (( ${#options} )) && _arguments -s -S $options\n (( ${#subcommands} )) && _describe -t commands 'command' subcommands\n}\n\nif [[ ${zsh_eval_context[-1]} == loadautofunc ]]; then\n __dedalus_completion \"$@\"\nelse\n compdef __dedalus_completion 'dedalus'\nfi\n"; + "#compdef dedalus\n# File generated from our OpenAPI spec by Scalar. Do not edit.\n\n__dedalus_known_command() {\n case \"$1\" in\n 'completion'|'upgrade'|'uninstall'|'machines'|'machines list'|'machines create'|'machines retrieve'|'machines update'|'machines delete'|'machines sleep'|'machines wake'|'machines reboot'|'machines resize'|'machines ssh'|'machines ssh list'|'machines ssh create'|'machines ssh retrieve'|'machines ssh delete'|'machines executions'|'machines executions list'|'machines executions create'|'machines executions retrieve'|'machines executions delete'|'machines executions output'|'machines executions events'|'machines executions logs'|'machines executions logs retrieve'|'machines executions logs create-token'|'machines autoresizing'|'machines autoresizing retrieve'|'machines autoresizing update'|'machines ports'|'machines ports list'|'machines ports create'|'machines ports retrieve'|'machines ports update'|'machines ports delete'|'machines ports access-keys'|'machines ports access-keys list'|'machines ports access-keys mint'|'machines ports access-keys revoke'|'machines ports access-keys rotate'|'organization'|'organization autoresizing'|'organization autoresizing retrieve'|'organization autoresizing update'|'images'|'images list'|'images create'|'images retrieve'|'images update'|'images delete'|'images uploads'|'images uploads create'|'login'|'logout') return 0 ;;\n esac\n return 1\n}\n\n__dedalus_completion() {\n local node candidate\n local -a subcommands options\n local -i index matched\n node=''\n matched=1\n for (( index = 2; index < CURRENT; index++ )); do\n case ${words[index]} in\n -*) continue ;;\n esac\n if [[ -z $node ]]; then\n candidate=${words[index]}\n else\n candidate=\"$node ${words[index]}\"\n fi\n if __dedalus_known_command \"$candidate\"; then\n node=$candidate\n matched=$index\n fi\n done\n\n subcommands=()\n options=()\n case \"$node\" in\n '')\n subcommands=('machines:machines commands' 'organization:organization commands' 'images:images commands' 'login:Sign in and save credentials for later commands' 'logout:Forget saved credentials, and revoke them if the provider supports it' 'completion:Print a shell completion script' 'upgrade:Upgrade to the latest release' 'uninstall:Show how to remove this installation' 'help:Show help for a command')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--version[Print the CLI version]' '--help[Show help for this command]')\n ;;\n 'completion')\n subcommands=('bash:Print a bash completion script' 'zsh:Print a zsh completion script' 'fish:Print a fish completion script')\n options=('--help[Show help for this command]')\n ;;\n 'upgrade')\n options=('--check[Report the latest version without installing it]' '--help[Show help for this command]')\n ;;\n 'uninstall')\n options=('--help[Show help for this command]')\n ;;\n 'machines')\n subcommands=('list:List machines' 'create:Create machine' 'retrieve:Get machine' 'update:Update machine' 'delete:Destroy machine' 'sleep:Sleep a running machine' 'wake:Wake a sleeping machine' 'reboot:Reboot a machine with fresh memory' 'resize:Resize machine' 'ssh:ssh commands' 'executions:executions commands' 'autoresizing:autoresizing commands' 'ports:ports commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines create')\n options=('--autosleep[Idle window before autosleep]:value:' '--image-id[Organization-owned ready custom image ID]:value:' '--memory-mib[Memory in MiB]:value:' '--storage-gib[Storage in GiB]:value:' '--vcpu[CPU in vCPUs]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--autosleep[The autosleep body parameter]:value:' '--storage-gib[The storage-gib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Destroy from the last published filesystem checkpoint without publishing the Machine'\\''s remaining...]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines sleep')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines wake')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines reboot')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--force[Recover from the last committed filesystem checkpoint without guest cooperation]' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines resize')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--memory-mib[RAM in MiB]:value:' '--vcpu[CPU in 0.25-vCPU steps]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh')\n subcommands=('list:List SSH sessions' 'create:Create SSH session' 'retrieve:Get SSH session' 'delete:Delete SSH session')\n options=('--help[Show help for this command]')\n ;;\n 'machines ssh list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--public-key[The public-key body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ssh delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--session-id[The session-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions')\n subcommands=('list:List executions' 'create:Create execution' 'retrieve:Get execution' 'delete:Delete execution' 'output:Get execution output' 'events:List execution events' 'logs:logs commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--command[Program and its arguments as an array of strings, such as \\[\"ls\", \"-la\"\\]]:value:' '--cwd[The cwd body parameter]:value:' '--env[The env body parameter]:value:' '--stdin[The stdin body parameter]:value:' '--timeout-ms[The timeout-ms body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions output')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions events')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs')\n subcommands=('retrieve:Get execution log status' 'create-token:Create execution log read token')\n options=('--help[Show help for this command]')\n ;;\n 'machines executions logs retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines executions logs create-token')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--execution-id[The execution-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing')\n subcommands=('retrieve:Read this machine'\\''s autoresizing settings' 'update:Set this machine'\\''s autoresizing settings')\n options=('--help[Show help for this command]')\n ;;\n 'machines autoresizing retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines autoresizing update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports')\n subcommands=('list:List ports' 'create:Create port' 'retrieve:Get port' 'update:Update port' 'delete:Delete port' 'access-keys:access-keys commands')\n options=('--help[Show help for this command]')\n ;;\n 'machines ports list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--max-items[Maximum number of streamed items to print; use -1 for unlimited]:value:' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports create')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--expires[Port lifetime in integer seconds]:value:' '--port[The port body parameter]:value:' '--protocol[The protocol body parameter]:value:' '--visibility[Who may reach the port]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports retrieve')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports update')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--visibility[Who may reach the port]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports delete')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys')\n subcommands=('list:List port access keys' 'mint:Mint port access key' 'revoke:Revoke port access key' 'rotate:Rotate port access key')\n options=('--help[Show help for this command]')\n ;;\n 'machines ports access-keys list')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys mint')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--expires-in[Lifetime in integer seconds]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys revoke')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--access-key-id[The access-key-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'machines ports access-keys rotate')\n options=('--machine-id[Bare, lowercase, hyphenated Machine UUID]:value:' '--port-id[The port-id path parameter]:value:' '--access-key-id[The access-key-id path parameter]:value:' '--expires-in[Lifetime in integer seconds]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization')\n subcommands=('autoresizing:autoresizing commands')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing')\n subcommands=('retrieve:Read organization autoresizing policy' 'update:Set organization autoresizing policy')\n options=('--help[Show help for this command]')\n ;;\n 'organization autoresizing retrieve')\n options=('--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'organization autoresizing update')\n options=('--cpu[The cpu body parameter]:value:' '--cpu-max-vcpu[The cpu-max-vcpu body parameter]:value:' '--memory[The memory body parameter]:value:' '--memory-max-mib[The memory-max-mib body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images')\n subcommands=('list:List images owned by the authenticated organization' 'create:Register an immutable OCI image for preparation' 'retrieve:Read preparation status for an organization-owned image' 'update:Rename an organization-owned image' 'delete:Delete an organization-owned image' 'uploads:uploads commands')\n options=('--help[Show help for this command]')\n ;;\n 'images list')\n options=('--limit[The limit query parameter]:value:' '--cursor[The cursor query parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images create')\n options=('--credential-ref[The credential-ref body parameter]:value:' '--name[A label people use to tell images apart]:value:' '--platform[The platform body parameter]:value:' '--source[The source body parameter]:value:' '--source.kind[The source.kind body parameter]:value:' '--source.reference[The source.reference body parameter]:value:' '--source.sha256[The source.sha256 body parameter]:value:' '--source.upload-id[The source.upload-id body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images retrieve')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images update')\n options=('--image-id[The image-id path parameter]:value:' '--name[The new label, or null to clear it]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images delete')\n options=('--image-id[The image-id path parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'images uploads')\n subcommands=('create:Reserve an immutable Docker image archive upload')\n options=('--help[Show help for this command]')\n ;;\n 'images uploads create')\n options=('--platform[The platform body parameter]:value:' '--sha256[The sha256 body parameter]:value:' '--size-bytes[The size-bytes body parameter]:value:' '--base-url[Override the base URL for API requests]:value:' '--timeout[Request timeout in milliseconds]:value:' '--max-retries[Number of retries for retryable failures]:value:' '--format[Output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--format-error[Error output format\\: auto, json, jsonl, pretty, raw, toon, yaml]:value:' '--transform[Dot-path transform for data output]:value:' '--transform-error[Dot-path transform for error output]:value:' '--raw-output[Print transformed string values without JSON quotes]' '--debug[Enable SDK debug logging]' '--no-input[Never prompt; a command that would ask fails instead]' '--api-key[Dedalus API key or short-lived delegated access token in `Authorization\\: Bearer `]:value:' '--x-api-key[Dedalus API key]:value:' '--browser-token[API credential ($DEDALUS_BROWSER_TOKEN)]:value:' '--dedalus-org-id[Optional organization assertion]:value:' '--help[Show help for this command]')\n ;;\n 'login')\n options=('--base-url[Sign in against this base URL instead of the default]:value:' '--flow[Sign-in flow to use\\: oauth-browser, api-key]:value:' '--no-input[Never prompt; a command that would ask fails instead]' '--help[Show help for this command]')\n ;;\n 'logout')\n options=('--base-url[Forget the credentials saved for this base URL (not with --all)]:value:' '--all[Forget every saved credential, for every base URL]' '--help[Show help for this command]')\n ;;\n esac\n\n words=( \"$words[1]\" \"${(@)words[matched+1,-1]}\" )\n (( CURRENT -= matched - 1 ))\n\n (( ${#options} )) && _arguments -s -S $options\n (( ${#subcommands} )) && _describe -t commands 'command' subcommands\n}\n\nif [[ ${zsh_eval_context[-1]} == loadautofunc ]]; then\n __dedalus_completion \"$@\"\nelse\n compdef __dedalus_completion 'dedalus'\nfi\n"; const fish = - "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\nset -g __dedalus_paths 'completion' 'upgrade' 'uninstall' 'machines' 'machines list' 'machines create' 'machines retrieve' 'machines update' 'machines delete' 'machines sleep' 'machines wake' 'machines reboot' 'machines resize' 'machines ssh' 'machines ssh list' 'machines ssh create' 'machines ssh retrieve' 'machines ssh delete' 'machines executions' 'machines executions list' 'machines executions create' 'machines executions retrieve' 'machines executions delete' 'machines executions output' 'machines executions events' 'machines executions logs' 'machines executions logs retrieve' 'machines executions logs create-token' 'machines autoresizing' 'machines autoresizing retrieve' 'machines autoresizing update' 'machines ports' 'machines ports list' 'machines ports create' 'machines ports retrieve' 'machines ports update' 'machines ports delete' 'machines ports access-keys' 'machines ports access-keys list' 'machines ports access-keys mint' 'machines ports access-keys revoke' 'machines ports access-keys rotate' 'organization' 'organization autoresizing' 'organization autoresizing retrieve' 'organization autoresizing update' 'images' 'images list' 'images create' 'images retrieve' 'images update' 'images delete' 'images uploads' 'images uploads create' 'login' 'logout'\n\nfunction __dedalus_path\n set -l path ''\n set -l tokens (commandline -opc)\n for token in $tokens[2..-1]\n if string match -q -- '-*' $token\n continue\n end\n set -l candidate\n if test -z \"$path\"\n set candidate $token\n else\n set candidate \"$path $token\"\n end\n if contains -- $candidate $__dedalus_paths\n set path $candidate\n end\n end\n echo $path\nend\n\nfunction __dedalus_at --argument-names index\n set -l current (__dedalus_path)\n if test \"$index\" -eq 0\n test -z \"$current\"\n else\n test \"$current\" = \"$__dedalus_paths[$index]\"\n end\nend\n\ncomplete -c 'dedalus' -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines' -d 'machines commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'organization' -d 'organization commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'images' -d 'images commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'login' -d 'Sign in and save credentials for later commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'logout' -d 'Forget saved credentials, and revoke them if the provider supports it'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'completion' -d 'Print a shell completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'upgrade' -d 'Upgrade to the latest release'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'uninstall' -d 'Show how to remove this installation'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'help' -d 'Show help for a command'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'version' -d 'Print the CLI version'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'bash' -d 'Print a bash completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'zsh' -d 'Print a zsh completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'fish' -d 'Print a fish completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'check' -d 'Report the latest version without installing it'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'list' -d 'List machines'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'create' -d 'Create machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'retrieve' -d 'Get machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'update' -d 'Update machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'delete' -d 'Destroy machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'sleep' -d 'Sleep a running machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'wake' -d 'Wake a sleeping machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'reboot' -d 'Reboot a machine with fresh memory'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'resize' -d 'Resize machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ssh' -d 'ssh commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'executions' -d 'executions commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ports' -d 'ports commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'image-id' -d 'Organization-owned ready custom image ID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'autosleep' -d 'The autosleep body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'storage-gib' -d 'The storage-gib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'force' -d 'Destroy from the last published filesystem checkpoint without publishing the Machine\\'s remaining...'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'force' -d 'Recover from the last committed filesystem checkpoint without guest cooperation'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'memory-mib' -d 'RAM in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'vcpu' -d 'CPU in 0.25-vCPU steps' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'list' -d 'List SSH sessions'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'create' -d 'Create SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'retrieve' -d 'Get SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'delete' -d 'Delete SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'public-key' -d 'The public-key body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'list' -d 'List executions'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'create' -d 'Create execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'retrieve' -d 'Get execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'delete' -d 'Delete execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'output' -d 'Get execution output'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'events' -d 'List execution events'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'logs' -d 'logs commands'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'command' -d 'Program and its arguments as an array of strings, such as [\"ls\", \"-la\"]' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'cwd' -d 'The cwd body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'env' -d 'The env body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'stdin' -d 'The stdin body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout-ms' -d 'The timeout-ms body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'retrieve' -d 'Get execution log status'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'create-token' -d 'Create execution log read token'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'retrieve' -d 'Read this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'update' -d 'Set this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'list' -d 'List ports'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'create' -d 'Create port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'retrieve' -d 'Get port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'update' -d 'Update port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'delete' -d 'Delete port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'access-keys' -d 'access-keys commands'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'expires' -d 'Port lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'port' -d 'The port body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'protocol' -d 'The protocol body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'visibility' -d 'Who may reach the port' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'visibility' -d 'Who may reach the port' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'list' -d 'List port access keys'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'mint' -d 'Mint port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'revoke' -d 'Revoke port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'rotate' -d 'Rotate port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'expires-in' -d 'Lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'access-key-id' -d 'The access-key-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'access-key-id' -d 'The access-key-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'expires-in' -d 'Lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -a 'retrieve' -d 'Read organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -a 'update' -d 'Set organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'list' -d 'List images owned by the authenticated organization'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'create' -d 'Register an immutable OCI image for preparation'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'retrieve' -d 'Read preparation status for an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'update' -d 'Rename an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'delete' -d 'Delete an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'uploads' -d 'uploads commands'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'credential-ref' -d 'The credential-ref body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'name' -d 'A label people use to tell images apart' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source' -d 'The source body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.kind' -d 'The source.kind body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.reference' -d 'The source.reference body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.sha256' -d 'The source.sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.upload-id' -d 'The source.upload-id body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'name' -d 'The new label, or null to clear it' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 53' -a 'create' -d 'Reserve an immutable Docker image archive upload'\ncomplete -c 'dedalus' -n '__dedalus_at 53' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'sha256' -d 'The sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'size-bytes' -d 'The size-bytes body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'base-url' -d 'Sign in against this base URL instead of the default' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'flow' -d 'Sign-in flow to use: api-key, x-api-key, oauth-browser' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'base-url' -d 'Forget the credentials saved for this base URL (not with --all)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'all' -d 'Forget every saved credential, for every base URL'\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'help' -d 'Show help for this command'\n"; + "# File generated from our OpenAPI spec by Scalar. Do not edit.\n\nset -g __dedalus_paths 'completion' 'upgrade' 'uninstall' 'machines' 'machines list' 'machines create' 'machines retrieve' 'machines update' 'machines delete' 'machines sleep' 'machines wake' 'machines reboot' 'machines resize' 'machines ssh' 'machines ssh list' 'machines ssh create' 'machines ssh retrieve' 'machines ssh delete' 'machines executions' 'machines executions list' 'machines executions create' 'machines executions retrieve' 'machines executions delete' 'machines executions output' 'machines executions events' 'machines executions logs' 'machines executions logs retrieve' 'machines executions logs create-token' 'machines autoresizing' 'machines autoresizing retrieve' 'machines autoresizing update' 'machines ports' 'machines ports list' 'machines ports create' 'machines ports retrieve' 'machines ports update' 'machines ports delete' 'machines ports access-keys' 'machines ports access-keys list' 'machines ports access-keys mint' 'machines ports access-keys revoke' 'machines ports access-keys rotate' 'organization' 'organization autoresizing' 'organization autoresizing retrieve' 'organization autoresizing update' 'images' 'images list' 'images create' 'images retrieve' 'images update' 'images delete' 'images uploads' 'images uploads create' 'login' 'logout'\n\nfunction __dedalus_path\n set -l path ''\n set -l tokens (commandline -opc)\n for token in $tokens[2..-1]\n if string match -q -- '-*' $token\n continue\n end\n set -l candidate\n if test -z \"$path\"\n set candidate $token\n else\n set candidate \"$path $token\"\n end\n if contains -- $candidate $__dedalus_paths\n set path $candidate\n end\n end\n echo $path\nend\n\nfunction __dedalus_at --argument-names index\n set -l current (__dedalus_path)\n if test \"$index\" -eq 0\n test -z \"$current\"\n else\n test \"$current\" = \"$__dedalus_paths[$index]\"\n end\nend\n\ncomplete -c 'dedalus' -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'machines' -d 'machines commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'organization' -d 'organization commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'images' -d 'images commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'login' -d 'Sign in and save credentials for later commands'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'logout' -d 'Forget saved credentials, and revoke them if the provider supports it'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'completion' -d 'Print a shell completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'upgrade' -d 'Upgrade to the latest release'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'uninstall' -d 'Show how to remove this installation'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -a 'help' -d 'Show help for a command'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'version' -d 'Print the CLI version'\ncomplete -c 'dedalus' -n '__dedalus_at 0' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'bash' -d 'Print a bash completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'zsh' -d 'Print a zsh completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -a 'fish' -d 'Print a fish completion script'\ncomplete -c 'dedalus' -n '__dedalus_at 1' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'check' -d 'Report the latest version without installing it'\ncomplete -c 'dedalus' -n '__dedalus_at 2' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 3' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'list' -d 'List machines'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'create' -d 'Create machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'retrieve' -d 'Get machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'update' -d 'Update machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'delete' -d 'Destroy machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'sleep' -d 'Sleep a running machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'wake' -d 'Wake a sleeping machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'reboot' -d 'Reboot a machine with fresh memory'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'resize' -d 'Resize machine'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ssh' -d 'ssh commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'executions' -d 'executions commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -a 'ports' -d 'ports commands'\ncomplete -c 'dedalus' -n '__dedalus_at 4' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 5' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'autosleep' -d 'Idle window before autosleep' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'image-id' -d 'Organization-owned ready custom image ID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'memory-mib' -d 'Memory in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'storage-gib' -d 'Storage in GiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'vcpu' -d 'CPU in vCPUs' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 6' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 7' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'autosleep' -d 'The autosleep body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'storage-gib' -d 'The storage-gib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 8' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'force' -d 'Destroy from the last published filesystem checkpoint without publishing the Machine\\'s remaining...'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 9' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 10' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 11' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'force' -d 'Recover from the last committed filesystem checkpoint without guest cooperation'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 12' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'memory-mib' -d 'RAM in MiB' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'vcpu' -d 'CPU in 0.25-vCPU steps' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 13' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'list' -d 'List SSH sessions'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'create' -d 'Create SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'retrieve' -d 'Get SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -a 'delete' -d 'Delete SSH session'\ncomplete -c 'dedalus' -n '__dedalus_at 14' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 15' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'public-key' -d 'The public-key body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 16' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 17' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'session-id' -d 'The session-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 18' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'list' -d 'List executions'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'create' -d 'Create execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'retrieve' -d 'Get execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'delete' -d 'Delete execution'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'output' -d 'Get execution output'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'events' -d 'List execution events'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -a 'logs' -d 'logs commands'\ncomplete -c 'dedalus' -n '__dedalus_at 19' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 20' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'command' -d 'Program and its arguments as an array of strings, such as [\"ls\", \"-la\"]' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'cwd' -d 'The cwd body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'env' -d 'The env body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'stdin' -d 'The stdin body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout-ms' -d 'The timeout-ms body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 21' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 22' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 23' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 24' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 25' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'retrieve' -d 'Get execution log status'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -a 'create-token' -d 'Create execution log read token'\ncomplete -c 'dedalus' -n '__dedalus_at 26' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 27' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'execution-id' -d 'The execution-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 28' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'retrieve' -d 'Read this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -a 'update' -d 'Set this machine\\'s autoresizing settings'\ncomplete -c 'dedalus' -n '__dedalus_at 29' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 30' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 31' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'list' -d 'List ports'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'create' -d 'Create port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'retrieve' -d 'Get port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'update' -d 'Update port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'delete' -d 'Delete port'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -a 'access-keys' -d 'access-keys commands'\ncomplete -c 'dedalus' -n '__dedalus_at 32' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'max-items' -d 'Maximum number of streamed items to print; use -1 for unlimited' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 33' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'expires' -d 'Port lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'port' -d 'The port body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'protocol' -d 'The protocol body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'visibility' -d 'Who may reach the port' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 34' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 35' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'visibility' -d 'Who may reach the port' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 36' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 37' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'list' -d 'List port access keys'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'mint' -d 'Mint port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'revoke' -d 'Revoke port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -a 'rotate' -d 'Rotate port access key'\ncomplete -c 'dedalus' -n '__dedalus_at 38' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 39' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'expires-in' -d 'Lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 40' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'access-key-id' -d 'The access-key-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 41' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'machine-id' -d 'Bare, lowercase, hyphenated Machine UUID' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'port-id' -d 'The port-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'access-key-id' -d 'The access-key-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'expires-in' -d 'Lifetime in integer seconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 42' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -a 'autoresizing' -d 'autoresizing commands'\ncomplete -c 'dedalus' -n '__dedalus_at 43' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -a 'retrieve' -d 'Read organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -a 'update' -d 'Set organization autoresizing policy'\ncomplete -c 'dedalus' -n '__dedalus_at 44' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 45' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'cpu' -d 'The cpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'cpu-max-vcpu' -d 'The cpu-max-vcpu body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'memory' -d 'The memory body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'memory-max-mib' -d 'The memory-max-mib body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 46' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'list' -d 'List images owned by the authenticated organization'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'create' -d 'Register an immutable OCI image for preparation'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'retrieve' -d 'Read preparation status for an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'update' -d 'Rename an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'delete' -d 'Delete an organization-owned image'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -a 'uploads' -d 'uploads commands'\ncomplete -c 'dedalus' -n '__dedalus_at 47' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'limit' -d 'The limit query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'cursor' -d 'The cursor query parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 48' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'credential-ref' -d 'The credential-ref body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'name' -d 'A label people use to tell images apart' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source' -d 'The source body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.kind' -d 'The source.kind body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.reference' -d 'The source.reference body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.sha256' -d 'The source.sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'source.upload-id' -d 'The source.upload-id body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 49' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 50' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'name' -d 'The new label, or null to clear it' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 51' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'image-id' -d 'The image-id path parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 52' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 53' -a 'create' -d 'Reserve an immutable Docker image archive upload'\ncomplete -c 'dedalus' -n '__dedalus_at 53' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'platform' -d 'The platform body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'sha256' -d 'The sha256 body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'size-bytes' -d 'The size-bytes body parameter' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'base-url' -d 'Override the base URL for API requests' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'timeout' -d 'Request timeout in milliseconds' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'max-retries' -d 'Number of retries for retryable failures' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'format' -d 'Output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'format-error' -d 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'transform' -d 'Dot-path transform for data output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'transform-error' -d 'Dot-path transform for error output' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'raw-output' -d 'Print transformed string values without JSON quotes'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'debug' -d 'Enable SDK debug logging'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'api-key' -d 'Dedalus API key or short-lived delegated access token in `Authorization: Bearer `' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'x-api-key' -d 'Dedalus API key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'browser-token' -d 'API credential ($DEDALUS_BROWSER_TOKEN)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'dedalus-org-id' -d 'Optional organization assertion' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 54' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'base-url' -d 'Sign in against this base URL instead of the default' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'flow' -d 'Sign-in flow to use: oauth-browser, api-key' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'no-input' -d 'Never prompt; a command that would ask fails instead'\ncomplete -c 'dedalus' -n '__dedalus_at 55' -l 'help' -d 'Show help for this command'\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'base-url' -d 'Forget the credentials saved for this base URL (not with --all)' -r -f\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'all' -d 'Forget every saved credential, for every base URL'\ncomplete -c 'dedalus' -n '__dedalus_at 56' -l 'help' -d 'Show help for this command'\n"; export const completions = { bash, zsh, fish } as const; diff --git a/src/cli/login.ts b/src/cli/login.ts index d4c4bd4..9309e44 100644 --- a/src/cli/login.ts +++ b/src/cli/login.ts @@ -124,6 +124,11 @@ export type CliAuthDefinition = { readonly logo?: string; }; +// @custom start +// The public list describes choices to people; methods also includes compatible script spellings. +export const publicLoginFlows = (auth: CliAuthDefinition) => auth.menu ?? auth.methods; +// @custom end + /** How long the browser flow waits for the redirect before giving the terminal back. */ const BROWSER_FLOW_TIMEOUT_MS = 300000; @@ -679,7 +684,9 @@ const chooseMethod = async ( auth: CliAuthDefinition, flow: string | undefined, ): Promise => { - const names = auth.methods.map((method) => method.name); + // @custom start + const names = publicLoginFlows(auth).map((method) => method.name); + // @custom end if (flow !== undefined) { const chosen = auth.methods.find((method) => method.name === flow); if (!chosen) diff --git a/src/cli/runtime.ts b/src/cli/runtime.ts index af47cbb..03fdd42 100644 --- a/src/cli/runtime.ts +++ b/src/cli/runtime.ts @@ -14,6 +14,9 @@ import { encodeToon } from './toon.js'; import { takeWarnings } from './credentials'; import { type CliAuthDefinition, UsageError, runLogin, runLogout, storedCredentials } from './login'; +// @custom start +import { publicLoginFlows } from './login'; +// @custom end import { createDiagnostics, diagnosticScope } from '../feedback/diagnostics.js'; import { routeBrowserCredential } from '../custom/browser-routing.js'; @@ -504,7 +507,9 @@ const addAuthCommands = ( auth: CliAuthDefinition, selection: EnvironmentSelection, ): void => { - const flows = auth.methods.map((method) => method.name).join(', '); + // @custom start + const flows = publicLoginFlows(auth).map((method) => method.name).join(', '); + // @custom end const login = usageExitCode(new Command(auth.loginPath.at(-1) ?? 'login')) .description('Sign in and save credentials for later commands') .showHelpAfterError() @@ -589,8 +594,10 @@ const credentialBaseUrl = ( auth.defaultBaseUrl; // Lists the flows by name so `--flow` can be used without first running the picker. +// @custom start const authFlowHelp = (auth: CliAuthDefinition): string => - '\nSign-in flows:\n' + auth.methods.map((method) => ' ' + method.name + ' ' + method.label).join('\n'); + '\nSign-in flows:\n' + publicLoginFlows(auth).map((flow) => ' ' + flow.name + ' ' + flow.label).join('\n'); +// @custom end // `--no-input` as a plain switch read as `noInput`, not as Commander's negation of `--input`: a // spec param named `input` registers `--input `, and a negation would write `false` into it. diff --git a/src/commands/index.ts b/src/commands/index.ts index 9aacb57..096c83a 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -1525,7 +1525,7 @@ export const auth = { // @custom start menu: [ { name: 'oauth-browser', label: 'Sign in with a browser' }, - { name: 'x-api-key', label: 'Use an API key' }, + { name: 'api-key', label: 'Use an API key' }, ], // @custom end storeName: 'dedalus', @@ -1545,7 +1545,9 @@ export const auth = { label: 'Enter your access token', kind: 'token', clientKey: 'apiKey', - prompt: 'Access token: ', + // @custom start + prompt: 'API key: ', + // @custom end }, { name: 'x-api-key', diff --git a/tests/fixtures/login-menu.py b/tests/fixtures/login-menu.py index fc24389..30eea1c 100644 --- a/tests/fixtures/login-menu.py +++ b/tests/fixtures/login-menu.py @@ -47,6 +47,6 @@ def check(args, keys, expected): check([], b'\r', b'Opening your browser to sign in.') check([], b'\x1b[B\r', b'API key: ') - check(['--flow', 'api-key'], None, b'Access token: ') + check(['--flow', 'api-key'], None, b'API key: ') check(['--flow', 'x-api-key'], None, b'API key: ') check(['--flow', 'oauth-browser'], None, b'Opening your browser to sign in.') diff --git a/tests/login-menu.test.mjs b/tests/login-menu.test.mjs index d8e9183..ef8aa28 100644 --- a/tests/login-menu.test.mjs +++ b/tests/login-menu.test.mjs @@ -1,4 +1,5 @@ -import { execFileSync } from 'node:child_process'; +import assert from 'node:assert/strict'; +import { execFileSync, spawnSync } from 'node:child_process'; import { resolve } from 'node:path'; import { test } from 'node:test'; import { fileURLToPath } from 'node:url'; @@ -10,3 +11,14 @@ test('login shows two interactive choices and preserves explicit flows', { execFileSync('python3', [fileURLToPath(new URL('./fixtures/login-menu.py', import.meta.url)), process.execPath, cli], { timeout: 30000 }); }); + +test('login help and invalid-flow errors advertise only the two public choices', () => { + const cli = resolve(process.env.CLI_PACKAGE_ROOT ?? '.', 'dist/esm/bin.js'); + const help = execFileSync(process.execPath, [cli, 'login', '--help'], { encoding: 'utf8' }); + assert.match(help, /Sign-in flows:\s+oauth-browser Sign in with a browser\s+api-key Use an API key\s*$/); + assert.doesNotMatch(help, /x-api-key/); + const bad = spawnSync(process.execPath, [cli, 'login', '--flow', 'unknown'], { encoding: 'utf8' }); + assert.equal(bad.status, 2); + assert.match(bad.stderr, /Available: oauth-browser, api-key\./); + assert.doesNotMatch(bad.stderr, /x-api-key/); +}); From 83290b1c321f87d2cc7c1fa5e127269b431cbc58 Mon Sep 17 00:00:00 2001 From: scalarbot Date: Tue, 24 Nov 2026 21:47:56 +0000 Subject: [PATCH 09/12] chore: release 0.9.2 Release-As: 0.9.2 From 84b33debe4a1b6de73bf91f142b9716ff149e709 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:48:01 +0000 Subject: [PATCH 10/12] chore: release 0.9.2 Release-As: 0.9.2 From 8cd89563f422f33684fbfa4a4de3b4ef6912f8ae Mon Sep 17 00:00:00 2001 From: Simon Liang <231182611+AgentWings@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:16:55 -0800 Subject: [PATCH 11/12] feat(cli)!: distribute the cli through pnpm (#135) Release-As: 0.9.3 --- .claude/skills/dedalus-cli-sdk/SKILL.md | 16 +- .github/workflows/release-please.yml | 42 ++--- .github/workflows/sdk-ci.yml | 9 +- .github/workflows/sdk-release.yml | 42 ++--- .gitignore | 1 + README.md | 37 ++-- SKILL.md | 16 +- VERSIONING.md | 6 + ci/publish-steps.ts | 73 ++------ ci/sdk-ci.ts | 11 +- package.json | 4 + scripts/install.sh | 90 ++++------ scripts/publish-npm.mjs | 9 +- ...blish-binaries.mjs => publish-package.mjs} | 16 +- scripts/update-homebrew.mjs | 35 ++-- scripts/verify-standalone.mjs | 17 -- src/cli/upgrade.ts | 26 ++- tests/homebrew-release.test.mjs | 61 ++++--- tests/legacy-installer.test.mjs | 162 +++++++----------- tests/publish-package.test.mjs | 27 +++ tests/upgrade-package.test.mjs | 86 ++++++++++ 21 files changed, 359 insertions(+), 427 deletions(-) rename scripts/{publish-binaries.mjs => publish-package.mjs} (83%) delete mode 100644 scripts/verify-standalone.mjs create mode 100644 tests/publish-package.test.mjs create mode 100644 tests/upgrade-package.test.mjs diff --git a/.claude/skills/dedalus-cli-sdk/SKILL.md b/.claude/skills/dedalus-cli-sdk/SKILL.md index 1c4f14b..9c72c9c 100644 --- a/.claude/skills/dedalus-cli-sdk/SKILL.md +++ b/.claude/skills/dedalus-cli-sdk/SKILL.md @@ -10,18 +10,14 @@ Generated CLI client for Dedalus API, published as `dedalus-cli`. Use the genera ## Install ```sh -# npm (requires Node.js) -npm install -g dedalus-cli +# macOS, Linux, and Windows (requires Node.js 20+ and pnpm) +pnpm add --global dedalus-cli -# Homebrew — standalone binary, no Node.js required +# Homebrew installs Node and the same CLI package brew install dedalus-labs/tap/dedalus -# Direct download — standalone binary, no Node.js required -curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz dedalus -sudo mv dedalus /usr/local/bin/ - -# Windows — download and extract dedalus-windows-x64.zip, then add it to PATH -# https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-windows-x64.zip +# macOS and Linux installer (requires Node.js 20+ and pnpm) +curl -fsSL https://www.dedaluslabs.ai/install/dedalus | bash ``` ## Client setup and authentication @@ -65,7 +61,7 @@ Failed requests print a structured error to standard error and exit with a statu ## Requirements -- Node.js 20 or newer — for the npm install only; the standalone binaries bundle their own runtime. +- Node.js 20 or newer and pnpm. Homebrew installs its own Node dependency. ## Reference files diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5b5c5d4..ab19d9b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -58,48 +58,30 @@ jobs: with: node-version: "24" registry-url: https://registry.npmjs.org - - run: npm install + - uses: pnpm/action-setup@a15d269cd4658e1107c09f1fabf4cbd7bd1f308a + with: + version: 10.20.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts shell: bash - - run: npm run build + - name: Build CLI + run: pnpm run build shell: bash - - name: Read package version - run: echo "PKG_VERSION=$(node -p 'require("./package.json").version')" >> "$GITHUB_ENV" + - name: Pack Node CLI + run: pnpm pack --pack-destination release-packages shell: bash - run: npm install -g npm@11 shell: bash - name: Publish to npm run: node scripts/publish-npm.mjs shell: bash - - name: Set up Bun - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 - with: - bun-version: 1.4.0 - - name: Compile standalone binaries - run: | - ROOT="$PWD" - mkdir -p release-binaries - for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do - rm -rf compile-out && mkdir -p compile-out - case "$target" in - windows-*) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus.exe" - (cd compile-out && zip -q "$ROOT/release-binaries/dedalus-${target}.zip" "dedalus.exe") - ;; - *) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus" - tar -czf "release-binaries/dedalus-${target}.tar.gz" -C compile-out "dedalus" - ;; - esac - done - rm -rf compile-out - shell: bash - - name: Attach binaries to the release - run: node scripts/publish-binaries.mjs + - name: Attach Node package to the release + run: node scripts/publish-package.mjs env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - name: Open Homebrew release PR + run: node scripts/update-homebrew.mjs env: HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - run: node scripts/update-homebrew.mjs shell: bash diff --git a/.github/workflows/sdk-ci.yml b/.github/workflows/sdk-ci.yml index df11bf3..1a4ea19 100644 --- a/.github/workflows/sdk-ci.yml +++ b/.github/workflows/sdk-ci.yml @@ -25,7 +25,7 @@ jobs: run: pnpm run ci:generate shell: bash - name: Check generated workflows - run: git diff --exit-code -- .github/workflows/sdk-ci.yml + run: git diff --exit-code -- .github/workflows shell: bash - name: Build CLI run: pnpm run build @@ -33,13 +33,6 @@ jobs: - name: Install and test staging package run: node scripts/verify-staging-package.mjs shell: bash - - name: Set up Bun - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 - with: - bun-version: 1.4.0 - - name: Test native standalone binary - run: node scripts/verify-standalone.mjs - shell: bash - name: Upload tested staging package uses: actions/upload-artifact@v7 with: diff --git a/.github/workflows/sdk-release.yml b/.github/workflows/sdk-release.yml index 0e4f1c7..3263f7e 100644 --- a/.github/workflows/sdk-release.yml +++ b/.github/workflows/sdk-release.yml @@ -19,48 +19,30 @@ jobs: with: node-version: "24" registry-url: https://registry.npmjs.org - - run: npm install + - uses: pnpm/action-setup@a15d269cd4658e1107c09f1fabf4cbd7bd1f308a + with: + version: 10.20.0 + - name: Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts shell: bash - - run: npm run build + - name: Build CLI + run: pnpm run build shell: bash - - name: Read package version - run: echo "PKG_VERSION=$(node -p 'require("./package.json").version')" >> "$GITHUB_ENV" + - name: Pack Node CLI + run: pnpm pack --pack-destination release-packages shell: bash - run: npm install -g npm@11 shell: bash - name: Publish to npm run: node scripts/publish-npm.mjs shell: bash - - name: Set up Bun - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 - with: - bun-version: 1.4.0 - - name: Compile standalone binaries - run: | - ROOT="$PWD" - mkdir -p release-binaries - for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do - rm -rf compile-out && mkdir -p compile-out - case "$target" in - windows-*) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus.exe" - (cd compile-out && zip -q "$ROOT/release-binaries/dedalus-${target}.zip" "dedalus.exe") - ;; - *) - bun build src/bin.ts --compile --minify --target="bun-${target}" --outfile "compile-out/dedalus" - tar -czf "release-binaries/dedalus-${target}.tar.gz" -C compile-out "dedalus" - ;; - esac - done - rm -rf compile-out - shell: bash - - name: Attach binaries to the release - run: node scripts/publish-binaries.mjs + - name: Attach Node package to the release + run: node scripts/publish-package.mjs env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - name: Open Homebrew release PR + run: node scripts/update-homebrew.mjs env: HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - run: node scripts/update-homebrew.mjs shell: bash diff --git a/.gitignore b/.gitignore index 6434b0e..74eafb2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ node_modules/ /apple-codesign-*/ /compile-out/ /release-binaries/ +/release-packages/ /tap/ /artifacts/ diff --git a/README.md b/README.md index 88676bc..1fb41f5 100644 --- a/README.md +++ b/README.md @@ -32,29 +32,27 @@ The full API of this library can be found in [api.md](./api.md). ## Installation ```sh -# npm (requires Node.js) -npm install -g dedalus-cli +# macOS, Linux, and Windows (requires Node.js 20+ and pnpm) +pnpm add --global dedalus-cli -# Homebrew — standalone binary, no Node.js required +# Homebrew installs Node and the same CLI package brew install dedalus-labs/tap/dedalus -# Direct download — standalone binary, no Node.js required -curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz dedalus -sudo mv dedalus /usr/local/bin/ - -# Windows — download and extract dedalus-windows-x64.zip, then add it to PATH -# https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-windows-x64.zip +# macOS and Linux installer (requires Node.js 20+ and pnpm) +curl -fsSL https://www.dedaluslabs.ai/install/dedalus | bash ``` ### Upgrading -Run `dedalus upgrade --check` to check for a release, then `dedalus upgrade` to -install it. Package-manager installations use their owning manager. Standalone -macOS and Linux installations download the release archive and verify its -`checksums.txt` before replacing the executable. +Run `pnpm add --global dedalus-cli@latest` to upgrade a pnpm installation. +`dedalus upgrade --check` checks for a release, and `dedalus upgrade` uses the +package manager that owns the installation. Homebrew installations use Homebrew. -If your CLI does not recognize `dedalus upgrade`, reinstall it using one of the -methods above. Older Go CLI versions do not support this command. +New releases ship a Node package instead of native executables. Existing direct +downloads must migrate with the installation command above. Remove the old +executable if it takes precedence over pnpm's `dedalus` on your `PATH`. +If pnpm reports that its global bin directory is missing, run `pnpm setup` and +open a new shell before installing.
@@ -203,6 +201,10 @@ directory, runs the tests against the installed package, and uploads the `dedalus-cli-staging` artifact. The artifact contains a `.tgz` and its checksum record. This workflow does not publish to npm or Homebrew. +CI builds and tests the Node package with pnpm on Linux. Releases use +GitHub-hosted Ubuntu for npm trusted publishing and attach the same Node package +archive to GitHub. Homebrew installs that archive through pnpm and supplies Node. + Test packages are marked private and retain the production API default. Set `DEDALUS_TEST_BASE_URL` to your test API and pass it explicitly: @@ -218,6 +220,9 @@ Set `DEDALUS_API_KEY` to a staging credential before submitting. To reproduce CI locally, run `pnpm install --frozen-lockfile`, `pnpm build`, and `pnpm test:package`. Custom feedback code lives under `src/feedback` and is integrated on `scalar-next`. Validate Scalar regeneration there before promoting a release. +Release workflow customizations live under `ci/`. After merging generated output, +run `pnpm ci:generate` and the package checks before releasing. CI rejects drift +in any generated workflow, including the release workflows. ## Shell Completion @@ -317,7 +322,7 @@ Paginated commands fetch subsequent pages for you. Use `--max-items ` to ## Requirements -- Node.js 20 or newer — for the npm install only; the standalone binaries bundle their own runtime. +- Node.js 20 or newer and pnpm. Homebrew installs its own Node dependency. Powered by Scalar. diff --git a/SKILL.md b/SKILL.md index 8198270..f7f2e43 100644 --- a/SKILL.md +++ b/SKILL.md @@ -10,18 +10,14 @@ Generated CLI client for Dedalus API, published as `dedalus-cli`. Use the genera ## Install ```sh -# npm (requires Node.js) -npm install -g dedalus-cli +# macOS, Linux, and Windows (requires Node.js 20+ and pnpm) +pnpm add --global dedalus-cli -# Homebrew — standalone binary, no Node.js required +# Homebrew installs Node and the same CLI package brew install dedalus-labs/tap/dedalus -# Direct download — standalone binary, no Node.js required -curl -fsSL "https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz dedalus -sudo mv dedalus /usr/local/bin/ - -# Windows — download and extract dedalus-windows-x64.zip, then add it to PATH -# https://github.com/dedalus-labs/dedalus-cli/releases/latest/download/dedalus-windows-x64.zip +# macOS and Linux installer (requires Node.js 20+ and pnpm) +curl -fsSL https://www.dedaluslabs.ai/install/dedalus | bash ``` ## Client setup and authentication @@ -65,7 +61,7 @@ Failed requests print a structured error to standard error and exit with a statu ## Requirements -- Node.js 20 or newer — for the npm install only; the standalone binaries bundle their own runtime. +- Node.js 20 or newer and pnpm. Homebrew installs its own Node dependency. ## Reference files diff --git a/VERSIONING.md b/VERSIONING.md index f9cf7dd..5556348 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -27,6 +27,12 @@ branch — so the PR diff shows the full pending release — and are versioned f release, publishes it, and syncs the version bump and changelog back to `scalar-next`. Pre-1.0, breaking changes bump the minor version. +CLI distribution is customized on `scalar-next`: pnpm builds and packs the Node +package, and the release workflow publishes it to npm and GitHub. No native +executable compilation is required. Workflow sources live under `ci/`; regenerate +them with `pnpm ci:generate` after integrating generated output, then run +`pnpm build` and `pnpm test:package` before promoting the release. + ### Choosing an exact version To release a specific version — `1.0.0`, a hotfix number, anything the commit history would diff --git a/ci/publish-steps.ts b/ci/publish-steps.ts index d155748..ea7e3b4 100644 --- a/ci/publish-steps.ts +++ b/ci/publish-steps.ts @@ -1,79 +1,38 @@ import { command, unsafeShell, type GitHubWorkflowStep } from '@dedalus-labs/hollywood'; -// npm trusted publishing requires a GitHub-hosted runner. +// pnpm publish uses npm's trusted-publishing client on a GitHub-hosted runner. export const publishSteps = [ - { - uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1', - }, + { uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' }, { uses: 'actions/setup-node@820762786026740c76f36085b0efc47a31fe5020', - with: { - 'node-version': '24', - 'registry-url': 'https://registry.npmjs.org', - }, - }, - { - run: unsafeShell(`npm install`), - shell: 'bash', + with: { 'node-version': '24', 'registry-url': 'https://registry.npmjs.org' }, }, { - run: unsafeShell(`npm run build`), - shell: 'bash', + uses: 'pnpm/action-setup@a15d269cd4658e1107c09f1fabf4cbd7bd1f308a', + with: { version: '10.20.0' }, }, { - name: 'Read package version', - run: unsafeShell(`echo "PKG_VERSION=$(node -p 'require("./package.json").version')" >> "$GITHUB_ENV"`), - shell: 'bash', + name: 'Install dependencies', + run: command({ file: 'pnpm', args: ['install', '--frozen-lockfile', '--ignore-scripts'] }), }, + { name: 'Build CLI', run: command({ file: 'pnpm', args: ['run', 'build'] }) }, { - run: unsafeShell(`npm install -g npm@11`), - shell: 'bash', + name: 'Pack Node CLI', + run: command({ file: 'pnpm', args: ['pack', '--pack-destination', 'release-packages'] }), }, + { run: unsafeShell('npm install -g npm@11'), shell: 'bash' }, { name: 'Publish to npm', - run: unsafeShell(`node scripts/publish-npm.mjs`), - shell: 'bash', - }, - { - name: 'Set up Bun', - uses: 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6', - with: { - 'bun-version': '1.4.0', - }, - }, - { - name: 'Compile standalone binaries', - run: unsafeShell(`ROOT="$PWD" -mkdir -p release-binaries -for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do - rm -rf compile-out && mkdir -p compile-out - case "$target" in - windows-*) - bun build src/bin.ts --compile --minify --target="bun-\${target}" --outfile "compile-out/dedalus.exe" - (cd compile-out && zip -q "$ROOT/release-binaries/dedalus-\${target}.zip" "dedalus.exe") - ;; - *) - bun build src/bin.ts --compile --minify --target="bun-\${target}" --outfile "compile-out/dedalus" - tar -czf "release-binaries/dedalus-\${target}.tar.gz" -C compile-out "dedalus" - ;; - esac -done -rm -rf compile-out -`), - shell: 'bash', + run: command({ file: 'node', args: ['scripts/publish-npm.mjs'] }), }, { - name: 'Attach binaries to the release', - run: command({ file: 'node', args: ['scripts/publish-binaries.mjs'] }), - env: { - GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}', - }, + name: 'Attach Node package to the release', + run: command({ file: 'node', args: ['scripts/publish-package.mjs'] }), + env: { GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' }, }, { name: 'Open Homebrew release PR', - env: { - HOMEBREW_TAP_TOKEN: '${{ secrets.HOMEBREW_TAP_TOKEN }}', - }, run: command({ file: 'node', args: ['scripts/update-homebrew.mjs'] }), + env: { HOMEBREW_TAP_TOKEN: '${{ secrets.HOMEBREW_TAP_TOKEN }}' }, }, ] as const satisfies readonly GitHubWorkflowStep[]; diff --git a/ci/sdk-ci.ts b/ci/sdk-ci.ts index dae0f74..a2a64d5 100644 --- a/ci/sdk-ci.ts +++ b/ci/sdk-ci.ts @@ -33,7 +33,7 @@ export const sdkCI = workflow({ name: 'Check generated workflows', run: command({ file: 'git', - args: ['diff', '--exit-code', '--', '.github/workflows/sdk-ci.yml'], + args: ['diff', '--exit-code', '--', '.github/workflows'], }), }, { name: 'Build CLI', run: command({ file: 'pnpm', args: ['run', 'build'] }) }, @@ -41,15 +41,6 @@ export const sdkCI = workflow({ name: 'Install and test staging package', run: command({ file: 'node', args: ['scripts/verify-staging-package.mjs'] }), }, - { - name: 'Set up Bun', - uses: 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6', - with: { 'bun-version': '1.4.0' }, - }, - { - name: 'Test native standalone binary', - run: command({ file: 'node', args: ['scripts/verify-standalone.mjs'] }), - }, { name: 'Upload tested staging package', uses: 'actions/upload-artifact@v7', diff --git a/package.json b/package.json index dc3e6e7..385a654 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,10 @@ "url": "git+https://github.com/dedalus-labs/dedalus-cli.git" }, "type": "module", + "packageManager": "pnpm@10.20.0", + "engines": { + "node": ">=20" + }, "bin": { "dedalus": "./dist/esm/bin.js" }, diff --git a/scripts/install.sh b/scripts/install.sh index 7ff355b..1db47ad 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -3,73 +3,55 @@ set -euo pipefail main() ( - local repo='https://github.com/dedalus-labs/dedalus-cli' - local install_dir="${DEDALUS_INSTALL_DIR:-$HOME/.local/bin}" - local version="${DEDALUS_VERSION:-}" os arch stage probe watchdog actual + local version="${DEDALUS_VERSION:-}" spec='dedalus-cli@latest' + local install_dir="${DEDALUS_INSTALL_DIR:-}" global_bin actual stage - case "$(uname -s)" in - Darwin) os=darwin ;; - Linux) os=linux ;; - *) echo 'Unsupported OS; this installer supports macOS and Linux.' >&2; exit 1 ;; - esac - case "$(uname -m)" in - x86_64|amd64) arch=x64 ;; - arm64|aarch64) arch=arm64 ;; - *) echo 'Unsupported architecture; expected x64 or arm64.' >&2; exit 1 ;; - esac - - if [[ -z "$version" ]]; then - version=$(curl -fsSL --connect-timeout 10 --max-time 30 -o /dev/null \ - -w '%{url_effective}' "$repo/releases/latest") - version=${version##*/} + if ! command -v node >/dev/null || ! node -e 'process.exit(Number(process.versions.node.split(".")[0]) >= 20 ? 0 : 1)'; then + echo 'Node.js 20 or newer is required. Install it from https://nodejs.org/ and retry.' >&2 + exit 1 fi - if [[ ! "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then - echo "Invalid release tag: $version" >&2 + if ! command -v pnpm >/dev/null; then + echo 'pnpm is required. Install it from https://pnpm.io/installation and retry.' >&2 exit 1 fi - - mkdir -p "$install_dir" - install_dir=$(cd "$install_dir" && pwd -P) - if [[ -L "$install_dir/dedalus" || -d "$install_dir/dedalus" ]]; then + if [[ -n "$version" ]]; then + if [[ ! "$version" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then + echo "Invalid package version: $version" >&2 + exit 1 + fi + spec="dedalus-cli@${version#v}" + fi + if [[ -n "$install_dir" && ( -L "$install_dir/dedalus" || -d "$install_dir/dedalus" ) ]]; then echo 'Refusing to replace a symlink or directory; use the original package manager.' >&2 exit 1 fi - # Stage beside the destination so the final rename stays on one filesystem. - stage=$(mktemp -d "$install_dir/.dedalus-install.XXXXXX") - trap 'rm -rf "$stage"' EXIT - trap 'exit 130' INT - trap 'exit 143' TERM - local asset="dedalus-${os}-${arch}.tar.gz" - echo "Downloading $version ($os/$arch)..." - curl -fsSL --connect-timeout 10 --max-time 300 \ - "$repo/releases/download/$version/$asset" -o "$stage/archive.tar.gz" - tar -xzf "$stage/archive.tar.gz" -C "$stage" dedalus - if [[ ! -f "$stage/dedalus" || -L "$stage/dedalus" ]]; then - echo "$asset did not contain a regular dedalus executable." >&2 + if ! global_bin=$(pnpm bin --global) || [[ -z "$global_bin" ]]; then + echo 'Configure pnpm global installs with pnpm setup, then retry in a new shell.' >&2 exit 1 fi - chmod 755 "$stage/dedalus" - # Verify both compatibility and version before replacing the working CLI. - "$stage/dedalus" --version > "$stage/version" & - probe=$! - (sleep 10; kill -KILL "$probe" 2>/dev/null || true) >/dev/null 2>&1 & - watchdog=$! - if ! wait "$probe"; then - kill "$watchdog" 2>/dev/null || true - echo 'Downloaded CLI failed its version check; existing CLI left unchanged.' >&2 + pnpm add --global --ignore-scripts "$spec" + actual=$("$global_bin/dedalus" --version) + if [[ -n "$version" && "$actual" != "${version#v}" ]]; then + echo "Expected ${version#v}, received $actual." >&2 exit 1 fi - kill "$watchdog" 2>/dev/null || true - actual=$(cat "$stage/version") - if [[ "$actual" != "${version#v}" ]]; then - echo "Expected ${version#v}, received $actual; existing CLI left unchanged." >&2 - exit 1 + # Older Go updaters request their original executable's directory. + if [[ -n "$install_dir" ]]; then + mkdir -p "$install_dir" + install_dir=$(cd "$install_dir" && pwd -P) + global_bin=$(cd "$global_bin" && pwd -P) + if [[ "$install_dir" != "$global_bin" ]]; then + stage=$(mktemp -d "$install_dir/.dedalus-install.XXXXXX") + trap 'rm -rf "$stage"' EXIT + printf '#!/usr/bin/env bash\nexec %q "$@"\n' "$global_bin/dedalus" > "$stage/dedalus" + chmod 755 "$stage/dedalus" + mv -f "$stage/dedalus" "$install_dir/dedalus" + fi fi - mv -f "$stage/dedalus" "$install_dir/dedalus" - echo "Installed dedalus $version to $install_dir/dedalus" - echo 'For future updates, run: dedalus upgrade' + echo "Installed dedalus $actual with pnpm ($global_bin/dedalus)." + echo 'For future updates, run: pnpm add --global dedalus-cli@latest' ) -# Read the entire script before doing work when invoked by the legacy curl | bash. +# Read the entire script before doing work when invoked by curl | bash. main "$@" diff --git a/scripts/publish-npm.mjs b/scripts/publish-npm.mjs index 894443f..3d4268a 100644 --- a/scripts/publish-npm.mjs +++ b/scripts/publish-npm.mjs @@ -34,11 +34,11 @@ export const npmDistTagForVersion = (version) => { return /^[a-z][a-z0-9-]*$/.test(candidate) ? candidate : 'next'; }; -/** Runs one npm command with inherited CI credentials and output. */ -const runNpm = (args, stdio = 'inherit') => spawnSync('npm', args, { stdio }); +/** Runs one pnpm command with inherited CI credentials and output. */ +const runPnpm = (args, stdio = 'inherit') => spawnSync('pnpm', args, { stdio }); /** Publishes the repository package once, applying a derived prerelease dist-tag when needed. */ -export const publishNpm = (runner = runNpm, metadata = readPackageMetadata()) => { +export const publishNpm = (runner = runPnpm, metadata = readPackageMetadata()) => { const { name, version } = metadata; const packageSpec = `${name}@${version}`; if (runner(['view', packageSpec, 'version'], 'ignore').status === 0) { @@ -65,7 +65,8 @@ export const publishNpm = (runner = runNpm, metadata = readPackageMetadata()) => : stableTags.includes(derived) ? `${derived}-prerelease` : derived; - const args = ['publish', '--access', ACCESS, ...(tag ? ['--tag', tag] : [])]; + const archive = `./release-packages/${name.replace('@', '').replace('/', '-')}-${version}.tgz`; + const args = ['publish', archive, '--no-git-checks', '--access', ACCESS, ...(tag ? ['--tag', tag] : [])]; console.log( tag ? `Publishing ${packageSpec} to npm with dist-tag ${tag}` : `Publishing ${packageSpec} to npm`, ); diff --git a/scripts/publish-binaries.mjs b/scripts/publish-package.mjs similarity index 83% rename from scripts/publish-binaries.mjs rename to scripts/publish-package.mjs index 607c01f..9bcda4d 100644 --- a/scripts/publish-binaries.mjs +++ b/scripts/publish-package.mjs @@ -1,4 +1,4 @@ -// Both release workflows call this after compilation. Published archives stay +// Both release workflows call this after packing. Published archives stay // immutable; retries fill missing assets and download the bytes Homebrew hashes. import { spawnSync } from 'node:child_process'; import { createHash } from 'node:crypto'; @@ -10,13 +10,7 @@ const { version } = JSON.parse(readFileSync('package.json', 'utf8')); const repository = process.env.GITHUB_REPOSITORY; if (!repository) throw new Error('GITHUB_REPOSITORY is required'); const tag = `v${version}`; -const archives = [ - 'dedalus-linux-x64.tar.gz', - 'dedalus-linux-arm64.tar.gz', - 'dedalus-darwin-x64.tar.gz', - 'dedalus-darwin-arm64.tar.gz', - 'dedalus-windows-x64.zip', -]; +const archives = [`dedalus-cli-${version}.tgz`]; const run = (args, capture = false) => { const result = spawnSync('gh', args, { encoding: 'utf8', @@ -31,7 +25,7 @@ const published = new Set(assets.map(({ name }) => name)); for (const archive of archives) { if (published.has(archive)) continue; // Never replace an asset: a merged Homebrew formula may already pin its bytes. - run(['release', 'upload', tag, join('release-binaries', archive), '--repo', repository]); + run(['release', 'upload', tag, join('release-packages', archive), '--repo', repository]); } const directory = mkdtempSync(join(tmpdir(), 'dedalus-release-')); @@ -41,9 +35,9 @@ try { } // Hash the published assets, including any reused from a previous attempt. for (const archive of archives) { - copyFileSync(join(directory, archive), join('release-binaries', archive)); + copyFileSync(join(directory, archive), join('release-packages', archive)); } - // The standalone upgrade command requires checksums for the published bytes. + // Record checksums for the package actually published to GitHub. const checksums = archives .map( (archive) => diff --git a/scripts/update-homebrew.mjs b/scripts/update-homebrew.mjs index 6739eae..564b889 100644 --- a/scripts/update-homebrew.mjs +++ b/scripts/update-homebrew.mjs @@ -6,12 +6,6 @@ import { join, resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; const tap = 'dedalus-labs/homebrew-tap'; -const platforms = [ - ['macos', 'arm', 'darwin-arm64'], - ['macos', 'intel', 'darwin-x64'], - ['linux', 'arm', 'linux-arm64'], - ['linux', 'intel', 'linux-x64'], -]; export function renderFormula(version, repository, directory) { if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) { @@ -26,27 +20,18 @@ export function renderFormula(version, repository, directory) { ' homepage "https://docs.dedaluslabs.ai"', ` version "${version}"`, ' license "Apache-2.0"', + ` url "https://github.com/${repository}/releases/download/v${version}/dedalus-cli-${version}.tgz"`, + ` sha256 "${createHash('sha256').update(readFileSync(join(directory, `dedalus-cli-${version}.tgz`))).digest('hex')}"`, + ' depends_on "node"', + ' depends_on "pnpm" => :build', ]; - for (const os of ['macos', 'linux']) { - lines.push('', ` on_${os} do`); - for (const [, architecture, target] of platforms.filter(([name]) => name === os)) { - const archive = `dedalus-${target}.tar.gz`; - const digest = createHash('sha256') - .update(readFileSync(join(directory, archive))) - .digest('hex'); - lines.push( - ` on_${architecture} do`, - ` url "https://github.com/${repository}/releases/download/v${version}/${archive}"`, - ` sha256 "${digest}"`, - ' end', - ); - } - lines.push(' end'); - } lines.push( '', ' def install', - ' bin.install "dedalus"', + ' libexec.mkpath', + ' system "pnpm", "add", "--dir", libexec, "--prod", "--ignore-scripts", cached_download.to_s', + ' (bin/"dedalus").write_env_script libexec/"node_modules/.bin/dedalus", PATH: "#{Formula["node"].opt_bin}:$PATH"', + ' man1.install Dir[libexec/"node_modules/dedalus-cli/man/*.1"]', ' end', '', ' test do', @@ -60,7 +45,7 @@ export function renderFormula(version, repository, directory) { export function updateHomebrew() { const { version } = JSON.parse(readFileSync('package.json', 'utf8')); - const formula = renderFormula(version, process.env.GITHUB_REPOSITORY, 'release-binaries'); + const formula = renderFormula(version, process.env.GITHUB_REPOSITORY, 'release-packages'); if (process.argv.includes('--dry-run')) { process.stdout.write(formula); return; @@ -118,7 +103,7 @@ export function updateHomebrew() { const body = join(directory, 'release-pr-body.txt'); writeFileSync( body, - `Update the standalone CLI formula to ${version}. All four platform archives are pinned to the SHA-256 digests of the binaries uploaded by this release.\n`, + `Update the Node CLI formula to ${version}. The package archive is pinned to the SHA-256 digest uploaded by this release. Homebrew installs Node and uses pnpm to install the CLI.\n`, ); run('gh', [ 'pr', diff --git a/scripts/verify-standalone.mjs b/scripts/verify-standalone.mjs deleted file mode 100644 index bb8b926..0000000 --- a/scripts/verify-standalone.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import assert from 'node:assert/strict'; -import { execFileSync } from 'node:child_process'; -import { mkdtempSync, rmSync } from 'node:fs'; -import { tmpdir } from 'node:os'; -import { join } from 'node:path'; - -const directory = mkdtempSync(join(tmpdir(), 'dedalus-standalone-')); -try { - const binary = join(directory, process.platform === 'win32' ? 'dedalus.exe' : 'dedalus'); - execFileSync('bun', ['build', 'src/bin.ts', '--compile', '--minify', '--outfile', binary], { stdio: 'inherit' }); - const output = execFileSync(binary, ['doctor', '--json'], { - env: { PATH: process.env.PATH, HOME: directory, USERPROFILE: directory }, encoding: 'utf8', - }); - assert.equal(JSON.parse(output).install_method, 'standalone'); -} finally { - rmSync(directory, { recursive: true, force: true }); -} diff --git a/src/cli/upgrade.ts b/src/cli/upgrade.ts index 8a3f427..2641c92 100644 --- a/src/cli/upgrade.ts +++ b/src/cli/upgrade.ts @@ -32,7 +32,7 @@ const RELEASE = { repo: 'dedalus-labs/dedalus-cli', npmPackage: 'dedalus-cli', brewFormula: 'dedalus', - windowsArchive: true, + windowsArchive: false, } as { /** * The destination repository as `owner/repo`, which every GitHub Release request is addressed by. @@ -146,19 +146,15 @@ const detectInstall = (binaryName: string, distTag = stableDistTag()): InstallKi const executable = process.execPath; // A compiled standalone executable *is* the command; running under `node`/`bun` instead means this // is the npm package (or a checkout of it), and the script's own path says which manager owns it. - if (!runsCompiled(executable, binaryName)) return detectPackageInstall(distTag); - - const path = resolvedPath(executable); - - // `Caskroom` as well as `Cellar`, and that is not redundant with the `homebrew`/`linuxbrew` segments - // beside it: on an **Intel** Mac Homebrew's prefix is `/usr/local`, so a cask stages its executable - // at `/usr/local/Caskroom///` — a path carrying none of the other three. Without - // this, such an install classified as self-managed and `upgrade` renamed a downloaded binary over the - // file inside the Caskroom, which is admin-owned on Intel Homebrew and so writable without `sudo`. - // Brew went on recording the old version and reverted the binary on the next `brew upgrade`. Apple - // Silicon and Linux casks were caught only because `/opt/homebrew` and `/home/linuxbrew` happen to - // contain a matching segment. - if (/\/(Cellar|Caskroom|homebrew|linuxbrew)\//u.test(path) && RELEASE.brewFormula) { + const compiled = runsCompiled(executable, binaryName); + const path = resolvedPath(compiled ? executable : process.argv[1] ?? ''); + + // Node packages belong to Homebrew only inside this formula's keg. npm and pnpm + // global installations can share Homebrew's prefix without belonging to the formula. + const homebrewOwned = compiled + ? /\/(Cellar|Caskroom|homebrew|linuxbrew)\//u.test(path) + : /\/(?:Cellar|Caskroom)\/([^/]+)\/[^/]+\//u.exec(path)?.[1] === RELEASE.brewFormula; + if (homebrewOwned && RELEASE.brewFormula) { // A cask is upgraded and removed through `--cask`. The token is the formula's own lowercased name, // which is what the generated cask is declared under, so one value serves both spellings. const cask = /\/Caskroom\//u.test(path); @@ -185,6 +181,8 @@ const detectInstall = (binaryName: string, distTag = stableDistTag()): InstallKi : {}), }; } + if (!compiled) return detectPackageInstall(distTag); + // `/usr/bin` is where a distro package manager installs; the documented direct download goes to // `/usr/local/bin`, so it does not land here. // diff --git a/tests/homebrew-release.test.mjs b/tests/homebrew-release.test.mjs index db8df41..7396938 100644 --- a/tests/homebrew-release.test.mjs +++ b/tests/homebrew-release.test.mjs @@ -8,18 +8,18 @@ import { test } from 'node:test'; import { parse } from 'yaml'; import { renderFormula } from '../scripts/update-homebrew.mjs'; -const targets = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64']; +const archive = 'dedalus-cli-0.7.0.tgz'; -test('invariant_formulas_pin_every_platform_archive_before_updating_the_tap', () => { +test('invariant_formulas_pin_the_node_package_before_updating_the_tap', () => { const directory = mkdtempSync(join(tmpdir(), 'homebrew-archives-')); try { - for (const target of targets) writeFileSync(join(directory, `dedalus-${target}.tar.gz`), target); + writeFileSync(join(directory, archive), 'node package'); const formula = renderFormula('0.7.0', 'dedalus-labs/dedalus-cli', directory); - for (const target of targets) { - assert.ok(formula.includes(`/v0.7.0/dedalus-${target}.tar.gz`)); - assert.ok(formula.includes(createHash('sha256').update(target).digest('hex'))); - } - rmSync(join(directory, 'dedalus-linux-arm64.tar.gz')); + assert.ok(formula.includes(`/v0.7.0/${archive}`)); + assert.ok(formula.includes(createHash('sha256').update('node package').digest('hex'))); + assert.ok(formula.includes('depends_on "node"')); + assert.ok(formula.includes('system "pnpm", "add"')); + rmSync(join(directory, archive)); assert.throws(() => renderFormula('0.7.0', 'dedalus-labs/dedalus-cli', directory), /ENOENT/); } finally { rmSync(directory, { recursive: true, force: true }); @@ -37,8 +37,8 @@ function verifyPublication(workflow) { readFileSync(new URL(`../.github/workflows/${workflow}.yml`, import.meta.url), 'utf8'), ); const steps = definition.jobs[workflow === 'release-please' ? 'publish' : 'release'].steps; - const compile = steps.find((step) => step.name === 'Compile standalone binaries').run; - const upload = steps.find((step) => step.name === 'Attach binaries to the release').run; + const pack = steps.find((step) => step.name === 'Pack Node CLI').run; + const upload = steps.find((step) => step.name === 'Attach Node package to the release').run; const homebrew = steps.find((step) => step.name === 'Open Homebrew release PR').run; const state = join(root, 'prs.json'); const env = { @@ -71,18 +71,18 @@ function verifyPublication(workflow) { cpSync(new URL('../scripts', import.meta.url), join(release, 'scripts'), { recursive: true, }); - const bun = join(binaries, 'bun'); + const pnpm = join(binaries, 'pnpm'); writeFileSync( - bun, + pnpm, `#!${process.execPath} const fs = require('node:fs'); const args = process.argv.slice(2); -const output = args[args.indexOf('--outfile') + 1]; -fs.writeFileSync(output, args.find(arg => arg.startsWith('--target='))); -fs.utimesSync(output, Number(process.env.BUILD_EPOCH), Number(process.env.BUILD_EPOCH)); +require('node:assert/strict').deepEqual(args, ['pack', '--pack-destination', 'release-packages']); +fs.mkdirSync('release-packages', { recursive: true }); +fs.writeFileSync('release-packages/dedalus-cli-0.7.0.tgz', 'package ' + process.env.BUILD_EPOCH); `, ); - chmodSync(bun, 0o755); + chmodSync(pnpm, 0o755); git(['init', '--bare', '--initial-branch=main', bare]); git(['init', '--initial-branch=main'], seed); git(['config', 'user.name', 'Fixture'], seed); @@ -137,18 +137,17 @@ else if (action === 'create') { chmodSync(gh, 0o755); writeFileSync(join(release, 'package.json'), '{"version":"0.7.0"}\n'); const shell = (command) => run('bash', ['-e', '-o', 'pipefail', '-c', command], release); - const archive = 'dedalus-linux-x64.tar.gz'; - // A previous attempt published only one platform before failing. - shell(compile); - const original = readFileSync(join(release, 'release-binaries', archive)); + // A previous attempt uploaded the package before failing later in the release. + shell(pack); + const original = readFileSync(join(release, 'release-packages', archive)); if (workflow === 'release-please') - cpSync(join(release, 'release-binaries', archive), join(published, archive)); + cpSync(join(release, 'release-packages', archive), join(published, archive)); env.BUILD_EPOCH = '1700000060'; - shell(compile); + shell(pack); shell(upload); shell(homebrew); const assets = new Map( - [...targets.map((target) => `dedalus-${target}.tar.gz`), 'dedalus-windows-x64.zip'].map((name) => [ + [archive].map((name) => [ name, readFileSync(join(published, name)), ]), @@ -160,7 +159,7 @@ else if (action === 'create') { for (const [name, bytes] of assets) { assert.deepEqual(readFileSync(join(published, name)), bytes, `${name}: published bytes`); assert.deepEqual( - readFileSync(join(release, 'release-binaries', name)), + readFileSync(join(release, 'release-packages', name)), bytes, `${name}: formula input`, ); @@ -173,13 +172,13 @@ else if (action === 'create') { assert.equal(git(['--git-dir', bare, 'rev-parse', 'main']), main); assert.equal(JSON.parse(readFileSync(state, 'utf8')).creates, 1); - // The same compiled payload gets a different archive timestamp on retry. + // A retry must reuse the uploaded package even if local bytes have changed. const retry = (epoch) => { env.BUILD_EPOCH = String(epoch); - shell(compile); + shell(pack); assert.notDeepEqual( - readFileSync(join(release, 'release-binaries/dedalus-darwin-arm64.tar.gz')), - assets.get('dedalus-darwin-arm64.tar.gz'), + readFileSync(join(release, 'release-packages', archive)), + assets.get(archive), ); shell(upload); assertPublishedBytes(); @@ -196,11 +195,11 @@ else if (action === 'create') { if (workflow === 'sdk-release') git(['--git-dir', bare, 'update-ref', '-d', branch]); assert.match(retry(1700000240), /already contains/); const formula = git(['--git-dir', bare, 'show', 'main:Formula/dedalus.rb']); - for (const target of targets) { + for (const name of assets.keys()) { const digest = createHash('sha256') - .update(assets.get(`dedalus-${target}.tar.gz`)) + .update(assets.get(name)) .digest('hex'); - assert.ok(formula.includes(digest), `${target}: merged formula checksum`); + assert.ok(formula.includes(digest), `${name}: merged formula checksum`); } assert.equal(git(['--git-dir', bare, 'rev-parse', 'main']), first); assert.equal(JSON.parse(readFileSync(state, 'utf8')).creates, 1); diff --git a/tests/legacy-installer.test.mjs b/tests/legacy-installer.test.mjs index 1b3a04a..5cd4e7d 100644 --- a/tests/legacy-installer.test.mjs +++ b/tests/legacy-installer.test.mjs @@ -1,149 +1,111 @@ import assert from 'node:assert/strict'; import { spawnSync } from 'node:child_process'; -import { - chmodSync, - mkdirSync, - mkdtempSync, - readFileSync, - readdirSync, - rmSync, - symlinkSync, - writeFileSync, -} from 'node:fs'; +import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { test } from 'node:test'; const installer = new URL('../scripts/install.sh', import.meta.url); -function fixture(t, { os = 'Darwin', arch = 'arm64', failure = '', version = 'v0.7.0' } = {}) { - const root = mkdtempSync(join(tmpdir(), 'dedalus-installer-')); +function fixture(t, { failure = '', version = 'v0.9.2', legacy = true } = {}) { + const root = mkdtempSync(join(tmpdir(), 'dedalus-pnpm-installer-')); t.after(() => rmSync(root, { recursive: true, force: true })); const bin = join(root, 'tools'); const destination = join(root, 'custom bin'); - const payload = join(root, 'payload'); - for (const path of [bin, destination, payload]) mkdirSync(path); + const globalBin = join(root, "pnpm's bin"); + for (const path of [bin, destination, globalBin]) mkdirSync(path); writeFileSync(join(destination, 'dedalus'), 'old executable'); const executable = (path, content) => { writeFileSync(path, content); chmodSync(path, 0o755); }; - executable( - join(payload, 'dedalus'), - failure === 'timeout' - ? '#!/bin/sh\nwhile :; do :; done\n' - : failure === 'cannot-run' - ? '#!/bin/sh\nexit 126\n' - : `#!/bin/sh\nprintf '%s\\n' '${failure === 'wrong-version' ? '9.9.9' : '0.7.0'}'\n`, - ); - const archive = join(root, 'archive.tar.gz'); - if (failure === 'missing-binary') rmSync(join(payload, 'dedalus')); - const packed = spawnSync('tar', [ - '-czf', - archive, - '-C', - payload, - failure === 'missing-binary' ? '.' : 'dedalus', - ]); - assert.equal(packed.status, 0); - if (failure === 'corrupt') writeFileSync(archive, 'not an archive'); - executable(join(bin, 'uname'), `#!/bin/sh\ncase "$1" in -s) echo '${os}';; -m) echo '${arch}';; esac\n`); - executable( - join(bin, 'curl'), - `#!${process.execPath} + if (failure === 'old-node') executable(join(bin, 'node'), '#!/bin/sh\nexit 1\n'); + else if (failure !== 'missing-node') symlinkSync(process.execPath, join(bin, 'node')); + if (failure !== 'missing-pnpm') executable(join(bin, 'pnpm'), `#!${process.execPath} +const assert = require('node:assert/strict'); const fs = require('node:fs'); +const path = require('node:path'); const args = process.argv.slice(2); -const url = args.find(arg => arg.startsWith('https://')); -fs.appendFileSync(process.env.INSTALL_TEST_LOG, url + '\\n'); -if (process.env.INSTALL_TEST_FAILURE === 'download') process.exit(22); -if (url.endsWith('/releases/latest')) { - console.log('https://github.com/dedalus-labs/dedalus-cli/releases/tag/v0.7.0'); +fs.appendFileSync(process.env.INSTALL_TEST_LOG, JSON.stringify(args) + '\\n'); +if (args[0] === 'bin') { + assert.deepEqual(args, ['bin', '--global']); + if (process.env.INSTALL_TEST_FAILURE === 'unconfigured') process.exit(1); + console.log(process.env.INSTALL_TEST_GLOBAL_BIN); } else { - fs.copyFileSync(process.env.INSTALL_TEST_ARCHIVE, args[args.indexOf('-o') + 1]); + assert.deepEqual(args.slice(0, 3), ['add', '--global', '--ignore-scripts']); + if (process.env.INSTALL_TEST_FAILURE === 'install') process.exit(1); + const binary = path.join(process.env.INSTALL_TEST_GLOBAL_BIN, 'dedalus'); + const version = process.env.INSTALL_TEST_FAILURE === 'wrong-version' ? '9.9.9' : '0.9.2'; + fs.writeFileSync(binary, '#!/bin/sh\\nif [ "$1" = --version ]; then echo ' + version + '; else printf "%s\\\\n" "$@"; fi\\n'); + fs.chmodSync(binary, 0o755); } -`, - ); +`); + const log = join(root, 'commands'); const env = { ...process.env, - PATH: `${bin}:${process.env.PATH}`, - DEDALUS_INSTALL_DIR: destination, + PATH: ['missing-node', 'missing-pnpm'].includes(failure) ? bin : `${bin}:${process.env.PATH}`, DEDALUS_VERSION: version, - INSTALL_TEST_LOG: join(root, 'requests'), - INSTALL_TEST_ARCHIVE: archive, + INSTALL_TEST_LOG: log, + INSTALL_TEST_GLOBAL_BIN: globalBin, INSTALL_TEST_FAILURE: failure, }; + delete env.DEDALUS_INSTALL_DIR; + if (legacy) env.DEDALUS_INSTALL_DIR = destination; return { - destination, - run: () => - spawnSync('bash', ['-c', 'bash < "$1"', 'installer-test', installer.pathname], { - env, - encoding: 'utf8', - timeout: 20000, - }), - requests: () => readFileSync(env.INSTALL_TEST_LOG, 'utf8'), + destination, globalBin, + run: () => spawnSync('/bin/bash', ['-c', '/bin/bash < "$1"', 'installer-test', installer.pathname], { + env, encoding: 'utf8', timeout: 20000, + }), + commands: () => existsSync(log) ? readFileSync(log, 'utf8').trim().split('\n').map(JSON.parse) : [], }; } -for (const [os, arch, target] of [ - ['Darwin', 'arm64', 'darwin-arm64'], - ['Darwin', 'x86_64', 'darwin-x64'], - ['Linux', 'aarch64', 'linux-arm64'], - ['Linux', 'x86_64', 'linux-x64'], -]) { - test(`legacy installer replaces the pinned ${target} executable in its original directory`, (t) => { - const f = fixture(t, { os, arch }); - const result = f.run(); - assert.equal(result.status, 0, result.stderr); - assert.equal( - f.requests(), - `https://github.com/dedalus-labs/dedalus-cli/releases/download/v0.7.0/dedalus-${target}.tar.gz\n`, - ); - assert.equal( - spawnSync(join(f.destination, 'dedalus'), ['--version'], { encoding: 'utf8' }).stdout.trim(), - '0.7.0', - ); - assert.deepEqual(readdirSync(f.destination), ['dedalus']); - }); -} +test('invariant_installer_delegates_the_pinned_version_to_pnpm_and_preserves_legacy_command_paths', (t) => { + const f = fixture(t); + const result = f.run(); + assert.equal(result.status, 0, result.stderr); + assert.deepEqual(f.commands(), [['bin', '--global'], ['add', '--global', '--ignore-scripts', 'dedalus-cli@0.9.2']]); + assert.equal(spawnSync(join(f.destination, 'dedalus'), ['--version'], { encoding: 'utf8' }).stdout.trim(), '0.9.2'); + assert.equal(spawnSync(join(f.destination, 'dedalus'), ['two words', '$literal'], { encoding: 'utf8' }).stdout, 'two words\n$literal\n'); + assert.deepEqual(readdirSync(f.destination), ['dedalus']); +}); + +test('invariant_new_installs_use_the_pnpm_global_command', (t) => { + const f = fixture(t, { version: '', legacy: false }); + const result = f.run(); + assert.equal(result.status, 0, result.stderr); + assert.deepEqual(f.commands()[1], ['add', '--global', '--ignore-scripts', 'dedalus-cli@latest']); + assert.equal(readFileSync(join(f.destination, 'dedalus'), 'utf8'), 'old executable'); +}); -for (const failure of ['download', 'corrupt', 'missing-binary', 'cannot-run', 'wrong-version', 'timeout']) { - test(`legacy installer preserves the working binary after ${failure} failure`, (t) => { +for (const failure of ['missing-node', 'old-node', 'missing-pnpm', 'unconfigured', 'install', 'wrong-version']) { + test(`invariant_failed_install_preserves_the_legacy_executable (${failure})`, (t) => { const f = fixture(t, { failure }); const result = f.run(); assert.equal(result.error, undefined); assert.notEqual(result.status, 0); assert.equal(readFileSync(join(f.destination, 'dedalus'), 'utf8'), 'old executable'); assert.deepEqual(readdirSync(f.destination), ['dedalus']); - assert.doesNotMatch(result.stdout, /Installed/); + assert.doesNotMatch(result.stdout, /Installed dedalus/); + if (failure === 'missing-node' || failure === 'old-node') assert.match(result.stderr, /Node.js 20/); + if (failure === 'missing-pnpm') assert.match(result.stderr, /pnpm is required/); + if (failure === 'unconfigured') assert.match(result.stderr, /pnpm setup/); }); } -test('an unpinned install resolves latest before choosing its archive', (t) => { - const f = fixture(t, { version: '' }); - const result = f.run(); - assert.equal(result.status, 0, result.stderr); - assert.match(f.requests(), /releases\/latest\n.*\/v0\.7\.0\/dedalus-darwin-arm64.tar.gz\n/); -}); - -test('an unsupported platform fails without replacing the executable', (t) => { - const f = fixture(t, { os: 'FreeBSD' }); - const result = f.run(); - assert.notEqual(result.status, 0); - assert.equal(readFileSync(join(f.destination, 'dedalus'), 'utf8'), 'old executable'); +test('invariant_installer_rejects_invalid_versions_before_running_pnpm', (t) => { + const f = fixture(t, { version: '../../latest' }); + assert.notEqual(f.run().status, 0); + assert.deepEqual(f.commands(), []); }); -test('installer refuses a package-manager symlink', (t) => { +test('invariant_installer_does_not_replace_another_package_managers_symlink', (t) => { const f = fixture(t); const managed = join(f.destination, 'managed'); writeFileSync(managed, 'managed executable'); rmSync(join(f.destination, 'dedalus')); symlinkSync(managed, join(f.destination, 'dedalus')); assert.notEqual(f.run().status, 0); + assert.deepEqual(f.commands(), []); assert.equal(readFileSync(managed, 'utf8'), 'managed executable'); }); - -test('installer rejects invalid release tags before downloading', (t) => { - const f = fixture(t, { version: '../../latest' }); - assert.notEqual(f.run().status, 0); - assert.throws(f.requests, { code: 'ENOENT' }); -}); diff --git a/tests/publish-package.test.mjs b/tests/publish-package.test.mjs new file mode 100644 index 0000000..fffa4b0 --- /dev/null +++ b/tests/publish-package.test.mjs @@ -0,0 +1,27 @@ +import assert from 'node:assert/strict'; +import { test } from 'node:test'; +import { publishNpm } from '../scripts/publish-npm.mjs'; + +for (const [version, tag] of [['0.9.3', undefined], ['0.10.0-rc.1', 'rc'], ['0.10.0-latest.1', 'latest-prerelease']]) { + test(`invariant_publishing_uses_the_packed_node_archive_and_preserves_release_channels (${version})`, () => { + const calls = []; + publishNpm((args) => { + calls.push(args); + return { status: args[0] === 'view' ? 1 : 0 }; + }, { name: 'dedalus-cli', version }); + assert.deepEqual(calls, [ + ['view', `dedalus-cli@${version}`, 'version'], + ['publish', `./release-packages/dedalus-cli-${version}.tgz`, '--no-git-checks', '--access', 'public', ...(tag ? ['--tag', tag] : [])], + ]); + }); +} + +test('invariant_a_failed_publish_never_reports_success', () => { + assert.throws(() => publishNpm(() => ({ status: 1 }), { name: 'dedalus-cli', version: '0.9.3' }), /publish failed/); +}); + +test('invariant_an_existing_registry_version_is_not_republished', () => { + const calls = []; + publishNpm((args) => { calls.push(args); return { status: 0 }; }, { name: 'dedalus-cli', version: '0.9.3' }); + assert.deepEqual(calls, [['view', 'dedalus-cli@0.9.3', 'version']]); +}); diff --git a/tests/upgrade-package.test.mjs b/tests/upgrade-package.test.mjs new file mode 100644 index 0000000..df21820 --- /dev/null +++ b/tests/upgrade-package.test.mjs @@ -0,0 +1,86 @@ +import assert from 'node:assert/strict'; +import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { delimiter, join } from 'node:path'; +import { test } from 'node:test'; +import { pathToFileURL } from 'node:url'; +import { Command } from 'commander'; + +const root = process.env.CLI_PACKAGE_ROOT ?? new URL('..', import.meta.url).pathname; +const { addUpgradeCommands } = await import(pathToFileURL(join(root, 'dist/esm/cli/upgrade.js'))); + +test('invariant_homebrew_owns_upgrades_of_its_node_package_installation', async (t) => { + const directory = mkdtempSync(join(tmpdir(), 'dedalus-homebrew-node-')); + const bin = join(directory, 'bin'); + const script = join(directory, 'Cellar/dedalus/0.9.2/libexec/node_modules/dedalus-cli/dist/esm/bin.js'); + mkdirSync(bin); + const log = join(directory, 'commands'); + const brew = join(bin, 'brew'); + writeFileSync(brew, `#!${process.execPath} +const fs = require('node:fs'); +fs.appendFileSync(${JSON.stringify(log)}, JSON.stringify(process.argv.slice(2)) + '\\n'); +if (process.argv[2] === 'list') console.log('dedalus 0.9.3'); +`); + chmodSync(brew, 0o755); + const original = process.argv[1]; + process.argv[1] = script; + t.after(() => { process.argv[1] = original; rmSync(directory, { recursive: true, force: true }); }); + const program = new Command(); + addUpgradeCommands(program, 'dedalus', '0.9.2'); + await program.parseAsync(['node', 'dedalus', 'upgrade']); + assert.deepEqual(readFileSync(log, 'utf8').trim().split('\n').map(JSON.parse), [ + ['update'], ['upgrade', 'dedalus'], ['list', '--versions', 'dedalus'], + ]); +}); + +for (const [location, manager] of [['prefix', 'npm'], ['node-keg', 'npm'], ['pnpm-global', 'pnpm']]) { + test(`invariant_package_managers_keep_ownership_under_homebrews_prefix (${location})`, async (t) => { + const directory = mkdtempSync(join(tmpdir(), 'dedalus-package-ownership-')); + const prefix = join(directory, 'opt/homebrew'); + const bin = join(prefix, 'bin'); + const packageRoot = location === 'node-keg' + ? join(prefix, 'Cellar/node/24.0.0/lib/node_modules') + : location === 'pnpm-global' + ? join(prefix, 'pnpm/global/5/node_modules') + : join(prefix, 'lib/node_modules'); + const script = join(packageRoot, 'dedalus-cli/dist/esm/bin.js'); + const log = join(directory, 'commands'); + mkdirSync(bin, { recursive: true }); + for (const name of ['npm', 'pnpm', 'brew']) { + const executable = join(bin, name); + writeFileSync(executable, `#!${process.execPath} +const fs = require('node:fs'); +const args = process.argv.slice(2); +fs.appendFileSync(${JSON.stringify(log)}, JSON.stringify([${JSON.stringify(name)}, ...args]) + '\\n'); +if (args[0] === 'root') console.log(${JSON.stringify(packageRoot)}); +if (args[0] === 'list') console.log('dedalus 0.9.3'); +`); + chmodSync(executable, 0o755); + } + const original = { script: process.argv[1], executable: process.execPath, path: process.env.PATH, stderr: process.stderr.write }; + let output = ''; + t.after(() => { + process.argv[1] = original.script; + process.execPath = original.executable; + process.env.PATH = original.path; + process.stderr.write = original.stderr; + rmSync(directory, { recursive: true, force: true }); + }); + process.argv[1] = script; + process.execPath = join(bin, 'node'); + process.env.PATH = `${bin}${delimiter}${original.path}`; + process.stderr.write = (chunk) => { output += String(chunk); return true; }; + for (const command of ['upgrade', 'uninstall']) { + const program = new Command(); + addUpgradeCommands(program, 'dedalus', '0.9.2'); + await program.parseAsync(['node', 'dedalus', command]); + } + assert.match(output, new RegExp(`installed with ${manager}`)); + assert.doesNotMatch(output, /installed with Homebrew|brew uninstall|brew upgrade/); + assert.ok(output.includes(manager === 'npm' ? 'npm uninstall -g dedalus-cli' : 'pnpm remove -g dedalus-cli')); + const commands = existsSync(log) ? readFileSync(log, 'utf8').trim().split('\n').map(JSON.parse) : []; + assert.deepEqual(commands, manager === 'npm' ? [ + ['npm', 'root', '-g'], ['npm', 'i', '-g', 'dedalus-cli@latest'], ['npm', 'root', '-g'], + ] : [['pnpm', 'add', '-g', 'dedalus-cli@latest']]); + }); +} From f37d928dc28dd4c39f90084f91848ae102782002 Mon Sep 17 00:00:00 2001 From: "scalar-docs[bot]" <148485328+scalar-docs[bot]@users.noreply.github.com> Date: Wed, 25 Nov 2026 05:17:16 +0000 Subject: [PATCH 12/12] release: 0.9.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- src/commands/index.ts | 4 ++-- src/sdk/version.ts | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7e08ec6..ee2bfff 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.2" + ".": "0.9.3" } diff --git a/CHANGELOG.md b/CHANGELOG.md index e1bce1e..f691916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [0.9.3](https://github.com/dedalus-labs/dedalus-cli/compare/v0.9.2...v0.9.3) (2026-11-25) + + +### ⚠ BREAKING CHANGES + +* **cli:** distribute the cli through pnpm ([#135](https://github.com/dedalus-labs/dedalus-cli/issues/135)) + +### Features + +* **cli:** distribute the cli through pnpm ([#135](https://github.com/dedalus-labs/dedalus-cli/issues/135)) ([8cd8956](https://github.com/dedalus-labs/dedalus-cli/commit/8cd89563f422f33684fbfa4a4de3b4ef6912f8ae)) + ## [0.9.2](https://github.com/dedalus-labs/dedalus-cli/compare/v0.9.1...v0.9.2) (2026-11-24) diff --git a/package.json b/package.json index 385a654..7d7a25d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dedalus-cli", - "version": "0.9.2", + "version": "0.9.3", "description": "Controlplane API for Dedalus Cloud Services (DCS).", "author": "Dedalus", "repository": { diff --git a/src/commands/index.ts b/src/commands/index.ts index 66ff329..b6fa0dc 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -1582,7 +1582,7 @@ export const getProgram = (): Command => { createProgram({ SDK, binaryName: 'dedalus', - version: '0.9.2', // x-release-please-version + version: '0.9.3', // x-release-please-version description: 'CLI for Dedalus', defaultFormat: 'json', defaultErrorFormat: 'json', @@ -1607,6 +1607,6 @@ export const getProgram = (): Command => { clientOptions, auth, ); - addUpgradeCommands(program, 'dedalus', '0.9.2'); // x-release-please-version + addUpgradeCommands(program, 'dedalus', '0.9.3'); // x-release-please-version return program; }; diff --git a/src/sdk/version.ts b/src/sdk/version.ts index f32304c..3303be1 100644 --- a/src/sdk/version.ts +++ b/src/sdk/version.ts @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -export const VERSION = '0.9.2'; // x-release-please-version +export const VERSION = '0.9.3'; // x-release-please-version