@eyeauras/insight-cli 0.8.4 → 0.9.1
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/.cli-package-build.json +1 -1
- package/README.md +16 -23
- package/SKILL.md +6 -44
- package/dist/src/activity-audit.d.ts +33 -46
- package/dist/src/activity-audit.js +120 -195
- package/dist/src/analysis-default.d.ts +10 -2
- package/dist/src/analysis-default.js +62 -47
- package/dist/src/analysis-storage.d.ts +13 -13
- package/dist/src/analysis-storage.js +127 -258
- package/dist/src/artifacts.d.ts +5 -1
- package/dist/src/artifacts.js +31 -46
- package/dist/src/audit-commands.d.ts +6 -1
- package/dist/src/audit-commands.js +9 -2
- package/dist/src/audit-retention.d.ts +5 -23
- package/dist/src/audit-retention.js +37 -150
- package/dist/src/binary.js +4 -13
- package/dist/src/budgets.d.ts +2 -2
- package/dist/src/budgets.js +7 -9
- package/dist/src/capture.js +17 -30
- package/dist/src/cli.d.ts +9 -4
- package/dist/src/cli.js +288 -473
- package/dist/src/code-references.d.ts +2 -13
- package/dist/src/code-references.js +7 -99
- package/dist/src/context-diagnostics.d.ts +1 -23
- package/dist/src/context-diagnostics.js +1 -83
- package/dist/src/core/coordinator.d.ts +298 -0
- package/dist/src/core/coordinator.js +591 -0
- package/dist/src/core/layout.d.ts +51 -0
- package/dist/src/core/layout.js +55 -0
- package/dist/src/core/legacy-import.d.ts +55 -0
- package/dist/src/core/legacy-import.js +193 -0
- package/dist/src/cross-results.d.ts +3 -3
- package/dist/src/cross-results.js +4 -42
- package/dist/src/cross.js +2 -3
- package/dist/src/debugger-results.d.ts +1 -6
- package/dist/src/debugger-results.js +21 -153
- package/dist/src/debugger.d.ts +21 -11
- package/dist/src/debugger.js +106 -168
- package/dist/src/decode-results.d.ts +2 -1
- package/dist/src/decode-results.js +4 -20
- package/dist/src/diagnostic-error.d.ts +1 -1
- package/dist/src/diagnostic-error.js +4 -23
- package/dist/src/die.js +1 -23
- package/dist/src/dnspy-runtime.js +5 -12
- package/dist/src/dnspy.js +13 -28
- package/dist/src/dotnet-diagnostics.js +1 -1
- package/dist/src/extensions.d.ts +2 -3
- package/dist/src/extensions.js +14 -91
- package/dist/src/frida-worker.js +0 -20
- package/dist/src/frida.js +3 -26
- package/dist/src/function-boundaries.d.ts +2 -2
- package/dist/src/function-boundaries.js +9 -61
- package/dist/src/function-entries.d.ts +2 -2
- package/dist/src/function-entries.js +6 -36
- package/dist/src/function-inspection.d.ts +2 -2
- package/dist/src/function-inspection.js +17 -33
- package/dist/src/function-results.d.ts +1 -3
- package/dist/src/function-results.js +2 -13
- package/dist/src/hub/admin.d.ts +101 -0
- package/dist/src/hub/admin.js +314 -0
- package/dist/src/hub/autostart.d.ts +111 -0
- package/dist/src/hub/autostart.js +207 -0
- package/dist/src/hub/bundle.d.ts +33 -0
- package/dist/src/hub/bundle.js +25 -0
- package/dist/src/hub/client.d.ts +90 -0
- package/dist/src/hub/client.js +256 -0
- package/dist/src/hub/commands.d.ts +13 -0
- package/dist/src/hub/commands.js +280 -0
- package/dist/src/hub/contract.d.ts +87 -0
- package/dist/src/hub/contract.js +3 -0
- package/dist/src/hub/extensions.d.ts +41 -0
- package/dist/src/hub/extensions.js +3 -0
- package/dist/src/hub/ghidra.d.ts +70 -0
- package/dist/src/hub/ghidra.js +197 -0
- package/dist/src/hub/index.d.ts +6 -0
- package/dist/src/hub/index.js +7 -0
- package/dist/src/{work/store.d.ts → hub/ledger-store.d.ts} +57 -94
- package/dist/src/hub/ledger-store.js +919 -0
- package/dist/src/hub/ledger.d.ts +4 -0
- package/dist/src/hub/ledger.js +173 -0
- package/dist/src/hub/lock.d.ts +7 -0
- package/dist/src/hub/lock.js +53 -0
- package/dist/src/hub/repository.d.ts +45 -0
- package/dist/src/hub/repository.js +130 -0
- package/dist/src/hub/server.d.ts +86 -0
- package/dist/src/hub/server.js +414 -0
- package/dist/src/hub/settings.d.ts +36 -0
- package/dist/src/hub/settings.js +112 -0
- package/dist/src/hub/storage.d.ts +13 -0
- package/dist/src/hub/storage.js +46 -0
- package/dist/src/hub/store.d.ts +75 -0
- package/dist/src/hub/store.js +188 -0
- package/dist/src/ilspy.js +1 -1
- package/dist/src/internal-timing.d.ts +2 -9
- package/dist/src/internal-timing.js +2 -95
- package/dist/src/lldb.js +3 -15
- package/dist/src/llvm.js +0 -9
- package/dist/src/managed-heap.js +3 -7
- package/dist/src/managed-metadata.js +2 -5
- package/dist/src/memory-inputs.d.ts +1 -4
- package/dist/src/memory-inputs.js +10 -40
- package/dist/src/mitmproxy.d.ts +35 -4
- package/dist/src/mitmproxy.js +59 -40
- package/dist/src/model.d.ts +0 -73
- package/dist/src/model.js +0 -45
- package/dist/src/mutations.d.ts +1 -1
- package/dist/src/mutations.js +5 -10
- package/dist/src/native/contract.d.ts +130 -0
- package/dist/src/native/ghidra.d.ts +58 -0
- package/dist/src/native/ghidra.js +77 -0
- package/dist/src/native/host.d.ts +71 -0
- package/dist/src/native/host.js +265 -0
- package/dist/src/native/index.d.ts +13 -0
- package/dist/src/native/index.js +19 -0
- package/dist/src/native/jvm.d.ts +54 -0
- package/dist/src/native/jvm.js +47 -0
- package/dist/src/native/worker.d.ts +70 -0
- package/dist/src/native/worker.js +240 -0
- package/dist/src/native-inputs.d.ts +9 -14
- package/dist/src/native-inputs.js +22 -110
- package/dist/src/native-merge-patches.d.ts +2 -2
- package/dist/src/native-merge-patches.js +14 -14
- package/dist/src/persistent-client.js +53 -25
- package/dist/src/procmon.js +17 -31
- package/dist/src/program-files.d.ts +42 -0
- package/dist/src/program-files.js +148 -0
- package/dist/src/queries.js +2 -15
- package/dist/src/query-policy.d.ts +0 -2
- package/dist/src/query-policy.js +1 -14
- package/dist/src/research.d.ts +59 -238
- package/dist/src/research.js +212 -906
- package/dist/src/runtime-identity.d.ts +8 -0
- package/dist/src/runtime-identity.js +26 -0
- package/dist/src/runtime-manager.d.ts +1 -11
- package/dist/src/runtime-manager.js +10 -145
- package/dist/src/runtime-selection.d.ts +1 -1
- package/dist/src/runtime-selection.js +5 -37
- package/dist/src/saved-materials.js +8 -51
- package/dist/src/scripts.d.ts +1 -1
- package/dist/src/scripts.js +15 -15
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk.js +8 -8
- package/dist/src/sevenzip.js +1 -3
- package/dist/src/strace.js +0 -3
- package/dist/src/string-anchors.d.ts +2 -3
- package/dist/src/string-anchors.js +8 -101
- package/dist/src/text-window.d.ts +5 -4
- package/dist/src/text-window.js +4 -4
- package/dist/src/tool-runtime/archives.d.ts +1 -1
- package/dist/src/tool-runtime/archives.js +11 -20
- package/dist/src/tool-runtime/catalog.js +2 -5
- package/dist/src/tool-runtime/commands.js +1 -3
- package/dist/src/tool-runtime/deadline.js +2 -7
- package/dist/src/tool-runtime/definition.js +1 -31
- package/dist/src/tool-runtime/identity.js +6 -87
- package/dist/src/tool-runtime/installer.d.ts +2 -6
- package/dist/src/tool-runtime/installer.js +14 -76
- package/dist/src/tool-runtime/java-arguments.js +4 -10
- package/dist/src/tool-runtime/launch-worker.js +2 -8
- package/dist/src/tool-runtime/run.d.ts +2 -0
- package/dist/src/tool-runtime/run.js +20 -8
- package/dist/src/tool-runtime/store.d.ts +3 -3
- package/dist/src/tool-runtime/store.js +21 -83
- package/dist/src/tool-runtime/supervisor.d.ts +6 -11
- package/dist/src/tool-runtime/supervisor.js +155 -214
- package/dist/src/tool-runtime/windows-helper.d.ts +5 -0
- package/dist/src/tool-runtime/windows-helper.js +13 -0
- package/dist/src/tool-runtime/windows-job.d.ts +5 -5
- package/dist/src/tool-runtime/windows-job.js +13 -31
- package/dist/src/tshark.js +14 -27
- package/dist/src/ui-results.d.ts +3 -2
- package/dist/src/ui-results.js +16 -53
- package/dist/src/ui.d.ts +12 -13
- package/dist/src/ui.js +32 -70
- package/dist/src/version-tracking.d.ts +25 -39
- package/dist/src/version-tracking.js +70 -174
- package/dist/src/windbg.d.ts +1 -1
- package/dist/src/windbg.js +2 -8
- package/dist/src/work/client.d.ts +63 -0
- package/dist/src/work/client.js +163 -0
- package/dist/src/work/commands.d.ts +3 -1
- package/dist/src/work/commands.js +158 -184
- package/dist/src/work/dashboard.d.ts +2 -2
- package/dist/src/work/dashboard.js +7 -8
- package/dist/src/work/legacy.d.ts +8 -0
- package/dist/src/work/legacy.js +70 -0
- package/dist/src/work/model.d.ts +0 -3
- package/dist/src/work/model.js +0 -10
- package/dist/src/work/timing.d.ts +3 -3
- package/dist/src/work/timing.js +21 -25
- package/dist/src/workspace.d.ts +4 -250
- package/dist/src/workspace.js +11 -699
- package/node_modules/@eyeauras/cli-factory/README.md +6 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/cli.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/cli.js +76 -28
- package/node_modules/@eyeauras/cli-factory/dist/src/cli.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/command.d.ts +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/command.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/command.js +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/command.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.d.ts +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.js +18 -6
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/file-publication.d.ts +44 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/file-publication.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/{profile-file.js → file-publication.js} +41 -113
- package/node_modules/@eyeauras/cli-factory/dist/src/file-publication.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.d.ts +5 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.js +17 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/index.d.ts +9 -4
- package/node_modules/@eyeauras/cli-factory/dist/src/index.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/index.js +5 -2
- package/node_modules/@eyeauras/cli-factory/dist/src/index.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/json-rpc.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/json-rpc.js +11 -18
- package/node_modules/@eyeauras/cli-factory/dist/src/json-rpc.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.d.ts +10 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.js +69 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output.d.ts +3 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/output.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/output.js +74 -14
- package/node_modules/@eyeauras/cli-factory/dist/src/output.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.d.ts +3 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.js +9 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/permissions.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/permissions.js +3 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/permissions.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.d.ts +16 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.js +83 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/types.d.ts +5 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/types.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/view.d.ts +49 -7
- package/node_modules/@eyeauras/cli-factory/dist/src/view.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/view.js +83 -6
- package/node_modules/@eyeauras/cli-factory/dist/src/view.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/package.json +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/cli-host.proto +19 -19
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.d.ts +7 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.js +9 -4
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/host.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/host.js +5 -4
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/host.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.d.ts +11 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.js +85 -57
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/package.json +2 -2
- package/package.json +4 -5
- package/references/native/InsightAnalyzerOptions.java +10 -0
- package/references/native/InsightAnchorScan.java +1 -11
- package/references/native/InsightCodeReferences.java +2 -3
- package/references/native/InsightCopyType.java +24 -0
- package/references/native/InsightFunctionBoundaries.java +0 -1
- package/references/native/InsightFunctionDatabases.java +20 -16
- package/references/native/InsightHelperCall.java +17 -0
- package/references/native/InsightHubServer.java +214 -0
- package/references/native/InsightNativeHost.java +112 -0
- package/references/native/InsightPlugins.java +0 -1
- package/references/native/InsightPythonWheels.java +3 -2
- package/references/native/InsightResearchQueries.java +3 -4
- package/references/native/InsightResearchView.java +4 -10
- package/references/native/InsightSdkFiles.java +7 -15
- package/references/native/InsightSdkScript.java +1 -4
- package/references/native/InsightSdkTools.java +36 -97
- package/references/native/InsightSdkTypes.java +13 -43
- package/references/native/InsightStringAnchors.java +1 -3
- package/references/native/InsightTraceState.java +13 -96
- package/references/native/InsightTraceTools.java +3 -5
- package/references/native/InsightVersionTracking.java +0 -6
- package/references/native/{HeadlessProgramMergeManager.java → InsightWcMerge.java} +17 -24
- package/references/native/InsightWcOps.java +449 -0
- package/references/native/InsightWcWorker.java +142 -0
- package/references/native/NATIVE-MERGE-NOTICE.txt +4 -8
- package/runtime/GhidraMCP-7.0.0.jar +0 -0
- package/runtime/managed/insight-heap/README.md +3 -3
- package/runtime/managed/insight-managed/README.md +3 -3
- package/runtime/native/binary/README.md +5 -4
- package/runtime/native/windows/DirectoryAlias.cs +24 -0
- package/runtime/native/windows/Insight.Windows.csproj +27 -0
- package/runtime/native/windows/Native.cs +36 -0
- package/runtime/native/windows/OwnedJob.cs +86 -0
- package/runtime/native/windows/Program.cs +50 -0
- package/runtime/native/windows/RegistryRedirect.cs +42 -0
- package/runtime/native/windows/insight-windows-x64.exe +0 -0
- package/runtime/native/windows/packages.lock.json +35 -0
- package/runtime/native/windows/provenance.json +17 -0
- package/runtime/research-view.provenance.json +6 -7
- package/runtime/toolbox.json +33 -114
- package/skill-bundle/insight-artifacts/SKILL.md +5 -19
- package/skill-bundle/insight-binary/SKILL.md +5 -35
- package/skill-bundle/insight-capture/SKILL.md +5 -45
- package/skill-bundle/insight-cli/SKILL.md +6 -44
- package/skill-bundle/insight-die/SKILL.md +5 -38
- package/skill-bundle/insight-dnspy/SKILL.md +5 -54
- package/skill-bundle/insight-dotnet-dump/SKILL.md +5 -35
- package/skill-bundle/insight-dotnet-stack/SKILL.md +5 -28
- package/skill-bundle/insight-dotnet-trace/SKILL.md +5 -34
- package/skill-bundle/insight-frida/SKILL.md +5 -56
- package/skill-bundle/insight-ghidra/SKILL.md +14 -113
- package/skill-bundle/insight-ilspy/SKILL.md +5 -34
- package/skill-bundle/insight-interop/SKILL.md +5 -43
- package/skill-bundle/insight-lldb/SKILL.md +5 -43
- package/skill-bundle/insight-llvm/SKILL.md +5 -45
- package/skill-bundle/insight-managed-heap/SKILL.md +5 -32
- package/skill-bundle/insight-managed-metadata/SKILL.md +5 -41
- package/skill-bundle/insight-mitmproxy/SKILL.md +5 -51
- package/skill-bundle/insight-overview/SKILL.md +5 -68
- package/skill-bundle/insight-procmon/SKILL.md +5 -38
- package/skill-bundle/insight-re/SKILL.md +10 -127
- package/skill-bundle/insight-sevenzip/SKILL.md +5 -31
- package/skill-bundle/insight-strace/SKILL.md +5 -35
- package/skill-bundle/insight-tshark/SKILL.md +5 -38
- package/skill-bundle/insight-windbg/SKILL.md +5 -35
- package/skill-bundle/manifest.json +1 -1
- package/skills/insight-artifacts/SKILL.md +5 -19
- package/skills/insight-binary/SKILL.md +5 -35
- package/skills/insight-capture/SKILL.md +5 -45
- package/skills/insight-die/SKILL.md +5 -38
- package/skills/insight-dnspy/SKILL.md +5 -54
- package/skills/insight-dotnet-dump/SKILL.md +5 -35
- package/skills/insight-dotnet-stack/SKILL.md +5 -28
- package/skills/insight-dotnet-trace/SKILL.md +5 -34
- package/skills/insight-frida/SKILL.md +5 -56
- package/skills/insight-ghidra/SKILL.md +14 -113
- package/skills/insight-ilspy/SKILL.md +5 -34
- package/skills/insight-interop/SKILL.md +5 -43
- package/skills/insight-lldb/SKILL.md +5 -43
- package/skills/insight-llvm/SKILL.md +5 -45
- package/skills/insight-managed-heap/SKILL.md +5 -32
- package/skills/insight-managed-metadata/SKILL.md +5 -41
- package/skills/insight-mitmproxy/SKILL.md +5 -51
- package/skills/insight-overview/SKILL.md +5 -68
- package/skills/insight-procmon/SKILL.md +5 -38
- package/skills/insight-re/SKILL.md +10 -127
- package/skills/insight-sevenzip/SKILL.md +5 -31
- package/skills/insight-strace/SKILL.md +5 -35
- package/skills/insight-tshark/SKILL.md +5 -38
- package/skills/insight-windbg/SKILL.md +5 -35
- package/dist/src/administration-results.d.ts +0 -1
- package/dist/src/administration-results.js +0 -84
- package/dist/src/administration.d.ts +0 -14
- package/dist/src/administration.js +0 -134
- package/dist/src/archive-contract.d.ts +0 -6
- package/dist/src/archive-contract.js +0 -108
- package/dist/src/archive.d.ts +0 -12
- package/dist/src/archive.js +0 -116
- package/dist/src/comment-effects.d.ts +0 -3
- package/dist/src/comment-effects.js +0 -55
- package/dist/src/context-credential.d.ts +0 -18
- package/dist/src/context-credential.js +0 -44
- package/dist/src/contexts.d.ts +0 -387
- package/dist/src/contexts.js +0 -2805
- package/dist/src/coordinator.d.ts +0 -41
- package/dist/src/coordinator.js +0 -160
- package/dist/src/cross-peer.d.ts +0 -20
- package/dist/src/cross-peer.js +0 -53
- package/dist/src/data-effects.d.ts +0 -3
- package/dist/src/data-effects.js +0 -103
- package/dist/src/debugger-caller.d.ts +0 -17
- package/dist/src/debugger-caller.js +0 -129
- package/dist/src/debugger-launch.d.ts +0 -2
- package/dist/src/debugger-launch.js +0 -17
- package/dist/src/debugger-supervisor.js +0 -179
- package/dist/src/directory-identity.d.ts +0 -6
- package/dist/src/directory-identity.js +0 -45
- package/dist/src/documentation-effects.d.ts +0 -5
- package/dist/src/documentation-effects.js +0 -56
- package/dist/src/function-effects.d.ts +0 -4
- package/dist/src/function-effects.js +0 -112
- package/dist/src/ghidra-processes.d.ts +0 -6
- package/dist/src/ghidra-processes.js +0 -138
- package/dist/src/ghidra.d.ts +0 -50
- package/dist/src/ghidra.js +0 -468
- package/dist/src/initial-model.d.ts +0 -7
- package/dist/src/initial-model.js +0 -115
- package/dist/src/initial-progress.d.ts +0 -4
- package/dist/src/initial-progress.js +0 -74
- package/dist/src/inline-script.d.ts +0 -15
- package/dist/src/inline-script.js +0 -61
- package/dist/src/legacy-migration.d.ts +0 -37
- package/dist/src/legacy-migration.js +0 -238
- package/dist/src/lifecycle.d.ts +0 -77
- package/dist/src/lifecycle.js +0 -315
- package/dist/src/merge.d.ts +0 -29
- package/dist/src/merge.js +0 -66
- package/dist/src/mutation-effects.d.ts +0 -4
- package/dist/src/mutation-effects.js +0 -321
- package/dist/src/native-queries.d.ts +0 -2
- package/dist/src/native-queries.js +0 -24
- package/dist/src/native-service.d.ts +0 -40
- package/dist/src/native-service.js +0 -406
- package/dist/src/projects.d.ts +0 -31
- package/dist/src/projects.js +0 -302
- package/dist/src/prototype-cli.d.ts +0 -8
- package/dist/src/prototype-cli.js +0 -155
- package/dist/src/query-results.d.ts +0 -2
- package/dist/src/query-results.js +0 -224
- package/dist/src/research-view.d.ts +0 -6
- package/dist/src/research-view.js +0 -9
- package/dist/src/sdk-files.d.ts +0 -29
- package/dist/src/sdk-files.js +0 -249
- package/dist/src/server.d.ts +0 -102
- package/dist/src/server.js +0 -663
- package/dist/src/storage-gc.d.ts +0 -23
- package/dist/src/storage-gc.js +0 -600
- package/dist/src/store.d.ts +0 -33
- package/dist/src/store.js +0 -178
- package/dist/src/sync-policy.d.ts +0 -22
- package/dist/src/sync-policy.js +0 -129
- package/dist/src/timed-backend.d.ts +0 -3
- package/dist/src/timed-backend.js +0 -24
- package/dist/src/timing-report.d.ts +0 -32
- package/dist/src/timing-report.js +0 -74
- package/dist/src/tool-runtime/native-process-proof.d.ts +0 -2
- package/dist/src/tool-runtime/native-process-proof.js +0 -26
- package/dist/src/transport.d.ts +0 -60
- package/dist/src/transport.js +0 -223
- package/dist/src/unresolved-guidance.d.ts +0 -46
- package/dist/src/unresolved-guidance.js +0 -55
- package/dist/src/work/backup.d.ts +0 -66
- package/dist/src/work/backup.js +0 -446
- package/dist/src/work/store.js +0 -1107
- package/dist/src/worker-lease.d.ts +0 -17
- package/dist/src/worker-lease.js +0 -50
- package/node_modules/@eyeauras/cli-factory/dist/src/profile-file.d.ts +0 -37
- package/node_modules/@eyeauras/cli-factory/dist/src/profile-file.d.ts.map +0 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/profile-file.js.map +0 -1
- package/references/InsightRepositoryProbe.java +0 -55
- package/references/administration.md +0 -34
- package/references/agent-execution.md +0 -36
- package/references/agent-setup.md +0 -60
- package/references/archive.md +0 -32
- package/references/artifacts.md +0 -52
- package/references/debugger.md +0 -64
- package/references/extensions-and-sync.md +0 -125
- package/references/ilspy.md +0 -33
- package/references/managed-runtime.md +0 -162
- package/references/native/InsightArchivePayloads.java +0 -36
- package/references/native/InsightBlockTransfer.java +0 -57
- package/references/native/InsightGuiMain.java +0 -33
- package/references/native/InsightHeadlessMain.java +0 -18
- package/references/native/InsightImportProgress.java +0 -60
- package/references/native/InsightInitialImport.java +0 -48
- package/references/native/InsightInitialJournal.java +0 -57
- package/references/native/InsightInitialPublication.java +0 -142
- package/references/native/InsightInitialRecovery.java +0 -131
- package/references/native/InsightInlineExecutor.java +0 -143
- package/references/native/InsightInlineScript.java +0 -14
- package/references/native/InsightNativeCheckout.java +0 -487
- package/references/native/InsightNativeFingerprint.java +0 -80
- package/references/native/InsightNativeMigration.java +0 -155
- package/references/native/InsightNativeRead.java +0 -80
- package/references/native/InsightNativeReceipt.java +0 -31
- package/references/native/InsightNativeService.java +0 -43
- package/references/native/InsightNativeView.java +0 -40
- package/references/native/InsightOfflineAuthenticator.java +0 -20
- package/references/native/InsightOwnedScripts.java +0 -170
- package/references/native/InsightProjectFiles.java +0 -92
- package/references/native/InsightPublicationRecovery.java +0 -63
- package/references/native/InsightServerAdministration.java +0 -82
- package/references/native/InsightServerInit.java +0 -62
- package/references/native/InsightServerMain.java +0 -43
- package/references/native/InsightServerProbe.java +0 -29
- package/references/native/InsightSnapshotFields.java +0 -74
- package/references/native/InsightSnapshotInspect.java +0 -191
- package/references/native/InsightSnapshotPublisher.java +0 -123
- package/references/native/InsightStopDebugger.java +0 -20
- package/references/native/InsightTraceInspect.java +0 -24
- package/references/native/InsightWorkerLease.java +0 -132
- package/references/native-workflows.md +0 -124
- package/references/persistent-client.mjs +0 -147
- package/references/persistent.md +0 -90
- package/references/query-semantics.md +0 -109
- package/references/recovery.md +0 -235
- package/references/research.md +0 -296
- package/references/setup.md +0 -135
- package/references/sparse-navigation.md +0 -173
- package/references/storage.md +0 -139
- package/references/work-tracking.md +0 -261
- package/runtime/native/file-version.ps1 +0 -7
- package/runtime/native/mitmproxy/bridge.py +0 -180
- package/runtime/native/windows-job/DirectoryAlias.cs +0 -24
- package/runtime/native/windows-job/Insight.WindowsJob.csproj +0 -1
- package/runtime/native/windows-job/Insight.WindowsJob.dll +0 -0
- package/runtime/native/windows-job/OwnedJob.cs +0 -79
- package/runtime/native/windows-job/RegistryRedirect.cs +0 -45
- package/runtime/native/windows-job/packages.lock.json +0 -21
- package/runtime/native/windows-job/provenance.json +0 -16
- package/runtime/native/windows-job/windows-job.ps1 +0 -8
- package/skill-bundle/insight-artifacts/references/agent-execution.md +0 -36
- package/skill-bundle/insight-artifacts/references/artifacts.md +0 -52
- package/skill-bundle/insight-artifacts/references/recovery.md +0 -235
- package/skill-bundle/insight-artifacts/references/storage.md +0 -139
- package/skill-bundle/insight-binary/references/agent-execution.md +0 -36
- package/skill-bundle/insight-capture/references/agent-execution.md +0 -36
- package/skill-bundle/insight-cli/references/agent-execution.md +0 -36
- package/skill-bundle/insight-cli/references/agent-setup.md +0 -60
- package/skill-bundle/insight-cli/references/archive.md +0 -32
- package/skill-bundle/insight-cli/references/managed-runtime.md +0 -162
- package/skill-bundle/insight-cli/references/persistent-client.mjs +0 -147
- package/skill-bundle/insight-cli/references/persistent.md +0 -90
- package/skill-bundle/insight-cli/references/recovery.md +0 -235
- package/skill-bundle/insight-cli/references/setup.md +0 -135
- package/skill-bundle/insight-cli/references/storage.md +0 -139
- package/skill-bundle/insight-die/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dnspy/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dotnet-dump/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dotnet-stack/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dotnet-trace/references/agent-execution.md +0 -36
- package/skill-bundle/insight-frida/references/agent-execution.md +0 -36
- package/skill-bundle/insight-ghidra/references/administration.md +0 -34
- package/skill-bundle/insight-ghidra/references/agent-execution.md +0 -36
- package/skill-bundle/insight-ghidra/references/archive.md +0 -32
- package/skill-bundle/insight-ghidra/references/artifacts.md +0 -52
- package/skill-bundle/insight-ghidra/references/debugger.md +0 -64
- package/skill-bundle/insight-ghidra/references/extensions-and-sync.md +0 -125
- package/skill-bundle/insight-ghidra/references/managed-runtime.md +0 -162
- package/skill-bundle/insight-ghidra/references/native-workflows.md +0 -124
- package/skill-bundle/insight-ghidra/references/persistent-client.mjs +0 -147
- package/skill-bundle/insight-ghidra/references/persistent.md +0 -90
- package/skill-bundle/insight-ghidra/references/query-semantics.md +0 -109
- package/skill-bundle/insight-ghidra/references/recovery.md +0 -235
- package/skill-bundle/insight-ghidra/references/research.md +0 -296
- package/skill-bundle/insight-ghidra/references/setup.md +0 -135
- package/skill-bundle/insight-ghidra/references/sparse-navigation.md +0 -173
- package/skill-bundle/insight-ghidra/references/storage.md +0 -139
- package/skill-bundle/insight-ilspy/references/agent-execution.md +0 -36
- package/skill-bundle/insight-ilspy/references/ilspy.md +0 -33
- package/skill-bundle/insight-interop/references/agent-execution.md +0 -36
- package/skill-bundle/insight-lldb/references/agent-execution.md +0 -36
- package/skill-bundle/insight-llvm/references/agent-execution.md +0 -36
- package/skill-bundle/insight-managed-heap/references/agent-execution.md +0 -36
- package/skill-bundle/insight-managed-metadata/references/agent-execution.md +0 -36
- package/skill-bundle/insight-mitmproxy/references/agent-execution.md +0 -36
- package/skill-bundle/insight-overview/references/agent-execution.md +0 -36
- package/skill-bundle/insight-procmon/references/agent-execution.md +0 -36
- package/skill-bundle/insight-re/references/agent-execution.md +0 -36
- package/skill-bundle/insight-re/references/artifacts.md +0 -52
- package/skill-bundle/insight-re/references/persistent-client.mjs +0 -147
- package/skill-bundle/insight-re/references/persistent.md +0 -90
- package/skill-bundle/insight-re/references/recovery.md +0 -235
- package/skill-bundle/insight-re/references/storage.md +0 -139
- package/skill-bundle/insight-re/references/work-tracking.md +0 -261
- package/skill-bundle/insight-sevenzip/references/agent-execution.md +0 -36
- package/skill-bundle/insight-strace/references/agent-execution.md +0 -36
- package/skill-bundle/insight-tshark/references/agent-execution.md +0 -36
- package/skill-bundle/insight-windbg/references/agent-execution.md +0 -36
- package/skills/insight-artifacts/references/agent-execution.md +0 -36
- package/skills/insight-artifacts/references/artifacts.md +0 -52
- package/skills/insight-artifacts/references/recovery.md +0 -235
- package/skills/insight-artifacts/references/storage.md +0 -139
- package/skills/insight-binary/references/agent-execution.md +0 -36
- package/skills/insight-capture/references/agent-execution.md +0 -36
- package/skills/insight-die/references/agent-execution.md +0 -36
- package/skills/insight-dnspy/references/agent-execution.md +0 -36
- package/skills/insight-dotnet-dump/references/agent-execution.md +0 -36
- package/skills/insight-dotnet-stack/references/agent-execution.md +0 -36
- package/skills/insight-dotnet-trace/references/agent-execution.md +0 -36
- package/skills/insight-frida/references/agent-execution.md +0 -36
- package/skills/insight-ghidra/references/administration.md +0 -34
- package/skills/insight-ghidra/references/agent-execution.md +0 -36
- package/skills/insight-ghidra/references/archive.md +0 -32
- package/skills/insight-ghidra/references/artifacts.md +0 -52
- package/skills/insight-ghidra/references/debugger.md +0 -64
- package/skills/insight-ghidra/references/extensions-and-sync.md +0 -125
- package/skills/insight-ghidra/references/managed-runtime.md +0 -162
- package/skills/insight-ghidra/references/native-workflows.md +0 -124
- package/skills/insight-ghidra/references/persistent-client.mjs +0 -147
- package/skills/insight-ghidra/references/persistent.md +0 -90
- package/skills/insight-ghidra/references/query-semantics.md +0 -109
- package/skills/insight-ghidra/references/recovery.md +0 -235
- package/skills/insight-ghidra/references/research.md +0 -296
- package/skills/insight-ghidra/references/setup.md +0 -135
- package/skills/insight-ghidra/references/sparse-navigation.md +0 -173
- package/skills/insight-ghidra/references/storage.md +0 -139
- package/skills/insight-ilspy/references/agent-execution.md +0 -36
- package/skills/insight-ilspy/references/ilspy.md +0 -33
- package/skills/insight-interop/references/agent-execution.md +0 -36
- package/skills/insight-lldb/references/agent-execution.md +0 -36
- package/skills/insight-llvm/references/agent-execution.md +0 -36
- package/skills/insight-managed-heap/references/agent-execution.md +0 -36
- package/skills/insight-managed-metadata/references/agent-execution.md +0 -36
- package/skills/insight-mitmproxy/references/agent-execution.md +0 -36
- package/skills/insight-overview/references/agent-execution.md +0 -36
- package/skills/insight-procmon/references/agent-execution.md +0 -36
- package/skills/insight-re/references/agent-execution.md +0 -36
- package/skills/insight-re/references/artifacts.md +0 -52
- package/skills/insight-re/references/persistent-client.mjs +0 -147
- package/skills/insight-re/references/persistent.md +0 -90
- package/skills/insight-re/references/recovery.md +0 -235
- package/skills/insight-re/references/storage.md +0 -139
- package/skills/insight-re/references/work-tracking.md +0 -261
- package/skills/insight-sevenzip/references/agent-execution.md +0 -36
- package/skills/insight-strace/references/agent-execution.md +0 -36
- package/skills/insight-tshark/references/agent-execution.md +0 -36
- package/skills/insight-windbg/references/agent-execution.md +0 -36
- /package/dist/src/{debugger-supervisor.d.ts → native/contract.js} +0 -0
- /package/runtime/native/{windows-job → windows}/NuGet.Config +0 -0
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { link, lstat,
|
|
3
|
-
import { isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
4
|
-
import { command } from "./command.js";
|
|
5
|
-
import { tableView } from "./view.js";
|
|
2
|
+
import { link, lstat, mkdtemp, open, realpath, rmdir, unlink, } from "node:fs/promises";
|
|
3
|
+
import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
6
4
|
import { privateDirectory } from "./private-storage.js";
|
|
7
5
|
import { consumeResponseBody } from "./response-body.js";
|
|
8
6
|
import { CliError } from "./errors.js";
|
|
9
7
|
/** A download or saved-file failure; `published` and `cleanupFailed` say what was left behind. */
|
|
10
|
-
export class
|
|
8
|
+
export class FilePublicationError extends CliError {
|
|
11
9
|
published;
|
|
12
10
|
cleanupFailed;
|
|
13
11
|
constructor(message, published = false, cleanupFailed = false, options = {}) {
|
|
14
12
|
super(message, { code: "download.failed", ...options });
|
|
15
13
|
this.published = published;
|
|
16
14
|
this.cleanupFailed = cleanupFailed;
|
|
17
|
-
this.name = "
|
|
15
|
+
this.name = "FilePublicationError";
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
function fileIdentityFromStat(path, stat) {
|
|
@@ -29,11 +27,6 @@ function fileIdentityFromStat(path, stat) {
|
|
|
29
27
|
ctimeNs: stat.ctimeNs,
|
|
30
28
|
};
|
|
31
29
|
}
|
|
32
|
-
function inside(parent, child) {
|
|
33
|
-
const part = relative(parent, child);
|
|
34
|
-
if (part === ".." || part.startsWith(".." + sep) || isAbsolute(part))
|
|
35
|
-
throw new Error("The path escapes its parent directory.");
|
|
36
|
-
}
|
|
37
30
|
async function directoryIdentity(path) {
|
|
38
31
|
const stat = await lstat(path, { bigint: true });
|
|
39
32
|
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
@@ -52,13 +45,6 @@ async function prepareDirectories(path) {
|
|
|
52
45
|
const result = [await directoryIdentity(current)];
|
|
53
46
|
for (const segment of relative(current, absolute).split(sep).filter(Boolean)) {
|
|
54
47
|
current = join(current, segment);
|
|
55
|
-
try {
|
|
56
|
-
await mkdir(current, { mode: 0o700 });
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
if (error.code !== "EEXIST")
|
|
60
|
-
throw error;
|
|
61
|
-
}
|
|
62
48
|
result.push(await directoryIdentity(current));
|
|
63
49
|
}
|
|
64
50
|
// Packaged Windows applications can resolve AppData to a different physical spelling.
|
|
@@ -95,26 +81,31 @@ function safeBasename(value) {
|
|
|
95
81
|
!/[<>:"/\\|?*\u0000-\u001f\u007f-\u009f\p{Cf}]/u.test(value) && !/[. ]$/.test(value) &&
|
|
96
82
|
!/^(?:con|prn|aux|nul|conin\$|conout\$|clock\$|com[1-9¹²³]|lpt[1-9¹²³])(?:[ .]|$)/i.test(value);
|
|
97
83
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (!isAbsolute(
|
|
101
|
-
throw new
|
|
84
|
+
/** Publish without overwriting; the destination parent must already exist. */
|
|
85
|
+
export async function publishFile(options) {
|
|
86
|
+
if (!isAbsolute(options.cwd))
|
|
87
|
+
throw new FilePublicationError("The working directory must be absolute.");
|
|
88
|
+
if (options.output === undefined && !safeBasename(options.name)) {
|
|
89
|
+
throw new FilePublicationError("Download name must be one safe basename without reserved characters.");
|
|
102
90
|
}
|
|
103
|
-
|
|
104
|
-
|
|
91
|
+
const destination = resolve(options.cwd, options.output ?? options.name);
|
|
92
|
+
if (!safeBasename(basename(destination)) || options.output === "") {
|
|
93
|
+
throw new FilePublicationError("The output must name a safe file.");
|
|
105
94
|
}
|
|
95
|
+
return publishAt(options, destination);
|
|
96
|
+
}
|
|
97
|
+
/** Publish generated user text using the same exclusive publisher. */
|
|
98
|
+
export function saveFile(options) {
|
|
99
|
+
const { content, ...target } = options;
|
|
100
|
+
return publishFile({ ...target, openResponse: async () => new Response(content), inspectResponse() { } });
|
|
101
|
+
}
|
|
102
|
+
async function publishAt(options, destination) {
|
|
103
|
+
const { maxBytes, signal } = options;
|
|
106
104
|
if (maxBytes !== undefined && (!Number.isSafeInteger(maxBytes) || maxBytes < 1)) {
|
|
107
|
-
throw new
|
|
105
|
+
throw new FilePublicationError("Download byte limit must be a positive safe integer.");
|
|
108
106
|
}
|
|
109
|
-
const
|
|
110
|
-
const downloadDirectory = join(profileDirectory, "downloads");
|
|
111
|
-
const tempDirectory = join(profileDirectory, "temp");
|
|
112
|
-
const destination = join(downloadDirectory, name);
|
|
113
|
-
inside(profileDirectory, downloadDirectory);
|
|
114
|
-
inside(profileDirectory, tempDirectory);
|
|
115
|
-
inside(downloadDirectory, destination);
|
|
107
|
+
const parentDirectory = dirname(destination);
|
|
116
108
|
let destinationDirectories = [];
|
|
117
|
-
let stagingDirectories = [];
|
|
118
109
|
let stagingDirectory;
|
|
119
110
|
let stagingDirectoryIdentity;
|
|
120
111
|
let stagingPath;
|
|
@@ -136,8 +127,7 @@ export async function publishProfileFile(options) {
|
|
|
136
127
|
failureMessage =
|
|
137
128
|
"Download directories could not be verified; symlinks, junctions and replacement are " +
|
|
138
129
|
"unsupported; no destination was published.";
|
|
139
|
-
destinationDirectories = await prepareDirectories(
|
|
140
|
-
stagingDirectories = await prepareDirectories(tempDirectory);
|
|
130
|
+
destinationDirectories = await prepareDirectories(parentDirectory);
|
|
141
131
|
try {
|
|
142
132
|
const existing = await lstat(destination);
|
|
143
133
|
void existing;
|
|
@@ -149,8 +139,8 @@ export async function publishProfileFile(options) {
|
|
|
149
139
|
if (error.code !== "ENOENT")
|
|
150
140
|
throw error;
|
|
151
141
|
}
|
|
152
|
-
await verifyDirectories(
|
|
153
|
-
stagingDirectory = await mkdtemp(join(
|
|
142
|
+
await verifyDirectories(destinationDirectories);
|
|
143
|
+
stagingDirectory = await mkdtemp(join(parentDirectory, ".download-"));
|
|
154
144
|
stagingDirectoryIdentity = await directoryIdentity(stagingDirectory);
|
|
155
145
|
await privateDirectory(stagingDirectory);
|
|
156
146
|
await verifyIdentity(stagingDirectoryIdentity, "directory");
|
|
@@ -172,7 +162,7 @@ export async function publishProfileFile(options) {
|
|
|
172
162
|
await options.inspectResponse(response);
|
|
173
163
|
}
|
|
174
164
|
catch (error) {
|
|
175
|
-
if (error instanceof
|
|
165
|
+
if (error instanceof FilePublicationError)
|
|
176
166
|
failureMessage = error.message;
|
|
177
167
|
throw error;
|
|
178
168
|
}
|
|
@@ -198,7 +188,7 @@ export async function publishProfileFile(options) {
|
|
|
198
188
|
failureMessage =
|
|
199
189
|
"Download directories or private staging changed during the transfer; " +
|
|
200
190
|
"no destination was published.";
|
|
201
|
-
await verifyDirectories(
|
|
191
|
+
await verifyDirectories(destinationDirectories);
|
|
202
192
|
await verifyIdentity(stagingDirectoryIdentity, "directory");
|
|
203
193
|
const completedIdentity = await fileIdentity(stagingIdentity.path);
|
|
204
194
|
if (completedIdentity.dev !== stagingIdentity.dev ||
|
|
@@ -217,7 +207,7 @@ export async function publishProfileFile(options) {
|
|
|
217
207
|
});
|
|
218
208
|
}
|
|
219
209
|
catch (error) {
|
|
220
|
-
if (error instanceof
|
|
210
|
+
if (error instanceof FilePublicationError)
|
|
221
211
|
failureMessage = error.message;
|
|
222
212
|
throw error;
|
|
223
213
|
}
|
|
@@ -229,7 +219,7 @@ export async function publishProfileFile(options) {
|
|
|
229
219
|
failureMessage =
|
|
230
220
|
"Download directories or private staging changed during validation; " +
|
|
231
221
|
"no destination was published.";
|
|
232
|
-
await verifyDirectories(
|
|
222
|
+
await verifyDirectories(destinationDirectories);
|
|
233
223
|
await verifyIdentity(stagingDirectoryIdentity, "directory");
|
|
234
224
|
await verifyFileSnapshot(stagingIdentity);
|
|
235
225
|
if (signal?.aborted) {
|
|
@@ -247,15 +237,15 @@ export async function publishProfileFile(options) {
|
|
|
247
237
|
}
|
|
248
238
|
else {
|
|
249
239
|
failureMessage =
|
|
250
|
-
"Download could not be published exclusively; the
|
|
240
|
+
"Download could not be published exclusively; the destination filesystem must support hard links.";
|
|
251
241
|
}
|
|
252
242
|
throw error;
|
|
253
243
|
}
|
|
254
244
|
published = true;
|
|
255
245
|
failureMessage =
|
|
256
246
|
"Download was published, but its destination identity could not be verified; " +
|
|
257
|
-
"inspect the
|
|
258
|
-
await verifyDirectories(
|
|
247
|
+
"inspect the destination directory.";
|
|
248
|
+
await verifyDirectories(destinationDirectories);
|
|
259
249
|
await verifyIdentity(stagingDirectoryIdentity, "directory");
|
|
260
250
|
await verifyIdentity(stagingIdentity, "file");
|
|
261
251
|
const publishedIdentity = await fileIdentity(destination);
|
|
@@ -297,7 +287,7 @@ export async function publishProfileFile(options) {
|
|
|
297
287
|
try {
|
|
298
288
|
if (!stagingDirectoryIdentity)
|
|
299
289
|
throw new Error("No staging directory identity.");
|
|
300
|
-
await verifyDirectories(
|
|
290
|
+
await verifyDirectories(destinationDirectories);
|
|
301
291
|
await verifyIdentity(stagingDirectoryIdentity, "directory");
|
|
302
292
|
if (stagingPath && stagingIdentity) {
|
|
303
293
|
try {
|
|
@@ -314,7 +304,7 @@ export async function publishProfileFile(options) {
|
|
|
314
304
|
else if (stagingPath) {
|
|
315
305
|
throw new Error("The staged file identity is unknown.");
|
|
316
306
|
}
|
|
317
|
-
await verifyDirectories(
|
|
307
|
+
await verifyDirectories(destinationDirectories);
|
|
318
308
|
await verifyIdentity(stagingDirectoryIdentity, "directory");
|
|
319
309
|
await rmdir(stagingDirectory);
|
|
320
310
|
}
|
|
@@ -326,74 +316,12 @@ export async function publishProfileFile(options) {
|
|
|
326
316
|
}
|
|
327
317
|
const cause = failures.length > 1 ? new AggregateError(failures, "Download and cleanup failures.") : failures[0];
|
|
328
318
|
if (cleanupFailed) {
|
|
329
|
-
throw new
|
|
330
|
-
? "Download was published, but private staging cleanup failed; inspect the
|
|
331
|
-
: "Download was not published, and private staging cleanup failed; inspect the
|
|
319
|
+
throw new FilePublicationError(published
|
|
320
|
+
? "Download was published, but private staging cleanup failed; inspect the destination directory for .download-* staging."
|
|
321
|
+
: "Download was not published, and private staging cleanup failed; inspect the destination directory for .download-* staging.", published, true, { cause });
|
|
332
322
|
}
|
|
333
323
|
if (!result)
|
|
334
|
-
throw new
|
|
324
|
+
throw new FilePublicationError(failureMessage, published, false, { cause });
|
|
335
325
|
return result;
|
|
336
326
|
}
|
|
337
|
-
|
|
338
|
-
export function saveProfileFile(options) {
|
|
339
|
-
const { content, ...target } = options;
|
|
340
|
-
return publishProfileFile({ ...target, openResponse: async () => new Response(content), inspectResponse() { } });
|
|
341
|
-
}
|
|
342
|
-
async function savedFiles(appDataDirectory) {
|
|
343
|
-
try {
|
|
344
|
-
if (!isAbsolute(appDataDirectory))
|
|
345
|
-
throw new Error("The profile AppData directory is not absolute.");
|
|
346
|
-
const directory = join(resolve(appDataDirectory), "downloads");
|
|
347
|
-
const directories = await prepareDirectories(directory);
|
|
348
|
-
const files = [];
|
|
349
|
-
for (const name of (await readdir(directory)).sort()) {
|
|
350
|
-
const path = join(directory, name);
|
|
351
|
-
const stat = await lstat(path);
|
|
352
|
-
if (stat.isFile())
|
|
353
|
-
files.push({ name, path, bytes: stat.size, modified: stat.mtime.toISOString() });
|
|
354
|
-
}
|
|
355
|
-
return { directories, files };
|
|
356
|
-
}
|
|
357
|
-
catch (cause) {
|
|
358
|
-
throw new ProfileFileError("Profile downloads could not be read; symlinks, junctions and replacement are unsupported.", false, false, { cause });
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
/** Delete regular files directly inside downloads; links, directories and other profiles are never touched. */
|
|
362
|
-
async function deleteSavedFiles(appDataDirectory, name) {
|
|
363
|
-
const { directories, files } = await savedFiles(appDataDirectory);
|
|
364
|
-
const selected = files.filter((file) => name === undefined || file.name === name);
|
|
365
|
-
if (name !== undefined && !selected.length) {
|
|
366
|
-
throw new ProfileFileError("No saved file has that name.", false, false, { next: [["downloads", "list"]] });
|
|
367
|
-
}
|
|
368
|
-
const deleted = [];
|
|
369
|
-
try {
|
|
370
|
-
for (const file of selected) {
|
|
371
|
-
await verifyDirectories(directories);
|
|
372
|
-
await unlink(file.path);
|
|
373
|
-
deleted.push(file.name);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
catch (cause) {
|
|
377
|
-
throw new ProfileFileError(`Deleted ${deleted.length} saved files, then deletion failed.`, false, false, {
|
|
378
|
-
cause, next: [["downloads", "list"]],
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
return { deleted };
|
|
382
|
-
}
|
|
383
|
-
/** Local built-ins for files saved by publishProfileFile/saveProfileFile in the selected profile. */
|
|
384
|
-
export const downloadCommands = command("downloads", "List or delete files saved in this profile's downloads directory", [
|
|
385
|
-
command("list", "List saved files without reading them", async (_input, context) => (await savedFiles(context.appArguments.AppDataDirectory)).files, {
|
|
386
|
-
view: tableView({
|
|
387
|
-
columns: [
|
|
388
|
-
{ header: "NAME", value: (file) => file.name },
|
|
389
|
-
{ header: "SIZE", value: (file) => file.bytes, format: "bytes" },
|
|
390
|
-
{ header: "MODIFIED", value: (file) => new Date(file.modified), format: "age" },
|
|
391
|
-
{ header: "PATH", value: (file) => file.path, shrink: true },
|
|
392
|
-
],
|
|
393
|
-
empty: "No saved files.",
|
|
394
|
-
}),
|
|
395
|
-
}),
|
|
396
|
-
command("delete <name>", "Delete one saved file", ({ args }, context) => deleteSavedFiles(context.appArguments.AppDataDirectory, args.name)),
|
|
397
|
-
command("clean", "Delete every saved file", (_input, context) => deleteSavedFiles(context.appArguments.AppDataDirectory)),
|
|
398
|
-
], { group: "Configuration" });
|
|
399
|
-
//# sourceMappingURL=profile-file.js.map
|
|
327
|
+
//# sourceMappingURL=file-publication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-publication.js","sourceRoot":"","sources":["../../src/file-publication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,MAAM,GAEP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAwB,MAAM,aAAa,CAAC;AAE7D,kGAAkG;AAClG,MAAM,OAAO,oBAAqB,SAAQ,QAAQ;IAG9B,SAAS;IACT,aA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C,sBAAsB,CAAC,CAAC;gBAChD,MAAM,cAAc,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAC;gBAC5D,MAAM,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrB,aAAa,GAAG,IAAI,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,QAAQ,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACjH,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,IAAI,oBAAoB,CAC5B,SAAS;YACP,CAAC,CAAC,wHAAwH;YAC1H,CAAC,CAAC,4HAA4H,EAChI,SAAS,EACT,IAAI,EACJ,EAAE,KAAK,EAAE,CACV,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,oBAAoB,CAAC,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACzF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandDefinition } from "./types.js";
|
|
2
|
+
export type HelpLayout = ReadonlyArray<readonly [group: string, names: readonly string[]]>;
|
|
3
|
+
/** Orders a branch's children for help: each named group in turn, then the rest under `rest`. */
|
|
4
|
+
export declare function helpLayout(layout: HelpLayout, children: readonly CommandDefinition[], rest?: string): CommandDefinition[];
|
|
5
|
+
//# sourceMappingURL=help.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;AAE3F,iGAAiG;AACjG,wBAAgB,UAAU,CACxB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,IAAI,SAAS,GACZ,iBAAiB,EAAE,CAerB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Orders a branch's children for help: each named group in turn, then the rest under `rest`. */
|
|
2
|
+
export function helpLayout(layout, children, rest = "More") {
|
|
3
|
+
const nameOf = (child) => child.name.split(" ", 1)[0] ?? child.name;
|
|
4
|
+
const placed = new Set();
|
|
5
|
+
const ordered = layout.flatMap(([group, names]) => names.map((name) => {
|
|
6
|
+
const child = children.find((candidate) => nameOf(candidate) === name);
|
|
7
|
+
if (!child)
|
|
8
|
+
throw new Error(`Help group '${group}' lists missing command '${name}'.`);
|
|
9
|
+
placed.add(child);
|
|
10
|
+
return { ...child, group };
|
|
11
|
+
}));
|
|
12
|
+
return [
|
|
13
|
+
...ordered,
|
|
14
|
+
...children.filter((child) => !placed.has(child)).map((child) => ({ ...child, group: rest })),
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAIA,iGAAiG;AACjG,MAAM,UAAU,UAAU,CACxB,MAAkB,EAClB,QAAsC,EACtC,IAAI,GAAG,MAAM;IAEb,MAAM,MAAM,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;IACvF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAChD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,KAAK,4BAA4B,IAAI,IAAI,CAAC,CAAC;QACtF,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC,CAAC,CACH,CAAC;IACF,OAAO;QACL,GAAG,OAAO;QACV,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;KAC9F,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
export { readResponseBody } from "./response-body.js";
|
|
2
|
+
export { advanceOffset } from "./pagination.js";
|
|
2
3
|
export { fetchWithRedirects } from "./http.js";
|
|
3
4
|
export { parseServerUrl, normalizeBearerToken } from "./input-normalization.js";
|
|
4
5
|
export { tokenAuth } from "./auth.js";
|
|
5
6
|
export { validateArgv } from "./argv.js";
|
|
6
7
|
export { visitResources } from "./resources.js";
|
|
7
8
|
export { privateDirectory, privateEndpoint } from "./private-storage.js";
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
9
|
+
export { FilePublicationError, publishFile, saveFile } from "./file-publication.js";
|
|
10
|
+
export type { FileOptions, PublishedFile, StagedFile, } from "./file-publication.js";
|
|
10
11
|
export { AppArguments } from "./app-arguments.js";
|
|
11
12
|
export { createCli } from "./cli.js";
|
|
13
|
+
export { streamResult } from "./stream-result.js";
|
|
14
|
+
export type { StreamResult } from "./stream-result.js";
|
|
12
15
|
export { command, localCommand } from "./command.js";
|
|
13
16
|
export type { InferredCommandHandler } from "./command-input.js";
|
|
14
17
|
export { targetCommands } from "./target-commands.js";
|
|
@@ -17,8 +20,10 @@ export { durationParser, integerParser, jsonParser } from "./option-parsers.js";
|
|
|
17
20
|
export { CliError, HttpError, diagnosticCause } from "./errors.js";
|
|
18
21
|
export type { CliErrorOptions } from "./errors.js";
|
|
19
22
|
export { formatHuman, writeResult } from "./output.js";
|
|
20
|
-
export { recordView, tableView } from "./view.js";
|
|
21
|
-
export type { HumanView, RecordViewSpec, TableViewSpec, ViewColumn, ViewField, ViewFormat, ViewSection, ViewValue, } from "./view.js";
|
|
23
|
+
export { listView, moreResults, offsetFooter, recordView, tableView, treeView } from "./view.js";
|
|
24
|
+
export type { HumanView, ListViewSpec, RecordViewSpec, TableViewSpec, TreeViewSpec, ViewColumn, ViewContext, ViewField, ViewFormat, ViewGuard, ViewSection, ViewValue, } from "./view.js";
|
|
25
|
+
export { helpLayout } from "./help.js";
|
|
26
|
+
export type { HelpLayout } from "./help.js";
|
|
22
27
|
export { Permission } from "./permissions.js";
|
|
23
28
|
export { ProfileStore } from "./profile-store.js";
|
|
24
29
|
export { PlatformSecretStore, MemorySecretStore, ProfileSecrets, } from "./secret-store.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,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AoB,EACpB,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,KAAK,EACL,aAAa,EACb,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
export { readResponseBody } from "./response-body.js";
|
|
2
|
+
export { advanceOffset } from "./pagination.js";
|
|
2
3
|
export { fetchWithRedirects } from "./http.js";
|
|
3
4
|
export { parseServerUrl, normalizeBearerToken } from "./input-normalization.js";
|
|
4
5
|
export { tokenAuth } from "./auth.js";
|
|
5
6
|
export { validateArgv } from "./argv.js";
|
|
6
7
|
export { visitResources } from "./resources.js";
|
|
7
8
|
export { privateDirectory, privateEndpoint } from "./private-storage.js";
|
|
8
|
-
export {
|
|
9
|
+
export { FilePublicationError, publishFile, saveFile } from "./file-publication.js";
|
|
9
10
|
export { AppArguments } from "./app-arguments.js";
|
|
10
11
|
export { createCli } from "./cli.js";
|
|
12
|
+
export { streamResult } from "./stream-result.js";
|
|
11
13
|
export { command, localCommand } from "./command.js";
|
|
12
14
|
export { targetCommands } from "./target-commands.js";
|
|
13
15
|
export { durationParser, integerParser, jsonParser } from "./option-parsers.js";
|
|
14
16
|
export { CliError, HttpError, diagnosticCause } from "./errors.js";
|
|
15
17
|
export { formatHuman, writeResult } from "./output.js";
|
|
16
|
-
export { recordView, tableView } from "./view.js";
|
|
18
|
+
export { listView, moreResults, offsetFooter, recordView, tableView, treeView } from "./view.js";
|
|
19
|
+
export { helpLayout } from "./help.js";
|
|
17
20
|
export { Permission } from "./permissions.js";
|
|
18
21
|
export { ProfileStore } from "./profile-store.js";
|
|
19
22
|
export { PlatformSecretStore, MemorySecretStore, ProfileSecrets, } from "./secret-store.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;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UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAejG,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-rpc.d.ts","sourceRoot":"","sources":["../../src/json-rpc.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"json-rpc.d.ts","sourceRoot":"","sources":["../../src/json-rpc.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAsEtD,wBAAsB,UAAU,CAAC,OAAO,EAAE;IACxC,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { failedCommandOutput, writeOutput } from "./output-write.js";
|
|
2
2
|
import { requestLines } from "./lines.js";
|
|
3
3
|
import { globalFlagRequested, validateArgv } from "./argv.js";
|
|
4
4
|
import { CliError, machineError } from "./errors.js";
|
|
@@ -23,22 +23,7 @@ function executeParams(value) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
async function response(output, value, signal) {
|
|
26
|
-
|
|
27
|
-
throw new Error("JSON-RPC output is closed.");
|
|
28
|
-
const closed = new AbortController();
|
|
29
|
-
const onClose = () => closed.abort(new Error("JSON-RPC output closed while writing."));
|
|
30
|
-
output.once("close", onClose);
|
|
31
|
-
try {
|
|
32
|
-
if (!output.write(`${JSON.stringify(value)}\n`))
|
|
33
|
-
await once(output, "drain", {
|
|
34
|
-
signal: signal
|
|
35
|
-
? AbortSignal.any([signal, closed.signal])
|
|
36
|
-
: closed.signal,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
finally {
|
|
40
|
-
output.off("close", onClose);
|
|
41
|
-
}
|
|
26
|
+
await writeOutput(output, `${JSON.stringify(value)}\n`, signal);
|
|
42
27
|
}
|
|
43
28
|
function errorResponse(output, id, code, message, signal, data) {
|
|
44
29
|
return response(output, {
|
|
@@ -93,9 +78,17 @@ export async function runJsonRpc(options) {
|
|
|
93
78
|
result = await options.execute(params.argv);
|
|
94
79
|
}
|
|
95
80
|
catch (error) {
|
|
81
|
+
// Preserve a command/cleanup failure when the disconnected transport cannot report it.
|
|
82
|
+
if (options.output.destroyed || options.output.writableEnded)
|
|
83
|
+
throw error;
|
|
96
84
|
if (expectsResponse) {
|
|
97
85
|
const { message, data } = errorData(error, params.argv);
|
|
98
|
-
|
|
86
|
+
try {
|
|
87
|
+
await errorResponse(options.output, request.id, -32000, message, options.signal, data);
|
|
88
|
+
}
|
|
89
|
+
catch (writeError) {
|
|
90
|
+
throw failedCommandOutput(error, writeError);
|
|
91
|
+
}
|
|
99
92
|
}
|
|
100
93
|
continue;
|
|
101
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-rpc.js","sourceRoot":"","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,CAAC;YAC1E,IAAI,eAAe,EAAE,CAAC;gBACpB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBACxD,IAAI,CAAC;oBAAC,MAAM,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAAC,CAAC;gBAC/F,OAAO,UAAU,EAAE,CAAC;oBAAC,MAAM,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;gBAAC,CAAC;YACtE,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,eAAe;YACjB,MAAM,QAAQ,CACZ,OAAO,CAAC,MAAM,EACd;gBACE,OAAO,EAAE,KAAK;gBACd,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,IAAI;gBACtB,MAAM,EAAE,MAAM,IAAI,IAAI;aACvB,EACD,OAAO,CAAC,MAAM,CACf,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Writable } from "node:stream";
|
|
2
|
+
/** Only a failure observed at the output boundary receives the broken-pipe policy. */
|
|
3
|
+
export declare function outputFailure(error: Error): Error;
|
|
4
|
+
/** A failed response write must not replace an already-known command failure. */
|
|
5
|
+
export declare function failedCommandOutput(error: unknown, writeError: unknown): Error;
|
|
6
|
+
/** Start a failure response even after interruption, but do not block cancellation on its sink. */
|
|
7
|
+
export declare function waitForOutput(write: Promise<void>, signal: AbortSignal): Promise<boolean>;
|
|
8
|
+
/** Await the callback even below the high-water mark; retain ownership of late write errors. */
|
|
9
|
+
export declare function writeOutput(output: Writable, text: string, signal?: AbortSignal): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=output-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-write.d.ts","sourceRoot":"","sources":["../../src/output-write.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAIjD;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,GAAG,KAAK,CAS9E;AAED,mGAAmG;AACnG,wBAAsB,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAS/F;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B/F"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { addAbortListener } from "node:events";
|
|
2
|
+
import { CliError } from "./errors.js";
|
|
3
|
+
/** Only a failure observed at the output boundary receives the broken-pipe policy. */
|
|
4
|
+
export function outputFailure(error) {
|
|
5
|
+
return error.code === "EPIPE"
|
|
6
|
+
? new CliError("The output reader closed the pipe.", { code: "output.brokenPipe", exitCode: 141, cause: error })
|
|
7
|
+
: error;
|
|
8
|
+
}
|
|
9
|
+
/** A failed response write must not replace an already-known command failure. */
|
|
10
|
+
export function failedCommandOutput(error, writeError) {
|
|
11
|
+
const cause = new AggregateError([error, writeError], "The command failed and its response could not be written.");
|
|
12
|
+
if (!(error instanceof CliError))
|
|
13
|
+
return cause;
|
|
14
|
+
const failure = new CliError(error.message, {
|
|
15
|
+
code: error.code, exitCode: error.exitCode, result: error.result, next: error.next, cause,
|
|
16
|
+
});
|
|
17
|
+
failure.profile = error.profile;
|
|
18
|
+
failure.defaultProfile = error.defaultProfile;
|
|
19
|
+
return failure;
|
|
20
|
+
}
|
|
21
|
+
/** Start a failure response even after interruption, but do not block cancellation on its sink. */
|
|
22
|
+
export async function waitForOutput(write, signal) {
|
|
23
|
+
// Prefer an already-completed write to an already-aborted signal, retaining interrupted data.
|
|
24
|
+
const completed = write.then(() => true);
|
|
25
|
+
let listener;
|
|
26
|
+
const cancelled = new Promise(resolve => {
|
|
27
|
+
listener = addAbortListener(signal, () => resolve(false));
|
|
28
|
+
});
|
|
29
|
+
try {
|
|
30
|
+
return await Promise.race([completed, cancelled]);
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
listener?.[Symbol.dispose]();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Await the callback even below the high-water mark; retain ownership of late write errors. */
|
|
37
|
+
export function writeOutput(output, text, signal) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
signal?.throwIfAborted();
|
|
40
|
+
if (output.destroyed || output.writableEnded) {
|
|
41
|
+
reject(outputFailure(output.errored ?? new Error("Command output is closed.")));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const closed = () => finish(new Error("Command output closed while writing."));
|
|
45
|
+
const failed = (error) => finish(outputFailure(error));
|
|
46
|
+
const finish = (error) => {
|
|
47
|
+
output.off("close", closed).off("error", failed);
|
|
48
|
+
aborted?.[Symbol.dispose]();
|
|
49
|
+
if (error)
|
|
50
|
+
reject(error);
|
|
51
|
+
else
|
|
52
|
+
resolve();
|
|
53
|
+
};
|
|
54
|
+
const aborted = signal && addAbortListener(signal, () => reject(signal.reason));
|
|
55
|
+
output.once("close", closed).once("error", failed);
|
|
56
|
+
try {
|
|
57
|
+
output.write(text, error => {
|
|
58
|
+
// Node emits error after a failed callback. Cancellation may already have returned;
|
|
59
|
+
// keep the listener until that event. A successful callback releases ownership.
|
|
60
|
+
if (!error)
|
|
61
|
+
finish();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
finish(outputFailure(error instanceof Error ? error : new Error("Command output write failed.")));
|
|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AC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACjD,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,IAAI,KAAK;gBAAE,MAAM,CAAC,KAAK,CAAC,CAAC;;gBAAM,OAAO,EAAE,CAAC;QAC3C,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,IAAI,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAChF,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;gBACzB,oFAAoF;gBACpF,gFAAgF;gBAChF,IAAI,CAAC,KAAK;oBAAE,MAAM,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,aAAa,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC;QACpG,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Writable } from "node:stream";
|
|
2
|
+
import type { CommandInput } from "./types.js";
|
|
2
3
|
import { type HumanView } from "./view.js";
|
|
3
4
|
export declare function formatHuman(value: unknown): string;
|
|
4
5
|
/** A terminal's usable line width; files, pipes and other streams have none. */
|
|
@@ -8,5 +9,6 @@ export declare function writeResult(output: Writable, value: unknown, json: bool
|
|
|
8
9
|
cliName: string;
|
|
9
10
|
profile?: string;
|
|
10
11
|
defaultProfile?: string;
|
|
11
|
-
|
|
12
|
+
input?: CommandInput;
|
|
13
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
12
14
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAmGvD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAmClD;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAMlE;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,OAAO,EACb,YAAY,CAAC,EAAE;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,EACD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAgBf"}
|