@socketsecurity/cli-with-sentry 0.15.11 → 0.15.12
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/bin/cli.js +6 -6
- package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/cli.js +5731 -6607
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +274 -305
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +28 -34
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-bin.js +96 -123
- package/dist/shadow-bin.js.map +1 -1
- package/dist/shadow-inject.js +470 -580
- package/dist/shadow-inject.js.map +1 -1
- package/dist/socket-completion.bash +221 -0
- package/dist/types/cli.d.mts +2 -2
- package/dist/types/commands/analytics/cmd-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -6
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -7
- package/dist/types/commands/analytics/handle-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +26 -46
- package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -16
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -47
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +9 -15
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/ci/cmd-ci.d.mts +9 -15
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +3 -3
- package/dist/types/commands/ci/handle-ci.d.mts +2 -2
- package/dist/types/commands/config/cmd-config-auto.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-get.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-list.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-set.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-unset.d.mts +9 -15
- package/dist/types/commands/config/cmd-config.d.mts +3 -3
- package/dist/types/commands/config/discover-config-value.d.mts +3 -5
- package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-auto.d.mts +7 -10
- package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-get.d.mts +7 -10
- package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-set.d.mts +8 -12
- package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-unset.d.mts +7 -10
- package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-auto.d.mts +4 -8
- package/dist/types/commands/config/output-config-get.d.mts +4 -8
- package/dist/types/commands/config/output-config-list.d.mts +6 -9
- package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-set.d.mts +3 -6
- package/dist/types/commands/config/output-config-unset.d.mts +3 -6
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts +9 -15
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -10
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -11
- package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -15
- package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +9 -15
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -3
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts +9 -15
- package/dist/types/commands/fix/git.d.mts +14 -49
- package/dist/types/commands/fix/npm-fix.d.mts +4 -16
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/open-pr.d.mts +20 -46
- package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +4 -16
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/run-fix.d.mts +3 -3
- package/dist/types/commands/fix/shared.d.mts +9 -15
- package/dist/types/commands/fix/types.d.mts +16 -16
- package/dist/types/commands/info/cmd-info.d.mts +9 -15
- package/dist/types/commands/info/fetch-package-info.d.mts +3 -7
- package/dist/types/commands/info/handle-package-info.d.mts +15 -22
- package/dist/types/commands/info/handle-package-info.d.mts.map +1 -1
- package/dist/types/commands/info/output-package-info.d.mts +10 -18
- package/dist/types/commands/info/output-package-info.d.mts.map +1 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/cmd-install.d.mts +3 -0
- package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
- package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
- package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/output-install-completion.d.mts +12 -0
- package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/login/apply-login.d.mts +2 -7
- package/dist/types/commands/login/attempt-login.d.mts +2 -5
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
- package/dist/types/commands/login/cmd-login.d.mts +9 -15
- package/dist/types/commands/logout/apply-logout.d.mts +2 -2
- package/dist/types/commands/logout/attempt-logout.d.mts +2 -2
- package/dist/types/commands/logout/cmd-logout.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +7 -15
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +3 -9
- package/dist/types/commands/manifest/output-requirements.d.mts +6 -10
- package/dist/types/commands/{cdxgen → manifest}/run-cdxgen.d.mts +2 -2
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/npm/cmd-npm.d.mts +9 -15
- package/dist/types/commands/npx/cmd-npx.d.mts +9 -15
- package/dist/types/commands/oops/cmd-oops.d.mts +9 -15
- package/dist/types/commands/optimize/add-overrides.d.mts +18 -22
- package/dist/types/commands/optimize/apply-optimization.d.mts +2 -6
- package/dist/types/commands/optimize/cmd-optimize.d.mts +9 -15
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -7
- package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -5
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +8 -11
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -10
- package/dist/types/commands/optimize/ls-by-agent.d.mts +6 -13
- package/dist/types/commands/optimize/shared.d.mts +2 -2
- package/dist/types/commands/optimize/types.d.mts +7 -7
- package/dist/types/commands/optimize/update-lockfile.d.mts +9 -12
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -11
- package/dist/types/commands/organization/cmd-organization-list.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -3
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization.d.mts +3 -3
- package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -6
- package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -6
- package/dist/types/commands/organization/fetch-quota.d.mts +4 -6
- package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -6
- package/dist/types/commands/organization/handle-license-policy.d.mts +3 -6
- package/dist/types/commands/organization/handle-organization-list.d.mts +3 -5
- package/dist/types/commands/organization/handle-quota.d.mts +3 -3
- package/dist/types/commands/organization/handle-security-policy.d.mts +3 -6
- package/dist/types/commands/organization/output-license-policy.d.mts +4 -7
- package/dist/types/commands/organization/output-organization-list.d.mts +4 -7
- package/dist/types/commands/organization/output-quota.d.mts +4 -7
- package/dist/types/commands/organization/output-security-policy.d.mts +4 -7
- package/dist/types/commands/package/cmd-package-score.d.mts +9 -15
- package/dist/types/commands/package/cmd-package-shallow.d.mts +16 -22
- package/dist/types/commands/package/cmd-package.d.mts +3 -3
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts +49 -51
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -6
- package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -6
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -9
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -1
- package/dist/types/commands/package/output-purl-score.d.mts +4 -8
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -8
- package/dist/types/commands/package/parse-package-specifiers.d.mts +5 -8
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +9 -15
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -4
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +9 -15
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -4
- package/dist/types/commands/report/cmd-report-create.d.mts +9 -15
- package/dist/types/commands/report/cmd-report-view.d.mts +9 -15
- package/dist/types/commands/report/cmd-report.d.mts +3 -3
- package/dist/types/commands/repos/cmd-repos-create.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-del.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-list.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-update.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-view.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos.d.mts +3 -3
- package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -7
- package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -16
- package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -7
- package/dist/types/commands/repos/handle-create-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -7
- package/dist/types/commands/repos/handle-list-repos.d.mts +10 -17
- package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-update-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-view-repo.d.mts +3 -7
- package/dist/types/commands/repos/output-create-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-delete-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-list-repos.d.mts +4 -7
- package/dist/types/commands/repos/output-update-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-view-repo.d.mts +4 -7
- package/dist/types/commands/scan/cmd-scan-create.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-del.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan.d.mts +3 -3
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -26
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -22
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-report-data.d.mts +8 -14
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -7
- package/dist/types/commands/scan/fetch-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -6
- package/dist/types/commands/scan/generate-report.d.mts +36 -50
- package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +20 -37
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -7
- package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-list-scans.d.mts +13 -23
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -7
- package/dist/types/commands/scan/handle-scan-report.d.mts +12 -21
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-view.d.mts +3 -8
- package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -8
- package/dist/types/commands/scan/output-delete-scan.d.mts +4 -7
- package/dist/types/commands/scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +4 -7
- package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -8
- package/dist/types/commands/scan/output-scan-report.d.mts +20 -38
- package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-view.d.mts +4 -10
- package/dist/types/commands/scan/stream-scan.d.mts +2 -6
- package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -2
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +4 -4
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -4
- package/dist/types/commands/scan/suggest_target.d.mts +2 -2
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +9 -15
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -16
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -17
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -7
- package/dist/types/commands/threat-feed/types.d.mts +12 -12
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -2
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +9 -15
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -2
- package/dist/types/constants.d.mts +125 -135
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/flags.d.mts +14 -17
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/instrument-with-sentry.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/index.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +19 -24
- package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +43 -71
- package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +3 -8
- package/dist/types/shadow/npm/arborist/lib/edge.d.mts +58 -71
- package/dist/types/shadow/npm/arborist/lib/node.d.mts +55 -91
- package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +26 -32
- package/dist/types/shadow/npm/arborist-helpers.d.mts +33 -66
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
- package/dist/types/shadow/npm/bin.d.mts +2 -5
- package/dist/types/shadow/npm/inject.d.mts +2 -2
- package/dist/types/shadow/npm/install.d.mts +11 -16
- package/dist/types/shadow/npm/link.d.mts +2 -5
- package/dist/types/shadow/npm/paths.d.mts +7 -7
- package/dist/types/shadow/npm/proc-log/index.d.mts +3 -6
- package/dist/types/types.d.mts +15 -17
- package/dist/types/utils/agent.d.mts +11 -14
- package/dist/types/utils/alert/artifact.d.mts +32 -50
- package/dist/types/utils/alert/fix.d.mts +5 -5
- package/dist/types/utils/alert/severity.d.mts +12 -24
- package/dist/types/utils/alerts-map.d.mts +23 -36
- package/dist/types/utils/api.d.mts +11 -34
- package/dist/types/utils/check-input.d.mts +9 -12
- package/dist/types/utils/cmd.d.mts +4 -4
- package/dist/types/utils/color-or-markdown.d.mts +14 -23
- package/dist/types/utils/color-or-markdown.d.mts.map +1 -1
- package/dist/types/utils/completion.d.mts +11 -0
- package/dist/types/utils/completion.d.mts.map +1 -0
- package/dist/types/utils/config.d.mts +22 -31
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/determine-org-slug.d.mts +2 -7
- package/dist/types/utils/errors.d.mts +12 -21
- package/dist/types/utils/fail-msg-with-badge.d.mts +2 -5
- package/dist/types/utils/fs.d.mts +21 -52
- package/dist/types/utils/get-output-kind.d.mts +3 -6
- package/dist/types/utils/glob.d.mts +13 -24
- package/dist/types/utils/map-to-object.d.mts +4 -6
- package/dist/types/utils/markdown.d.mts +4 -15
- package/dist/types/utils/meow-with-subcommands.d.mts +34 -46
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/npm-paths.d.mts +7 -7
- package/dist/types/utils/npm-paths.d.mts.map +1 -1
- package/dist/types/utils/objects.d.mts +3 -8
- package/dist/types/utils/output-formatting.d.mts +14 -24
- package/dist/types/utils/package-environment.d.mts +51 -72
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/path-resolve.d.mts +9 -14
- package/dist/types/utils/pnpm.d.mts +9 -7
- package/dist/types/utils/pnpm.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts +8 -12
- package/dist/types/utils/semver.d.mts +5 -17
- package/dist/types/utils/serialize-result-json.d.mts +3 -3
- package/dist/types/utils/socket-package-alert.d.mts +62 -81
- package/dist/types/utils/socket-url.d.mts +9 -15
- package/dist/types/utils/spec.d.mts +4 -7
- package/dist/types/utils/spec.d.mts.map +1 -1
- package/dist/types/utils/strings.d.mts +2 -5
- package/dist/types/utils/translations.d.mts +592 -592
- package/dist/types/utils/walk-nested-map.d.mts +7 -10
- package/dist/utils.js +1531 -1833
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +38333 -51605
- package/dist/vendor.js.map +1 -1
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +5 -8
- package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +2 -4
- package/external/@socketsecurity/registry/external/cacache.js +1 -2
- package/external/@socketsecurity/registry/external/libnpmpack.js +36 -76
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +31 -67
- package/external/@socketsecurity/registry/external/pacote.js +36 -76
- package/external/@socketsecurity/registry/external/tinyglobby.js +3 -6
- package/external/@socketsecurity/registry/external/which.js +2 -4
- package/external/@socketsecurity/registry/lib/logger.d.ts +3 -1
- package/external/@socketsecurity/registry/lib/logger.js +149 -69
- package/external/@socketsecurity/registry/package.json +2 -2
- package/external/blessed/lib/alias.js +475 -468
- package/external/blessed/lib/blessed.js +12 -12
- package/external/blessed/lib/colors.js +234 -194
- package/external/blessed/lib/events.js +64 -70
- package/external/blessed/lib/gpmclient.js +117 -141
- package/external/blessed/lib/helpers.js +89 -94
- package/external/blessed/lib/keys.js +169 -342
- package/external/blessed/lib/program.js +2130 -2365
- package/external/blessed/lib/tput.js +1183 -1276
- package/external/blessed/lib/unicode.js +400 -522
- package/external/blessed/lib/widget.js +14 -14
- package/external/blessed/lib/widgets/ansiimage.js +90 -96
- package/external/blessed/lib/widgets/bigtext.js +91 -102
- package/external/blessed/lib/widgets/box.js +8 -8
- package/external/blessed/lib/widgets/button.js +23 -23
- package/external/blessed/lib/widgets/checkbox.js +50 -54
- package/external/blessed/lib/widgets/element.js +1415 -1716
- package/external/blessed/lib/widgets/filemanager.js +107 -118
- package/external/blessed/lib/widgets/form.js +144 -178
- package/external/blessed/lib/widgets/image.js +26 -36
- package/external/blessed/lib/widgets/input.js +8 -8
- package/external/blessed/lib/widgets/layout.js +103 -119
- package/external/blessed/lib/widgets/line.js +17 -20
- package/external/blessed/lib/widgets/list.js +349 -402
- package/external/blessed/lib/widgets/listbar.js +265 -306
- package/external/blessed/lib/widgets/listtable.js +133 -146
- package/external/blessed/lib/widgets/loading.js +31 -31
- package/external/blessed/lib/widgets/log.js +41 -40
- package/external/blessed/lib/widgets/message.js +64 -86
- package/external/blessed/lib/widgets/node.js +175 -207
- package/external/blessed/lib/widgets/overlayimage.js +360 -437
- package/external/blessed/lib/widgets/progressbar.js +79 -88
- package/external/blessed/lib/widgets/prompt.js +54 -61
- package/external/blessed/lib/widgets/question.js +48 -61
- package/external/blessed/lib/widgets/radiobutton.js +26 -27
- package/external/blessed/lib/widgets/radioset.js +8 -8
- package/external/blessed/lib/widgets/screen.js +1186 -1375
- package/external/blessed/lib/widgets/scrollablebox.js +202 -228
- package/external/blessed/lib/widgets/scrollabletext.js +9 -9
- package/external/blessed/lib/widgets/table.js +187 -216
- package/external/blessed/lib/widgets/terminal.js +258 -298
- package/external/blessed/lib/widgets/text.js +9 -9
- package/external/blessed/lib/widgets/textarea.js +188 -222
- package/external/blessed/lib/widgets/textbox.js +34 -36
- package/external/blessed/lib/widgets/video.js +55 -59
- package/external/blessed/usr/fonts/ter-u14b.json +1 -1
- package/external/blessed/usr/fonts/ter-u14n.json +1 -1
- package/external/blessed/vendor/tng.js +1016 -1144
- package/external/blessed-contrib/lib/layout/grid.js +345 -377
- package/external/blessed-contrib/lib/widget/charts/bar.js +6612 -7139
- package/external/blessed-contrib/lib/widget/charts/line.js +16224 -23941
- package/external/blessed-contrib/lib/widget/table.js +78 -96
- package/package.json +8 -8
- package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var nextTick = global.setImmediate || process.nextTick.bind(process);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var Node = require('./node');
|
|
16
|
+
var Box = require('./box');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Terminal
|
|
@@ -21,88 +21,76 @@ const Box = require('./box')
|
|
|
21
21
|
|
|
22
22
|
function Terminal(options) {
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new Terminal(options)
|
|
24
|
+
return new Terminal(options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
28
|
-
options.scrollable = false
|
|
27
|
+
options = options || {};
|
|
28
|
+
options.scrollable = false;
|
|
29
29
|
|
|
30
|
-
Box.call(this, options)
|
|
30
|
+
Box.call(this, options);
|
|
31
31
|
|
|
32
32
|
// XXX Workaround for all motion
|
|
33
33
|
if (this.screen.program.tmux && this.screen.program.tmuxVersion >= 2) {
|
|
34
|
-
this.screen.program.enableMouse()
|
|
34
|
+
this.screen.program.enableMouse();
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
this.handler = options.handler
|
|
38
|
-
this.shell = options.shell || process.env.SHELL || 'sh'
|
|
39
|
-
this.args = options.args || []
|
|
37
|
+
this.handler = options.handler;
|
|
38
|
+
this.shell = options.shell || process.env.SHELL || 'sh';
|
|
39
|
+
this.args = options.args || [];
|
|
40
40
|
|
|
41
|
-
this.cursor = this.options.cursor
|
|
42
|
-
this.cursorBlink = this.options.cursorBlink
|
|
43
|
-
this.screenKeys = this.options.screenKeys
|
|
41
|
+
this.cursor = this.options.cursor;
|
|
42
|
+
this.cursorBlink = this.options.cursorBlink;
|
|
43
|
+
this.screenKeys = this.options.screenKeys;
|
|
44
44
|
|
|
45
|
-
this.style = this.style || {}
|
|
46
|
-
this.style.bg = this.style.bg || 'default'
|
|
47
|
-
this.style.fg = this.style.fg || 'default'
|
|
45
|
+
this.style = this.style || {};
|
|
46
|
+
this.style.bg = this.style.bg || 'default';
|
|
47
|
+
this.style.fg = this.style.fg || 'default';
|
|
48
48
|
|
|
49
|
-
this.termName =
|
|
50
|
-
|
|
49
|
+
this.termName = options.terminal
|
|
50
|
+
|| options.term
|
|
51
|
+
|| process.env.TERM
|
|
52
|
+
|| 'xterm';
|
|
51
53
|
|
|
52
|
-
this.bootstrap()
|
|
54
|
+
this.bootstrap();
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
Object.setPrototypeOf(Terminal.prototype, Box.prototype)
|
|
57
|
+
Object.setPrototypeOf(Terminal.prototype, Box.prototype);
|
|
56
58
|
|
|
57
|
-
Terminal.prototype.type = 'terminal'
|
|
59
|
+
Terminal.prototype.type = 'terminal';
|
|
58
60
|
|
|
59
|
-
Terminal.prototype.bootstrap = function
|
|
60
|
-
|
|
61
|
+
Terminal.prototype.bootstrap = function() {
|
|
62
|
+
var self = this;
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
var element = {
|
|
63
65
|
// window
|
|
64
|
-
get document() {
|
|
65
|
-
return element
|
|
66
|
-
},
|
|
66
|
+
get document() { return element; },
|
|
67
67
|
navigator: { userAgent: 'node.js' },
|
|
68
68
|
|
|
69
69
|
// document
|
|
70
|
-
get defaultView() {
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
get documentElement() {
|
|
74
|
-
return element
|
|
75
|
-
},
|
|
76
|
-
createElement: function () {
|
|
77
|
-
return element
|
|
78
|
-
},
|
|
70
|
+
get defaultView() { return element; },
|
|
71
|
+
get documentElement() { return element; },
|
|
72
|
+
createElement: function() { return element; },
|
|
79
73
|
|
|
80
74
|
// element
|
|
81
|
-
get ownerDocument() {
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
getElementsByTagName: function () {
|
|
87
|
-
return [element]
|
|
88
|
-
},
|
|
89
|
-
getElementById: function () {
|
|
90
|
-
return element
|
|
91
|
-
},
|
|
75
|
+
get ownerDocument() { return element; },
|
|
76
|
+
addEventListener: function() {},
|
|
77
|
+
removeEventListener: function() {},
|
|
78
|
+
getElementsByTagName: function() { return [element]; },
|
|
79
|
+
getElementById: function() { return element; },
|
|
92
80
|
parentNode: null,
|
|
93
81
|
offsetParent: null,
|
|
94
|
-
appendChild: function
|
|
95
|
-
removeChild: function
|
|
96
|
-
setAttribute: function
|
|
97
|
-
getAttribute: function
|
|
82
|
+
appendChild: function() {},
|
|
83
|
+
removeChild: function() {},
|
|
84
|
+
setAttribute: function() {},
|
|
85
|
+
getAttribute: function() {},
|
|
98
86
|
style: {},
|
|
99
|
-
focus: function
|
|
100
|
-
blur: function
|
|
87
|
+
focus: function() {},
|
|
88
|
+
blur: function() {},
|
|
101
89
|
console: console
|
|
102
|
-
}
|
|
90
|
+
};
|
|
103
91
|
|
|
104
|
-
element.parentNode = element
|
|
105
|
-
element.offsetParent = element
|
|
92
|
+
element.parentNode = element;
|
|
93
|
+
element.offsetParent = element;
|
|
106
94
|
|
|
107
95
|
this.term = require('term.js')({
|
|
108
96
|
termName: this.termName,
|
|
@@ -114,16 +102,16 @@ Terminal.prototype.bootstrap = function () {
|
|
|
114
102
|
parent: element,
|
|
115
103
|
cursorBlink: this.cursorBlink,
|
|
116
104
|
screenKeys: this.screenKeys
|
|
117
|
-
})
|
|
105
|
+
});
|
|
118
106
|
|
|
119
|
-
this.term.refresh = function
|
|
120
|
-
self.screen.render()
|
|
121
|
-
}
|
|
107
|
+
this.term.refresh = function() {
|
|
108
|
+
self.screen.render();
|
|
109
|
+
};
|
|
122
110
|
|
|
123
|
-
this.term.keyDown = function
|
|
124
|
-
this.term.keyPress = function
|
|
111
|
+
this.term.keyDown = function() {};
|
|
112
|
+
this.term.keyPress = function() {};
|
|
125
113
|
|
|
126
|
-
this.term.open(element)
|
|
114
|
+
this.term.open(element);
|
|
127
115
|
|
|
128
116
|
// Emits key sequences in html-land.
|
|
129
117
|
// Technically not necessary here.
|
|
@@ -137,117 +125,96 @@ Terminal.prototype.bootstrap = function () {
|
|
|
137
125
|
|
|
138
126
|
// Incoming keys and mouse inputs.
|
|
139
127
|
// NOTE: Cannot pass mouse events - coordinates will be off!
|
|
140
|
-
this.screen.program.input.on(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (self.screen.focused === self && !self._isMouse(data)) {
|
|
144
|
-
self.handler(data)
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
this.onScreenEvent('mouse', function (data) {
|
|
150
|
-
if (self.screen.focused !== self) {
|
|
151
|
-
return
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (data.x < self.aleft + self.ileft) {
|
|
155
|
-
return
|
|
128
|
+
this.screen.program.input.on('data', this._onData = function(data) {
|
|
129
|
+
if (self.screen.focused === self && !self._isMouse(data)) {
|
|
130
|
+
self.handler(data);
|
|
156
131
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (data.y
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
) {
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
this.onScreenEvent('mouse', function(data) {
|
|
135
|
+
if (self.screen.focused !== self) return;
|
|
136
|
+
|
|
137
|
+
if (data.x < self.aleft + self.ileft) return;
|
|
138
|
+
if (data.y < self.atop + self.itop) return;
|
|
139
|
+
if (data.x > self.aleft - self.ileft + self.width) return;
|
|
140
|
+
if (data.y > self.atop - self.itop + self.height) return;
|
|
141
|
+
|
|
142
|
+
if (self.term.x10Mouse
|
|
143
|
+
|| self.term.vt200Mouse
|
|
144
|
+
|| self.term.normalMouse
|
|
145
|
+
|| self.term.mouseEvents
|
|
146
|
+
|| self.term.utfMouse
|
|
147
|
+
|| self.term.sgrMouse
|
|
148
|
+
|| self.term.urxvtMouse) {
|
|
149
|
+
;
|
|
176
150
|
} else {
|
|
177
|
-
return
|
|
151
|
+
return;
|
|
178
152
|
}
|
|
179
153
|
|
|
180
|
-
|
|
181
|
-
x = data.x - self.aleft
|
|
182
|
-
y = data.y - self.atop
|
|
183
|
-
s
|
|
154
|
+
var b = data.raw[0]
|
|
155
|
+
, x = data.x - self.aleft
|
|
156
|
+
, y = data.y - self.atop
|
|
157
|
+
, s;
|
|
184
158
|
|
|
185
159
|
if (self.term.urxvtMouse) {
|
|
186
160
|
if (self.screen.program.sgrMouse) {
|
|
187
|
-
b += 32
|
|
161
|
+
b += 32;
|
|
188
162
|
}
|
|
189
|
-
s = '\x1b[' + b + ';' + (x + 32) + ';' + (y + 32) + 'M'
|
|
163
|
+
s = '\x1b[' + b + ';' + (x + 32) + ';' + (y + 32) + 'M';
|
|
190
164
|
} else if (self.term.sgrMouse) {
|
|
191
165
|
if (!self.screen.program.sgrMouse) {
|
|
192
|
-
b -= 32
|
|
166
|
+
b -= 32;
|
|
193
167
|
}
|
|
194
|
-
s =
|
|
195
|
-
'
|
|
196
|
-
b +
|
|
197
|
-
';' +
|
|
198
|
-
x +
|
|
199
|
-
';' +
|
|
200
|
-
y +
|
|
201
|
-
(data.action === 'mousedown' ? 'M' : 'm')
|
|
168
|
+
s = '\x1b[<' + b + ';' + x + ';' + y
|
|
169
|
+
+ (data.action === 'mousedown' ? 'M' : 'm');
|
|
202
170
|
} else {
|
|
203
171
|
if (self.screen.program.sgrMouse) {
|
|
204
|
-
b += 32
|
|
172
|
+
b += 32;
|
|
205
173
|
}
|
|
206
|
-
s =
|
|
207
|
-
|
|
208
|
-
String.fromCharCode(
|
|
209
|
-
String.fromCharCode(
|
|
210
|
-
String.fromCharCode(y + 32)
|
|
174
|
+
s = '\x1b[M'
|
|
175
|
+
+ String.fromCharCode(b)
|
|
176
|
+
+ String.fromCharCode(x + 32)
|
|
177
|
+
+ String.fromCharCode(y + 32);
|
|
211
178
|
}
|
|
212
179
|
|
|
213
|
-
self.handler(s)
|
|
214
|
-
})
|
|
180
|
+
self.handler(s);
|
|
181
|
+
});
|
|
215
182
|
|
|
216
|
-
this.on('focus', function
|
|
217
|
-
self.term.focus()
|
|
218
|
-
})
|
|
183
|
+
this.on('focus', function() {
|
|
184
|
+
self.term.focus();
|
|
185
|
+
});
|
|
219
186
|
|
|
220
|
-
this.on('blur', function
|
|
221
|
-
self.term.blur()
|
|
222
|
-
})
|
|
187
|
+
this.on('blur', function() {
|
|
188
|
+
self.term.blur();
|
|
189
|
+
});
|
|
223
190
|
|
|
224
|
-
this.term.on('title', function
|
|
225
|
-
self.title = title
|
|
226
|
-
self.emit('title', title)
|
|
227
|
-
})
|
|
191
|
+
this.term.on('title', function(title) {
|
|
192
|
+
self.title = title;
|
|
193
|
+
self.emit('title', title);
|
|
194
|
+
});
|
|
228
195
|
|
|
229
|
-
this.term.on('passthrough', function
|
|
230
|
-
self.screen.program.flush()
|
|
231
|
-
self.screen.program._owrite(data)
|
|
232
|
-
})
|
|
196
|
+
this.term.on('passthrough', function(data) {
|
|
197
|
+
self.screen.program.flush();
|
|
198
|
+
self.screen.program._owrite(data);
|
|
199
|
+
});
|
|
233
200
|
|
|
234
|
-
this.on('resize', function
|
|
235
|
-
nextTick(function
|
|
236
|
-
self.term.resize(self.width - self.iwidth, self.height - self.iheight)
|
|
237
|
-
})
|
|
238
|
-
})
|
|
201
|
+
this.on('resize', function() {
|
|
202
|
+
nextTick(function() {
|
|
203
|
+
self.term.resize(self.width - self.iwidth, self.height - self.iheight);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
239
206
|
|
|
240
|
-
this.once('render', function
|
|
241
|
-
self.term.resize(self.width - self.iwidth, self.height - self.iheight)
|
|
242
|
-
})
|
|
207
|
+
this.once('render', function() {
|
|
208
|
+
self.term.resize(self.width - self.iwidth, self.height - self.iheight);
|
|
209
|
+
});
|
|
243
210
|
|
|
244
|
-
this.on('destroy', function
|
|
245
|
-
self.kill()
|
|
246
|
-
self.screen.program.input.removeListener('data', self._onData)
|
|
247
|
-
})
|
|
211
|
+
this.on('destroy', function() {
|
|
212
|
+
self.kill();
|
|
213
|
+
self.screen.program.input.removeListener('data', self._onData);
|
|
214
|
+
});
|
|
248
215
|
|
|
249
216
|
if (this.handler) {
|
|
250
|
-
return
|
|
217
|
+
return;
|
|
251
218
|
}
|
|
252
219
|
|
|
253
220
|
this.pty = require('pty.js').fork(this.shell, this.args, {
|
|
@@ -256,199 +223,192 @@ Terminal.prototype.bootstrap = function () {
|
|
|
256
223
|
rows: this.height - this.iheight,
|
|
257
224
|
cwd: process.env.HOME,
|
|
258
225
|
env: this.options.env || process.env
|
|
259
|
-
})
|
|
226
|
+
});
|
|
260
227
|
|
|
261
|
-
this.on('resize', function
|
|
262
|
-
nextTick(function
|
|
228
|
+
this.on('resize', function() {
|
|
229
|
+
nextTick(function() {
|
|
263
230
|
try {
|
|
264
|
-
self.pty.resize(self.width - self.iwidth, self.height - self.iheight)
|
|
265
|
-
} catch (e) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
this.dattr = this.sattr(this.style)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
xl = ret.xl - this.iright
|
|
304
|
-
yi = ret.yi + this.itop
|
|
305
|
-
yl = ret.yl - this.ibottom
|
|
306
|
-
cursor
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
for (
|
|
311
|
-
|
|
312
|
-
if (!line || !this.term.lines[scrollback + y - yi])
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
this.
|
|
320
|
-
(this.term.ydisp === this.term.ybase || this.term.selectMode) &&
|
|
321
|
-
!this.term.cursorHidden
|
|
322
|
-
) {
|
|
323
|
-
cursor = xi + this.term.x
|
|
231
|
+
self.pty.resize(self.width - self.iwidth, self.height - self.iheight);
|
|
232
|
+
} catch (e) {
|
|
233
|
+
;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
this.handler = function(data) {
|
|
239
|
+
self.pty.write(data);
|
|
240
|
+
self.screen.render();
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
this.pty.on('data', function(data) {
|
|
244
|
+
self.write(data);
|
|
245
|
+
self.screen.render();
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
this.pty.on('exit', function(code) {
|
|
249
|
+
self.emit('exit', code || null);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
this.onScreenEvent('keypress', function() {
|
|
253
|
+
self.screen.render();
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
this.screen._listenKeys(this);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
Terminal.prototype.write = function(data) {
|
|
260
|
+
return this.term.write(data);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
Terminal.prototype.render = function() {
|
|
264
|
+
var ret = this._render();
|
|
265
|
+
if (!ret) return;
|
|
266
|
+
|
|
267
|
+
this.dattr = this.sattr(this.style);
|
|
268
|
+
|
|
269
|
+
var xi = ret.xi + this.ileft
|
|
270
|
+
, xl = ret.xl - this.iright
|
|
271
|
+
, yi = ret.yi + this.itop
|
|
272
|
+
, yl = ret.yl - this.ibottom
|
|
273
|
+
, cursor;
|
|
274
|
+
|
|
275
|
+
var scrollback = this.term.lines.length - (yl - yi);
|
|
276
|
+
|
|
277
|
+
for (var y = Math.max(yi, 0); y < yl; y++) {
|
|
278
|
+
var line = this.screen.lines[y];
|
|
279
|
+
if (!line || !this.term.lines[scrollback + y - yi]) break;
|
|
280
|
+
|
|
281
|
+
if (y === yi + this.term.y
|
|
282
|
+
&& this.term.cursorState
|
|
283
|
+
&& this.screen.focused === this
|
|
284
|
+
&& (this.term.ydisp === this.term.ybase || this.term.selectMode)
|
|
285
|
+
&& !this.term.cursorHidden) {
|
|
286
|
+
cursor = xi + this.term.x;
|
|
324
287
|
} else {
|
|
325
|
-
cursor = -1
|
|
288
|
+
cursor = -1;
|
|
326
289
|
}
|
|
327
290
|
|
|
328
|
-
for (
|
|
329
|
-
if (!line[x] || !this.term.lines[scrollback + y - yi][x - xi])
|
|
330
|
-
break
|
|
331
|
-
}
|
|
291
|
+
for (var x = Math.max(xi, 0); x < xl; x++) {
|
|
292
|
+
if (!line[x] || !this.term.lines[scrollback + y - yi][x - xi]) break;
|
|
332
293
|
|
|
333
|
-
line[x][0] = this.term.lines[scrollback + y - yi][x - xi][0]
|
|
294
|
+
line[x][0] = this.term.lines[scrollback + y - yi][x - xi][0];
|
|
334
295
|
|
|
335
296
|
if (x === cursor) {
|
|
336
297
|
if (this.cursor === 'line') {
|
|
337
|
-
line[x][0] = this.dattr
|
|
338
|
-
line[x][1] = '\u2502'
|
|
339
|
-
continue
|
|
298
|
+
line[x][0] = this.dattr;
|
|
299
|
+
line[x][1] = '\u2502';
|
|
300
|
+
continue;
|
|
340
301
|
} else if (this.cursor === 'underline') {
|
|
341
|
-
line[x][0] = this.dattr | (2 << 18)
|
|
302
|
+
line[x][0] = this.dattr | (2 << 18);
|
|
342
303
|
} else if (this.cursor === 'block' || !this.cursor) {
|
|
343
|
-
line[x][0] = this.dattr | (8 << 18)
|
|
304
|
+
line[x][0] = this.dattr | (8 << 18);
|
|
344
305
|
}
|
|
345
306
|
}
|
|
346
307
|
|
|
347
|
-
line[x][1] = this.term.lines[scrollback + y - yi][x - xi][1]
|
|
308
|
+
line[x][1] = this.term.lines[scrollback + y - yi][x - xi][1];
|
|
348
309
|
|
|
349
310
|
// default foreground = 257
|
|
350
311
|
if (((line[x][0] >> 9) & 0x1ff) === 257) {
|
|
351
|
-
line[x][0] &= ~(0x1ff << 9)
|
|
352
|
-
line[x][0] |= ((this.dattr >> 9) & 0x1ff) << 9
|
|
312
|
+
line[x][0] &= ~(0x1ff << 9);
|
|
313
|
+
line[x][0] |= ((this.dattr >> 9) & 0x1ff) << 9;
|
|
353
314
|
}
|
|
354
315
|
|
|
355
316
|
// default background = 256
|
|
356
317
|
if ((line[x][0] & 0x1ff) === 256) {
|
|
357
|
-
line[x][0] &= ~0x1ff
|
|
358
|
-
line[x][0] |= this.dattr & 0x1ff
|
|
318
|
+
line[x][0] &= ~0x1ff;
|
|
319
|
+
line[x][0] |= this.dattr & 0x1ff;
|
|
359
320
|
}
|
|
360
321
|
}
|
|
361
322
|
|
|
362
|
-
line.dirty = true
|
|
323
|
+
line.dirty = true;
|
|
363
324
|
}
|
|
364
325
|
|
|
365
|
-
return ret
|
|
366
|
-
}
|
|
326
|
+
return ret;
|
|
327
|
+
};
|
|
367
328
|
|
|
368
|
-
Terminal.prototype._isMouse = function
|
|
369
|
-
|
|
329
|
+
Terminal.prototype._isMouse = function(buf) {
|
|
330
|
+
var s = buf;
|
|
370
331
|
if (Buffer.isBuffer(s)) {
|
|
371
332
|
if (s[0] > 127 && s[1] === undefined) {
|
|
372
|
-
s[0] -= 128
|
|
373
|
-
s = '\x1b' + s.toString('utf-8')
|
|
333
|
+
s[0] -= 128;
|
|
334
|
+
s = '\x1b' + s.toString('utf-8');
|
|
374
335
|
} else {
|
|
375
|
-
s = s.toString('utf-8')
|
|
336
|
+
s = s.toString('utf-8');
|
|
376
337
|
}
|
|
377
338
|
}
|
|
378
|
-
return (
|
|
379
|
-
|
|
380
|
-
/^\x1b\[
|
|
381
|
-
/^\x1b\[(\d+;\d+;\d+)
|
|
382
|
-
/^\x1b\[<(\d+;\d+;\d+)
|
|
383
|
-
/^\x1b\[
|
|
384
|
-
/^\x1b\[
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
this.
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
this.
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
this.term.
|
|
405
|
-
this.
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
xi = 0 + (xi || 0)
|
|
339
|
+
return (buf[0] === 0x1b && buf[1] === 0x5b && buf[2] === 0x4d)
|
|
340
|
+
|| /^\x1b\[M([\x00\u0020-\uffff]{3})/.test(s)
|
|
341
|
+
|| /^\x1b\[(\d+;\d+;\d+)M/.test(s)
|
|
342
|
+
|| /^\x1b\[<(\d+;\d+;\d+)([mM])/.test(s)
|
|
343
|
+
|| /^\x1b\[<(\d+;\d+;\d+;\d+)&w/.test(s)
|
|
344
|
+
|| /^\x1b\[24([0135])~\[(\d+),(\d+)\]\r/.test(s)
|
|
345
|
+
|| /^\x1b\[(O|I)/.test(s);
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
Terminal.prototype.setScroll =
|
|
349
|
+
Terminal.prototype.scrollTo = function(offset) {
|
|
350
|
+
this.term.ydisp = offset;
|
|
351
|
+
return this.emit('scroll');
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
Terminal.prototype.getScroll = function() {
|
|
355
|
+
return this.term.ydisp;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
Terminal.prototype.scroll = function(offset) {
|
|
359
|
+
this.term.scrollDisp(offset);
|
|
360
|
+
return this.emit('scroll');
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
Terminal.prototype.resetScroll = function() {
|
|
364
|
+
this.term.ydisp = 0;
|
|
365
|
+
this.term.ybase = 0;
|
|
366
|
+
return this.emit('scroll');
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
Terminal.prototype.getScrollHeight = function() {
|
|
370
|
+
return this.term.rows - 1;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
Terminal.prototype.getScrollPerc = function() {
|
|
374
|
+
return (this.term.ydisp / this.term.ybase) * 100;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
Terminal.prototype.setScrollPerc = function(i) {
|
|
378
|
+
return this.setScroll((i / 100) * this.term.ybase | 0);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
Terminal.prototype.screenshot = function(xi, xl, yi, yl) {
|
|
382
|
+
xi = 0 + (xi || 0);
|
|
423
383
|
if (xl != null) {
|
|
424
|
-
xl = 0 + (xl || 0)
|
|
384
|
+
xl = 0 + (xl || 0);
|
|
425
385
|
} else {
|
|
426
|
-
xl = this.term.lines[0].length
|
|
386
|
+
xl = this.term.lines[0].length;
|
|
427
387
|
}
|
|
428
|
-
yi = 0 + (yi || 0)
|
|
388
|
+
yi = 0 + (yi || 0);
|
|
429
389
|
if (yl != null) {
|
|
430
|
-
yl = 0 + (yl || 0)
|
|
390
|
+
yl = 0 + (yl || 0);
|
|
431
391
|
} else {
|
|
432
|
-
yl = this.term.lines.length
|
|
392
|
+
yl = this.term.lines.length;
|
|
433
393
|
}
|
|
434
|
-
return this.screen.screenshot(xi, xl, yi, yl, this.term)
|
|
435
|
-
}
|
|
394
|
+
return this.screen.screenshot(xi, xl, yi, yl, this.term);
|
|
395
|
+
};
|
|
436
396
|
|
|
437
|
-
Terminal.prototype.kill = function
|
|
397
|
+
Terminal.prototype.kill = function() {
|
|
438
398
|
if (this.pty) {
|
|
439
|
-
this.pty.destroy()
|
|
440
|
-
this.pty.kill()
|
|
399
|
+
this.pty.destroy();
|
|
400
|
+
this.pty.kill();
|
|
441
401
|
}
|
|
442
|
-
this.term.refresh = function
|
|
443
|
-
this.term.write('\x1b[H\x1b[J')
|
|
402
|
+
this.term.refresh = function() {};
|
|
403
|
+
this.term.write('\x1b[H\x1b[J');
|
|
444
404
|
if (this.term._blink) {
|
|
445
|
-
clearInterval(this.term._blink)
|
|
405
|
+
clearInterval(this.term._blink);
|
|
446
406
|
}
|
|
447
|
-
this.term.destroy()
|
|
448
|
-
}
|
|
407
|
+
this.term.destroy();
|
|
408
|
+
};
|
|
449
409
|
|
|
450
410
|
/**
|
|
451
411
|
* Expose
|
|
452
412
|
*/
|
|
453
413
|
|
|
454
|
-
module.exports = Terminal
|
|
414
|
+
module.exports = Terminal;
|