@myagentroam/node 0.12.0 → 0.12.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.
Files changed (132) hide show
  1. package/dist/code-navigation/index.js +2 -0
  2. package/dist/code-navigation/languages/c-family.js +9 -0
  3. package/dist/code-navigation/languages/c-preprocessor.js +30 -0
  4. package/dist/code-navigation/languages/c.js +8 -0
  5. package/dist/code-navigation/languages/cpp.js +10 -0
  6. package/dist/code-navigation/languages/csharp.js +18 -0
  7. package/dist/code-navigation/languages/css.js +7 -0
  8. package/dist/code-navigation/languages/ecmascript.js +44 -0
  9. package/dist/code-navigation/languages/file-target.js +9 -0
  10. package/dist/code-navigation/languages/go.js +32 -0
  11. package/dist/code-navigation/languages/html.js +7 -0
  12. package/dist/code-navigation/languages/jvm.js +17 -0
  13. package/dist/code-navigation/languages/less.js +7 -0
  14. package/dist/code-navigation/languages/markdown.js +113 -0
  15. package/dist/code-navigation/languages/markup-reference.js +27 -0
  16. package/dist/code-navigation/languages/objective-c.js +11 -0
  17. package/dist/code-navigation/languages/objective-cpp.js +10 -0
  18. package/dist/code-navigation/languages/python.js +17 -0
  19. package/dist/code-navigation/languages/rust.js +18 -0
  20. package/dist/code-navigation/languages/sass.js +7 -0
  21. package/dist/code-navigation/languages/scss.js +7 -0
  22. package/dist/code-navigation/languages/stylesheet-reference.js +37 -0
  23. package/dist/code-navigation/languages/vue.js +75 -0
  24. package/dist/code-navigation/registry.js +72 -0
  25. package/dist/code-navigation/source-ranges.js +17 -0
  26. package/dist/code-navigation/symbol-maps.js +257 -0
  27. package/dist/code-navigation/symbol-matcher.js +48 -0
  28. package/dist/code-navigation/symbol-navigation.js +1 -0
  29. package/dist/code-navigation/types.js +1 -0
  30. package/dist/ctags-binary.js +3 -3
  31. package/dist/marctl/bin/marctl.mjs +6 -0
  32. package/dist/marctl/bin/marnodes.mjs +6 -0
  33. package/dist/marctl/bin/marscp.mjs +6 -0
  34. package/dist/marctl/bin/marssh.mjs +6 -0
  35. package/dist/marctl/package.json +1 -0
  36. package/dist/marctl/src/cli.mjs +271 -0
  37. package/dist/marctl/src/client.mjs +291 -0
  38. package/dist/marctl/src/config.mjs +46 -0
  39. package/dist/marctl/src/direct-control.mjs +225 -0
  40. package/dist/marctl/src/direct-errors.mjs +48 -0
  41. package/dist/marctl/src/direct-process.mjs +374 -0
  42. package/dist/marctl/src/direct-transport.mjs +235 -0
  43. package/dist/marctl/src/direct.mjs +421 -0
  44. package/dist/marctl/src/errors.mjs +11 -0
  45. package/dist/marctl/src/i18n/en-US.mjs +285 -0
  46. package/dist/marctl/src/i18n/index.mjs +20 -0
  47. package/dist/marctl/src/i18n/zh-CN.mjs +269 -0
  48. package/dist/marctl/src/scp-channel.mjs +99 -0
  49. package/dist/marctl/src/scp-copy.mjs +46 -0
  50. package/dist/marctl/src/scp-endpoint.mjs +29 -0
  51. package/dist/marctl/src/scp-protocol.mjs +2 -0
  52. package/dist/marctl/src/scp-worker.cjs +266 -0
  53. package/dist/marctl/src/scp-workers.mjs +179 -0
  54. package/dist/marctl/src/scp.mjs +64 -0
  55. package/dist/marctl/src/session-args.mjs +233 -0
  56. package/dist/marctl/src/session-input.mjs +43 -0
  57. package/dist/marctl/src/session-prepare.mjs +87 -0
  58. package/dist/marctl/src/session-target.mjs +26 -0
  59. package/dist/marctl/src/session-wait.mjs +232 -0
  60. package/dist/marctl/src/sessions.mjs +93 -0
  61. package/dist/marctl/src/terminal-frame.mjs +48 -0
  62. package/dist/marctl/src/terminal-interaction.mjs +177 -0
  63. package/dist/marctl/src/terminal-race.mjs +117 -0
  64. package/dist/marctl/src/terminal-relay-sender.mjs +129 -0
  65. package/dist/marctl/src/terminal-relay.mjs +305 -0
  66. package/dist/marctl/src/terminal.mjs +152 -0
  67. package/dist/marctl.js +1 -1
  68. package/dist/marnodes.js +1 -1
  69. package/dist/marscp.js +1 -1
  70. package/dist/marssh.js +1 -1
  71. package/dist/ripgrep-binary.js +3 -3
  72. package/dist/runner/mar-agent/agent-operation-presentation.js +22 -10
  73. package/dist/service/code-navigation/file-reference-parser.js +1 -1
  74. package/dist/service/node-terminal-channel.js +1 -1
  75. package/dist/session/session-catalog-service.js +4 -1
  76. package/dist/workspace/workspace-code-navigation-service.js +2 -2
  77. package/package.json +11 -9
  78. package/vendor/ctags/NOTICE +0 -22
  79. package/vendor/ctags/darwin-arm64/ctags +0 -0
  80. package/vendor/ctags/darwin-x64/ctags +0 -0
  81. package/vendor/ctags/licenses/COPYING +0 -340
  82. package/vendor/ctags/licenses/COPYING.MinGW-w64-runtime.txt +0 -240
  83. package/vendor/ctags/licenses/LICENSE.janssen +0 -19
  84. package/vendor/ctags/licenses/LICENSE.libyaml +0 -19
  85. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/COPYING +0 -340
  86. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/RECEIPT.yml +0 -27
  87. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libiconv.yml +0 -24
  88. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libjansson.yml +0 -19
  89. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libxml2.yml +0 -20
  90. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libyaml.yml +0 -7
  91. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libz.yml +0 -13
  92. package/vendor/ctags/licenses/official-snapshot/darwin-x64/COPYING +0 -340
  93. package/vendor/ctags/licenses/official-snapshot/darwin-x64/RECEIPT.yml +0 -27
  94. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libiconv.yml +0 -24
  95. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libjansson.yml +0 -19
  96. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libxml2.yml +0 -20
  97. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libyaml.yml +0 -7
  98. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libz.yml +0 -13
  99. package/vendor/ctags/licenses/official-snapshot/linux-arm64/COPYING +0 -340
  100. package/vendor/ctags/licenses/official-snapshot/linux-arm64/RECEIPT.yml +0 -27
  101. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libiconv.yml +0 -24
  102. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libjansson.yml +0 -19
  103. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libxml2.yml +0 -20
  104. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libyaml.yml +0 -7
  105. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libz.yml +0 -13
  106. package/vendor/ctags/licenses/official-snapshot/linux-x64/COPYING +0 -340
  107. package/vendor/ctags/licenses/official-snapshot/linux-x64/RECEIPT.yml +0 -27
  108. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libiconv.yml +0 -24
  109. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libjansson.yml +0 -19
  110. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libxml2.yml +0 -20
  111. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libyaml.yml +0 -7
  112. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libz.yml +0 -13
  113. package/vendor/ctags/licenses/win32-x64/COPYING +0 -340
  114. package/vendor/ctags/licenses/win32-x64/COPYING.MinGW-w64-runtime.txt +0 -240
  115. package/vendor/ctags/licenses/win32-x64/Copyright.libxml2 +0 -23
  116. package/vendor/ctags/licenses/win32-x64/LICENCE.pcre2 +0 -94
  117. package/vendor/ctags/licenses/win32-x64/LICENSE.janssen +0 -19
  118. package/vendor/ctags/licenses/win32-x64/LICENSE.libyaml +0 -19
  119. package/vendor/ctags/linux-arm64/ctags +0 -0
  120. package/vendor/ctags/linux-x64/ctags +0 -0
  121. package/vendor/ctags/manifest.json +0 -42
  122. package/vendor/ctags/source/universal-ctags-ab95af198f8eaeb6d50dc96e3adf52e769d3e5f0.tar.gz +0 -0
  123. package/vendor/ctags/win32-x64/ctags.exe +0 -0
  124. package/vendor/ripgrep/LICENSE-MIT +0 -21
  125. package/vendor/ripgrep/UNLICENSE +0 -24
  126. package/vendor/ripgrep/darwin-arm64/rg +0 -0
  127. package/vendor/ripgrep/darwin-x64/rg +0 -0
  128. package/vendor/ripgrep/linux-arm64/rg +0 -0
  129. package/vendor/ripgrep/linux-x64/rg +0 -0
  130. package/vendor/ripgrep/manifest.json +0 -42
  131. package/vendor/ripgrep/win32-arm64/rg.exe +0 -0
  132. package/vendor/ripgrep/win32-x64/rg.exe +0 -0
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Fixed source maps generated from `Universal Ctags ab95af1 --list-maps`.
3
+ * This remains pure metadata: Node owns the executable and index lifecycle.
4
+ */
5
+ export const symbolNavigationMaps = [
6
+ { id: 'Abaqus', fileNamePatterns: ['*.inp'] },
7
+ { id: 'Abc', fileNamePatterns: ['*.abc', '*.abc'] },
8
+ { id: 'Ada', fileNamePatterns: ['*.adb', '*.ads', '*.Ada', '*.ada'] },
9
+ { id: 'Ant', fileNamePatterns: ['build.xml', '*.build.xml', '*.ant', '*.xml'] },
10
+ {
11
+ id: 'Asciidoc',
12
+ fileNamePatterns: ['*.asc', '*.adoc', '*.asciidoc', '*.asc', '*.adoc', '*.asciidoc']
13
+ },
14
+ {
15
+ id: 'Asm',
16
+ fileNamePatterns: [
17
+ '*.A51',
18
+ '*.29[kK]',
19
+ '*.[68][68][kKsSxX]',
20
+ '*.[xX][68][68]',
21
+ '*.asm',
22
+ '*.ASM',
23
+ '*.s',
24
+ '*.S'
25
+ ]
26
+ },
27
+ { id: 'Asp', fileNamePatterns: ['*.asp', '*.asa'] },
28
+ { id: 'Autoconf', fileNamePatterns: ['configure.in', '*.ac'] },
29
+ { id: 'AutoIt', fileNamePatterns: ['*.au3', '*.AU3', '*.aU3', '*.Au3'] },
30
+ { id: 'Automake', fileNamePatterns: ['Makefile.am', 'GNUmakefile.am', '*.am'] },
31
+ { id: 'Awk', fileNamePatterns: ['*.awk', '*.gawk', '*.mawk'] },
32
+ { id: 'Basic', fileNamePatterns: ['*.bas', '*.bi', '*.bm', '*.bb', '*.pb'] },
33
+ { id: 'Bats', fileNamePatterns: ['*.bats'] },
34
+ { id: 'BETA', fileNamePatterns: ['*.bet'] },
35
+ { id: 'BibTeX', fileNamePatterns: ['*.bib'] },
36
+ { id: 'Clojure', fileNamePatterns: ['*.clj', '*.cljs', '*.cljc'] },
37
+ { id: 'CMake', fileNamePatterns: ['CMakeLists.txt', '*.cmake'] },
38
+ { id: 'C', fileNamePatterns: ['*.c'] },
39
+ { id: 'Cargo', fileNamePatterns: ['Cargo.toml'] },
40
+ {
41
+ id: 'C++',
42
+ fileNamePatterns: [
43
+ '*.c++',
44
+ '*.cc',
45
+ '*.cp',
46
+ '*.cpp',
47
+ '*.cxx',
48
+ '*.h',
49
+ '*.h++',
50
+ '*.hh',
51
+ '*.hp',
52
+ '*.hpp',
53
+ '*.hxx',
54
+ '*.inl',
55
+ '*.C',
56
+ '*.H',
57
+ '*.CPP',
58
+ '*.CXX'
59
+ ]
60
+ },
61
+ { id: 'CSS', fileNamePatterns: ['*.css'] },
62
+ { id: 'C#', fileNamePatterns: ['*.cs'] },
63
+ { id: 'Ctags', fileNamePatterns: ['*.ctags'] },
64
+ { id: 'Cobol', fileNamePatterns: ['*.cbl', '*.cob', '*.CBL', '*.COB'] },
65
+ { id: 'CUDA', fileNamePatterns: ['*.cu', '*.cuh'] },
66
+ { id: 'D', fileNamePatterns: ['*.d', '*.di'] },
67
+ { id: 'DBusService', fileNamePatterns: ['*.service'] },
68
+ { id: 'Diff', fileNamePatterns: ['*.diff', '*.patch'] },
69
+ { id: 'DTD', fileNamePatterns: ['*.dtd', '*.mod'] },
70
+ { id: 'DTS', fileNamePatterns: ['*.dts', '*.dtsi'] },
71
+ { id: 'DosBatch', fileNamePatterns: ['*.bat', '*.cmd'] },
72
+ { id: 'Eiffel', fileNamePatterns: ['*.e'] },
73
+ { id: 'Elixir', fileNamePatterns: ['*.ex', '*.exs'] },
74
+ { id: 'EmacsLisp', fileNamePatterns: ['*.el'] },
75
+ { id: 'Erlang', fileNamePatterns: ['*.erl', '*.ERL', '*.hrl', '*.HRL'] },
76
+ { id: 'Falcon', fileNamePatterns: ['*.fal', '*.ftd'] },
77
+ { id: 'Flex', fileNamePatterns: ['*.as', '*.mxml'] },
78
+ { id: 'Forth', fileNamePatterns: ['*.fth', '*.forth', '*.fs', '*.4th', '*.f'] },
79
+ {
80
+ id: 'Fortran',
81
+ fileNamePatterns: [
82
+ '*.f',
83
+ '*.for',
84
+ '*.ftn',
85
+ '*.f77',
86
+ '*.f90',
87
+ '*.f95',
88
+ '*.f03',
89
+ '*.f08',
90
+ '*.f15',
91
+ '*.F',
92
+ '*.FOR',
93
+ '*.FTN',
94
+ '*.F77',
95
+ '*.F90',
96
+ '*.F95',
97
+ '*.F03',
98
+ '*.F08',
99
+ '*.F15'
100
+ ]
101
+ },
102
+ { id: 'Fypp', fileNamePatterns: ['*.fy'] },
103
+ { id: 'Gdbinit', fileNamePatterns: ['.gdbinit', '*.gdb'] },
104
+ { id: 'GDScript', fileNamePatterns: ['*.gd'] },
105
+ { id: 'GemSpec', fileNamePatterns: ['*.gemspec'] },
106
+ { id: 'Go', fileNamePatterns: ['*.go'] },
107
+ { id: 'GoMod', fileNamePatterns: ['go.mod'] },
108
+ { id: 'GPerf', fileNamePatterns: ['*.perf', '*.gperf'] },
109
+ { id: 'Haskell', fileNamePatterns: ['*.hs'] },
110
+ { id: 'Haxe', fileNamePatterns: ['*.hx'] },
111
+ { id: 'HTML', fileNamePatterns: ['*.htm', '*.html'] },
112
+ { id: 'Iniconf', fileNamePatterns: ['*.ini', '*.conf'] },
113
+ { id: 'Inko', fileNamePatterns: ['*.inko'] },
114
+ { id: 'ITcl', fileNamePatterns: ['*.itcl'] },
115
+ { id: 'Java', fileNamePatterns: ['*.java'] },
116
+ { id: 'JavaProperties', fileNamePatterns: ['*.properties'] },
117
+ { id: 'JavaScript', fileNamePatterns: ['*.js', '*.jsx', '*.mjs'] },
118
+ { id: 'JSON', fileNamePatterns: ['*.json'] },
119
+ { id: 'Julia', fileNamePatterns: ['*.jl'] },
120
+ { id: 'Kconfig', fileNamePatterns: ['Kconfig*'] },
121
+ {
122
+ id: 'LdScript',
123
+ fileNamePatterns: ['*.lds.S', '*.ld.S', 'ld.script', '*.lds', '*.scr', '*.ld', '*.ldi']
124
+ },
125
+ { id: 'LEX', fileNamePatterns: ['*.lex', '*.l'] },
126
+ { id: 'Lisp', fileNamePatterns: ['*.cl', '*.clisp', '*.l', '*.lisp', '*.lsp'] },
127
+ { id: 'LiterateHaskell', fileNamePatterns: ['*.lhs'] },
128
+ { id: 'Lua', fileNamePatterns: ['*.lua'] },
129
+ { id: 'M4', fileNamePatterns: ['*.m4', '*.spt'] },
130
+ {
131
+ id: 'Man',
132
+ fileNamePatterns: [
133
+ '*.man',
134
+ '*.1',
135
+ '*.2',
136
+ '*.3',
137
+ '*.4',
138
+ '*.5',
139
+ '*.6',
140
+ '*.7',
141
+ '*.8',
142
+ '*.9',
143
+ '*.3pm',
144
+ '*.3stap',
145
+ '*.7stap'
146
+ ]
147
+ },
148
+ { id: 'Make', fileNamePatterns: ['[Mm]akefile', 'GNUmakefile', '*.mak', '*.mk'] },
149
+ { id: 'Markdown', fileNamePatterns: ['*.md', '*.markdown'] },
150
+ { id: 'MatLab', fileNamePatterns: ['*.m'] },
151
+ { id: 'Meson', fileNamePatterns: ['meson.build'] },
152
+ { id: 'MesonOptions', fileNamePatterns: ['meson_options.txt'] },
153
+ { id: 'Myrddin', fileNamePatterns: ['*.myr'] },
154
+ { id: 'Nftables', fileNamePatterns: ['*.nft'] },
155
+ { id: 'NSIS', fileNamePatterns: ['*.nsi', '*.nsh'] },
156
+ { id: 'ObjectiveC', fileNamePatterns: ['*.mm', '*.m', '*.h'] },
157
+ { id: 'OCaml', fileNamePatterns: ['*.ml', '*.mli', '*.aug'] },
158
+ { id: 'Odin', fileNamePatterns: ['*.odin'] },
159
+ { id: 'Org', fileNamePatterns: ['*.org'] },
160
+ { id: 'Passwd', fileNamePatterns: ['passwd'] },
161
+ { id: 'Pascal', fileNamePatterns: ['*.p', '*.pas'] },
162
+ { id: 'Perl', fileNamePatterns: ['*.pl', '*.pm', '*.ph', '*.plx', '*.perl'] },
163
+ { id: 'Perl6', fileNamePatterns: ['*.p6', '*.pm6', '*.pm', '*.pl6', '*.t6'] },
164
+ { id: 'PHP', fileNamePatterns: ['*.php', '*.php3', '*.php4', '*.php5', '*.php7', '*.phtml'] },
165
+ { id: 'PkgConfig', fileNamePatterns: ['*.pc'] },
166
+ { id: 'Pod', fileNamePatterns: ['*.pod'] },
167
+ { id: 'PowerShell', fileNamePatterns: ['*.ps1', '*.psm1'] },
168
+ { id: 'Prolog', fileNamePatterns: ['*.pl', '*.pro'] },
169
+ { id: 'Protobuf', fileNamePatterns: ['*.proto'] },
170
+ { id: 'PuppetManifest', fileNamePatterns: ['*.pp'] },
171
+ {
172
+ id: 'Python',
173
+ fileNamePatterns: ['*.py', '*.pyw', '*.pyx', '*.pxd', '*.pxi', '*.scons', '*.wsgi']
174
+ },
175
+ { id: 'PythonEntryPoints', fileNamePatterns: ['entry_points.txt'] },
176
+ { id: 'QemuHX', fileNamePatterns: ['*.hx'] },
177
+ { id: 'Quarto', fileNamePatterns: ['*.qmd'] },
178
+ { id: 'RMarkdown', fileNamePatterns: ['*.rmd'] },
179
+ { id: 'R', fileNamePatterns: ['*.r', '*.R', '*.s', '*.q'] },
180
+ { id: 'Rake', fileNamePatterns: ['Rakefile', '*.rake'] },
181
+ { id: 'Raku', fileNamePatterns: ['*.raku', '*.rakumod', '*.rakutest', '*.rakudoc'] },
182
+ { id: 'REXX', fileNamePatterns: ['*.cmd', '*.rexx', '*.rx'] },
183
+ { id: 'Robot', fileNamePatterns: ['*.robot'] },
184
+ {
185
+ id: 'RpmMacros',
186
+ fileNamePatterns: ['%(.*/)?macros\\.d/macros\\.([^/]+)$%', '*.rpmmacros']
187
+ },
188
+ { id: 'RpmSpec', fileNamePatterns: ['*.spec'] },
189
+ { id: 'ReStructuredText', fileNamePatterns: ['*.rest', '*.reST', '*.rst'] },
190
+ { id: 'Ruby', fileNamePatterns: ['*.rb', '*.ruby'] },
191
+ { id: 'Rust', fileNamePatterns: ['*.rs'] },
192
+ {
193
+ id: 'Scheme',
194
+ fileNamePatterns: ['*.SCM', '*.SM', '*.sch', '*.scheme', '*.scm', '*.sm', '*.rkt']
195
+ },
196
+ { id: 'SCSS', fileNamePatterns: ['*.scss'] },
197
+ { id: 'SELinuxInterface', fileNamePatterns: ['*.if'] },
198
+ { id: 'SELinuxTypeEnforcement', fileNamePatterns: ['*.te'] },
199
+ { id: 'SINEX', fileNamePatterns: ['*.snx', '*.sinex'] },
200
+ { id: 'Sh', fileNamePatterns: ['*.sh', '*.SH', '*.bsh', '*.bash', '*.ksh', '*.ash'] },
201
+ { id: 'SLang', fileNamePatterns: ['*.sl'] },
202
+ { id: 'SML', fileNamePatterns: ['*.sml', '*.sig'] },
203
+ { id: 'Scdoc', fileNamePatterns: ['*.scd'] },
204
+ { id: 'SQL', fileNamePatterns: ['*.sql'] },
205
+ {
206
+ id: 'SystemdUnit',
207
+ fileNamePatterns: [
208
+ '*.service',
209
+ '*.socket',
210
+ '*.device',
211
+ '*.mount',
212
+ '*.automount',
213
+ '*.swap',
214
+ '*.target',
215
+ '*.path',
216
+ '*.timer',
217
+ '*.snapshot',
218
+ '*.slice'
219
+ ]
220
+ },
221
+ { id: 'SystemTap', fileNamePatterns: ['*.stp', '*.stpm'] },
222
+ { id: 'Tcl', fileNamePatterns: ['*.tcl', '*.tk', '*.wish', '*.exp'] },
223
+ { id: 'Terraform', fileNamePatterns: ['*.tf'] },
224
+ { id: 'TerraformVariables', fileNamePatterns: ['*.tfvars'] },
225
+ { id: 'Tex', fileNamePatterns: ['*.tex'] },
226
+ { id: 'TTCN', fileNamePatterns: ['*.ttcn', '*.ttcn3'] },
227
+ { id: 'Txt2tags', fileNamePatterns: ['*.t2t', '*.t2t'] },
228
+ { id: 'TypeScript', fileNamePatterns: ['*.ts'] },
229
+ { id: 'TypeSpec', fileNamePatterns: ['*.tsp'] },
230
+ { id: 'V', fileNamePatterns: ['*.v'] },
231
+ { id: 'Vera', fileNamePatterns: ['*.vr', '*.vri', '*.vrh'] },
232
+ { id: 'Verilog', fileNamePatterns: ['*.v', '*.vh'] },
233
+ { id: 'SystemVerilog', fileNamePatterns: ['*.sv', '*.svh', '*.svi'] },
234
+ { id: 'VHDL', fileNamePatterns: ['*.vhdl', '*.vhd'] },
235
+ { id: 'Vim', fileNamePatterns: ['vimrc', '[._]vimrc', 'gvimrc', '[._]gvimrc', '*.vim', '*.vba'] },
236
+ { id: 'WindRes', fileNamePatterns: ['*.rc'] },
237
+ { id: 'YACC', fileNamePatterns: ['*.y'] },
238
+ { id: 'YumRepo', fileNamePatterns: ['*.repo'] },
239
+ { id: 'Zephir', fileNamePatterns: ['*.zep'] },
240
+ { id: 'Zsh', fileNamePatterns: ['*.zsh'] },
241
+ { id: 'DBusIntrospect', fileNamePatterns: ['*.xml'] },
242
+ { id: 'Glade', fileNamePatterns: ['*.glade'] },
243
+ { id: 'Maven2', fileNamePatterns: ['pom.xml', '*.pom', '*.xml'] },
244
+ { id: 'PlistXML', fileNamePatterns: ['*.plist'] },
245
+ { id: 'RelaxNG', fileNamePatterns: ['*.rng'] },
246
+ { id: 'SVG', fileNamePatterns: ['*.svg'] },
247
+ { id: 'XRC', fileNamePatterns: ['*.xrc'] },
248
+ { id: 'XML', fileNamePatterns: ['*.xml'] },
249
+ { id: 'XSLT', fileNamePatterns: ['*.xsl', '*.xslt'] },
250
+ { id: 'Yaml', fileNamePatterns: ['*.yml', '*.yaml'] },
251
+ { id: 'OpenAPI', fileNamePatterns: ['openapi.yaml'] },
252
+ { id: 'Varlink', fileNamePatterns: ['*.varlink'] },
253
+ { id: 'Kotlin', fileNamePatterns: ['*.kt', '*.kts'] },
254
+ { id: 'Thrift', fileNamePatterns: ['*.thrift'] },
255
+ { id: 'Elm', fileNamePatterns: ['*.elm'] },
256
+ { id: 'TOML', fileNamePatterns: ['*.toml'] }
257
+ ];
@@ -0,0 +1,48 @@
1
+ import { symbolNavigationMaps } from './symbol-maps.js';
2
+ let compiled;
3
+ export function symbolNavigationLanguageForPath(path) {
4
+ const name = basename(path);
5
+ return compiledLanguages().find((entry) => entry.patterns.some((pattern) => pattern.test(name)))
6
+ ?.language;
7
+ }
8
+ export function supportsSymbolNavigationPath(path) {
9
+ const name = basename(path);
10
+ return compiledLanguages().some((entry) => entry.patterns.some((pattern) => pattern.test(name)));
11
+ }
12
+ export function symbolNavigationLanguages() {
13
+ return symbolNavigationMaps;
14
+ }
15
+ function compiledLanguages() {
16
+ return (compiled ??= symbolNavigationMaps.map((language) => ({
17
+ language,
18
+ patterns: language.fileNamePatterns.map((pattern) => globPattern(pattern))
19
+ })));
20
+ }
21
+ function globPattern(value) {
22
+ let expression = '';
23
+ for (let index = 0; index < value.length; index += 1) {
24
+ const character = value[index];
25
+ if (character === '*') {
26
+ expression += '.*';
27
+ continue;
28
+ }
29
+ if (character === '?') {
30
+ expression += '.';
31
+ continue;
32
+ }
33
+ if (character === '[') {
34
+ const close = value.indexOf(']', index + 1);
35
+ if (close >= 0) {
36
+ expression += value.slice(index, close + 1);
37
+ index = close;
38
+ continue;
39
+ }
40
+ }
41
+ expression += character.replace(/[\\^$.*+?()[\]{}|]/gu, '\\$&');
42
+ }
43
+ return new RegExp(`^${expression}$`, 'iu');
44
+ }
45
+ function basename(path) {
46
+ const normalized = path.replaceAll('\\', '/');
47
+ return normalized.slice(normalized.lastIndexOf('/') + 1);
48
+ }
@@ -0,0 +1 @@
1
+ export { supportsSymbolNavigationPath, symbolNavigationLanguageForPath, symbolNavigationLanguages } from './symbol-matcher.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { chmod } from 'node:fs/promises';
2
2
  import { dirname, resolve } from 'node:path';
3
- import { fileURLToPath } from 'node:url';
3
+ import { createRequire } from 'node:module';
4
4
  export const BUNDLED_CTAGS_VERSION = '6.2.0-ab95af1';
5
5
  const TARGETS = {
6
6
  'linux-x64': ['linux-x64', 'ctags'],
@@ -11,8 +11,8 @@ const TARGETS = {
11
11
  };
12
12
  export function bundledCtagsDirectory(packageRoot) {
13
13
  return packageRoot === undefined
14
- ? resolve(dirname(fileURLToPath(import.meta.url)), '..', 'vendor/ctags')
15
- : resolve(packageRoot, 'mar-node/vendor/ctags');
14
+ ? resolve(dirname(createRequire(import.meta.url).resolve('@myagentroam/binaries/package.json')), 'vendor/ctags')
15
+ : resolve(packageRoot, 'packages/binaries/vendor/ctags');
16
16
  }
17
17
  export function bundledCtagsPath(platform = process.platform, architecture = process.arch, packageRoot) {
18
18
  const target = TARGETS[`${platform}-${architecture}`];
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { executableArgs, main } from '../src/cli.mjs';
4
+
5
+ const exitCode = await main(executableArgs(process.argv[1], process.argv.slice(2)));
6
+ if (exitCode !== 0) process.exitCode = exitCode;
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from '../src/cli.mjs';
4
+
5
+ const exitCode = await main(['nodes', ...process.argv.slice(2)], { program: 'marnodes' });
6
+ if (exitCode !== 0) process.exitCode = exitCode;
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from '../src/cli.mjs';
4
+
5
+ const exitCode = await main(['scp', ...process.argv.slice(2)], { program: 'marscp' });
6
+ if (exitCode !== 0) process.exitCode = exitCode;
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from '../src/cli.mjs';
4
+
5
+ const exitCode = await main(['ssh', ...process.argv.slice(2)], { program: 'marssh' });
6
+ if (exitCode !== 0) process.exitCode = exitCode;
@@ -0,0 +1 @@
1
+ {"type":"module","version":"0.12.1"}
@@ -0,0 +1,271 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { MarctlClient } from './client.mjs';
3
+ import { loadConfig } from './config.mjs';
4
+ import { MarctlError } from './errors.mjs';
5
+ import { createTranslator } from './i18n/index.mjs';
6
+ import { runTerminalSession } from './terminal.mjs';
7
+ import { runScp } from './scp.mjs';
8
+ import { parseSessionArgs } from './session-args.mjs';
9
+ import { runSessionCommand, sessionExitCode } from './sessions.mjs';
10
+
11
+ async function withCommandSignals(run) {
12
+ const controller = new AbortController();
13
+ const onSigint = () => controller.abort('SIGINT');
14
+ const onSigterm = () => controller.abort('SIGTERM');
15
+ process.once('SIGINT', onSigint);
16
+ process.once('SIGTERM', onSigterm);
17
+ try {
18
+ return await run(controller.signal);
19
+ } finally {
20
+ process.off('SIGINT', onSigint);
21
+ process.off('SIGTERM', onSigterm);
22
+ }
23
+ }
24
+
25
+ export async function main(
26
+ argv = process.argv.slice(2),
27
+ {
28
+ env = process.env,
29
+ stdout = process.stdout,
30
+ stderr = process.stderr,
31
+ stdin = process.stdin,
32
+ program = 'marctl',
33
+ client,
34
+ WebSocketClass
35
+ } = {}
36
+ ) {
37
+ const translate = createTranslator(env);
38
+ let args;
39
+ try {
40
+ args = parseArgs(argv, translate);
41
+ if (args.help) {
42
+ writeLine(
43
+ stdout,
44
+ args.command === undefined
45
+ ? translate('help')
46
+ : translate(`commandHelp.${args.command}`, {
47
+ program: program === 'marctl' ? `marctl ${args.command}` : program
48
+ })
49
+ );
50
+ return 0;
51
+ }
52
+ if (args.version) {
53
+ const { version } = JSON.parse(
54
+ await readFile(new URL('../package.json', import.meta.url), 'utf8')
55
+ );
56
+ writeLine(stdout, `marctl ${version}`);
57
+ return 0;
58
+ }
59
+
60
+ const config = await loadConfig({ env, translate });
61
+ const marctlClient = client ?? new MarctlClient({ ...config, translate });
62
+ if (args.command === 'nodes') {
63
+ const nodes = await marctlClient.listNodes();
64
+ writeLine(stdout, translate('nodesHeader'));
65
+ for (const node of nodes) {
66
+ writeLine(
67
+ stdout,
68
+ [
69
+ node.id,
70
+ node.displayName ?? '',
71
+ node.connected ? translate('connected') : translate('disconnected'),
72
+ node.platform ?? ''
73
+ ].join('\t')
74
+ );
75
+ }
76
+ return 0;
77
+ }
78
+ if (args.command === 'agents') {
79
+ const execute = (signal) =>
80
+ runSessionCommand({
81
+ args,
82
+ client: marctlClient,
83
+ env,
84
+ stdin,
85
+ WebSocketClass,
86
+ translate,
87
+ signal
88
+ });
89
+ const result = args.action === 'wait' ? await withCommandSignals(execute) : await execute();
90
+ writeLine(stdout, JSON.stringify(result, null, args.json ? undefined : 2));
91
+ return 0;
92
+ }
93
+ if (args.command === 'scp') {
94
+ const socketClass = WebSocketClass ?? (await import('ws')).default;
95
+ return await withCommandSignals((signal) =>
96
+ runScp({
97
+ source: args.source,
98
+ destination: args.destination,
99
+ preserve: args.preserve,
100
+ client: marctlClient,
101
+ WebSocketClass: socketClass,
102
+ resolveNodeId: (reference) => resolveNodeId(marctlClient, reference, translate),
103
+ translate,
104
+ signal
105
+ })
106
+ );
107
+ }
108
+
109
+ const nodeId = await resolveNodeId(marctlClient, args.nodeId, translate);
110
+ const socketClass = WebSocketClass ?? (await import('ws')).default;
111
+ return await withCommandSignals((signal) =>
112
+ runTerminalSession({
113
+ client: marctlClient,
114
+ WebSocketClass: socketClass,
115
+ nodeId,
116
+ command: args.remoteCommand,
117
+ raceConnections: true,
118
+ stdout,
119
+ stderr,
120
+ translate,
121
+ signal
122
+ })
123
+ );
124
+ } catch (error) {
125
+ if (argv[0] === 'agents') {
126
+ const failure = {
127
+ code: error.code ?? 'MARCTL_COMMAND_FAILED',
128
+ message: error instanceof MarctlError ? error.message : translate('errors.commandFailed'),
129
+ ...(error.requestId === undefined ? {} : { requestId: error.requestId }),
130
+ ...(error.upstreamRequestId === undefined
131
+ ? {}
132
+ : { upstreamRequestId: error.upstreamRequestId }),
133
+ ...(error.details === undefined ? {} : { details: error.details }),
134
+ ...(error.sessionId === undefined ? {} : { sessionId: error.sessionId }),
135
+ ...(error.runId === undefined ? {} : { runId: error.runId }),
136
+ ...(error.stage === undefined ? {} : { stage: error.stage }),
137
+ ...(error.upstreamCode === undefined ? {} : { upstreamCode: error.upstreamCode }),
138
+ ...(error.progress === undefined ? {} : { progress: error.progress }),
139
+ ...(error.clientMessageId === undefined ? {} : { clientMessageId: error.clientMessageId })
140
+ };
141
+ if (args?.json === true || (args === undefined && argv.includes('--json')))
142
+ writeLine(stdout, JSON.stringify({ error: failure }));
143
+ else {
144
+ writeLine(stderr, program + ': ' + failure.message + ' [' + failure.code + ']');
145
+ if (failure.details !== undefined) writeLine(stderr, failure.details);
146
+ if (failure.progress !== undefined)
147
+ writeLine(stderr, JSON.stringify({ progress: failure.progress }, null, 2));
148
+ }
149
+ return sessionExitCode(error);
150
+ }
151
+ writeLine(
152
+ stderr,
153
+ `${program}: ${error instanceof MarctlError ? error.message : translate('errors.commandFailed')}`
154
+ );
155
+ return 1;
156
+ }
157
+ }
158
+
159
+ export async function resolveNodeId(client, reference, translate = createTranslator()) {
160
+ const nodes = await client.listNodes();
161
+ const byId = nodes.find((node) => node.id === reference);
162
+ if (byId) return byId.id;
163
+ const matches = nodes.filter((node) => node.displayName === reference);
164
+ if (matches.length > 1) throw new MarctlError(translate('errors.nodeNameAmbiguous'));
165
+ if (matches.length === 0) throw new MarctlError(translate('errors.nodeNotFound'));
166
+ return matches[0].id;
167
+ }
168
+
169
+ export function executableArgs(executable, args) {
170
+ const name = String(executable ?? '')
171
+ .split(/[\\/]/u)
172
+ .at(-1)
173
+ .replace(/\.(?:cmd|exe|ps1)$/iu, '');
174
+ const command = { marnodes: 'nodes', marssh: 'ssh', marscp: 'scp' }[name];
175
+ return command === undefined ? args : [command, ...args];
176
+ }
177
+
178
+ export function parseArgs(argv, translate = createTranslator()) {
179
+ if (argv[0] === 'agents') return parseSessionArgs(argv.slice(1), translate);
180
+ let command;
181
+ let nodeId;
182
+ const remoteArgs = [];
183
+ let separator = false;
184
+ let help = false;
185
+ let version = false;
186
+ let preserve = false;
187
+
188
+ for (let index = 0; index < argv.length; index += 1) {
189
+ const argument = argv[index];
190
+ if (
191
+ !separator &&
192
+ nodeId === undefined &&
193
+ (argument === '--help' || argument === '-h' || (command === undefined && argument === 'help'))
194
+ ) {
195
+ help = true;
196
+ continue;
197
+ }
198
+ if (!separator && nodeId === undefined && (argument === '--version' || argument === '-V')) {
199
+ version = true;
200
+ continue;
201
+ }
202
+ if (!separator && argument === '--') {
203
+ separator = true;
204
+ continue;
205
+ }
206
+ if (command === undefined) {
207
+ if (
208
+ argument !== 'nodes' &&
209
+ argument !== 'ssh' &&
210
+ argument !== 'scp' &&
211
+ argument !== 'agents' &&
212
+ argument !== 'version'
213
+ )
214
+ throw unsupportedSshOption(argument, translate);
215
+ command = argument;
216
+ continue;
217
+ }
218
+ if (command === 'nodes' || command === 'version')
219
+ throw new MarctlError(translate('errors.invalidArguments'));
220
+ if (command === 'scp') {
221
+ if (!separator && argument.startsWith('-') && argument !== '-') {
222
+ if (!/^-[pq]+$/u.test(argument))
223
+ throw new MarctlError(translate('errors.scpOptionsUnsupported'));
224
+ if (argument.includes('p')) preserve = true;
225
+ continue;
226
+ }
227
+ if (nodeId === undefined) nodeId = argument;
228
+ else remoteArgs.push(argument);
229
+ continue;
230
+ }
231
+ if (nodeId === undefined) {
232
+ if (!separator && argument.startsWith('-'))
233
+ throw command === 'ssh'
234
+ ? unsupportedSshOption(argument, translate)
235
+ : new MarctlError(translate('errors.invalidArguments'));
236
+ nodeId = argument;
237
+ continue;
238
+ }
239
+ remoteArgs.push(argument);
240
+ }
241
+
242
+ if (help) return { help: true, ...(command === undefined ? {} : { command }) };
243
+ if (version || command === 'version') return { version: true };
244
+ if (command === 'nodes' && nodeId === undefined && remoteArgs.length === 0) return { command };
245
+ if (command === 'scp' && nodeId !== undefined && remoteArgs.length === 1)
246
+ return {
247
+ command,
248
+ source: nodeId,
249
+ destination: remoteArgs[0],
250
+ preserve
251
+ };
252
+ if (command === 'ssh' && nodeId !== undefined && nodeId !== '')
253
+ return {
254
+ command,
255
+ nodeId,
256
+ ...(remoteArgs.length === 0
257
+ ? {}
258
+ : { remoteCommand: remoteArgs.length === 1 ? remoteArgs[0] : remoteArgs.join(' ') })
259
+ };
260
+ throw new MarctlError(translate('errors.invalidArguments'));
261
+ }
262
+
263
+ function writeLine(stream, value) {
264
+ stream.write(`${value}\n`);
265
+ }
266
+
267
+ function unsupportedSshOption(argument, translate) {
268
+ if (typeof argument === 'string' && argument.startsWith('-'))
269
+ return new MarctlError(translate('errors.sshOptionsUnsupported'));
270
+ return new MarctlError(translate('errors.invalidArguments'));
271
+ }