dsh-remote 0.8.50 → 0.8.52

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.
Files changed (136) hide show
  1. package/README.en.md +8 -0
  2. package/README.md +22 -0
  3. package/lib/client.js +15 -3
  4. package/lib/index.js +269 -8
  5. package/lib/instructions.js +288 -0
  6. package/lib/openssh.js +10 -1
  7. package/lib/pool.js +29 -1
  8. package/lib/remote-fs.js +26 -1
  9. package/lib/sftp-surface.js +46 -3
  10. package/lib/sshconfig.js +13 -3
  11. package/node_modules/buildcheck/.eslintrc.js +5 -0
  12. package/node_modules/buildcheck/.github/workflows/ci.yml +88 -0
  13. package/node_modules/buildcheck/.github/workflows/lint.yml +27 -0
  14. package/node_modules/buildcheck/.npmignore +3 -0
  15. package/node_modules/buildcheck/LICENSE +19 -0
  16. package/node_modules/buildcheck/README.md +106 -0
  17. package/node_modules/buildcheck/deps/Find-VisualStudio.cs +250 -0
  18. package/node_modules/buildcheck/lib/findvs.js +361 -0
  19. package/node_modules/buildcheck/lib/index.js +738 -0
  20. package/node_modules/buildcheck/package.json +36 -0
  21. package/node_modules/buildcheck/test/test.js +8 -0
  22. package/node_modules/cpu-features/.eslintrc.js +5 -0
  23. package/node_modules/cpu-features/.github/workflows/ci.yml +74 -0
  24. package/node_modules/cpu-features/.github/workflows/lint.yml +27 -0
  25. package/node_modules/cpu-features/LICENSE +19 -0
  26. package/node_modules/cpu-features/README.md +59 -0
  27. package/node_modules/cpu-features/binding.gyp +16 -0
  28. package/node_modules/cpu-features/buildcheck.js +32 -0
  29. package/node_modules/cpu-features/deps/cpu_features/.clang-format +4 -0
  30. package/node_modules/cpu-features/deps/cpu_features/.dockerignore +31 -0
  31. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +5 -0
  32. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +30 -0
  33. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +22 -0
  34. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +26 -0
  35. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +31 -0
  36. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +43 -0
  37. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +25 -0
  38. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +31 -0
  39. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +24 -0
  40. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +30 -0
  41. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +29 -0
  42. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +28 -0
  43. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +27 -0
  44. package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +21 -0
  45. package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +329 -0
  46. package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +261 -0
  47. package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +23 -0
  48. package/node_modules/cpu-features/deps/cpu_features/LICENSE +230 -0
  49. package/node_modules/cpu-features/deps/cpu_features/README.md +272 -0
  50. package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +19 -0
  51. package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +5 -0
  52. package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +11 -0
  53. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +3 -0
  54. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +3 -0
  55. package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +30 -0
  56. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +252 -0
  57. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +40 -0
  58. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +64 -0
  59. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +312 -0
  60. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +7 -0
  61. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +48 -0
  62. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +34 -0
  63. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +22 -0
  64. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +11 -0
  65. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +107 -0
  66. package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +15 -0
  67. package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +105 -0
  68. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +54 -0
  69. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +384 -0
  70. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +259 -0
  71. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +121 -0
  72. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +74 -0
  73. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +149 -0
  74. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +72 -0
  75. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +108 -0
  76. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +288 -0
  77. package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +40 -0
  78. package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +37 -0
  79. package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +39 -0
  80. package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +240 -0
  81. package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +49 -0
  82. package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +110 -0
  83. package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +70 -0
  84. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +60 -0
  85. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +4 -0
  86. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +205 -0
  87. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +320 -0
  88. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +12 -0
  89. package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +456 -0
  90. package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +165 -0
  91. package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +75 -0
  92. package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +490 -0
  93. package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +79 -0
  94. package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +19 -0
  95. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +86 -0
  96. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +26 -0
  97. package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +22 -0
  98. package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +62 -0
  99. package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +169 -0
  100. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +88 -0
  101. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +79 -0
  102. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +82 -0
  103. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +138 -0
  104. package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +212 -0
  105. package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +93 -0
  106. package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +163 -0
  107. package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +111 -0
  108. package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +120 -0
  109. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +2055 -0
  110. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +68 -0
  111. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +58 -0
  112. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +57 -0
  113. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +58 -0
  114. package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +132 -0
  115. package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +192 -0
  116. package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +461 -0
  117. package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +114 -0
  118. package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +53 -0
  119. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +396 -0
  120. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +384 -0
  121. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +176 -0
  122. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +131 -0
  123. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +180 -0
  124. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +82 -0
  125. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +1729 -0
  126. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +103 -0
  127. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +61 -0
  128. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +52 -0
  129. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +31 -0
  130. package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +132 -0
  131. package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +202 -0
  132. package/node_modules/cpu-features/lib/index.js +5 -0
  133. package/node_modules/cpu-features/package.json +40 -0
  134. package/node_modules/cpu-features/src/binding.cc +151 -0
  135. package/node_modules/cpu-features/test/test.js +12 -0
  136. package/package.json +1 -1
@@ -0,0 +1,151 @@
1
+ #include <node.h>
2
+ #include <node_buffer.h>
3
+ #include <nan.h>
4
+ #include <ctype.h> // isspace
5
+
6
+ #include "cpu_features_macros.h"
7
+
8
+ #if defined(CPU_FEATURES_ARCH_X86)
9
+ # include "cpuinfo_x86.h"
10
+ # define GetFeatureName GetX86FeaturesEnumName
11
+ # define GetFeatureValue GetX86FeaturesEnumValue
12
+ # define FeatureType X86Features
13
+ # define FeatureEnumType X86FeaturesEnum
14
+ # define LastFeature X86_LAST_
15
+ #elif defined(CPU_FEATURES_ARCH_ARM)
16
+ # include "cpuinfo_arm.h"
17
+ # define GetFeatureName GetArmFeaturesEnumName
18
+ # define GetFeatureValue GetArmFeaturesEnumValue
19
+ # define FeatureType ArmFeatures
20
+ # define FeatureEnumType ArmFeaturesEnum
21
+ # define LastFeature ARM_LAST_
22
+ #elif defined(CPU_FEATURES_ARCH_AARCH64)
23
+ # include "cpuinfo_aarch64.h"
24
+ # define GetFeatureName GetAarch64FeaturesEnumName
25
+ # define GetFeatureValue GetAarch64FeaturesEnumValue
26
+ # define FeatureType Aarch64Features
27
+ # define FeatureEnumType Aarch64FeaturesEnum
28
+ # define LastFeature AARCH64_LAST_
29
+ #elif defined(CPU_FEATURES_ARCH_MIPS)
30
+ # include "cpuinfo_mips.h"
31
+ # define GetFeatureName GetMipsFeaturesEnumName
32
+ # define GetFeatureValue GetMipsFeaturesEnumValue
33
+ # define FeatureType MipsFeatures
34
+ # define FeatureEnumType MipsFeaturesEnum
35
+ # define LastFeature MIPS_LAST_
36
+ #elif defined(CPU_FEATURES_ARCH_PPC)
37
+ # include "cpuinfo_ppc.h"
38
+ # define GetFeatureName GetPPCFeaturesEnumName
39
+ # define GetFeatureValue GetPPCFeaturesEnumValue
40
+ # define FeatureType PPCFeatures
41
+ # define FeatureEnumType PPCFeaturesEnum
42
+ # define LastFeature PPC_LAST_
43
+ #endif
44
+
45
+ #define SET_FLAG(key) \
46
+ Nan::Set(ret, Nan::New<String>(key).ToLocalChecked(), Nan::New<Boolean>(true))
47
+
48
+ #define SET_STR(key, val) \
49
+ Nan::Set(ret, \
50
+ Nan::New<String>(key).ToLocalChecked(), \
51
+ Nan::New<String>(trim(val)).ToLocalChecked())
52
+
53
+ #define SET_NUM(key, val) \
54
+ Nan::Set(ret, Nan::New<String>(key).ToLocalChecked(), Nan::New<Number>(val))
55
+
56
+ #define SET_VAL(key, val) \
57
+ Nan::Set(ret, Nan::New<String>(key).ToLocalChecked(), val)
58
+
59
+ using namespace node;
60
+ using namespace v8;
61
+ using namespace cpu_features;
62
+ using namespace std;
63
+
64
+ static inline void ltrim(string& s) {
65
+ s.erase(s.begin(), find_if(s.begin(), s.end(), [](int ch) {
66
+ return !isspace(ch);
67
+ }));
68
+ }
69
+
70
+ static inline void rtrim(string& s) {
71
+ s.erase(find_if(s.rbegin(), s.rend(), [](int ch) {
72
+ return !isspace(ch);
73
+ }).base(), s.end());
74
+ }
75
+
76
+ static inline string trim(const char* str) {
77
+ string ret = str;
78
+ ltrim(ret);
79
+ rtrim(ret);
80
+ return ret;
81
+ }
82
+
83
+ #if defined(LastFeature)
84
+ Local<Object> GenerateFlags(const FeatureType* features) {
85
+ const auto ret = Nan::New<Object>();
86
+ for (size_t i = 0; i < LastFeature; ++i) {
87
+ const auto enum_val = static_cast<FeatureEnumType>(i);
88
+ if (GetFeatureValue(features, enum_val))
89
+ SET_FLAG(GetFeatureName(enum_val));
90
+ }
91
+ return ret;
92
+ }
93
+ #endif
94
+
95
+ NAN_METHOD(GetCPUInfo) {
96
+ const auto ret = Nan::New<Object>();
97
+ #if defined(CPU_FEATURES_ARCH_X86)
98
+ const X86Info details = GetX86Info();
99
+ SET_STR("arch", "x86");
100
+ SET_STR("brand", details.brand_string);
101
+ SET_NUM("family", details.family);
102
+ SET_NUM("model", details.model);
103
+ SET_NUM("stepping", details.stepping);
104
+ SET_STR("uarch",
105
+ GetX86MicroarchitectureName(GetX86Microarchitecture(&details)));
106
+ SET_VAL("flags", GenerateFlags(&details.features));
107
+ #elif defined(CPU_FEATURES_ARCH_ARM)
108
+ const ArmInfo details = GetArmInfo();
109
+ SET_STR("arch", "arm");
110
+ SET_NUM("implementer", details.implementer);
111
+ SET_NUM("architecture", details.architecture);
112
+ SET_NUM("variant", details.variant);
113
+ SET_NUM("part", details.part);
114
+ SET_NUM("revision", details.revision);
115
+ SET_VAL("flags", GenerateFlags(&details.features));
116
+ #elif defined(CPU_FEATURES_ARCH_AARCH64)
117
+ const Aarch64Info details = GetAarch64Info();
118
+ SET_STR("arch", "aarch64");
119
+ SET_NUM("implementer", details.implementer);
120
+ SET_NUM("variant", details.variant);
121
+ SET_NUM("part", details.part);
122
+ SET_NUM("revision", details.revision);
123
+ SET_VAL("flags", GenerateFlags(&details.features));
124
+ #elif defined(CPU_FEATURES_ARCH_MIPS)
125
+ const MipsInfo details = GetMipsInfo();
126
+ SET_STR("arch", "mips");
127
+ SET_VAL("flags", GenerateFlags(&details.features));
128
+ #elif defined(CPU_FEATURES_ARCH_PPC)
129
+ const PPCInfo details = GetPPCInfo();
130
+ const PPCPlatformStrings strings = GetPPCPlatformStrings();
131
+ SET_STR("arch", "ppc");
132
+ SET_STR("platform", strings.platform);
133
+ SET_STR("model", strings.model);
134
+ SET_STR("machine", strings.machine);
135
+ SET_STR("cpu", strings.cpu);
136
+ SET_STR("instruction set", strings.type.platform);
137
+ SET_STR("microarchitecture", strings.type.base_platform);
138
+ SET_VAL("flags", GenerateFlags(&details.features));
139
+ #else
140
+ SET_STR("arch", "unknown");
141
+ SET_VAL("flags", Nan::New<Object>());
142
+ #endif
143
+ info.GetReturnValue().Set(ret);
144
+ }
145
+
146
+ NAN_MODULE_INIT(init) {
147
+ Nan::Set(target, Nan::New<String>("getCPUInfo").ToLocalChecked(),
148
+ Nan::GetFunction(Nan::New<FunctionTemplate>(GetCPUInfo)).ToLocalChecked());
149
+ }
150
+
151
+ NODE_MODULE(cpufeatures, init)
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const assert = require('assert');
4
+
5
+ const info = require('../lib/index.js')();
6
+
7
+ console.log(info);
8
+ assert(typeof info === 'object' && info !== null);
9
+ assert(typeof info.arch === 'string' && info.arch);
10
+ assert(typeof info.flags === 'object' && info.flags !== null);
11
+ if (process.platform !== 'darwin' && process.arch !== 'arm64')
12
+ assert(Object.keys(info).length > 2); // Assume we are on a known platform
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-remote",
3
- "version": "0.8.50",
3
+ "version": "0.8.52",
4
4
  "description": "Remote-work assistant for DeepSeek Harness: connect SSH (password/key/agent/keyboard-interactive/proxy jump), pick a remote workspace, operate on it with 22 rw_* tools (incl. rw_edit/rw_stat/rw_mkdir/rw_remove/rw_move/rw_forward), conflict-aware mirror sync, one-click remote dsh deploy + web UI attach, port forwarding, optional side-bar remote file editing, audit log, keychain passwords.",
5
5
  "license": "MIT",
6
6
  "author": "flymysql <flyphp@outlook.com>",