@indigoai-us/hq-cloud 6.18.44-alpha.48 → 6.18.44-alpha.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-company.test.d.ts +2 -0
- package/dist/active-company.test.d.ts.map +1 -0
- package/dist/active-company.test.js +149 -0
- package/dist/active-company.test.js.map +1 -0
- package/dist/agent-codex-instructions.test.d.ts +2 -0
- package/dist/agent-codex-instructions.test.d.ts.map +1 -0
- package/dist/agent-codex-instructions.test.js +276 -0
- package/dist/agent-codex-instructions.test.js.map +1 -0
- package/dist/backup-prune.test.d.ts +2 -0
- package/dist/backup-prune.test.d.ts.map +1 -0
- package/dist/backup-prune.test.js +154 -0
- package/dist/backup-prune.test.js.map +1 -0
- package/dist/bandwidth.test.d.ts +2 -0
- package/dist/bandwidth.test.d.ts.map +1 -0
- package/dist/bandwidth.test.js +342 -0
- package/dist/bandwidth.test.js.map +1 -0
- package/dist/best-effort-error.test.d.ts +2 -0
- package/dist/best-effort-error.test.d.ts.map +1 -0
- package/dist/best-effort-error.test.js +54 -0
- package/dist/best-effort-error.test.js.map +1 -0
- package/dist/bin/area-ledger-migration.test.d.ts +2 -0
- package/dist/bin/area-ledger-migration.test.d.ts.map +1 -0
- package/dist/bin/area-ledger-migration.test.js +410 -0
- package/dist/bin/area-ledger-migration.test.js.map +1 -0
- package/dist/bin/backup-prune-runner.test.d.ts +2 -0
- package/dist/bin/backup-prune-runner.test.d.ts.map +1 -0
- package/dist/bin/backup-prune-runner.test.js +22 -0
- package/dist/bin/backup-prune-runner.test.js.map +1 -0
- package/dist/bin/journal-repair.test.d.ts +2 -0
- package/dist/bin/journal-repair.test.d.ts.map +1 -0
- package/dist/bin/journal-repair.test.js +53 -0
- package/dist/bin/journal-repair.test.js.map +1 -0
- package/dist/bin/layout-compatibility.test.d.ts +2 -0
- package/dist/bin/layout-compatibility.test.d.ts.map +1 -0
- package/dist/bin/layout-compatibility.test.js +87 -0
- package/dist/bin/layout-compatibility.test.js.map +1 -0
- package/dist/bin/outpost-heartbeat.test.d.ts +7 -0
- package/dist/bin/outpost-heartbeat.test.d.ts.map +1 -0
- package/dist/bin/outpost-heartbeat.test.js +84 -0
- package/dist/bin/outpost-heartbeat.test.js.map +1 -0
- package/dist/bin/outpost-session-host.test.d.ts +7 -0
- package/dist/bin/outpost-session-host.test.d.ts.map +1 -0
- package/dist/bin/outpost-session-host.test.js +52 -0
- package/dist/bin/outpost-session-host.test.js.map +1 -0
- package/dist/bin/sync-mutation.test.d.ts +2 -0
- package/dist/bin/sync-mutation.test.d.ts.map +1 -0
- package/dist/bin/sync-mutation.test.js +64 -0
- package/dist/bin/sync-mutation.test.js.map +1 -0
- package/dist/bin/sync-runner-args.test.d.ts +2 -0
- package/dist/bin/sync-runner-args.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-args.test.js +82 -0
- package/dist/bin/sync-runner-args.test.js.map +1 -0
- package/dist/bin/sync-runner-auth-wait.test.d.ts +2 -0
- package/dist/bin/sync-runner-auth-wait.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-auth-wait.test.js +406 -0
- package/dist/bin/sync-runner-auth-wait.test.js.map +1 -0
- package/dist/bin/sync-runner-backoff.regression.test.d.ts +29 -0
- package/dist/bin/sync-runner-backoff.regression.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-backoff.regression.test.js +224 -0
- package/dist/bin/sync-runner-backoff.regression.test.js.map +1 -0
- package/dist/bin/sync-runner-company.test.d.ts +2 -0
- package/dist/bin/sync-runner-company.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-company.test.js +2439 -0
- package/dist/bin/sync-runner-company.test.js.map +1 -0
- package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.d.ts +2 -0
- package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.js +648 -0
- package/dist/bin/sync-runner-delete-snapshot-mixed.bench.test.js.map +1 -0
- package/dist/bin/sync-runner-delete-snapshot.bench.test.d.ts +2 -0
- package/dist/bin/sync-runner-delete-snapshot.bench.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-delete-snapshot.bench.test.js +329 -0
- package/dist/bin/sync-runner-delete-snapshot.bench.test.js.map +1 -0
- package/dist/bin/sync-runner-events.test.d.ts +2 -0
- package/dist/bin/sync-runner-events.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-events.test.js +364 -0
- package/dist/bin/sync-runner-events.test.js.map +1 -0
- package/dist/bin/sync-runner-heap-telemetry.test.d.ts +2 -0
- package/dist/bin/sync-runner-heap-telemetry.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-heap-telemetry.test.js +1966 -0
- package/dist/bin/sync-runner-heap-telemetry.test.js.map +1 -0
- package/dist/bin/sync-runner-manifest.test.d.ts +12 -0
- package/dist/bin/sync-runner-manifest.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-manifest.test.js +921 -0
- package/dist/bin/sync-runner-manifest.test.js.map +1 -0
- package/dist/bin/sync-runner-planning.test.d.ts +2 -0
- package/dist/bin/sync-runner-planning.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-planning.test.js +448 -0
- package/dist/bin/sync-runner-planning.test.js.map +1 -0
- package/dist/bin/sync-runner-post-sync-flags.test.d.ts +2 -0
- package/dist/bin/sync-runner-post-sync-flags.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-post-sync-flags.test.js +64 -0
- package/dist/bin/sync-runner-post-sync-flags.test.js.map +1 -0
- package/dist/bin/sync-runner-publish-expansion.test.d.ts +2 -0
- package/dist/bin/sync-runner-publish-expansion.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-publish-expansion.test.js +54 -0
- package/dist/bin/sync-runner-publish-expansion.test.js.map +1 -0
- package/dist/bin/sync-runner-receiver-unresolved-company.test.d.ts +2 -0
- package/dist/bin/sync-runner-receiver-unresolved-company.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-receiver-unresolved-company.test.js +379 -0
- package/dist/bin/sync-runner-receiver-unresolved-company.test.js.map +1 -0
- package/dist/bin/sync-runner-rollup.test.d.ts +2 -0
- package/dist/bin/sync-runner-rollup.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-rollup.test.js +24 -0
- package/dist/bin/sync-runner-rollup.test.js.map +1 -0
- package/dist/bin/sync-runner-watch-loop.test.d.ts +2 -0
- package/dist/bin/sync-runner-watch-loop.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-watch-loop.test.js +735 -0
- package/dist/bin/sync-runner-watch-loop.test.js.map +1 -0
- package/dist/bin/sync-runner-watch-routes.test.d.ts +2 -0
- package/dist/bin/sync-runner-watch-routes.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-watch-routes.test.js +181 -0
- package/dist/bin/sync-runner-watch-routes.test.js.map +1 -0
- package/dist/bin/sync-runner.test.d.ts +10 -0
- package/dist/bin/sync-runner.test.d.ts.map +1 -0
- package/dist/bin/sync-runner.test.js +19084 -0
- package/dist/bin/sync-runner.test.js.map +1 -0
- package/dist/cli/case-alias.test.d.ts +2 -0
- package/dist/cli/case-alias.test.d.ts.map +1 -0
- package/dist/cli/case-alias.test.js +96 -0
- package/dist/cli/case-alias.test.js.map +1 -0
- package/dist/cli/conflict-recovery.test.d.ts +2 -0
- package/dist/cli/conflict-recovery.test.d.ts.map +1 -0
- package/dist/cli/conflict-recovery.test.js +207 -0
- package/dist/cli/conflict-recovery.test.js.map +1 -0
- package/dist/cli/conflict-winner.test.d.ts +7 -0
- package/dist/cli/conflict-winner.test.d.ts.map +1 -0
- package/dist/cli/conflict-winner.test.js +98 -0
- package/dist/cli/conflict-winner.test.js.map +1 -0
- package/dist/cli/doctor.test.d.ts +13 -0
- package/dist/cli/doctor.test.d.ts.map +1 -0
- package/dist/cli/doctor.test.js +607 -0
- package/dist/cli/doctor.test.js.map +1 -0
- package/dist/cli/invite.test.d.ts +5 -0
- package/dist/cli/invite.test.d.ts.map +1 -0
- package/dist/cli/invite.test.js +178 -0
- package/dist/cli/invite.test.js.map +1 -0
- package/dist/cli/onepass-pull-planner-regressions.test.d.ts +2 -0
- package/dist/cli/onepass-pull-planner-regressions.test.d.ts.map +1 -0
- package/dist/cli/onepass-pull-planner-regressions.test.js +300 -0
- package/dist/cli/onepass-pull-planner-regressions.test.js.map +1 -0
- package/dist/cli/onepass-pull-planner.test.d.ts +2 -0
- package/dist/cli/onepass-pull-planner.test.d.ts.map +1 -0
- package/dist/cli/onepass-pull-planner.test.js +266 -0
- package/dist/cli/onepass-pull-planner.test.js.map +1 -0
- package/dist/cli/push-scan-exclusions.test.d.ts +2 -0
- package/dist/cli/push-scan-exclusions.test.d.ts.map +1 -0
- package/dist/cli/push-scan-exclusions.test.js +99 -0
- package/dist/cli/push-scan-exclusions.test.js.map +1 -0
- package/dist/cli/reindex-knowledge.test.d.ts +12 -0
- package/dist/cli/reindex-knowledge.test.d.ts.map +1 -0
- package/dist/cli/reindex-knowledge.test.js +318 -0
- package/dist/cli/reindex-knowledge.test.js.map +1 -0
- package/dist/cli/reindex.test.d.ts +11 -0
- package/dist/cli/reindex.test.d.ts.map +1 -0
- package/dist/cli/reindex.test.js +860 -0
- package/dist/cli/reindex.test.js.map +1 -0
- package/dist/cli/rescue-breaker.test.d.ts +2 -0
- package/dist/cli/rescue-breaker.test.d.ts.map +1 -0
- package/dist/cli/rescue-breaker.test.js +812 -0
- package/dist/cli/rescue-breaker.test.js.map +1 -0
- package/dist/cli/rescue-classify-ordering.test.d.ts +2 -0
- package/dist/cli/rescue-classify-ordering.test.d.ts.map +1 -0
- package/dist/cli/rescue-classify-ordering.test.js +500 -0
- package/dist/cli/rescue-classify-ordering.test.js.map +1 -0
- package/dist/cli/rescue-clone-diagnostics.test.d.ts +2 -0
- package/dist/cli/rescue-clone-diagnostics.test.d.ts.map +1 -0
- package/dist/cli/rescue-clone-diagnostics.test.js +101 -0
- package/dist/cli/rescue-clone-diagnostics.test.js.map +1 -0
- package/dist/cli/rescue-clone-network-retry.test.d.ts +2 -0
- package/dist/cli/rescue-clone-network-retry.test.d.ts.map +1 -0
- package/dist/cli/rescue-clone-network-retry.test.js +415 -0
- package/dist/cli/rescue-clone-network-retry.test.js.map +1 -0
- package/dist/cli/rescue-core-stamp.test.d.ts +2 -0
- package/dist/cli/rescue-core-stamp.test.d.ts.map +1 -0
- package/dist/cli/rescue-core-stamp.test.js +364 -0
- package/dist/cli/rescue-core-stamp.test.js.map +1 -0
- package/dist/cli/rescue-drift-reconcile.test.d.ts +2 -0
- package/dist/cli/rescue-drift-reconcile.test.d.ts.map +1 -0
- package/dist/cli/rescue-drift-reconcile.test.js +162 -0
- package/dist/cli/rescue-drift-reconcile.test.js.map +1 -0
- package/dist/cli/rescue-drop-dir-symlink.test.d.ts +2 -0
- package/dist/cli/rescue-drop-dir-symlink.test.d.ts.map +1 -0
- package/dist/cli/rescue-drop-dir-symlink.test.js +255 -0
- package/dist/cli/rescue-drop-dir-symlink.test.js.map +1 -0
- package/dist/cli/rescue-exec-bit-preserve.test.d.ts +2 -0
- package/dist/cli/rescue-exec-bit-preserve.test.d.ts.map +1 -0
- package/dist/cli/rescue-exec-bit-preserve.test.js +177 -0
- package/dist/cli/rescue-exec-bit-preserve.test.js.map +1 -0
- package/dist/cli/rescue-hq-root-guard.test.d.ts +2 -0
- package/dist/cli/rescue-hq-root-guard.test.d.ts.map +1 -0
- package/dist/cli/rescue-hq-root-guard.test.js +210 -0
- package/dist/cli/rescue-hq-root-guard.test.js.map +1 -0
- package/dist/cli/rescue-journal-reconcile.test.d.ts +2 -0
- package/dist/cli/rescue-journal-reconcile.test.d.ts.map +1 -0
- package/dist/cli/rescue-journal-reconcile.test.js +186 -0
- package/dist/cli/rescue-journal-reconcile.test.js.map +1 -0
- package/dist/cli/rescue-keep-local-ignore.test.d.ts +2 -0
- package/dist/cli/rescue-keep-local-ignore.test.d.ts.map +1 -0
- package/dist/cli/rescue-keep-local-ignore.test.js +315 -0
- package/dist/cli/rescue-keep-local-ignore.test.js.map +1 -0
- package/dist/cli/rescue-move.test.d.ts +2 -0
- package/dist/cli/rescue-move.test.d.ts.map +1 -0
- package/dist/cli/rescue-move.test.js +166 -0
- package/dist/cli/rescue-move.test.js.map +1 -0
- package/dist/cli/rescue-mtime-preserve.test.d.ts +2 -0
- package/dist/cli/rescue-mtime-preserve.test.d.ts.map +1 -0
- package/dist/cli/rescue-mtime-preserve.test.js +186 -0
- package/dist/cli/rescue-mtime-preserve.test.js.map +1 -0
- package/dist/cli/rescue-preserve-copy-symlink.test.d.ts +2 -0
- package/dist/cli/rescue-preserve-copy-symlink.test.d.ts.map +1 -0
- package/dist/cli/rescue-preserve-copy-symlink.test.js +483 -0
- package/dist/cli/rescue-preserve-copy-symlink.test.js.map +1 -0
- package/dist/cli/rescue-realpath.test.d.ts +2 -0
- package/dist/cli/rescue-realpath.test.d.ts.map +1 -0
- package/dist/cli/rescue-realpath.test.js +109 -0
- package/dist/cli/rescue-realpath.test.js.map +1 -0
- package/dist/cli/rescue-restore-flag.test.d.ts +2 -0
- package/dist/cli/rescue-restore-flag.test.d.ts.map +1 -0
- package/dist/cli/rescue-restore-flag.test.js +82 -0
- package/dist/cli/rescue-restore-flag.test.js.map +1 -0
- package/dist/cli/rescue-rsync-preflight.test.d.ts +2 -0
- package/dist/cli/rescue-rsync-preflight.test.d.ts.map +1 -0
- package/dist/cli/rescue-rsync-preflight.test.js +579 -0
- package/dist/cli/rescue-rsync-preflight.test.js.map +1 -0
- package/dist/cli/rescue-rsync-status.test.d.ts +2 -0
- package/dist/cli/rescue-rsync-status.test.d.ts.map +1 -0
- package/dist/cli/rescue-rsync-status.test.js +406 -0
- package/dist/cli/rescue-rsync-status.test.js.map +1 -0
- package/dist/cli/rescue-settings-reconcile.test.d.ts +2 -0
- package/dist/cli/rescue-settings-reconcile.test.d.ts.map +1 -0
- package/dist/cli/rescue-settings-reconcile.test.js +610 -0
- package/dist/cli/rescue-settings-reconcile.test.js.map +1 -0
- package/dist/cli/rescue-snapshot-copy.test.d.ts +2 -0
- package/dist/cli/rescue-snapshot-copy.test.d.ts.map +1 -0
- package/dist/cli/rescue-snapshot-copy.test.js +790 -0
- package/dist/cli/rescue-snapshot-copy.test.js.map +1 -0
- package/dist/cli/rescue-snapshot-recovery.test.d.ts +2 -0
- package/dist/cli/rescue-snapshot-recovery.test.d.ts.map +1 -0
- package/dist/cli/rescue-snapshot-recovery.test.js +265 -0
- package/dist/cli/rescue-snapshot-recovery.test.js.map +1 -0
- package/dist/cli/rescue-snapshot.test.d.ts +2 -0
- package/dist/cli/rescue-snapshot.test.d.ts.map +1 -0
- package/dist/cli/rescue-snapshot.test.js +46 -0
- package/dist/cli/rescue-snapshot.test.js.map +1 -0
- package/dist/cli/rescue-source-switch-floor.test.d.ts +2 -0
- package/dist/cli/rescue-source-switch-floor.test.d.ts.map +1 -0
- package/dist/cli/rescue-source-switch-floor.test.js +247 -0
- package/dist/cli/rescue-source-switch-floor.test.js.map +1 -0
- package/dist/cli/rescue-unchanged-delete.test.d.ts +2 -0
- package/dist/cli/rescue-unchanged-delete.test.d.ts.map +1 -0
- package/dist/cli/rescue-unchanged-delete.test.js +305 -0
- package/dist/cli/rescue-unchanged-delete.test.js.map +1 -0
- package/dist/cli/rescue.reindex.test.d.ts +2 -0
- package/dist/cli/rescue.reindex.test.d.ts.map +1 -0
- package/dist/cli/rescue.reindex.test.js +72 -0
- package/dist/cli/rescue.reindex.test.js.map +1 -0
- package/dist/cli/rescue.test.d.ts +2 -0
- package/dist/cli/rescue.test.d.ts.map +1 -0
- package/dist/cli/rescue.test.js +127 -0
- package/dist/cli/rescue.test.js.map +1 -0
- package/dist/cli/share-plan-limit-presign.test.d.ts +2 -0
- package/dist/cli/share-plan-limit-presign.test.d.ts.map +1 -0
- package/dist/cli/share-plan-limit-presign.test.js +271 -0
- package/dist/cli/share-plan-limit-presign.test.js.map +1 -0
- package/dist/cli/share-presign-transport.test.d.ts +22 -0
- package/dist/cli/share-presign-transport.test.d.ts.map +1 -0
- package/dist/cli/share-presign-transport.test.js +388 -0
- package/dist/cli/share-presign-transport.test.js.map +1 -0
- package/dist/cli/share.test.d.ts +5 -0
- package/dist/cli/share.test.d.ts.map +1 -0
- package/dist/cli/share.test.js +12336 -0
- package/dist/cli/share.test.js.map +1 -0
- package/dist/cli/streaming-pull-planner.bench.test.d.ts +15 -0
- package/dist/cli/streaming-pull-planner.bench.test.d.ts.map +1 -0
- package/dist/cli/streaming-pull-planner.bench.test.js +273 -0
- package/dist/cli/streaming-pull-planner.bench.test.js.map +1 -0
- package/dist/cli/sync-scope.test.d.ts +22 -0
- package/dist/cli/sync-scope.test.d.ts.map +1 -0
- package/dist/cli/sync-scope.test.js +903 -0
- package/dist/cli/sync-scope.test.js.map +1 -0
- package/dist/cli/sync.test.d.ts +5 -0
- package/dist/cli/sync.test.d.ts.map +1 -0
- package/dist/cli/sync.test.js +9028 -0
- package/dist/cli/sync.test.js.map +1 -0
- package/dist/cli/tombstones.test.d.ts +2 -0
- package/dist/cli/tombstones.test.d.ts.map +1 -0
- package/dist/cli/tombstones.test.js +120 -0
- package/dist/cli/tombstones.test.js.map +1 -0
- package/dist/cli/watch-event-push-conflict.test.d.ts +25 -0
- package/dist/cli/watch-event-push-conflict.test.d.ts.map +1 -0
- package/dist/cli/watch-event-push-conflict.test.js +230 -0
- package/dist/cli/watch-event-push-conflict.test.js.map +1 -0
- package/dist/client-info.test.d.ts +11 -0
- package/dist/client-info.test.d.ts.map +1 -0
- package/dist/client-info.test.js +168 -0
- package/dist/client-info.test.js.map +1 -0
- package/dist/cognito-auth-lock-no-hard-links.test.d.ts +11 -0
- package/dist/cognito-auth-lock-no-hard-links.test.d.ts.map +1 -0
- package/dist/cognito-auth-lock-no-hard-links.test.js +76 -0
- package/dist/cognito-auth-lock-no-hard-links.test.js.map +1 -0
- package/dist/cognito-auth.test.d.ts +9 -0
- package/dist/cognito-auth.test.d.ts.map +1 -0
- package/dist/cognito-auth.test.js +745 -0
- package/dist/cognito-auth.test.js.map +1 -0
- package/dist/company-resolver.test.d.ts +7 -0
- package/dist/company-resolver.test.d.ts.map +1 -0
- package/dist/company-resolver.test.js +535 -0
- package/dist/company-resolver.test.js.map +1 -0
- package/dist/company-slug.test.d.ts +7 -0
- package/dist/company-slug.test.d.ts.map +1 -0
- package/dist/company-slug.test.js +43 -0
- package/dist/company-slug.test.js.map +1 -0
- package/dist/company-vault-transport.test.d.ts +12 -0
- package/dist/company-vault-transport.test.d.ts.map +1 -0
- package/dist/company-vault-transport.test.js +97 -0
- package/dist/company-vault-transport.test.js.map +1 -0
- package/dist/context.test.d.ts +7 -0
- package/dist/context.test.d.ts.map +1 -0
- package/dist/context.test.js +646 -0
- package/dist/context.test.js.map +1 -0
- package/dist/entity-resolver.test.d.ts +10 -0
- package/dist/entity-resolver.test.d.ts.map +1 -0
- package/dist/entity-resolver.test.js +244 -0
- package/dist/entity-resolver.test.js.map +1 -0
- package/dist/getindigo-dead-refs-contract.test.d.ts +2 -0
- package/dist/getindigo-dead-refs-contract.test.d.ts.map +1 -0
- package/dist/getindigo-dead-refs-contract.test.js +58 -0
- package/dist/getindigo-dead-refs-contract.test.js.map +1 -0
- package/dist/hermetic-test-env.test.d.ts +2 -0
- package/dist/hermetic-test-env.test.d.ts.map +1 -0
- package/dist/hermetic-test-env.test.js +61 -0
- package/dist/hermetic-test-env.test.js.map +1 -0
- package/dist/hq-root-recovery.test.d.ts +2 -0
- package/dist/hq-root-recovery.test.d.ts.map +1 -0
- package/dist/hq-root-recovery.test.js +65 -0
- package/dist/hq-root-recovery.test.js.map +1 -0
- package/dist/ignore.test.d.ts +10 -0
- package/dist/ignore.test.d.ts.map +1 -0
- package/dist/ignore.test.js +958 -0
- package/dist/ignore.test.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +26 -0
- package/dist/index.test.js.map +1 -0
- package/dist/journal-area-ledger-read-boundary.test.d.ts +2 -0
- package/dist/journal-area-ledger-read-boundary.test.d.ts.map +1 -0
- package/dist/journal-area-ledger-read-boundary.test.js +425 -0
- package/dist/journal-area-ledger-read-boundary.test.js.map +1 -0
- package/dist/journal-baseline.test.d.ts +2 -0
- package/dist/journal-baseline.test.d.ts.map +1 -0
- package/dist/journal-baseline.test.js +218 -0
- package/dist/journal-baseline.test.js.map +1 -0
- package/dist/journal-decode-window.test.d.ts +2 -0
- package/dist/journal-decode-window.test.d.ts.map +1 -0
- package/dist/journal-decode-window.test.js +99 -0
- package/dist/journal-decode-window.test.js.map +1 -0
- package/dist/journal-delta-writes.test.d.ts +2 -0
- package/dist/journal-delta-writes.test.d.ts.map +1 -0
- package/dist/journal-delta-writes.test.js +159 -0
- package/dist/journal-delta-writes.test.js.map +1 -0
- package/dist/journal-ledger-index.test.d.ts +15 -0
- package/dist/journal-ledger-index.test.d.ts.map +1 -0
- package/dist/journal-ledger-index.test.js +269 -0
- package/dist/journal-ledger-index.test.js.map +1 -0
- package/dist/journal-public-boundary.test.d.ts +2 -0
- package/dist/journal-public-boundary.test.d.ts.map +1 -0
- package/dist/journal-public-boundary.test.js +216 -0
- package/dist/journal-public-boundary.test.js.map +1 -0
- package/dist/journal-row-store.test.d.ts +2 -0
- package/dist/journal-row-store.test.d.ts.map +1 -0
- package/dist/journal-row-store.test.js +729 -0
- package/dist/journal-row-store.test.js.map +1 -0
- package/dist/journal-snapshot-memory-helpers.d.ts +35 -0
- package/dist/journal-snapshot-memory-helpers.d.ts.map +1 -0
- package/dist/journal-snapshot-memory-helpers.js +298 -0
- package/dist/journal-snapshot-memory-helpers.js.map +1 -0
- package/dist/journal-snapshot-memory.test.d.ts +2 -0
- package/dist/journal-snapshot-memory.test.d.ts.map +1 -0
- package/dist/journal-snapshot-memory.test.js +55 -0
- package/dist/journal-snapshot-memory.test.js.map +1 -0
- package/dist/journal-snapshot-v4-memory.test.d.ts +2 -0
- package/dist/journal-snapshot-v4-memory.test.d.ts.map +1 -0
- package/dist/journal-snapshot-v4-memory.test.js +24 -0
- package/dist/journal-snapshot-v4-memory.test.js.map +1 -0
- package/dist/journal-snapshot-v4-writer-memory.test.d.ts +2 -0
- package/dist/journal-snapshot-v4-writer-memory.test.d.ts.map +1 -0
- package/dist/journal-snapshot-v4-writer-memory.test.js +76 -0
- package/dist/journal-snapshot-v4-writer-memory.test.js.map +1 -0
- package/dist/journal-snapshot-v4-writer.test.d.ts +2 -0
- package/dist/journal-snapshot-v4-writer.test.d.ts.map +1 -0
- package/dist/journal-snapshot-v4-writer.test.js +282 -0
- package/dist/journal-snapshot-v4-writer.test.js.map +1 -0
- package/dist/journal-snapshot-v4.test.d.ts +2 -0
- package/dist/journal-snapshot-v4.test.d.ts.map +1 -0
- package/dist/journal-snapshot-v4.test.js +281 -0
- package/dist/journal-snapshot-v4.test.js.map +1 -0
- package/dist/journal-store.test.d.ts +2 -0
- package/dist/journal-store.test.d.ts.map +1 -0
- package/dist/journal-store.test.js +1227 -0
- package/dist/journal-store.test.js.map +1 -0
- package/dist/journal-streaming.heap.test.d.ts +2 -0
- package/dist/journal-streaming.heap.test.d.ts.map +1 -0
- package/dist/journal-streaming.heap.test.js +190 -0
- package/dist/journal-streaming.heap.test.js.map +1 -0
- package/dist/journal.test.d.ts +9 -0
- package/dist/journal.test.d.ts.map +1 -0
- package/dist/journal.test.js +1074 -0
- package/dist/journal.test.js.map +1 -0
- package/dist/kms10-etag-safe-pull.test.d.ts +2 -0
- package/dist/kms10-etag-safe-pull.test.d.ts.map +1 -0
- package/dist/kms10-etag-safe-pull.test.js +53 -0
- package/dist/kms10-etag-safe-pull.test.js.map +1 -0
- package/dist/lib/cloud-authoritative.test.d.ts +2 -0
- package/dist/lib/cloud-authoritative.test.d.ts.map +1 -0
- package/dist/lib/cloud-authoritative.test.js +42 -0
- package/dist/lib/cloud-authoritative.test.js.map +1 -0
- package/dist/lib/conflict-reconcile.test.d.ts +7 -0
- package/dist/lib/conflict-reconcile.test.d.ts.map +1 -0
- package/dist/lib/conflict-reconcile.test.js +246 -0
- package/dist/lib/conflict-reconcile.test.js.map +1 -0
- package/dist/lib/conflict.test.d.ts +9 -0
- package/dist/lib/conflict.test.d.ts.map +1 -0
- package/dist/lib/conflict.test.js +340 -0
- package/dist/lib/conflict.test.js.map +1 -0
- package/dist/lib/describe-error.test.d.ts +2 -0
- package/dist/lib/describe-error.test.d.ts.map +1 -0
- package/dist/lib/describe-error.test.js +148 -0
- package/dist/lib/describe-error.test.js.map +1 -0
- package/dist/lib/machine-id.test.d.ts +8 -0
- package/dist/lib/machine-id.test.d.ts.map +1 -0
- package/dist/lib/machine-id.test.js +228 -0
- package/dist/lib/machine-id.test.js.map +1 -0
- package/dist/lib/net-errors.test.d.ts +2 -0
- package/dist/lib/net-errors.test.d.ts.map +1 -0
- package/dist/lib/net-errors.test.js +111 -0
- package/dist/lib/net-errors.test.js.map +1 -0
- package/dist/lib/ontology-entity-meta.test.d.ts +2 -0
- package/dist/lib/ontology-entity-meta.test.d.ts.map +1 -0
- package/dist/lib/ontology-entity-meta.test.js +79 -0
- package/dist/lib/ontology-entity-meta.test.js.map +1 -0
- package/dist/lib/ontology-entity-push.test.d.ts +2 -0
- package/dist/lib/ontology-entity-push.test.d.ts.map +1 -0
- package/dist/lib/ontology-entity-push.test.js +156 -0
- package/dist/lib/ontology-entity-push.test.js.map +1 -0
- package/dist/lib/personal-connector-settings-sync.test.d.ts +2 -0
- package/dist/lib/personal-connector-settings-sync.test.d.ts.map +1 -0
- package/dist/lib/personal-connector-settings-sync.test.js +34 -0
- package/dist/lib/personal-connector-settings-sync.test.js.map +1 -0
- package/dist/lib/readlink-safe.test.d.ts +2 -0
- package/dist/lib/readlink-safe.test.d.ts.map +1 -0
- package/dist/lib/readlink-safe.test.js +34 -0
- package/dist/lib/readlink-safe.test.js.map +1 -0
- package/dist/lib/s3-content-checksum.test.d.ts +2 -0
- package/dist/lib/s3-content-checksum.test.d.ts.map +1 -0
- package/dist/lib/s3-content-checksum.test.js +26 -0
- package/dist/lib/s3-content-checksum.test.js.map +1 -0
- package/dist/lib/skill-register-landed-bytes.test.d.ts +2 -0
- package/dist/lib/skill-register-landed-bytes.test.d.ts.map +1 -0
- package/dist/lib/skill-register-landed-bytes.test.js +83 -0
- package/dist/lib/skill-register-landed-bytes.test.js.map +1 -0
- package/dist/local-path-codec.test.d.ts +14 -0
- package/dist/local-path-codec.test.d.ts.map +1 -0
- package/dist/local-path-codec.test.js +122 -0
- package/dist/local-path-codec.test.js.map +1 -0
- package/dist/machine-auth.test.d.ts +14 -0
- package/dist/machine-auth.test.d.ts.map +1 -0
- package/dist/machine-auth.test.js +1492 -0
- package/dist/machine-auth.test.js.map +1 -0
- package/dist/machine-token-cache-isolation.test.d.ts +24 -0
- package/dist/machine-token-cache-isolation.test.d.ts.map +1 -0
- package/dist/machine-token-cache-isolation.test.js +284 -0
- package/dist/machine-token-cache-isolation.test.js.map +1 -0
- package/dist/manifest/US-002.acceptance.test.d.ts +11 -0
- package/dist/manifest/US-002.acceptance.test.d.ts.map +1 -0
- package/dist/manifest/US-002.acceptance.test.js +160 -0
- package/dist/manifest/US-002.acceptance.test.js.map +1 -0
- package/dist/manifest/US-004.acceptance.test.d.ts +12 -0
- package/dist/manifest/US-004.acceptance.test.d.ts.map +1 -0
- package/dist/manifest/US-004.acceptance.test.js +173 -0
- package/dist/manifest/US-004.acceptance.test.js.map +1 -0
- package/dist/manifest/bench-gate.d.ts +30 -0
- package/dist/manifest/bench-gate.d.ts.map +1 -0
- package/dist/manifest/bench-gate.js +47 -0
- package/dist/manifest/bench-gate.js.map +1 -0
- package/dist/manifest/bench-gate.test.d.ts +2 -0
- package/dist/manifest/bench-gate.test.d.ts.map +1 -0
- package/dist/manifest/bench-gate.test.js +67 -0
- package/dist/manifest/bench-gate.test.js.map +1 -0
- package/dist/manifest/build-manifest-resident-parity.test.d.ts +2 -0
- package/dist/manifest/build-manifest-resident-parity.test.d.ts.map +1 -0
- package/dist/manifest/build-manifest-resident-parity.test.js +69 -0
- package/dist/manifest/build-manifest-resident-parity.test.js.map +1 -0
- package/dist/manifest/build-manifest.bench.test.d.ts +22 -0
- package/dist/manifest/build-manifest.bench.test.d.ts.map +1 -0
- package/dist/manifest/build-manifest.bench.test.js +931 -0
- package/dist/manifest/build-manifest.bench.test.js.map +1 -0
- package/dist/manifest/build-manifest.test.d.ts +10 -0
- package/dist/manifest/build-manifest.test.d.ts.map +1 -0
- package/dist/manifest/build-manifest.test.js +1220 -0
- package/dist/manifest/build-manifest.test.js.map +1 -0
- package/dist/manifest/contract.test.d.ts +17 -0
- package/dist/manifest/contract.test.d.ts.map +1 -0
- package/dist/manifest/contract.test.js +346 -0
- package/dist/manifest/contract.test.js.map +1 -0
- package/dist/manifest/import-graph.test.d.ts +25 -0
- package/dist/manifest/import-graph.test.d.ts.map +1 -0
- package/dist/manifest/import-graph.test.js +120 -0
- package/dist/manifest/import-graph.test.js.map +1 -0
- package/dist/manifest/ledger-shard-isolation.test.d.ts +18 -0
- package/dist/manifest/ledger-shard-isolation.test.d.ts.map +1 -0
- package/dist/manifest/ledger-shard-isolation.test.js +153 -0
- package/dist/manifest/ledger-shard-isolation.test.js.map +1 -0
- package/dist/manifest/snapshot-store.test.d.ts +11 -0
- package/dist/manifest/snapshot-store.test.d.ts.map +1 -0
- package/dist/manifest/snapshot-store.test.js +206 -0
- package/dist/manifest/snapshot-store.test.js.map +1 -0
- package/dist/manifest/upload-manifest.test.d.ts +10 -0
- package/dist/manifest/upload-manifest.test.d.ts.map +1 -0
- package/dist/manifest/upload-manifest.test.js +1335 -0
- package/dist/manifest/upload-manifest.test.js.map +1 -0
- package/dist/manifest-reconcile.test.d.ts +2 -0
- package/dist/manifest-reconcile.test.d.ts.map +1 -0
- package/dist/manifest-reconcile.test.js +1032 -0
- package/dist/manifest-reconcile.test.js.map +1 -0
- package/dist/object-io.test.d.ts +11 -0
- package/dist/object-io.test.d.ts.map +1 -0
- package/dist/object-io.test.js +2376 -0
- package/dist/object-io.test.js.map +1 -0
- package/dist/operation-lock.test.d.ts +5 -0
- package/dist/operation-lock.test.d.ts.map +1 -0
- package/dist/operation-lock.test.js +796 -0
- package/dist/operation-lock.test.js.map +1 -0
- package/dist/outcome-telemetry.test.d.ts +9 -0
- package/dist/outcome-telemetry.test.d.ts.map +1 -0
- package/dist/outcome-telemetry.test.js +663 -0
- package/dist/outcome-telemetry.test.js.map +1 -0
- package/dist/outposts/client.test.d.ts +9 -0
- package/dist/outposts/client.test.d.ts.map +1 -0
- package/dist/outposts/client.test.js +415 -0
- package/dist/outposts/client.test.js.map +1 -0
- package/dist/outposts/command.test.d.ts +18 -0
- package/dist/outposts/command.test.d.ts.map +1 -0
- package/dist/outposts/command.test.js +1230 -0
- package/dist/outposts/command.test.js.map +1 -0
- package/dist/outposts/replica-sync.test.d.ts +2 -0
- package/dist/outposts/replica-sync.test.d.ts.map +1 -0
- package/dist/outposts/replica-sync.test.js +225 -0
- package/dist/outposts/replica-sync.test.js.map +1 -0
- package/dist/outposts/self-deploy.test.d.ts +2 -0
- package/dist/outposts/self-deploy.test.d.ts.map +1 -0
- package/dist/outposts/self-deploy.test.js +218 -0
- package/dist/outposts/self-deploy.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-bounds.test.d.ts +25 -0
- package/dist/outposts/session-heartbeat-bounds.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-bounds.test.js +159 -0
- package/dist/outposts/session-heartbeat-bounds.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-guard.test.d.ts +16 -0
- package/dist/outposts/session-heartbeat-guard.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-guard.test.js +88 -0
- package/dist/outposts/session-heartbeat-guard.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-publisher.test.d.ts +10 -0
- package/dist/outposts/session-heartbeat-publisher.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-publisher.test.js +153 -0
- package/dist/outposts/session-heartbeat-publisher.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.d.ts +18 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.js +106 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-scan.test.d.ts +20 -0
- package/dist/outposts/session-heartbeat-scan.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-scan.test.js +242 -0
- package/dist/outposts/session-heartbeat-scan.test.js.map +1 -0
- package/dist/outposts/session-heartbeat.test.d.ts +11 -0
- package/dist/outposts/session-heartbeat.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat.test.js +387 -0
- package/dist/outposts/session-heartbeat.test.js.map +1 -0
- package/dist/outposts/session-host-auth.test.d.ts +16 -0
- package/dist/outposts/session-host-auth.test.d.ts.map +1 -0
- package/dist/outposts/session-host-auth.test.js +284 -0
- package/dist/outposts/session-host-auth.test.js.map +1 -0
- package/dist/outposts/session-host-command.test.d.ts +10 -0
- package/dist/outposts/session-host-command.test.d.ts.map +1 -0
- package/dist/outposts/session-host-command.test.js +182 -0
- package/dist/outposts/session-host-command.test.js.map +1 -0
- package/dist/outposts/session-host-connection.test.d.ts +18 -0
- package/dist/outposts/session-host-connection.test.d.ts.map +1 -0
- package/dist/outposts/session-host-connection.test.js +392 -0
- package/dist/outposts/session-host-connection.test.js.map +1 -0
- package/dist/outposts/session-host-fakes.d.ts +61 -0
- package/dist/outposts/session-host-fakes.d.ts.map +1 -0
- package/dist/outposts/session-host-fakes.js +115 -0
- package/dist/outposts/session-host-fakes.js.map +1 -0
- package/dist/outposts/session-host-ndjson.test.d.ts +11 -0
- package/dist/outposts/session-host-ndjson.test.d.ts.map +1 -0
- package/dist/outposts/session-host-ndjson.test.js +73 -0
- package/dist/outposts/session-host-ndjson.test.js.map +1 -0
- package/dist/outposts/session-host-protocol.test.d.ts +15 -0
- package/dist/outposts/session-host-protocol.test.d.ts.map +1 -0
- package/dist/outposts/session-host-protocol.test.js +0 -0
- package/dist/outposts/session-host-protocol.test.js.map +1 -0
- package/dist/outposts/session-host-server.test.d.ts +10 -0
- package/dist/outposts/session-host-server.test.d.ts.map +1 -0
- package/dist/outposts/session-host-server.test.js +118 -0
- package/dist/outposts/session-host-server.test.js.map +1 -0
- package/dist/outposts/session-host-sessions.test.d.ts +18 -0
- package/dist/outposts/session-host-sessions.test.d.ts.map +1 -0
- package/dist/outposts/session-host-sessions.test.js +439 -0
- package/dist/outposts/session-host-sessions.test.js.map +1 -0
- package/dist/outposts/terminal.test.d.ts +2 -0
- package/dist/outposts/terminal.test.d.ts.map +1 -0
- package/dist/outposts/terminal.test.js +146 -0
- package/dist/outposts/terminal.test.js.map +1 -0
- package/dist/outposts/transport.test.d.ts +10 -0
- package/dist/outposts/transport.test.d.ts.map +1 -0
- package/dist/outposts/transport.test.js +205 -0
- package/dist/outposts/transport.test.js.map +1 -0
- package/dist/packed-journal-phase2.test.d.ts +2 -0
- package/dist/packed-journal-phase2.test.d.ts.map +1 -0
- package/dist/packed-journal-phase2.test.js +273 -0
- package/dist/packed-journal-phase2.test.js.map +1 -0
- package/dist/path-ancestors.test.d.ts +2 -0
- package/dist/path-ancestors.test.d.ts.map +1 -0
- package/dist/path-ancestors.test.js +21 -0
- package/dist/path-ancestors.test.js.map +1 -0
- package/dist/personal-vault-exclusions.test.d.ts +22 -0
- package/dist/personal-vault-exclusions.test.d.ts.map +1 -0
- package/dist/personal-vault-exclusions.test.js +294 -0
- package/dist/personal-vault-exclusions.test.js.map +1 -0
- package/dist/personal-vault.test.d.ts +18 -0
- package/dist/personal-vault.test.d.ts.map +1 -0
- package/dist/personal-vault.test.js +1106 -0
- package/dist/personal-vault.test.js.map +1 -0
- package/dist/plan-limit-pause.test.d.ts +2 -0
- package/dist/plan-limit-pause.test.d.ts.map +1 -0
- package/dist/plan-limit-pause.test.js +150 -0
- package/dist/plan-limit-pause.test.js.map +1 -0
- package/dist/plan-limit.fixtures.d.ts +34 -0
- package/dist/plan-limit.fixtures.d.ts.map +1 -0
- package/dist/plan-limit.fixtures.js +96 -0
- package/dist/plan-limit.fixtures.js.map +1 -0
- package/dist/plan-limit.test.d.ts +2 -0
- package/dist/plan-limit.test.d.ts.map +1 -0
- package/dist/plan-limit.test.js +132 -0
- package/dist/plan-limit.test.js.map +1 -0
- package/dist/prefix-coalesce.test.d.ts +2 -0
- package/dist/prefix-coalesce.test.d.ts.map +1 -0
- package/dist/prefix-coalesce.test.js +260 -0
- package/dist/prefix-coalesce.test.js.map +1 -0
- package/dist/private-folder-transport.test.d.ts +2 -0
- package/dist/private-folder-transport.test.d.ts.map +1 -0
- package/dist/private-folder-transport.test.js +33 -0
- package/dist/private-folder-transport.test.js.map +1 -0
- package/dist/public-surface.test.d.ts +15 -0
- package/dist/public-surface.test.d.ts.map +1 -0
- package/dist/public-surface.test.js +110 -0
- package/dist/public-surface.test.js.map +1 -0
- package/dist/qmd-reindex.test.d.ts +14 -0
- package/dist/qmd-reindex.test.d.ts.map +1 -0
- package/dist/qmd-reindex.test.js +904 -0
- package/dist/qmd-reindex.test.js.map +1 -0
- package/dist/read-only-state-dir.test.d.ts +27 -0
- package/dist/read-only-state-dir.test.d.ts.map +1 -0
- package/dist/read-only-state-dir.test.js +210 -0
- package/dist/read-only-state-dir.test.js.map +1 -0
- package/dist/remote-pull.test.d.ts +2 -0
- package/dist/remote-pull.test.d.ts.map +1 -0
- package/dist/remote-pull.test.js +1147 -0
- package/dist/remote-pull.test.js.map +1 -0
- package/dist/s3-download-stream-hash.test.d.ts +2 -0
- package/dist/s3-download-stream-hash.test.d.ts.map +1 -0
- package/dist/s3-download-stream-hash.test.js +70 -0
- package/dist/s3-download-stream-hash.test.js.map +1 -0
- package/dist/s3.list-cost.test.d.ts +2 -0
- package/dist/s3.list-cost.test.d.ts.map +1 -0
- package/dist/s3.list-cost.test.js +51 -0
- package/dist/s3.list-cost.test.js.map +1 -0
- package/dist/s3.rename-retry.test.d.ts +2 -0
- package/dist/s3.rename-retry.test.d.ts.map +1 -0
- package/dist/s3.rename-retry.test.js +217 -0
- package/dist/s3.rename-retry.test.js.map +1 -0
- package/dist/s3.symlink-materialize.test.d.ts +18 -0
- package/dist/s3.symlink-materialize.test.d.ts.map +1 -0
- package/dist/s3.symlink-materialize.test.js +591 -0
- package/dist/s3.symlink-materialize.test.js.map +1 -0
- package/dist/s3.test.d.ts +9 -0
- package/dist/s3.test.d.ts.map +1 -0
- package/dist/s3.test.js +2091 -0
- package/dist/s3.test.js.map +1 -0
- package/dist/s3.windows-portability.test.d.ts +12 -0
- package/dist/s3.windows-portability.test.d.ts.map +1 -0
- package/dist/s3.windows-portability.test.js +228 -0
- package/dist/s3.windows-portability.test.js.map +1 -0
- package/dist/schemas/signal-types.test.d.ts +2 -0
- package/dist/schemas/signal-types.test.d.ts.map +1 -0
- package/dist/schemas/signal-types.test.js +65 -0
- package/dist/schemas/signal-types.test.js.map +1 -0
- package/dist/schemas/source-channels.test.d.ts +2 -0
- package/dist/schemas/source-channels.test.d.ts.map +1 -0
- package/dist/schemas/source-channels.test.js +65 -0
- package/dist/schemas/source-channels.test.js.map +1 -0
- package/dist/scope-shrink.test.d.ts +13 -0
- package/dist/scope-shrink.test.d.ts.map +1 -0
- package/dist/scope-shrink.test.js +558 -0
- package/dist/scope-shrink.test.js.map +1 -0
- package/dist/session-log-capture.test.d.ts +2 -0
- package/dist/session-log-capture.test.d.ts.map +1 -0
- package/dist/session-log-capture.test.js +533 -0
- package/dist/session-log-capture.test.js.map +1 -0
- package/dist/session-log-retention.test.d.ts +2 -0
- package/dist/session-log-retention.test.d.ts.map +1 -0
- package/dist/session-log-retention.test.js +383 -0
- package/dist/session-log-retention.test.js.map +1 -0
- package/dist/signals/get.test.d.ts +5 -0
- package/dist/signals/get.test.d.ts.map +1 -0
- package/dist/signals/get.test.js +254 -0
- package/dist/signals/get.test.js.map +1 -0
- package/dist/signals/list.test.d.ts +9 -0
- package/dist/signals/list.test.d.ts.map +1 -0
- package/dist/signals/list.test.js +330 -0
- package/dist/signals/list.test.js.map +1 -0
- package/dist/skill-telemetry.test.d.ts +2 -0
- package/dist/skill-telemetry.test.d.ts.map +1 -0
- package/dist/skill-telemetry.test.js +1484 -0
- package/dist/skill-telemetry.test.js.map +1 -0
- package/dist/sources/get.test.d.ts +5 -0
- package/dist/sources/get.test.d.ts.map +1 -0
- package/dist/sources/get.test.js +236 -0
- package/dist/sources/get.test.js.map +1 -0
- package/dist/sources/list.test.d.ts +8 -0
- package/dist/sources/list.test.d.ts.map +1 -0
- package/dist/sources/list.test.js +318 -0
- package/dist/sources/list.test.js.map +1 -0
- package/dist/sts-credential-refresh.test.d.ts +2 -0
- package/dist/sts-credential-refresh.test.d.ts.map +1 -0
- package/dist/sts-credential-refresh.test.js +181 -0
- package/dist/sts-credential-refresh.test.js.map +1 -0
- package/dist/swallowed-error-sites.test.d.ts +2 -0
- package/dist/swallowed-error-sites.test.d.ts.map +1 -0
- package/dist/swallowed-error-sites.test.js +209 -0
- package/dist/swallowed-error-sites.test.js.map +1 -0
- package/dist/swallowed-error-w32.test.d.ts +2 -0
- package/dist/swallowed-error-w32.test.d.ts.map +1 -0
- package/dist/swallowed-error-w32.test.js +186 -0
- package/dist/swallowed-error-w32.test.js.map +1 -0
- package/dist/swallowed-error-w33.test.d.ts +2 -0
- package/dist/swallowed-error-w33.test.d.ts.map +1 -0
- package/dist/swallowed-error-w33.test.js +136 -0
- package/dist/swallowed-error-w33.test.js.map +1 -0
- package/dist/swallowed-error-w34.test.d.ts +2 -0
- package/dist/swallowed-error-w34.test.d.ts.map +1 -0
- package/dist/swallowed-error-w34.test.js +110 -0
- package/dist/swallowed-error-w34.test.js.map +1 -0
- package/dist/swallowed-error-w35.test.d.ts +2 -0
- package/dist/swallowed-error-w35.test.d.ts.map +1 -0
- package/dist/swallowed-error-w35.test.js +237 -0
- package/dist/swallowed-error-w35.test.js.map +1 -0
- package/dist/sync/area-ledger-auto-migration.test.d.ts +2 -0
- package/dist/sync/area-ledger-auto-migration.test.d.ts.map +1 -0
- package/dist/sync/area-ledger-auto-migration.test.js +291 -0
- package/dist/sync/area-ledger-auto-migration.test.js.map +1 -0
- package/dist/sync/area-ledger-migration.test.d.ts +2 -0
- package/dist/sync/area-ledger-migration.test.d.ts.map +1 -0
- package/dist/sync/area-ledger-migration.test.js +554 -0
- package/dist/sync/area-ledger-migration.test.js.map +1 -0
- package/dist/sync/area-ledger-recovery.bench.test.d.ts +2 -0
- package/dist/sync/area-ledger-recovery.bench.test.d.ts.map +1 -0
- package/dist/sync/area-ledger-recovery.bench.test.js +60 -0
- package/dist/sync/area-ledger-recovery.bench.test.js.map +1 -0
- package/dist/sync/area-ledger-writer-lock.bench.test.d.ts +2 -0
- package/dist/sync/area-ledger-writer-lock.bench.test.d.ts.map +1 -0
- package/dist/sync/area-ledger-writer-lock.bench.test.js +57 -0
- package/dist/sync/area-ledger-writer-lock.bench.test.js.map +1 -0
- package/dist/sync/area-ledger.test.d.ts +2 -0
- package/dist/sync/area-ledger.test.d.ts.map +1 -0
- package/dist/sync/area-ledger.test.js +1401 -0
- package/dist/sync/area-ledger.test.js.map +1 -0
- package/dist/sync/area-resolver.test.d.ts +2 -0
- package/dist/sync/area-resolver.test.d.ts.map +1 -0
- package/dist/sync/area-resolver.test.js +234 -0
- package/dist/sync/area-resolver.test.js.map +1 -0
- package/dist/sync/base-version-resolver.test.d.ts +2 -0
- package/dist/sync/base-version-resolver.test.d.ts.map +1 -0
- package/dist/sync/base-version-resolver.test.js +24 -0
- package/dist/sync/base-version-resolver.test.js.map +1 -0
- package/dist/sync/candidate-uploader.test.d.ts +2 -0
- package/dist/sync/candidate-uploader.test.d.ts.map +1 -0
- package/dist/sync/candidate-uploader.test.js +132 -0
- package/dist/sync/candidate-uploader.test.js.map +1 -0
- package/dist/sync/child-process-sync-worker-env.test.d.ts +2 -0
- package/dist/sync/child-process-sync-worker-env.test.d.ts.map +1 -0
- package/dist/sync/child-process-sync-worker-env.test.js +38 -0
- package/dist/sync/child-process-sync-worker-env.test.js.map +1 -0
- package/dist/sync/child-process-sync-worker-errors.test.d.ts +2 -0
- package/dist/sync/child-process-sync-worker-errors.test.d.ts.map +1 -0
- package/dist/sync/child-process-sync-worker-errors.test.js +121 -0
- package/dist/sync/child-process-sync-worker-errors.test.js.map +1 -0
- package/dist/sync/child-process-sync-worker.test.d.ts +2 -0
- package/dist/sync/child-process-sync-worker.test.d.ts.map +1 -0
- package/dist/sync/child-process-sync-worker.test.js +279 -0
- package/dist/sync/child-process-sync-worker.test.js.map +1 -0
- package/dist/sync/content-hash.test.d.ts +2 -0
- package/dist/sync/content-hash.test.d.ts.map +1 -0
- package/dist/sync/content-hash.test.js +16 -0
- package/dist/sync/content-hash.test.js.map +1 -0
- package/dist/sync/delta-client.test.d.ts +2 -0
- package/dist/sync/delta-client.test.d.ts.map +1 -0
- package/dist/sync/delta-client.test.js +97 -0
- package/dist/sync/delta-client.test.js.map +1 -0
- package/dist/sync/durable-apply.test.d.ts +2 -0
- package/dist/sync/durable-apply.test.d.ts.map +1 -0
- package/dist/sync/durable-apply.test.js +187 -0
- package/dist/sync/durable-apply.test.js.map +1 -0
- package/dist/sync/event-sync.test.d.ts +14 -0
- package/dist/sync/event-sync.test.d.ts.map +1 -0
- package/dist/sync/event-sync.test.js +1717 -0
- package/dist/sync/event-sync.test.js.map +1 -0
- package/dist/sync/feature-flags.test.d.ts +24 -0
- package/dist/sync/feature-flags.test.d.ts.map +1 -0
- package/dist/sync/feature-flags.test.js +594 -0
- package/dist/sync/feature-flags.test.js.map +1 -0
- package/dist/sync/fsync-compat.test.d.ts +2 -0
- package/dist/sync/fsync-compat.test.d.ts.map +1 -0
- package/dist/sync/fsync-compat.test.js +52 -0
- package/dist/sync/fsync-compat.test.js.map +1 -0
- package/dist/sync/full-pass-cap-governor.bench.test.d.ts +2 -0
- package/dist/sync/full-pass-cap-governor.bench.test.d.ts.map +1 -0
- package/dist/sync/full-pass-cap-governor.bench.test.js +179 -0
- package/dist/sync/full-pass-cap-governor.bench.test.js.map +1 -0
- package/dist/sync/full-pass-caps.test.d.ts +2 -0
- package/dist/sync/full-pass-caps.test.d.ts.map +1 -0
- package/dist/sync/full-pass-caps.test.js +550 -0
- package/dist/sync/full-pass-caps.test.js.map +1 -0
- package/dist/sync/idle-full-reconcile.test.d.ts +2 -0
- package/dist/sync/idle-full-reconcile.test.d.ts.map +1 -0
- package/dist/sync/idle-full-reconcile.test.js +62 -0
- package/dist/sync/idle-full-reconcile.test.js.map +1 -0
- package/dist/sync/inbound-event-admission.test.d.ts +2 -0
- package/dist/sync/inbound-event-admission.test.d.ts.map +1 -0
- package/dist/sync/inbound-event-admission.test.js +128 -0
- package/dist/sync/inbound-event-admission.test.js.map +1 -0
- package/dist/sync/journal-ledger-stream.test.d.ts +12 -0
- package/dist/sync/journal-ledger-stream.test.d.ts.map +1 -0
- package/dist/sync/journal-ledger-stream.test.js +134 -0
- package/dist/sync/journal-ledger-stream.test.js.map +1 -0
- package/dist/sync/lease-client.test.d.ts +2 -0
- package/dist/sync/lease-client.test.d.ts.map +1 -0
- package/dist/sync/lease-client.test.js +119 -0
- package/dist/sync/lease-client.test.js.map +1 -0
- package/dist/sync/logger.test.d.ts +19 -0
- package/dist/sync/logger.test.d.ts.map +1 -0
- package/dist/sync/logger.test.js +204 -0
- package/dist/sync/logger.test.js.map +1 -0
- package/dist/sync/metrics.test.d.ts +19 -0
- package/dist/sync/metrics.test.d.ts.map +1 -0
- package/dist/sync/metrics.test.js +357 -0
- package/dist/sync/metrics.test.js.map +1 -0
- package/dist/sync/multipart-uploader.test.d.ts +2 -0
- package/dist/sync/multipart-uploader.test.d.ts.map +1 -0
- package/dist/sync/multipart-uploader.test.js +141 -0
- package/dist/sync/multipart-uploader.test.js.map +1 -0
- package/dist/sync/mutation-client.test.d.ts +2 -0
- package/dist/sync/mutation-client.test.d.ts.map +1 -0
- package/dist/sync/mutation-client.test.js +100 -0
- package/dist/sync/mutation-client.test.js.map +1 -0
- package/dist/sync/mutation-session.test.d.ts +2 -0
- package/dist/sync/mutation-session.test.d.ts.map +1 -0
- package/dist/sync/mutation-session.test.js +190 -0
- package/dist/sync/mutation-session.test.js.map +1 -0
- package/dist/sync/parallel-sync-coordinator.test.d.ts +2 -0
- package/dist/sync/parallel-sync-coordinator.test.d.ts.map +1 -0
- package/dist/sync/parallel-sync-coordinator.test.js +564 -0
- package/dist/sync/parallel-sync-coordinator.test.js.map +1 -0
- package/dist/sync/path-leases.test.d.ts +2 -0
- package/dist/sync/path-leases.test.d.ts.map +1 -0
- package/dist/sync/path-leases.test.js +51 -0
- package/dist/sync/path-leases.test.js.map +1 -0
- package/dist/sync/per-area-maintenance.test.d.ts +2 -0
- package/dist/sync/per-area-maintenance.test.d.ts.map +1 -0
- package/dist/sync/per-area-maintenance.test.js +100 -0
- package/dist/sync/per-area-maintenance.test.js.map +1 -0
- package/dist/sync/push-event.test.d.ts +15 -0
- package/dist/sync/push-event.test.d.ts.map +1 -0
- package/dist/sync/push-event.test.js +282 -0
- package/dist/sync/push-event.test.js.map +1 -0
- package/dist/sync/push-receiver.test.d.ts +25 -0
- package/dist/sync/push-receiver.test.d.ts.map +1 -0
- package/dist/sync/push-receiver.test.js +2851 -0
- package/dist/sync/push-receiver.test.js.map +1 -0
- package/dist/sync/push-transport.test.d.ts +2 -0
- package/dist/sync/push-transport.test.d.ts.map +1 -0
- package/dist/sync/push-transport.test.js +70 -0
- package/dist/sync/push-transport.test.js.map +1 -0
- package/dist/sync/push-walk-matchers.bench.test.d.ts +2 -0
- package/dist/sync/push-walk-matchers.bench.test.d.ts.map +1 -0
- package/dist/sync/push-walk-matchers.bench.test.js +230 -0
- package/dist/sync/push-walk-matchers.bench.test.js.map +1 -0
- package/dist/sync/realtime-network-integration.test.d.ts +2 -0
- package/dist/sync/realtime-network-integration.test.d.ts.map +1 -0
- package/dist/sync/realtime-network-integration.test.js +83 -0
- package/dist/sync/realtime-network-integration.test.js.map +1 -0
- package/dist/sync/realtime-rollout.test.d.ts +2 -0
- package/dist/sync/realtime-rollout.test.d.ts.map +1 -0
- package/dist/sync/realtime-rollout.test.js +94 -0
- package/dist/sync/realtime-rollout.test.js.map +1 -0
- package/dist/sync/realtime-telemetry.test.d.ts +2 -0
- package/dist/sync/realtime-telemetry.test.d.ts.map +1 -0
- package/dist/sync/realtime-telemetry.test.js +300 -0
- package/dist/sync/realtime-telemetry.test.js.map +1 -0
- package/dist/sync/receiver-origin-config.test.d.ts +2 -0
- package/dist/sync/receiver-origin-config.test.d.ts.map +1 -0
- package/dist/sync/receiver-origin-config.test.js +39 -0
- package/dist/sync/receiver-origin-config.test.js.map +1 -0
- package/dist/sync/reconcile-cursor.test.d.ts +2 -0
- package/dist/sync/reconcile-cursor.test.d.ts.map +1 -0
- package/dist/sync/reconcile-cursor.test.js +139 -0
- package/dist/sync/reconcile-cursor.test.js.map +1 -0
- package/dist/sync/remote-file-spool.test.d.ts +2 -0
- package/dist/sync/remote-file-spool.test.d.ts.map +1 -0
- package/dist/sync/remote-file-spool.test.js +79 -0
- package/dist/sync/remote-file-spool.test.js.map +1 -0
- package/dist/sync/scope-inventory-client.test.d.ts +2 -0
- package/dist/sync/scope-inventory-client.test.d.ts.map +1 -0
- package/dist/sync/scope-inventory-client.test.js +110 -0
- package/dist/sync/scope-inventory-client.test.js.map +1 -0
- package/dist/sync/secret-path-policy.test.d.ts +2 -0
- package/dist/sync/secret-path-policy.test.d.ts.map +1 -0
- package/dist/sync/secret-path-policy.test.js +183 -0
- package/dist/sync/secret-path-policy.test.js.map +1 -0
- package/dist/sync/snapshot-client.test.d.ts +2 -0
- package/dist/sync/snapshot-client.test.d.ts.map +1 -0
- package/dist/sync/snapshot-client.test.js +169 -0
- package/dist/sync/snapshot-client.test.js.map +1 -0
- package/dist/sync/state-store.test.d.ts +2 -0
- package/dist/sync/state-store.test.d.ts.map +1 -0
- package/dist/sync/state-store.test.js +1556 -0
- package/dist/sync/state-store.test.js.map +1 -0
- package/dist/sync/sync-contract.test.d.ts +2 -0
- package/dist/sync/sync-contract.test.d.ts.map +1 -0
- package/dist/sync/sync-contract.test.js +141 -0
- package/dist/sync/sync-contract.test.js.map +1 -0
- package/dist/sync/targeted-pull-prefixes.test.d.ts +2 -0
- package/dist/sync/targeted-pull-prefixes.test.d.ts.map +1 -0
- package/dist/sync/targeted-pull-prefixes.test.js +33 -0
- package/dist/sync/targeted-pull-prefixes.test.js.map +1 -0
- package/dist/sync/targeted-upsert-exact-list.test.d.ts +2 -0
- package/dist/sync/targeted-upsert-exact-list.test.d.ts.map +1 -0
- package/dist/sync/targeted-upsert-exact-list.test.js +247 -0
- package/dist/sync/targeted-upsert-exact-list.test.js.map +1 -0
- package/dist/sync/unchanged-push-events.test.d.ts +2 -0
- package/dist/sync/unchanged-push-events.test.d.ts.map +1 -0
- package/dist/sync/unchanged-push-events.test.js +76 -0
- package/dist/sync/unchanged-push-events.test.js.map +1 -0
- package/dist/sync/uploader-finalization.test.d.ts +2 -0
- package/dist/sync/uploader-finalization.test.d.ts.map +1 -0
- package/dist/sync/uploader-finalization.test.js +107 -0
- package/dist/sync/uploader-finalization.test.js.map +1 -0
- package/dist/sync-core.test.d.ts +2 -0
- package/dist/sync-core.test.d.ts.map +1 -0
- package/dist/sync-core.test.js +189 -0
- package/dist/sync-core.test.js.map +1 -0
- package/dist/sync-progress.test.d.ts +2 -0
- package/dist/sync-progress.test.d.ts.map +1 -0
- package/dist/sync-progress.test.js +277 -0
- package/dist/sync-progress.test.js.map +1 -0
- package/dist/telemetry-events.test.d.ts +2 -0
- package/dist/telemetry-events.test.d.ts.map +1 -0
- package/dist/telemetry-events.test.js +113 -0
- package/dist/telemetry-events.test.js.map +1 -0
- package/dist/telemetry.test.d.ts +11 -0
- package/dist/telemetry.test.d.ts.map +1 -0
- package/dist/telemetry.test.js +1603 -0
- package/dist/telemetry.test.js.map +1 -0
- package/dist/vault-client.test.d.ts +7 -0
- package/dist/vault-client.test.d.ts.map +1 -0
- package/dist/vault-client.test.js +1334 -0
- package/dist/vault-client.test.js.map +1 -0
- package/dist/watch-coverage.test.d.ts +2 -0
- package/dist/watch-coverage.test.d.ts.map +1 -0
- package/dist/watch-coverage.test.js +56 -0
- package/dist/watch-coverage.test.js.map +1 -0
- package/dist/watch-owner-lease.test.d.ts +2 -0
- package/dist/watch-owner-lease.test.d.ts.map +1 -0
- package/dist/watch-owner-lease.test.js +364 -0
- package/dist/watch-owner-lease.test.js.map +1 -0
- package/dist/watch-parent.test.d.ts +2 -0
- package/dist/watch-parent.test.d.ts.map +1 -0
- package/dist/watch-parent.test.js +131 -0
- package/dist/watch-parent.test.js.map +1 -0
- package/dist/watch-roots.test.d.ts +18 -0
- package/dist/watch-roots.test.d.ts.map +1 -0
- package/dist/watch-roots.test.js +395 -0
- package/dist/watch-roots.test.js.map +1 -0
- package/dist/watcher-continuity-hot-path.test.d.ts +2 -0
- package/dist/watcher-continuity-hot-path.test.d.ts.map +1 -0
- package/dist/watcher-continuity-hot-path.test.js +40 -0
- package/dist/watcher-continuity-hot-path.test.js.map +1 -0
- package/dist/watcher-event-gate.test.d.ts +16 -0
- package/dist/watcher-event-gate.test.d.ts.map +1 -0
- package/dist/watcher-event-gate.test.js +191 -0
- package/dist/watcher-event-gate.test.js.map +1 -0
- package/dist/watcher-replan-sweep.test.d.ts +2 -0
- package/dist/watcher-replan-sweep.test.d.ts.map +1 -0
- package/dist/watcher-replan-sweep.test.js +260 -0
- package/dist/watcher-replan-sweep.test.js.map +1 -0
- package/dist/watcher-stdout.test.d.ts +2 -0
- package/dist/watcher-stdout.test.d.ts.map +1 -0
- package/dist/watcher-stdout.test.js +86 -0
- package/dist/watcher-stdout.test.js.map +1 -0
- package/dist/watcher.test.d.ts +2 -0
- package/dist/watcher.test.d.ts.map +1 -0
- package/dist/watcher.test.js +4329 -0
- package/dist/watcher.test.js.map +1 -0
- package/dist/watcher.warmup-cancel.test.d.ts +2 -0
- package/dist/watcher.warmup-cancel.test.d.ts.map +1 -0
- package/dist/watcher.warmup-cancel.test.js +59 -0
- package/dist/watcher.warmup-cancel.test.js.map +1 -0
- package/dist/watcher.warmup-responsive.test.d.ts +2 -0
- package/dist/watcher.warmup-responsive.test.d.ts.map +1 -0
- package/dist/watcher.warmup-responsive.test.js +62 -0
- package/dist/watcher.warmup-responsive.test.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for the `outposts` command tree.
|
|
3
|
+
*
|
|
4
|
+
* Drives real Commander parses and spies on global `fetch`, asserting the
|
|
5
|
+
* `/outpost/*` request shape (method + path + query + body) plus the guards that
|
|
6
|
+
* matter: the destroy confirmation, the paid-provision gate, the teardown-incomplete
|
|
7
|
+
* retry, the per-person cap, the two 402 billing remediations, and the Lightsail
|
|
8
|
+
* SSH fallback.
|
|
9
|
+
*
|
|
10
|
+
* Ported from hq-cli when this surface moved into hq-cloud. The host seams the CLI
|
|
11
|
+
* used to own — token resolution and the cached session read — arrive through
|
|
12
|
+
* `OutpostsCommandDeps` here, so these tests inject them directly instead of
|
|
13
|
+
* module-mocking the CLI's internals.
|
|
14
|
+
*
|
|
15
|
+
* Outposts are caller-scoped, so there is no company resolution to mock.
|
|
16
|
+
*/
|
|
17
|
+
import { Command } from "commander";
|
|
18
|
+
import { afterEach, beforeEach, describe, expect, it, vi, } from "vitest";
|
|
19
|
+
// The SSH fallback shells out to `ssh` via spawnSync — stub it so tests don't
|
|
20
|
+
// touch a real box or need the ssh binary.
|
|
21
|
+
vi.mock("node:child_process", async (importOriginal) => {
|
|
22
|
+
const original = await importOriginal();
|
|
23
|
+
return { ...original, spawnSync: vi.fn() };
|
|
24
|
+
});
|
|
25
|
+
// The terminal subcommand hands the TTY to session-manager-plugin — stub the
|
|
26
|
+
// launcher (everything else in ./terminal.js stays real, incl. the retry loop).
|
|
27
|
+
const launchSessionManagerPlugin = vi.hoisted(() => vi.fn());
|
|
28
|
+
vi.mock("./terminal.js", async (importOriginal) => {
|
|
29
|
+
const original = await importOriginal();
|
|
30
|
+
return { ...original, launchSessionManagerPlugin };
|
|
31
|
+
});
|
|
32
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
33
|
+
import * as fs from "node:fs";
|
|
34
|
+
import * as path from "node:path";
|
|
35
|
+
import { OutpostsClient } from "./client.js";
|
|
36
|
+
import { registerOutpostsCommand } from "./command.js";
|
|
37
|
+
import { joinCommandParts, withRemoteHqDir, withRemoteRoot } from "./remote-command.js";
|
|
38
|
+
import { createOutpostTransport } from "./transport.js";
|
|
39
|
+
const mockSpawnSync = vi.mocked(spawnSync);
|
|
40
|
+
const TEST_API_URL = "https://hqapi.test.invalid";
|
|
41
|
+
function jsonResponse(status, body) {
|
|
42
|
+
return new Response(JSON.stringify(body), {
|
|
43
|
+
status,
|
|
44
|
+
headers: { "Content-Type": "application/json" },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function mockExecFlow(result, submission = {}) {
|
|
48
|
+
const commandId = String(result.commandId ?? submission.commandId ?? "cmd-test");
|
|
49
|
+
const outpostId = String(result.outpostId ?? submission.outpostId ?? "primary");
|
|
50
|
+
fetchSpy
|
|
51
|
+
.mockResolvedValueOnce(jsonResponse(202, {
|
|
52
|
+
ok: true,
|
|
53
|
+
userId: "u",
|
|
54
|
+
outpostId,
|
|
55
|
+
instanceId: "i-abc",
|
|
56
|
+
commandId,
|
|
57
|
+
outputPrefix: "prefix",
|
|
58
|
+
executionTimeoutSeconds: 172800,
|
|
59
|
+
...submission,
|
|
60
|
+
}))
|
|
61
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
62
|
+
ok: true,
|
|
63
|
+
userId: "u",
|
|
64
|
+
outpostId,
|
|
65
|
+
status: "Success",
|
|
66
|
+
done: true,
|
|
67
|
+
exitCode: 0,
|
|
68
|
+
stdout: "",
|
|
69
|
+
stderr: "",
|
|
70
|
+
truncated: false,
|
|
71
|
+
...result,
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
let fetchSpy;
|
|
75
|
+
let exitSpy;
|
|
76
|
+
let logSpy;
|
|
77
|
+
beforeEach(() => {
|
|
78
|
+
vi.clearAllMocks();
|
|
79
|
+
fetchSpy = vi.spyOn(globalThis, "fetch");
|
|
80
|
+
exitSpy = vi
|
|
81
|
+
.spyOn(process, "exit")
|
|
82
|
+
.mockImplementation((code) => {
|
|
83
|
+
throw new Error(`process.exit(${code})`);
|
|
84
|
+
});
|
|
85
|
+
logSpy = vi.spyOn(console, "log").mockImplementation(() => { });
|
|
86
|
+
vi.spyOn(console, "error").mockImplementation(() => { });
|
|
87
|
+
});
|
|
88
|
+
afterEach(() => {
|
|
89
|
+
vi.restoreAllMocks();
|
|
90
|
+
});
|
|
91
|
+
function testTransport() {
|
|
92
|
+
return createOutpostTransport({ baseUrl: TEST_API_URL });
|
|
93
|
+
}
|
|
94
|
+
function testDeps(overrides = {}) {
|
|
95
|
+
return {
|
|
96
|
+
transport: testTransport(),
|
|
97
|
+
getToken: async () => "test-token",
|
|
98
|
+
// Provision sends the cached refresh token to the box; stub the session read
|
|
99
|
+
// so tests never need a real login on disk.
|
|
100
|
+
loadCachedTokens: () => ({ refreshToken: "rt_test" }),
|
|
101
|
+
resolveCallerPersonUid: async () => "prs_test",
|
|
102
|
+
defaultApiBaseUrl: TEST_API_URL,
|
|
103
|
+
...overrides,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function buildProgram(overrides = {}) {
|
|
107
|
+
const program = new Command();
|
|
108
|
+
program.name("hq").exitOverride();
|
|
109
|
+
registerOutpostsCommand(program, testDeps(overrides));
|
|
110
|
+
return program;
|
|
111
|
+
}
|
|
112
|
+
async function run(args, overrides = {}) {
|
|
113
|
+
await buildProgram(overrides).parseAsync(["node", "hq", ...args]);
|
|
114
|
+
}
|
|
115
|
+
describe("outposts list", () => {
|
|
116
|
+
it("GETs /outpost/list", async () => {
|
|
117
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, {
|
|
118
|
+
outposts: [
|
|
119
|
+
{
|
|
120
|
+
outpostId: "primary",
|
|
121
|
+
state: "running",
|
|
122
|
+
instanceName: "outpost-abc",
|
|
123
|
+
region: "us-east-1",
|
|
124
|
+
agentRuntime: "claude",
|
|
125
|
+
platform: "ec2",
|
|
126
|
+
createdAt: "2026-01-01T00:00:00Z",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
}));
|
|
130
|
+
await run(["outposts", "list"]);
|
|
131
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
132
|
+
expect(String(url)).toContain("/outpost/list");
|
|
133
|
+
expect(init?.method ?? "GET").toBe("GET");
|
|
134
|
+
});
|
|
135
|
+
it("sends the resolved bearer token", async () => {
|
|
136
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { outposts: [] }));
|
|
137
|
+
await run(["outposts", "list"]);
|
|
138
|
+
const headers = fetchSpy.mock.calls[0][1]?.headers;
|
|
139
|
+
expect(headers.Authorization).toBe("Bearer test-token");
|
|
140
|
+
});
|
|
141
|
+
it("re-resolves the token per command so a refreshed session is picked up", async () => {
|
|
142
|
+
// The CLI passes `ensureCognitoToken`, which returns a NEW token once the old
|
|
143
|
+
// one nears expiry. Pinning the token at construction would send a stale one.
|
|
144
|
+
let calls = 0;
|
|
145
|
+
// A fresh Response per call — a Response body can only be read once, so a
|
|
146
|
+
// single reused object would fail the second command's `.json()`.
|
|
147
|
+
fetchSpy.mockImplementation(async () => jsonResponse(200, { outposts: [] }));
|
|
148
|
+
const deps = { getToken: async () => `token-${++calls}` };
|
|
149
|
+
await run(["outposts", "list"], deps);
|
|
150
|
+
await run(["outposts", "list"], deps);
|
|
151
|
+
const sent = fetchSpy.mock.calls.map(([, init]) => (init?.headers).Authorization);
|
|
152
|
+
expect(sent).toEqual(["Bearer token-1", "Bearer token-2"]);
|
|
153
|
+
});
|
|
154
|
+
it("emits raw JSON with --json", async () => {
|
|
155
|
+
const stdoutSpy = vi
|
|
156
|
+
.spyOn(process.stdout, "write")
|
|
157
|
+
.mockImplementation(() => true);
|
|
158
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { outposts: [] }));
|
|
159
|
+
await run(["outposts", "list", "--json"]);
|
|
160
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("\n");
|
|
161
|
+
expect(printed).toContain("[]");
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
describe("outposts status", () => {
|
|
165
|
+
it("GETs /outpost/status with the --id query param", async () => {
|
|
166
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { state: "running" }));
|
|
167
|
+
await run(["outposts", "status", "--id", "2"]);
|
|
168
|
+
const url = String(fetchSpy.mock.calls[0][0]);
|
|
169
|
+
expect(url).toContain("/outpost/status");
|
|
170
|
+
expect(url).toContain("outpostId=2");
|
|
171
|
+
});
|
|
172
|
+
it("omits outpostId when --id is not given", async () => {
|
|
173
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { state: "running" }));
|
|
174
|
+
await run(["outposts", "status"]);
|
|
175
|
+
expect(String(fetchSpy.mock.calls[0][0])).not.toContain("outpostId=");
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe("outposts codex-enable / login", () => {
|
|
179
|
+
it("POSTs /outpost/codex/enable", async () => {
|
|
180
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true }));
|
|
181
|
+
await run(["outposts", "codex-enable"]);
|
|
182
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
183
|
+
expect(String(url)).toContain("/outpost/codex/enable");
|
|
184
|
+
expect(init?.method).toBe("POST");
|
|
185
|
+
});
|
|
186
|
+
it("POSTs /outpost/regenerate-login-url", async () => {
|
|
187
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true }));
|
|
188
|
+
await run(["outposts", "login"]);
|
|
189
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
190
|
+
expect(String(url)).toContain("/outpost/regenerate-login-url");
|
|
191
|
+
expect(init?.method).toBe("POST");
|
|
192
|
+
});
|
|
193
|
+
it("login-code POSTs /outpost/login-code with the code in the body", async () => {
|
|
194
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true, userId: "u1" }));
|
|
195
|
+
await run(["outposts", "login-code", "ABC-123"]);
|
|
196
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
197
|
+
expect(String(url)).toContain("/outpost/login-code");
|
|
198
|
+
expect(init?.method).toBe("POST");
|
|
199
|
+
expect(JSON.parse(String(init?.body))).toEqual({ code: "ABC-123" });
|
|
200
|
+
});
|
|
201
|
+
it("login-code targets a specific box via --id (outpostId query)", async () => {
|
|
202
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true, userId: "u1" }));
|
|
203
|
+
await run(["outposts", "login-code", "CODE", "--id", "3"]);
|
|
204
|
+
const [url] = fetchSpy.mock.calls[0];
|
|
205
|
+
expect(String(url)).toContain("outpostId=3");
|
|
206
|
+
});
|
|
207
|
+
it("login-code trims whitespace and refuses an empty code without calling the API", async () => {
|
|
208
|
+
await expect(run(["outposts", "login-code", " "])).rejects.toThrow("process.exit(1)");
|
|
209
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
210
|
+
});
|
|
211
|
+
it("login-code surfaces an awaiting-login not-found error", async () => {
|
|
212
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(404, {
|
|
213
|
+
error: true,
|
|
214
|
+
step: "not-found",
|
|
215
|
+
message: "no outpost",
|
|
216
|
+
}));
|
|
217
|
+
await expect(run(["outposts", "login-code", "CODE"])).rejects.toThrow("process.exit(1)");
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
describe("outposts destroy", () => {
|
|
221
|
+
it("refuses without --yes and does not call the API", async () => {
|
|
222
|
+
await expect(run(["outposts", "destroy"])).rejects.toThrow("process.exit(1)");
|
|
223
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
224
|
+
});
|
|
225
|
+
it("POSTs /outpost/destroy with --yes", async () => {
|
|
226
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true, userId: "u1" }));
|
|
227
|
+
await run(["outposts", "destroy", "--yes"]);
|
|
228
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
229
|
+
expect(String(url)).toContain("/outpost/destroy");
|
|
230
|
+
expect(init?.method).toBe("POST");
|
|
231
|
+
});
|
|
232
|
+
it("treats a 409 teardown-incomplete as retryable (no exit)", async () => {
|
|
233
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(409, { error: true, step: "teardown-incomplete" }));
|
|
234
|
+
await run(["outposts", "destroy", "--id", "2", "--yes"]);
|
|
235
|
+
const printed = logSpy.mock.calls.map((c) => String(c[0])).join("\n");
|
|
236
|
+
expect(printed).toMatch(/still in progress/i);
|
|
237
|
+
expect(exitSpy).not.toHaveBeenCalled();
|
|
238
|
+
});
|
|
239
|
+
it("exits 1 on a genuine failure", async () => {
|
|
240
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(500, { error: "boom", step: "teardown" }));
|
|
241
|
+
await expect(run(["outposts", "destroy", "--yes"])).rejects.toThrow("process.exit(1)");
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
describe("outposts provision (billing gate)", () => {
|
|
245
|
+
it("refuses without --yes, prints the cost, and makes NO API call", async () => {
|
|
246
|
+
const errSpy = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
247
|
+
await expect(run(["outposts", "provision"])).rejects.toThrow("process.exit(1)");
|
|
248
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
249
|
+
const printed = errSpy.mock.calls
|
|
250
|
+
.map((c) => c.map(String).join(" "))
|
|
251
|
+
.join("\n");
|
|
252
|
+
expect(printed).toMatch(/\$80\.00\/month/);
|
|
253
|
+
});
|
|
254
|
+
it("POSTs /outpost/provision with the refresh token when --yes", async () => {
|
|
255
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true }));
|
|
256
|
+
await run(["outposts", "provision", "--runtime", "codex", "--yes"]);
|
|
257
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
258
|
+
expect(String(url)).toContain("/outpost/provision");
|
|
259
|
+
expect(init?.method).toBe("POST");
|
|
260
|
+
const sent = JSON.parse(init?.body);
|
|
261
|
+
expect(sent.refreshToken).toBe("rt_test");
|
|
262
|
+
expect(sent.agentRuntime).toBe("codex");
|
|
263
|
+
});
|
|
264
|
+
it("exits without provisioning when there is no cached session", async () => {
|
|
265
|
+
await expect(run(["outposts", "provision", "--yes"], {
|
|
266
|
+
loadCachedTokens: () => undefined,
|
|
267
|
+
})).rejects.toThrow("process.exit(1)");
|
|
268
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
269
|
+
});
|
|
270
|
+
it("rejects an unknown --runtime before the charge gate and makes NO API call", async () => {
|
|
271
|
+
const errSpy = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
272
|
+
await expect(run(["outposts", "provision", "--runtime", "codx", "--yes"])).rejects.toThrow("process.exit(1)");
|
|
273
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
274
|
+
const printed = errSpy.mock.calls
|
|
275
|
+
.map((c) => c.map(String).join(" "))
|
|
276
|
+
.join("\n");
|
|
277
|
+
// A typo'd runtime must not silently resolve to claude — codex is the whole
|
|
278
|
+
// point of the flag, so a near-miss has to name itself.
|
|
279
|
+
expect(printed).toContain("codx");
|
|
280
|
+
expect(printed).toMatch(/claude/);
|
|
281
|
+
expect(printed).toMatch(/codex/);
|
|
282
|
+
});
|
|
283
|
+
it("accepts an explicit --runtime claude", async () => {
|
|
284
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ok: true }));
|
|
285
|
+
await run(["outposts", "provision", "--runtime", "claude", "--yes"]);
|
|
286
|
+
const sent = JSON.parse(fetchSpy.mock.calls[0][1]?.body);
|
|
287
|
+
expect(sent.agentRuntime).toBe("claude");
|
|
288
|
+
});
|
|
289
|
+
it("explains the per-person cap on a 409 rather than printing a bare 'Conflict'", async () => {
|
|
290
|
+
const errSpy = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
291
|
+
// hq-pro's cap body carries `capped`/`limit`/`outposts` and NO
|
|
292
|
+
// `message`/`error` field, so the generic decoder falls through to
|
|
293
|
+
// res.statusText — the operator sees only "Conflict".
|
|
294
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(409, {
|
|
295
|
+
capped: true,
|
|
296
|
+
userId: "user_test_123",
|
|
297
|
+
limit: 1,
|
|
298
|
+
outposts: [
|
|
299
|
+
{
|
|
300
|
+
outpostId: "primary",
|
|
301
|
+
state: "ready",
|
|
302
|
+
instanceName: "outpost-user_test_123",
|
|
303
|
+
region: "us-east-1",
|
|
304
|
+
agentRuntime: "claude",
|
|
305
|
+
platform: "ec2",
|
|
306
|
+
createdAt: "2026-07-01T00:00:00.000Z",
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
}));
|
|
310
|
+
await expect(run(["outposts", "provision", "--yes"])).rejects.toThrow("process.exit(1)");
|
|
311
|
+
const printed = errSpy.mock.calls
|
|
312
|
+
.map((c) => c.map(String).join(" "))
|
|
313
|
+
.join("\n");
|
|
314
|
+
expect(printed).not.toMatch(/^Conflict$/m);
|
|
315
|
+
expect(printed).toMatch(/limit/i);
|
|
316
|
+
// Name the box they already own, and reassure on the charge they were just
|
|
317
|
+
// warned about — the cap is checked BEFORE activation billing.
|
|
318
|
+
expect(printed).toContain("primary");
|
|
319
|
+
expect(printed).toMatch(/not been charged/i);
|
|
320
|
+
});
|
|
321
|
+
it("mints a card-capture link on 402 billing_required and exits 1", async () => {
|
|
322
|
+
fetchSpy
|
|
323
|
+
.mockResolvedValueOnce(jsonResponse(402, {
|
|
324
|
+
error: "payment required",
|
|
325
|
+
billing: {
|
|
326
|
+
status: "billing_required",
|
|
327
|
+
setup: {
|
|
328
|
+
payerType: "person",
|
|
329
|
+
path: "/v1/billing/checkout/person",
|
|
330
|
+
method: "POST",
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
}))
|
|
334
|
+
.mockResolvedValueOnce(jsonResponse(200, { url: "https://checkout.stripe.com/outpost" }));
|
|
335
|
+
await expect(run(["outposts", "provision", "--yes"])).rejects.toThrow("process.exit(1)");
|
|
336
|
+
expect(String(fetchSpy.mock.calls[1][0])).toContain("/v1/billing/checkout/person");
|
|
337
|
+
const printed = logSpy.mock.calls.map((c) => String(c[0])).join("\n");
|
|
338
|
+
expect(printed).toContain("https://checkout.stripe.com/outpost");
|
|
339
|
+
});
|
|
340
|
+
it("surfaces the DECLINE reason on 402 payment_failed — never the 'No card on file' copy", async () => {
|
|
341
|
+
const errSpy = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
342
|
+
// hq-pro's payment_failed envelope: a card EXISTS and was declined. The
|
|
343
|
+
// server's `message` carries the friendly decline copy; telling this user
|
|
344
|
+
// "No card on file" sends them down the wrong remediation path entirely.
|
|
345
|
+
fetchSpy
|
|
346
|
+
.mockResolvedValueOnce(jsonResponse(402, {
|
|
347
|
+
error: "payment required",
|
|
348
|
+
message: "Your card was declined. Try a different card or contact your bank.",
|
|
349
|
+
billing: {
|
|
350
|
+
status: "payment_failed",
|
|
351
|
+
setup: {
|
|
352
|
+
payerType: "person",
|
|
353
|
+
path: "/v1/billing/checkout/person",
|
|
354
|
+
method: "POST",
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
}))
|
|
358
|
+
.mockResolvedValueOnce(jsonResponse(200, { url: "https://checkout.stripe.com/update-card" }));
|
|
359
|
+
await expect(run(["outposts", "provision", "--yes"])).rejects.toThrow("process.exit(1)");
|
|
360
|
+
const printed = [...errSpy.mock.calls, ...logSpy.mock.calls]
|
|
361
|
+
.map((c) => c.map(String).join(" "))
|
|
362
|
+
.join("\n");
|
|
363
|
+
expect(printed).toContain("declined");
|
|
364
|
+
expect(printed).not.toContain("No card on file");
|
|
365
|
+
// The card-capture link still surfaces — as the way to UPDATE the card.
|
|
366
|
+
expect(printed).toContain("https://checkout.stripe.com/update-card");
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
describe("outposts exec", () => {
|
|
370
|
+
afterEach(() => {
|
|
371
|
+
process.exitCode = undefined;
|
|
372
|
+
});
|
|
373
|
+
it("wraps the command to run from the box's HQ folder, then runs it", () => {
|
|
374
|
+
const wrapped = withRemoteHqDir("pwd");
|
|
375
|
+
// SSM may invoke the command as root with HOME unset. Seed a real home so
|
|
376
|
+
// tools such as gh do not write machine state into the HQ checkout.
|
|
377
|
+
expect(wrapped).toContain('export HOME="${HOME:-/root}"');
|
|
378
|
+
// cd into $HOME/hq (SSH/login user) …
|
|
379
|
+
expect(wrapped).toContain('cd "$HOME/hq"');
|
|
380
|
+
// … falling back to ec2-user's home for the SSM/root path (no $HOME) …
|
|
381
|
+
expect(wrapped).toContain("cd ~ec2-user/hq");
|
|
382
|
+
// … never failing merely because the box has no HQ folder …
|
|
383
|
+
expect(wrapped).toContain("|| true");
|
|
384
|
+
// … and the caller's command still runs after the cd.
|
|
385
|
+
expect(wrapped.endsWith("; pwd")).toBe(true);
|
|
386
|
+
});
|
|
387
|
+
it("submits a long-running command, polls its result, and propagates output and exit code", async () => {
|
|
388
|
+
const stdoutSpy = vi
|
|
389
|
+
.spyOn(process.stdout, "write")
|
|
390
|
+
.mockImplementation(() => true);
|
|
391
|
+
const stderrSpy = vi
|
|
392
|
+
.spyOn(process.stderr, "write")
|
|
393
|
+
.mockImplementation(() => true);
|
|
394
|
+
fetchSpy
|
|
395
|
+
.mockResolvedValueOnce(jsonResponse(202, {
|
|
396
|
+
ok: true,
|
|
397
|
+
outpostId: "primary",
|
|
398
|
+
instanceId: "i-abc",
|
|
399
|
+
commandId: "cmd-long",
|
|
400
|
+
outputPrefix: "prefix",
|
|
401
|
+
executionTimeoutSeconds: 172800,
|
|
402
|
+
}))
|
|
403
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
404
|
+
ok: true,
|
|
405
|
+
outpostId: "primary",
|
|
406
|
+
status: "Success",
|
|
407
|
+
done: true,
|
|
408
|
+
exitCode: 0,
|
|
409
|
+
stdout: "finished after 18 seconds\n",
|
|
410
|
+
stderr: "",
|
|
411
|
+
}));
|
|
412
|
+
await run(["outposts", "exec", "sleep", "19"]);
|
|
413
|
+
expect(fetchSpy).toHaveBeenCalledTimes(2);
|
|
414
|
+
expect(JSON.parse(fetchSpy.mock.calls[0][1]?.body)).toEqual({
|
|
415
|
+
mode: "submit",
|
|
416
|
+
command: withRemoteHqDir("'sleep' '19'"),
|
|
417
|
+
runAsRoot: false,
|
|
418
|
+
});
|
|
419
|
+
expect(JSON.parse(fetchSpy.mock.calls[1][1]?.body)).toEqual({
|
|
420
|
+
mode: "result",
|
|
421
|
+
commandId: "cmd-long",
|
|
422
|
+
});
|
|
423
|
+
expect(stdoutSpy.mock.calls.map((call) => String(call[0])).join(""))
|
|
424
|
+
.toContain("finished after 18 seconds\n");
|
|
425
|
+
expect(stderrSpy).toHaveBeenCalledTimes(0);
|
|
426
|
+
expect(process.exitCode).toBe(0);
|
|
427
|
+
});
|
|
428
|
+
it("reports the command id and retrieval command after bounded result-poll 5xx retries", async () => {
|
|
429
|
+
vi.useFakeTimers();
|
|
430
|
+
try {
|
|
431
|
+
const errorSpy = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
432
|
+
fetchSpy
|
|
433
|
+
.mockResolvedValueOnce(jsonResponse(202, {
|
|
434
|
+
ok: true,
|
|
435
|
+
outpostId: "primary",
|
|
436
|
+
instanceId: "i-abc",
|
|
437
|
+
commandId: "cmd-retry",
|
|
438
|
+
outputPrefix: "prefix",
|
|
439
|
+
executionTimeoutSeconds: 172800,
|
|
440
|
+
}))
|
|
441
|
+
.mockImplementation(async () => jsonResponse(503, { error: "temporary" }));
|
|
442
|
+
const pending = run(["outposts", "exec", "--id", "box one", "sleep", "19"]);
|
|
443
|
+
const settled = pending.then(() => ({ error: undefined }), (error) => ({ error }));
|
|
444
|
+
await vi.advanceTimersByTimeAsync(500);
|
|
445
|
+
await vi.advanceTimersByTimeAsync(1000);
|
|
446
|
+
await vi.advanceTimersByTimeAsync(2000);
|
|
447
|
+
await vi.advanceTimersByTimeAsync(4000);
|
|
448
|
+
const { error } = await settled;
|
|
449
|
+
expect(error).toMatchObject({ message: "process.exit(1)" });
|
|
450
|
+
expect(fetchSpy).toHaveBeenCalledTimes(5);
|
|
451
|
+
expect(errorSpy.mock.calls.map((call) => call.map(String).join(" ")).join("\n"))
|
|
452
|
+
.toContain("hq outposts exec-result --command-id 'cmd-retry' --id 'box one' --wait");
|
|
453
|
+
}
|
|
454
|
+
finally {
|
|
455
|
+
vi.useRealTimers();
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
it("prints a fetch command when the local wait timeout expires", async () => {
|
|
459
|
+
vi.useFakeTimers();
|
|
460
|
+
try {
|
|
461
|
+
const errorSpy = vi.spyOn(console, "error");
|
|
462
|
+
fetchSpy.mockImplementation(async (_input, init) => {
|
|
463
|
+
const body = JSON.parse(String(init?.body));
|
|
464
|
+
if (body.mode === "submit") {
|
|
465
|
+
return jsonResponse(202, {
|
|
466
|
+
ok: true,
|
|
467
|
+
userId: "u",
|
|
468
|
+
outpostId: "box one",
|
|
469
|
+
instanceId: "i-abc",
|
|
470
|
+
commandId: "cmd-wait-expired",
|
|
471
|
+
outputPrefix: "prefix",
|
|
472
|
+
executionTimeoutSeconds: 172800,
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
return jsonResponse(200, {
|
|
476
|
+
ok: true,
|
|
477
|
+
userId: "u",
|
|
478
|
+
outpostId: "box one",
|
|
479
|
+
status: "InProgress",
|
|
480
|
+
done: false,
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
const pending = run([
|
|
484
|
+
"outposts",
|
|
485
|
+
"exec",
|
|
486
|
+
"--id",
|
|
487
|
+
"box one",
|
|
488
|
+
"--wait-timeout-seconds",
|
|
489
|
+
"1",
|
|
490
|
+
"sleep",
|
|
491
|
+
"99",
|
|
492
|
+
]);
|
|
493
|
+
const settled = pending.then(() => ({ error: undefined }), (error) => ({ error }));
|
|
494
|
+
await vi.advanceTimersByTimeAsync(1000);
|
|
495
|
+
const { error } = await settled;
|
|
496
|
+
expect(error).toMatchObject({ message: "process.exit(1)" });
|
|
497
|
+
expect(errorSpy.mock.calls.map((call) => call.map(String).join(" ")).join("\n"))
|
|
498
|
+
.toContain("hq outposts exec-result --command-id 'cmd-wait-expired' --id 'box one' --wait");
|
|
499
|
+
}
|
|
500
|
+
finally {
|
|
501
|
+
vi.useRealTimers();
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
it("propagates an asynchronous remote exit code from the normal command", async () => {
|
|
505
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
506
|
+
vi.spyOn(process.stderr, "write").mockImplementation(() => true);
|
|
507
|
+
fetchSpy
|
|
508
|
+
.mockResolvedValueOnce(jsonResponse(202, {
|
|
509
|
+
ok: true,
|
|
510
|
+
outpostId: "primary",
|
|
511
|
+
instanceId: "i-abc",
|
|
512
|
+
commandId: "cmd-failed",
|
|
513
|
+
outputPrefix: "prefix",
|
|
514
|
+
executionTimeoutSeconds: 172800,
|
|
515
|
+
}))
|
|
516
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
517
|
+
ok: true,
|
|
518
|
+
outpostId: "primary",
|
|
519
|
+
status: "Failed",
|
|
520
|
+
done: true,
|
|
521
|
+
exitCode: 7,
|
|
522
|
+
stdout: "",
|
|
523
|
+
stderr: "remote failure\\n",
|
|
524
|
+
}));
|
|
525
|
+
await run(["outposts", "exec", "exit", "7"]);
|
|
526
|
+
expect(process.exitCode).toBe(7);
|
|
527
|
+
});
|
|
528
|
+
it("POSTs /outpost/exec with the joined command and streams stdout", async () => {
|
|
529
|
+
const stdoutSpy = vi
|
|
530
|
+
.spyOn(process.stdout, "write")
|
|
531
|
+
.mockImplementation(() => true);
|
|
532
|
+
mockExecFlow({
|
|
533
|
+
commandId: "cmd-1",
|
|
534
|
+
status: "Success",
|
|
535
|
+
exitCode: 0,
|
|
536
|
+
stdout: "hello world\n",
|
|
537
|
+
});
|
|
538
|
+
await run(["outposts", "exec", "echo", "hello", "world"]);
|
|
539
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
540
|
+
expect(String(url)).toContain("/outpost/exec");
|
|
541
|
+
expect(init?.method).toBe("POST");
|
|
542
|
+
// The command is wrapped so it runs from the box's HQ folder.
|
|
543
|
+
expect(JSON.parse(init?.body)).toEqual({
|
|
544
|
+
mode: "submit",
|
|
545
|
+
command: withRemoteHqDir("'echo' 'hello' 'world'"),
|
|
546
|
+
runAsRoot: false,
|
|
547
|
+
});
|
|
548
|
+
expect(JSON.parse(fetchSpy.mock.calls[1][1]?.body)).toEqual({
|
|
549
|
+
mode: "result",
|
|
550
|
+
commandId: "cmd-1",
|
|
551
|
+
});
|
|
552
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("");
|
|
553
|
+
expect(printed).toContain("hello world\n");
|
|
554
|
+
expect(process.exitCode).toBe(0);
|
|
555
|
+
});
|
|
556
|
+
it("propagates a non-zero remote exit code", async () => {
|
|
557
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
558
|
+
vi.spyOn(process.stderr, "write").mockImplementation(() => true);
|
|
559
|
+
mockExecFlow({ commandId: "cmd-2", status: "Failed", exitCode: 2, stderr: "nope\n" });
|
|
560
|
+
await run(["outposts", "exec", "exit", "2"]);
|
|
561
|
+
expect(process.exitCode).toBe(2);
|
|
562
|
+
});
|
|
563
|
+
it("sends root execution only when --root is explicit", async () => {
|
|
564
|
+
mockExecFlow({ commandId: "cmd-root", status: "Success", exitCode: 0 });
|
|
565
|
+
await run(["outposts", "exec", "--root", "touch", "/root/maintenance"]);
|
|
566
|
+
expect(JSON.parse(fetchSpy.mock.calls[0][1]?.body)).toEqual({
|
|
567
|
+
mode: "submit",
|
|
568
|
+
command: withRemoteHqDir("'touch' '/root/maintenance'"),
|
|
569
|
+
runAsRoot: true,
|
|
570
|
+
});
|
|
571
|
+
});
|
|
572
|
+
it("exits nonzero when SSM reports a Failed status with no numeric exit code", async () => {
|
|
573
|
+
// A remote failure that SSM can't attach a code to (Failed/Cancelled with
|
|
574
|
+
// exitCode null) must NOT read as success, or `hq outposts exec` in a script
|
|
575
|
+
// silently swallows the failure.
|
|
576
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
577
|
+
vi.spyOn(process.stderr, "write").mockImplementation(() => true);
|
|
578
|
+
mockExecFlow({ commandId: "cmd-x", status: "Failed", exitCode: null });
|
|
579
|
+
await run(["outposts", "exec", "boom"]);
|
|
580
|
+
expect(process.exitCode).toBe(1);
|
|
581
|
+
});
|
|
582
|
+
it("still exits 0 on a Success status that carries no numeric code", async () => {
|
|
583
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
584
|
+
mockExecFlow({ commandId: "cmd-y", status: "Success", exitCode: null });
|
|
585
|
+
await run(["outposts", "exec", "true"]);
|
|
586
|
+
expect(process.exitCode).toBe(0);
|
|
587
|
+
});
|
|
588
|
+
it("passes --id through as the outpostId query param", async () => {
|
|
589
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
590
|
+
mockExecFlow({ commandId: "c", outpostId: "2", status: "Success", exitCode: 0 });
|
|
591
|
+
await run(["outposts", "exec", "--id", "2", "uptime"]);
|
|
592
|
+
expect(String(fetchSpy.mock.calls[0][0])).toContain("outpostId=2");
|
|
593
|
+
});
|
|
594
|
+
it("exits 1 and surfaces the server message on a non-2xx (e.g. not-ready)", async () => {
|
|
595
|
+
const errorSpy = vi.spyOn(console, "error");
|
|
596
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(409, {
|
|
597
|
+
error: true,
|
|
598
|
+
step: "not-ready",
|
|
599
|
+
message: 'outpost is "provisioning", not ready — it must be running to exec',
|
|
600
|
+
}));
|
|
601
|
+
await expect(run(["outposts", "exec", "echo", "hi"])).rejects.toThrow("process.exit(1)");
|
|
602
|
+
expect(errorSpy.mock.calls.map((call) => call.map(String).join(" ")).join("\n"))
|
|
603
|
+
.toContain('outpost is "provisioning", not ready');
|
|
604
|
+
});
|
|
605
|
+
it("emits raw JSON with --json", async () => {
|
|
606
|
+
const stdoutSpy = vi
|
|
607
|
+
.spyOn(process.stdout, "write")
|
|
608
|
+
.mockImplementation(() => true);
|
|
609
|
+
mockExecFlow({ commandId: "cmd-3", status: "Success", exitCode: 0, stdout: "x\n" });
|
|
610
|
+
await run(["outposts", "exec", "--json", "echo", "x"]);
|
|
611
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("");
|
|
612
|
+
expect(JSON.parse(printed)).toEqual({
|
|
613
|
+
ok: true,
|
|
614
|
+
outpostId: "primary",
|
|
615
|
+
instanceId: "i-abc",
|
|
616
|
+
commandId: "cmd-3",
|
|
617
|
+
status: "Success",
|
|
618
|
+
exitCode: 0,
|
|
619
|
+
stdout: "x\n",
|
|
620
|
+
stderr: "",
|
|
621
|
+
truncated: false,
|
|
622
|
+
});
|
|
623
|
+
});
|
|
624
|
+
});
|
|
625
|
+
describe("outposts exec — Lightsail SSH fallback", () => {
|
|
626
|
+
afterEach(() => {
|
|
627
|
+
process.exitCode = undefined;
|
|
628
|
+
});
|
|
629
|
+
function platformUnsupported() {
|
|
630
|
+
return jsonResponse(409, {
|
|
631
|
+
error: true,
|
|
632
|
+
step: "platform-unsupported",
|
|
633
|
+
message: "remote exec requires the EC2 platform",
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
function sshAccess() {
|
|
637
|
+
return jsonResponse(200, {
|
|
638
|
+
ok: true,
|
|
639
|
+
outpostId: "primary",
|
|
640
|
+
platform: "lightsail",
|
|
641
|
+
host: "52.2.2.2",
|
|
642
|
+
port: 22,
|
|
643
|
+
username: "ec2-user",
|
|
644
|
+
privateKey: "-----BEGIN KEY-----\nx\n-----END KEY-----\n",
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
it("falls back to SSH when the box is Lightsail, streams stdout, propagates exit", async () => {
|
|
648
|
+
const stdoutSpy = vi
|
|
649
|
+
.spyOn(process.stdout, "write")
|
|
650
|
+
.mockImplementation(() => true);
|
|
651
|
+
fetchSpy
|
|
652
|
+
.mockResolvedValueOnce(platformUnsupported()) // /outpost/exec (SSM) → 409
|
|
653
|
+
.mockResolvedValueOnce(sshAccess()); // /outpost/ssh-access → 200
|
|
654
|
+
mockSpawnSync.mockReturnValue({
|
|
655
|
+
status: 0,
|
|
656
|
+
stdout: "lightsail-out\n",
|
|
657
|
+
stderr: "",
|
|
658
|
+
signal: null,
|
|
659
|
+
output: [],
|
|
660
|
+
pid: 1,
|
|
661
|
+
});
|
|
662
|
+
// Flags meant for the remote command go after `--` (same as the SSM path).
|
|
663
|
+
await run(["outposts", "exec", "--", "uname", "-a"]);
|
|
664
|
+
// Second HTTP call is the ssh-access mint.
|
|
665
|
+
expect(String(fetchSpy.mock.calls[1][0])).toContain("/outpost/ssh-access");
|
|
666
|
+
// ssh was invoked with the box coordinates and the command as the last arg.
|
|
667
|
+
const args = mockSpawnSync.mock.calls[0][1];
|
|
668
|
+
expect(mockSpawnSync.mock.calls[0][0]).toBe("ssh");
|
|
669
|
+
expect(args).toContain("ec2-user@52.2.2.2");
|
|
670
|
+
expect(args[args.length - 1]).toBe(withRemoteHqDir("'uname' '-a'"));
|
|
671
|
+
expect(args).toContain("BatchMode=yes");
|
|
672
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("");
|
|
673
|
+
expect(printed).toContain("lightsail-out\n");
|
|
674
|
+
expect(process.exitCode).toBe(0);
|
|
675
|
+
});
|
|
676
|
+
it("uses root over the SSH fallback only when --root is explicit", async () => {
|
|
677
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
678
|
+
fetchSpy
|
|
679
|
+
.mockResolvedValueOnce(platformUnsupported())
|
|
680
|
+
.mockResolvedValueOnce(sshAccess());
|
|
681
|
+
mockSpawnSync.mockReturnValue({
|
|
682
|
+
status: 0,
|
|
683
|
+
stdout: "",
|
|
684
|
+
stderr: "",
|
|
685
|
+
signal: null,
|
|
686
|
+
output: [],
|
|
687
|
+
pid: 1,
|
|
688
|
+
});
|
|
689
|
+
await run(["outposts", "exec", "--root", "--", "uname", "-a"]);
|
|
690
|
+
const args = mockSpawnSync.mock.calls[0][1];
|
|
691
|
+
expect(args[args.length - 1]).toBe(withRemoteRoot(withRemoteHqDir("'uname' '-a'")));
|
|
692
|
+
});
|
|
693
|
+
it("propagates a non-zero SSH exit code", async () => {
|
|
694
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
695
|
+
vi.spyOn(process.stderr, "write").mockImplementation(() => true);
|
|
696
|
+
fetchSpy
|
|
697
|
+
.mockResolvedValueOnce(platformUnsupported())
|
|
698
|
+
.mockResolvedValueOnce(sshAccess());
|
|
699
|
+
mockSpawnSync.mockReturnValue({
|
|
700
|
+
status: 7,
|
|
701
|
+
stdout: "",
|
|
702
|
+
stderr: "boom\n",
|
|
703
|
+
signal: null,
|
|
704
|
+
output: [],
|
|
705
|
+
pid: 1,
|
|
706
|
+
});
|
|
707
|
+
await run(["outposts", "exec", "false"]);
|
|
708
|
+
expect(process.exitCode).toBe(7);
|
|
709
|
+
});
|
|
710
|
+
it("exits 1 with a clear message when the ssh client is missing", async () => {
|
|
711
|
+
fetchSpy
|
|
712
|
+
.mockResolvedValueOnce(platformUnsupported())
|
|
713
|
+
.mockResolvedValueOnce(sshAccess());
|
|
714
|
+
const enoent = Object.assign(new Error("spawnSync ssh ENOENT"), {
|
|
715
|
+
code: "ENOENT",
|
|
716
|
+
});
|
|
717
|
+
mockSpawnSync.mockReturnValue({
|
|
718
|
+
error: enoent,
|
|
719
|
+
status: null,
|
|
720
|
+
stdout: "",
|
|
721
|
+
stderr: "",
|
|
722
|
+
signal: null,
|
|
723
|
+
output: [],
|
|
724
|
+
pid: 0,
|
|
725
|
+
});
|
|
726
|
+
await expect(run(["outposts", "exec", "echo", "hi"])).rejects.toThrow("process.exit(1)");
|
|
727
|
+
});
|
|
728
|
+
it("does NOT fall back for a non-platform error (e.g. not-ready)", async () => {
|
|
729
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(409, {
|
|
730
|
+
error: true,
|
|
731
|
+
step: "not-ready",
|
|
732
|
+
message: "not ready",
|
|
733
|
+
}));
|
|
734
|
+
await expect(run(["outposts", "exec", "echo", "hi"])).rejects.toThrow("process.exit(1)");
|
|
735
|
+
// Only the SSM call happened; no ssh-access mint, no ssh.
|
|
736
|
+
expect(fetchSpy).toHaveBeenCalledTimes(1);
|
|
737
|
+
expect(mockSpawnSync).not.toHaveBeenCalled();
|
|
738
|
+
});
|
|
739
|
+
it("refuses --async on Lightsail instead of silently holding an SSH session", async () => {
|
|
740
|
+
// --async exists to escape the ~20s sync cap. Falling back to a live SSH hold
|
|
741
|
+
// would reintroduce exactly the timeout it was meant to avoid.
|
|
742
|
+
fetchSpy.mockResolvedValueOnce(platformUnsupported());
|
|
743
|
+
await expect(run(["outposts", "exec", "--async", "sleep", "60"])).rejects.toThrow("process.exit(1)");
|
|
744
|
+
expect(mockSpawnSync).not.toHaveBeenCalled();
|
|
745
|
+
});
|
|
746
|
+
});
|
|
747
|
+
describe("outposts exec --async / --detach", () => {
|
|
748
|
+
afterEach(() => {
|
|
749
|
+
process.exitCode = undefined;
|
|
750
|
+
});
|
|
751
|
+
it("--detach submits with HQ-dir wrapper and prints commandId without waiting", async () => {
|
|
752
|
+
const stdoutSpy = vi
|
|
753
|
+
.spyOn(process.stdout, "write")
|
|
754
|
+
.mockImplementation(() => true);
|
|
755
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, {
|
|
756
|
+
ok: true,
|
|
757
|
+
userId: "u",
|
|
758
|
+
outpostId: "3",
|
|
759
|
+
instanceId: "i-3",
|
|
760
|
+
commandId: "cmd-detach",
|
|
761
|
+
outputPrefix: "outpost-exec/u/3/n/out",
|
|
762
|
+
executionTimeoutSeconds: 172800,
|
|
763
|
+
}));
|
|
764
|
+
await run([
|
|
765
|
+
"outposts",
|
|
766
|
+
"exec",
|
|
767
|
+
"--detach",
|
|
768
|
+
"--id",
|
|
769
|
+
"3",
|
|
770
|
+
"--json",
|
|
771
|
+
"sleep",
|
|
772
|
+
"999",
|
|
773
|
+
]);
|
|
774
|
+
expect(fetchSpy).toHaveBeenCalledTimes(1);
|
|
775
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
776
|
+
expect(String(url)).toContain("/outpost/exec");
|
|
777
|
+
expect(String(url)).toContain("outpostId=3");
|
|
778
|
+
expect(JSON.parse(init?.body)).toEqual({
|
|
779
|
+
mode: "submit",
|
|
780
|
+
command: withRemoteHqDir("'sleep' '999'"),
|
|
781
|
+
runAsRoot: false,
|
|
782
|
+
});
|
|
783
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("");
|
|
784
|
+
expect(printed).toContain('"commandId":"cmd-detach"');
|
|
785
|
+
// No second poll.
|
|
786
|
+
expect(fetchSpy).toHaveBeenCalledTimes(1);
|
|
787
|
+
});
|
|
788
|
+
it("--async submits then polls until done and streams stdout", async () => {
|
|
789
|
+
const stdoutSpy = vi
|
|
790
|
+
.spyOn(process.stdout, "write")
|
|
791
|
+
.mockImplementation(() => true);
|
|
792
|
+
fetchSpy
|
|
793
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
794
|
+
ok: true,
|
|
795
|
+
userId: "u",
|
|
796
|
+
outpostId: "primary",
|
|
797
|
+
instanceId: "i",
|
|
798
|
+
commandId: "cmd-async",
|
|
799
|
+
outputPrefix: "p",
|
|
800
|
+
executionTimeoutSeconds: 7200,
|
|
801
|
+
}))
|
|
802
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
803
|
+
ok: true,
|
|
804
|
+
userId: "u",
|
|
805
|
+
outpostId: "primary",
|
|
806
|
+
status: "Success",
|
|
807
|
+
done: true,
|
|
808
|
+
exitCode: 0,
|
|
809
|
+
stdout: "finished\n",
|
|
810
|
+
stderr: "",
|
|
811
|
+
}));
|
|
812
|
+
await run([
|
|
813
|
+
"outposts",
|
|
814
|
+
"exec",
|
|
815
|
+
"--async",
|
|
816
|
+
"--timeout-seconds",
|
|
817
|
+
"7200",
|
|
818
|
+
"echo",
|
|
819
|
+
"finished",
|
|
820
|
+
]);
|
|
821
|
+
// submit + one result poll (terminal on first poll)
|
|
822
|
+
expect(fetchSpy).toHaveBeenCalledTimes(2);
|
|
823
|
+
expect(JSON.parse(fetchSpy.mock.calls[0][1]?.body)).toEqual({
|
|
824
|
+
mode: "submit",
|
|
825
|
+
command: withRemoteHqDir("'echo' 'finished'"),
|
|
826
|
+
runAsRoot: false,
|
|
827
|
+
timeoutSeconds: 7200,
|
|
828
|
+
});
|
|
829
|
+
expect(JSON.parse(fetchSpy.mock.calls[1][1]?.body)).toEqual({
|
|
830
|
+
mode: "result",
|
|
831
|
+
commandId: "cmd-async",
|
|
832
|
+
});
|
|
833
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("");
|
|
834
|
+
expect(printed).toContain("finished\n");
|
|
835
|
+
expect(process.exitCode).toBe(0);
|
|
836
|
+
});
|
|
837
|
+
it("refuses --async and --detach together", async () => {
|
|
838
|
+
await expect(run(["outposts", "exec", "--async", "--detach", "true"])).rejects.toThrow("process.exit(1)");
|
|
839
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
840
|
+
});
|
|
841
|
+
it("rejects a --timeout-seconds beyond the AWS-RunShellScript 48h ceiling", async () => {
|
|
842
|
+
await expect(run(["outposts", "exec", "--timeout-seconds", "172801", "true"])).rejects.toThrow("process.exit(1)");
|
|
843
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
844
|
+
});
|
|
845
|
+
it("exec-submit forwards --timeout-seconds", async () => {
|
|
846
|
+
const stdoutSpy = vi
|
|
847
|
+
.spyOn(process.stdout, "write")
|
|
848
|
+
.mockImplementation(() => true);
|
|
849
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, {
|
|
850
|
+
ok: true,
|
|
851
|
+
commandId: "cmd-sub",
|
|
852
|
+
executionTimeoutSeconds: 3600,
|
|
853
|
+
userId: "u",
|
|
854
|
+
outpostId: "primary",
|
|
855
|
+
instanceId: "i",
|
|
856
|
+
outputPrefix: "p",
|
|
857
|
+
}));
|
|
858
|
+
await run([
|
|
859
|
+
"outposts",
|
|
860
|
+
"exec-submit",
|
|
861
|
+
"--timeout-seconds",
|
|
862
|
+
"3600",
|
|
863
|
+
"--json",
|
|
864
|
+
"sleep",
|
|
865
|
+
"10",
|
|
866
|
+
]);
|
|
867
|
+
expect(JSON.parse(fetchSpy.mock.calls[0][1]?.body)).toEqual({
|
|
868
|
+
mode: "submit",
|
|
869
|
+
command: "'sleep' '10'",
|
|
870
|
+
runAsRoot: false,
|
|
871
|
+
timeoutSeconds: 3600,
|
|
872
|
+
});
|
|
873
|
+
const printed = stdoutSpy.mock.calls.map((c) => String(c[0])).join("");
|
|
874
|
+
expect(printed).toContain("cmd-sub");
|
|
875
|
+
});
|
|
876
|
+
it("exec-submit requires --root to submit a privileged command", async () => {
|
|
877
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, {
|
|
878
|
+
ok: true,
|
|
879
|
+
commandId: "cmd-root-sub",
|
|
880
|
+
executionTimeoutSeconds: 172800,
|
|
881
|
+
userId: "u",
|
|
882
|
+
outpostId: "primary",
|
|
883
|
+
instanceId: "i",
|
|
884
|
+
outputPrefix: "p",
|
|
885
|
+
}));
|
|
886
|
+
await run(["outposts", "exec-submit", "--root", "--json", "touch", "/root/maintenance"]);
|
|
887
|
+
expect(JSON.parse(fetchSpy.mock.calls[0][1]?.body)).toEqual({
|
|
888
|
+
mode: "submit",
|
|
889
|
+
command: "'touch' '/root/maintenance'",
|
|
890
|
+
runAsRoot: true,
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
});
|
|
894
|
+
describe("outposts asynchronous exec", () => {
|
|
895
|
+
it("sends the stage, submit, and result mode request bodies", async () => {
|
|
896
|
+
fetchSpy
|
|
897
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
898
|
+
ok: true,
|
|
899
|
+
userId: "u1",
|
|
900
|
+
outpostId: "2",
|
|
901
|
+
key: "input-key",
|
|
902
|
+
putUrl: "https://upload.invalid/put",
|
|
903
|
+
getUrl: "https://download.invalid/get",
|
|
904
|
+
expiresInSeconds: 300,
|
|
905
|
+
}))
|
|
906
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
907
|
+
ok: true,
|
|
908
|
+
userId: "u1",
|
|
909
|
+
outpostId: "2",
|
|
910
|
+
instanceId: "i-2",
|
|
911
|
+
commandId: "cmd-1",
|
|
912
|
+
outputPrefix: "output-prefix",
|
|
913
|
+
}))
|
|
914
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
915
|
+
ok: true,
|
|
916
|
+
userId: "u1",
|
|
917
|
+
outpostId: "2",
|
|
918
|
+
status: "InProgress",
|
|
919
|
+
done: false,
|
|
920
|
+
}));
|
|
921
|
+
const client = new OutpostsClient({
|
|
922
|
+
transport: testTransport(),
|
|
923
|
+
token: "test-token",
|
|
924
|
+
});
|
|
925
|
+
await client.stageExecInput("2");
|
|
926
|
+
await client.submitExec("cd /tmp && run-worker", "2");
|
|
927
|
+
await client.fetchExecResult("cmd-1", "2");
|
|
928
|
+
expect(fetchSpy.mock.calls.map(([url]) => String(url))).toEqual([
|
|
929
|
+
expect.stringContaining("/outpost/exec?outpostId=2"),
|
|
930
|
+
expect.stringContaining("/outpost/exec?outpostId=2"),
|
|
931
|
+
expect.stringContaining("/outpost/exec?outpostId=2"),
|
|
932
|
+
]);
|
|
933
|
+
expect(fetchSpy.mock.calls.map(([, init]) => JSON.parse(init?.body))).toEqual([
|
|
934
|
+
{ mode: "stage" },
|
|
935
|
+
{ mode: "submit", command: "cd /tmp && run-worker", runAsRoot: false },
|
|
936
|
+
{ mode: "result", commandId: "cmd-1" },
|
|
937
|
+
]);
|
|
938
|
+
});
|
|
939
|
+
it("exec-stage PUTs the exact file bytes and prints only key + getUrl JSON", async () => {
|
|
940
|
+
const stdoutSpy = vi
|
|
941
|
+
.spyOn(process.stdout, "write")
|
|
942
|
+
.mockImplementation(() => true);
|
|
943
|
+
const file = path.join(process.cwd(), "package.json");
|
|
944
|
+
const expectedBytes = fs.readFileSync(file);
|
|
945
|
+
fetchSpy
|
|
946
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
947
|
+
ok: true,
|
|
948
|
+
userId: "u1",
|
|
949
|
+
outpostId: "2",
|
|
950
|
+
key: "input-key",
|
|
951
|
+
putUrl: "https://upload.invalid/put",
|
|
952
|
+
getUrl: "https://download.invalid/get",
|
|
953
|
+
expiresInSeconds: 300,
|
|
954
|
+
}))
|
|
955
|
+
.mockResolvedValueOnce(new Response(null, { status: 200 }));
|
|
956
|
+
await run([
|
|
957
|
+
"outposts",
|
|
958
|
+
"exec-stage",
|
|
959
|
+
"--id",
|
|
960
|
+
"2",
|
|
961
|
+
"--file",
|
|
962
|
+
file,
|
|
963
|
+
"--json",
|
|
964
|
+
]);
|
|
965
|
+
expect(fetchSpy).toHaveBeenCalledTimes(2);
|
|
966
|
+
const [uploadUrl, uploadInit] = fetchSpy.mock.calls[1];
|
|
967
|
+
expect(String(uploadUrl)).toBe("https://upload.invalid/put");
|
|
968
|
+
expect(uploadInit?.method).toBe("PUT");
|
|
969
|
+
expect(uploadInit?.headers).toEqual({
|
|
970
|
+
"Content-Length": String(expectedBytes.byteLength),
|
|
971
|
+
});
|
|
972
|
+
expect(Buffer.from(uploadInit?.body)).toEqual(expectedBytes);
|
|
973
|
+
const printed = stdoutSpy.mock.calls
|
|
974
|
+
.map((call) => String(call[0]))
|
|
975
|
+
.join("");
|
|
976
|
+
expect(JSON.parse(printed)).toEqual({
|
|
977
|
+
key: "input-key",
|
|
978
|
+
getUrl: "https://download.invalid/get",
|
|
979
|
+
});
|
|
980
|
+
});
|
|
981
|
+
it("exec-stage exits non-zero when the presigned upload fails", async () => {
|
|
982
|
+
fetchSpy
|
|
983
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
984
|
+
ok: true,
|
|
985
|
+
userId: "u1",
|
|
986
|
+
outpostId: "primary",
|
|
987
|
+
key: "input-key",
|
|
988
|
+
putUrl: "https://upload.invalid/put",
|
|
989
|
+
getUrl: "https://download.invalid/get",
|
|
990
|
+
expiresInSeconds: 300,
|
|
991
|
+
}))
|
|
992
|
+
.mockResolvedValueOnce(new Response(null, { status: 503 }));
|
|
993
|
+
await expect(run([
|
|
994
|
+
"outposts",
|
|
995
|
+
"exec-stage",
|
|
996
|
+
"--file",
|
|
997
|
+
path.join(process.cwd(), "package.json"),
|
|
998
|
+
"--json",
|
|
999
|
+
])).rejects.toThrow("process.exit(1)");
|
|
1000
|
+
});
|
|
1001
|
+
it("exec-stage reports a stalled presigned upload as a timeout", async () => {
|
|
1002
|
+
const file = path.join(process.cwd(), "package.json");
|
|
1003
|
+
const expectedBytes = fs.readFileSync(file);
|
|
1004
|
+
const timeoutMs = 60_000 + Math.ceil(expectedBytes.byteLength / (1024 * 1024)) * 15_000;
|
|
1005
|
+
const timeoutController = new AbortController();
|
|
1006
|
+
timeoutController.abort(new DOMException("The operation timed out", "TimeoutError"));
|
|
1007
|
+
const timeoutSpy = vi
|
|
1008
|
+
.spyOn(AbortSignal, "timeout")
|
|
1009
|
+
.mockReturnValue(timeoutController.signal);
|
|
1010
|
+
const errorSpy = vi.spyOn(console, "error");
|
|
1011
|
+
let uploadInit;
|
|
1012
|
+
fetchSpy
|
|
1013
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
1014
|
+
ok: true,
|
|
1015
|
+
userId: "u1",
|
|
1016
|
+
outpostId: "primary",
|
|
1017
|
+
key: "input-key",
|
|
1018
|
+
putUrl: "https://upload.invalid/put",
|
|
1019
|
+
getUrl: "https://download.invalid/get",
|
|
1020
|
+
expiresInSeconds: 300,
|
|
1021
|
+
}))
|
|
1022
|
+
.mockImplementationOnce(async (_url, init) => {
|
|
1023
|
+
uploadInit = init;
|
|
1024
|
+
throw timeoutController.signal.reason;
|
|
1025
|
+
});
|
|
1026
|
+
await expect(run(["outposts", "exec-stage", "--file", file, "--json"])).rejects.toThrow("process.exit(1)");
|
|
1027
|
+
expect(uploadInit?.signal).toBe(timeoutController.signal);
|
|
1028
|
+
expect(timeoutSpy).toHaveBeenCalledWith(timeoutMs);
|
|
1029
|
+
expect(errorSpy).toHaveBeenCalledWith(expect.any(String), expect.stringContaining("exec-stage upload timed out"));
|
|
1030
|
+
});
|
|
1031
|
+
it("exec-submit shell-quotes multiple argv parts without adding the HQ-directory wrapper", async () => {
|
|
1032
|
+
const stdoutSpy = vi
|
|
1033
|
+
.spyOn(process.stdout, "write")
|
|
1034
|
+
.mockImplementation(() => true);
|
|
1035
|
+
const script = 'printf "%s\\n" "$0" "$1" "$2"';
|
|
1036
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, {
|
|
1037
|
+
ok: true,
|
|
1038
|
+
userId: "u1",
|
|
1039
|
+
outpostId: "primary",
|
|
1040
|
+
instanceId: "i-1",
|
|
1041
|
+
commandId: "cmd-submit",
|
|
1042
|
+
outputPrefix: "output-prefix",
|
|
1043
|
+
}));
|
|
1044
|
+
await run([
|
|
1045
|
+
"outposts",
|
|
1046
|
+
"exec-submit",
|
|
1047
|
+
"--json",
|
|
1048
|
+
"--",
|
|
1049
|
+
"bash",
|
|
1050
|
+
"-c",
|
|
1051
|
+
script,
|
|
1052
|
+
"marker",
|
|
1053
|
+
"a b",
|
|
1054
|
+
"quote's",
|
|
1055
|
+
]);
|
|
1056
|
+
const body = JSON.parse(fetchSpy.mock.calls[0][1]?.body);
|
|
1057
|
+
expect(body).toEqual({
|
|
1058
|
+
mode: "submit",
|
|
1059
|
+
command: joinCommandParts([
|
|
1060
|
+
"bash",
|
|
1061
|
+
"-c",
|
|
1062
|
+
script,
|
|
1063
|
+
"marker",
|
|
1064
|
+
"a b",
|
|
1065
|
+
"quote's",
|
|
1066
|
+
]),
|
|
1067
|
+
runAsRoot: false,
|
|
1068
|
+
});
|
|
1069
|
+
expect(body.command).not.toContain("cd ~ec2-user/hq");
|
|
1070
|
+
expect(JSON.parse(String(stdoutSpy.mock.calls[0][0]))).toEqual({
|
|
1071
|
+
commandId: "cmd-submit",
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1074
|
+
// Spawns a real `bash` (execFileSync) to prove the round-trip end-to-end. Under
|
|
1075
|
+
// the saturated full-suite parallel pool that spawn can exceed vitest's default
|
|
1076
|
+
// per-test budget purely on scheduling contention; the extra budget covers that,
|
|
1077
|
+
// not slow logic (isolated, this runs in milliseconds).
|
|
1078
|
+
it("preserves one command part verbatim and round-trips quoted bash argv", () => {
|
|
1079
|
+
const single = " printf 'already formed' ";
|
|
1080
|
+
expect(joinCommandParts([single])).toBe(single);
|
|
1081
|
+
const script = 'printf "%s\\n" "$0" "$1" "$2"';
|
|
1082
|
+
const command = joinCommandParts([
|
|
1083
|
+
"bash",
|
|
1084
|
+
"-c",
|
|
1085
|
+
script,
|
|
1086
|
+
"marker",
|
|
1087
|
+
"a b",
|
|
1088
|
+
"quote's",
|
|
1089
|
+
]);
|
|
1090
|
+
expect(execFileSync("bash", ["-c", command], { encoding: "utf8" })).toBe("marker\na b\nquote's\n");
|
|
1091
|
+
}, 30_000);
|
|
1092
|
+
it("exec-result --wait retries a 429, polls until done, and prints the result contract", async () => {
|
|
1093
|
+
vi.useFakeTimers();
|
|
1094
|
+
try {
|
|
1095
|
+
const stdoutSpy = vi
|
|
1096
|
+
.spyOn(process.stdout, "write")
|
|
1097
|
+
.mockImplementation(() => true);
|
|
1098
|
+
fetchSpy
|
|
1099
|
+
.mockResolvedValueOnce(jsonResponse(429, {
|
|
1100
|
+
error: true,
|
|
1101
|
+
step: "rate",
|
|
1102
|
+
message: "slow down",
|
|
1103
|
+
}))
|
|
1104
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
1105
|
+
ok: true,
|
|
1106
|
+
userId: "u1",
|
|
1107
|
+
outpostId: "2",
|
|
1108
|
+
status: "InProgress",
|
|
1109
|
+
done: false,
|
|
1110
|
+
}))
|
|
1111
|
+
.mockResolvedValueOnce(jsonResponse(200, {
|
|
1112
|
+
ok: true,
|
|
1113
|
+
userId: "u1",
|
|
1114
|
+
outpostId: "2",
|
|
1115
|
+
status: "Success",
|
|
1116
|
+
done: true,
|
|
1117
|
+
exitCode: 0,
|
|
1118
|
+
stdout: "finished\n",
|
|
1119
|
+
stderr: "",
|
|
1120
|
+
truncated: false,
|
|
1121
|
+
}));
|
|
1122
|
+
const pending = run([
|
|
1123
|
+
"outposts",
|
|
1124
|
+
"exec-result",
|
|
1125
|
+
"--id",
|
|
1126
|
+
"2",
|
|
1127
|
+
"--command-id",
|
|
1128
|
+
"cmd-1",
|
|
1129
|
+
"--wait",
|
|
1130
|
+
"--json",
|
|
1131
|
+
]);
|
|
1132
|
+
await vi.advanceTimersByTimeAsync(500);
|
|
1133
|
+
await vi.advanceTimersByTimeAsync(1_000);
|
|
1134
|
+
await pending;
|
|
1135
|
+
expect(fetchSpy).toHaveBeenCalledTimes(3);
|
|
1136
|
+
expect(JSON.parse(String(stdoutSpy.mock.calls[0][0]))).toEqual({
|
|
1137
|
+
done: true,
|
|
1138
|
+
status: "Success",
|
|
1139
|
+
exitCode: 0,
|
|
1140
|
+
stdout: "finished\n",
|
|
1141
|
+
stderr: "",
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
finally {
|
|
1145
|
+
vi.useRealTimers();
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
describe("outposts terminal", () => {
|
|
1150
|
+
const SESSION = {
|
|
1151
|
+
ok: true,
|
|
1152
|
+
outpostId: "primary",
|
|
1153
|
+
mode: "shell",
|
|
1154
|
+
sessionId: "sess-1",
|
|
1155
|
+
tokenValue: "tok-SENSITIVE",
|
|
1156
|
+
streamUrl: "wss://stream",
|
|
1157
|
+
region: "us-east-1",
|
|
1158
|
+
endpoint: "https://ssm.us-east-1.amazonaws.com",
|
|
1159
|
+
request: { Target: "i-1", DocumentName: "hq-pro-box-terminal-test" },
|
|
1160
|
+
};
|
|
1161
|
+
const ttyHost = { isStdinTty: () => true };
|
|
1162
|
+
afterEach(() => {
|
|
1163
|
+
process.exitCode = undefined;
|
|
1164
|
+
});
|
|
1165
|
+
it("refuses shell mode without a TTY", async () => {
|
|
1166
|
+
await expect(run(["outposts", "terminal"], { host: { isStdinTty: () => false } })).rejects.toThrow("process.exit(1)");
|
|
1167
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
1168
|
+
expect(launchSessionManagerPlugin).not.toHaveBeenCalled();
|
|
1169
|
+
});
|
|
1170
|
+
it("re-POSTs on a 202 starting, then launches the plugin with the vended session", async () => {
|
|
1171
|
+
fetchSpy
|
|
1172
|
+
.mockResolvedValueOnce(jsonResponse(202, {
|
|
1173
|
+
ok: false,
|
|
1174
|
+
step: "starting",
|
|
1175
|
+
state: "starting-instance",
|
|
1176
|
+
retryAfterSeconds: 0,
|
|
1177
|
+
}))
|
|
1178
|
+
.mockResolvedValueOnce(jsonResponse(200, SESSION));
|
|
1179
|
+
launchSessionManagerPlugin.mockResolvedValue(0);
|
|
1180
|
+
await run(["outposts", "terminal"], { host: ttyHost });
|
|
1181
|
+
expect(fetchSpy).toHaveBeenCalledTimes(2);
|
|
1182
|
+
for (const call of fetchSpy.mock.calls) {
|
|
1183
|
+
const [url, init] = call;
|
|
1184
|
+
expect(String(url)).toBe(`${TEST_API_URL}/outpost/terminal`);
|
|
1185
|
+
expect(init?.method).toBe("POST");
|
|
1186
|
+
expect(JSON.parse(String(init?.body))).toEqual({ mode: "shell" });
|
|
1187
|
+
}
|
|
1188
|
+
expect(launchSessionManagerPlugin).toHaveBeenCalledTimes(1);
|
|
1189
|
+
expect(launchSessionManagerPlugin.mock.calls[0][0]).toMatchObject({
|
|
1190
|
+
sessionId: "sess-1",
|
|
1191
|
+
tokenValue: "tok-SENSITIVE",
|
|
1192
|
+
});
|
|
1193
|
+
expect(process.exitCode).toBe(0);
|
|
1194
|
+
});
|
|
1195
|
+
it("sends the port-forward body (no TTY needed) and threads --id", async () => {
|
|
1196
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(200, { ...SESSION, mode: "port-forward" }));
|
|
1197
|
+
launchSessionManagerPlugin.mockResolvedValue(0);
|
|
1198
|
+
await run([
|
|
1199
|
+
"outposts",
|
|
1200
|
+
"terminal",
|
|
1201
|
+
"--id",
|
|
1202
|
+
"box-2",
|
|
1203
|
+
"--forward",
|
|
1204
|
+
"4500",
|
|
1205
|
+
"--local-port",
|
|
1206
|
+
"9000",
|
|
1207
|
+
], { host: { isStdinTty: () => false } });
|
|
1208
|
+
const [url, init] = fetchSpy.mock.calls[0];
|
|
1209
|
+
expect(String(url)).toBe(`${TEST_API_URL}/outpost/terminal?outpostId=box-2`);
|
|
1210
|
+
expect(JSON.parse(String(init?.body))).toEqual({
|
|
1211
|
+
mode: "port-forward",
|
|
1212
|
+
portNumber: 4500,
|
|
1213
|
+
localPortNumber: 9000,
|
|
1214
|
+
});
|
|
1215
|
+
});
|
|
1216
|
+
it("rejects --local-port without --forward before any network call", async () => {
|
|
1217
|
+
await expect(run(["outposts", "terminal", "--local-port", "9000"], { host: ttyHost })).rejects.toThrow("process.exit(1)");
|
|
1218
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
1219
|
+
});
|
|
1220
|
+
it("renders the Lightsail refusal for platform-unsupported", async () => {
|
|
1221
|
+
fetchSpy.mockResolvedValueOnce(jsonResponse(409, {
|
|
1222
|
+
error: true,
|
|
1223
|
+
step: "platform-unsupported",
|
|
1224
|
+
message: "the interactive terminal requires the EC2 platform",
|
|
1225
|
+
}));
|
|
1226
|
+
await expect(run(["outposts", "terminal"], { host: ttyHost })).rejects.toThrow("process.exit(1)");
|
|
1227
|
+
expect(launchSessionManagerPlugin).not.toHaveBeenCalled();
|
|
1228
|
+
});
|
|
1229
|
+
});
|
|
1230
|
+
//# sourceMappingURL=command.test.js.map
|