@myagentroam/node 0.12.0 → 0.12.2

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 (142) 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/hosting/hosted-conversation-node-service.js +1 -1
  32. package/dist/marctl/bin/marctl.mjs +6 -0
  33. package/dist/marctl/bin/marnodes.mjs +6 -0
  34. package/dist/marctl/bin/marscp.mjs +6 -0
  35. package/dist/marctl/bin/marssh.mjs +6 -0
  36. package/dist/marctl/package.json +1 -0
  37. package/dist/marctl/src/cli.mjs +271 -0
  38. package/dist/marctl/src/client.mjs +291 -0
  39. package/dist/marctl/src/config.mjs +46 -0
  40. package/dist/marctl/src/direct-control.mjs +225 -0
  41. package/dist/marctl/src/direct-errors.mjs +48 -0
  42. package/dist/marctl/src/direct-process.mjs +374 -0
  43. package/dist/marctl/src/direct-transport.mjs +235 -0
  44. package/dist/marctl/src/direct.mjs +421 -0
  45. package/dist/marctl/src/errors.mjs +11 -0
  46. package/dist/marctl/src/i18n/en-US.mjs +285 -0
  47. package/dist/marctl/src/i18n/index.mjs +20 -0
  48. package/dist/marctl/src/i18n/zh-CN.mjs +269 -0
  49. package/dist/marctl/src/scp-channel.mjs +99 -0
  50. package/dist/marctl/src/scp-copy.mjs +46 -0
  51. package/dist/marctl/src/scp-endpoint.mjs +29 -0
  52. package/dist/marctl/src/scp-protocol.mjs +2 -0
  53. package/dist/marctl/src/scp-worker.cjs +266 -0
  54. package/dist/marctl/src/scp-workers.mjs +179 -0
  55. package/dist/marctl/src/scp.mjs +64 -0
  56. package/dist/marctl/src/session-args.mjs +233 -0
  57. package/dist/marctl/src/session-input.mjs +43 -0
  58. package/dist/marctl/src/session-prepare.mjs +87 -0
  59. package/dist/marctl/src/session-target.mjs +26 -0
  60. package/dist/marctl/src/session-wait.mjs +232 -0
  61. package/dist/marctl/src/sessions.mjs +93 -0
  62. package/dist/marctl/src/terminal-frame.mjs +48 -0
  63. package/dist/marctl/src/terminal-interaction.mjs +177 -0
  64. package/dist/marctl/src/terminal-race.mjs +117 -0
  65. package/dist/marctl/src/terminal-relay-sender.mjs +129 -0
  66. package/dist/marctl/src/terminal-relay.mjs +305 -0
  67. package/dist/marctl/src/terminal.mjs +152 -0
  68. package/dist/marctl-guidance.js +1 -1
  69. package/dist/marctl.js +1 -1
  70. package/dist/marnodes.js +1 -1
  71. package/dist/marscp.js +1 -1
  72. package/dist/marssh.js +1 -1
  73. package/dist/native-session-history.js +1 -1
  74. package/dist/ripgrep-binary.js +3 -3
  75. package/dist/runner/codex-runner.js +2 -2
  76. package/dist/runner/mar-agent/agent-operation-presentation.js +22 -10
  77. package/dist/runner/mar-agent/codex-imagegen-skill.js +15 -23
  78. package/dist/runner/mar-agent/conversation-normalizer.js +4 -18
  79. package/dist/runner/mar-agent/image-generation-extensions.js +1 -1
  80. package/dist/runner/mar-agent/image-generation.js +73 -20
  81. package/dist/runner/mar-agent/session-runtime-registry.js +5 -3
  82. package/dist/service/code-navigation/file-reference-parser.js +1 -1
  83. package/dist/service/node-terminal-channel.js +1 -1
  84. package/dist/session/session-catalog-service.js +4 -1
  85. package/dist/workspace/workspace-code-navigation-service.js +2 -2
  86. package/dist/workspace/workspace-git-exclude-service.js +1 -1
  87. package/package.json +11 -9
  88. package/vendor/ctags/NOTICE +0 -22
  89. package/vendor/ctags/darwin-arm64/ctags +0 -0
  90. package/vendor/ctags/darwin-x64/ctags +0 -0
  91. package/vendor/ctags/licenses/COPYING +0 -340
  92. package/vendor/ctags/licenses/COPYING.MinGW-w64-runtime.txt +0 -240
  93. package/vendor/ctags/licenses/LICENSE.janssen +0 -19
  94. package/vendor/ctags/licenses/LICENSE.libyaml +0 -19
  95. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/COPYING +0 -340
  96. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/RECEIPT.yml +0 -27
  97. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libiconv.yml +0 -24
  98. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libjansson.yml +0 -19
  99. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libxml2.yml +0 -20
  100. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libyaml.yml +0 -7
  101. package/vendor/ctags/licenses/official-snapshot/darwin-arm64/dependencies/libz.yml +0 -13
  102. package/vendor/ctags/licenses/official-snapshot/darwin-x64/COPYING +0 -340
  103. package/vendor/ctags/licenses/official-snapshot/darwin-x64/RECEIPT.yml +0 -27
  104. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libiconv.yml +0 -24
  105. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libjansson.yml +0 -19
  106. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libxml2.yml +0 -20
  107. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libyaml.yml +0 -7
  108. package/vendor/ctags/licenses/official-snapshot/darwin-x64/dependencies/libz.yml +0 -13
  109. package/vendor/ctags/licenses/official-snapshot/linux-arm64/COPYING +0 -340
  110. package/vendor/ctags/licenses/official-snapshot/linux-arm64/RECEIPT.yml +0 -27
  111. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libiconv.yml +0 -24
  112. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libjansson.yml +0 -19
  113. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libxml2.yml +0 -20
  114. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libyaml.yml +0 -7
  115. package/vendor/ctags/licenses/official-snapshot/linux-arm64/dependencies/libz.yml +0 -13
  116. package/vendor/ctags/licenses/official-snapshot/linux-x64/COPYING +0 -340
  117. package/vendor/ctags/licenses/official-snapshot/linux-x64/RECEIPT.yml +0 -27
  118. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libiconv.yml +0 -24
  119. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libjansson.yml +0 -19
  120. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libxml2.yml +0 -20
  121. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libyaml.yml +0 -7
  122. package/vendor/ctags/licenses/official-snapshot/linux-x64/dependencies/libz.yml +0 -13
  123. package/vendor/ctags/licenses/win32-x64/COPYING +0 -340
  124. package/vendor/ctags/licenses/win32-x64/COPYING.MinGW-w64-runtime.txt +0 -240
  125. package/vendor/ctags/licenses/win32-x64/Copyright.libxml2 +0 -23
  126. package/vendor/ctags/licenses/win32-x64/LICENCE.pcre2 +0 -94
  127. package/vendor/ctags/licenses/win32-x64/LICENSE.janssen +0 -19
  128. package/vendor/ctags/licenses/win32-x64/LICENSE.libyaml +0 -19
  129. package/vendor/ctags/linux-arm64/ctags +0 -0
  130. package/vendor/ctags/linux-x64/ctags +0 -0
  131. package/vendor/ctags/manifest.json +0 -42
  132. package/vendor/ctags/source/universal-ctags-ab95af198f8eaeb6d50dc96e3adf52e769d3e5f0.tar.gz +0 -0
  133. package/vendor/ctags/win32-x64/ctags.exe +0 -0
  134. package/vendor/ripgrep/LICENSE-MIT +0 -21
  135. package/vendor/ripgrep/UNLICENSE +0 -24
  136. package/vendor/ripgrep/darwin-arm64/rg +0 -0
  137. package/vendor/ripgrep/darwin-x64/rg +0 -0
  138. package/vendor/ripgrep/linux-arm64/rg +0 -0
  139. package/vendor/ripgrep/linux-x64/rg +0 -0
  140. package/vendor/ripgrep/manifest.json +0 -42
  141. package/vendor/ripgrep/win32-arm64/rg.exe +0 -0
  142. package/vendor/ripgrep/win32-x64/rg.exe +0 -0
@@ -602,7 +602,7 @@ export class MarAgentConversationNormalizer {
602
602
  this.#clearCodeModeOutputSnapshots(sourceCallId);
603
603
  }
604
604
  #startExecution(executionId) {
605
- for (const [callId, state] of this.#tools)
605
+ for (const state of this.#tools.values())
606
606
  if (state.executionId !== executionId) {
607
607
  state.active = false;
608
608
  }
@@ -1734,20 +1734,6 @@ function truncateCharacters(value, maximumCharacters) {
1734
1734
  ? value
1735
1735
  : characters.slice(0, maximumCharacters).join('');
1736
1736
  }
1737
- function boundedToolSummary(value) {
1738
- const maximumCodeUnits = 10_000;
1739
- if (value.length <= maximumCodeUnits)
1740
- return value;
1741
- let end = maximumCodeUnits - 1;
1742
- const lastIncluded = value.charCodeAt(end - 1);
1743
- const firstExcluded = value.charCodeAt(end);
1744
- if (lastIncluded >= 0xd800 &&
1745
- lastIncluded <= 0xdbff &&
1746
- firstExcluded >= 0xdc00 &&
1747
- firstExcluded <= 0xdfff)
1748
- end--;
1749
- return `${value.slice(0, end)}…`;
1750
- }
1751
1737
  function marAgentAgentId(value) {
1752
1738
  const data = structuredRecord(value);
1753
1739
  if (data === undefined)
@@ -1798,7 +1784,7 @@ function imageArtifacts(event) {
1798
1784
  const name = typeof artifact?.name === 'string' ? compactRunnerText(artifact.name, 255) : '';
1799
1785
  const byteSize = nonnegativeInteger(artifact?.byteSize);
1800
1786
  if (artifact?.kind !== 'image' ||
1801
- artifact.mimeType !== 'image/png' ||
1787
+ (artifact.mimeType !== 'image/png' && artifact.mimeType !== 'image/gif') ||
1802
1788
  typeof artifact.sha256 !== 'string' ||
1803
1789
  !/^[a-f0-9]{64}$/iu.test(artifact.sha256) ||
1804
1790
  name.length === 0 ||
@@ -1810,8 +1796,8 @@ function imageArtifacts(event) {
1810
1796
  fileName === '..' ||
1811
1797
  fileName.includes('/') ||
1812
1798
  fileName.includes('\\') ||
1813
- !fileName.toLocaleLowerCase().endsWith('.png'))
1799
+ !fileName.endsWith(artifact.mimeType === 'image/gif' ? '.gif' : '.png'))
1814
1800
  return [];
1815
- return [{ name, mime: 'image/png', byteSize, fileName }];
1801
+ return [{ name, mime: artifact.mimeType, byteSize, fileName }];
1816
1802
  });
1817
1803
  }
@@ -19,7 +19,7 @@ export function createImageGenerationExtensions(input) {
19
19
  {
20
20
  name: codex ? 'codex-imagegen' : 'byted_ark-imagegen',
21
21
  description: codex
22
- ? 'Generate or edit raster images with codex_image_gen only when explicitly requested. Load before calling the image tool.'
22
+ ? 'Generate or edit PNG images and looping GIFs with codex_image_gen only when explicitly requested. Load before calling the image tool.'
23
23
  : 'Generate or edit one image with byted_ark_image_gen only when explicitly requested. Load before calling the image tool.',
24
24
  requiredTools: [tool.name],
25
25
  load: async () => codex
@@ -26,7 +26,7 @@ export const codexImageGenToolDefinition = {
26
26
  agentScope: 'ROOT_ONLY',
27
27
  allowedCallers: ['direct', 'programmatic'],
28
28
  parallelSafety: 'safe',
29
- description: 'Only when the user requests or explicitly authorizes image generation or editing, use the configured Codex Images API. First load and follow skill({name:"codex-imagegen"}); reload if its guidance is no longer in context. Do not generate unsolicited visuals. Omit both selectors for a new image without references. For image inputs, inspect unseen local images with view_image when available; TEXT-only models must not claim visual inspection. Use referenced_image_paths when every image has an absolute path; otherwise use num_last_images_to_include for the smallest sufficient number of currently available conversation images. Never provide both selectors. Include at most five images; if required inputs are missing, ask for them rather than silently omitting them. Recent images are in-memory in the current Execution, not a permanent history library. One PNG is saved in the current Session and its path is returned, not inspected pixels. Use view_image when available to check the result; otherwise report that visual acceptance was not performed. Full workflow guidance is in the codex-imagegen skill.',
29
+ description: 'Generate or edit one PNG or simple looping GIF with the configured Codex Images API, only when requested or explicitly authorized. First load skill({name:"codex-imagegen"}); reuse it while in context. Omit selectors only for generation without references; otherwise use up to five absolute referenced_image_paths OR the smallest sufficient num_last_images_to_include from this Execution. Set transparent_background for transparency and gif for 2–16 animation frames. Returns a managed file path, not inspected pixels.',
30
30
  inputSchema: {
31
31
  type: 'object',
32
32
  properties: {
@@ -44,6 +44,19 @@ export const codexImageGenToolDefinition = {
44
44
  minimum: 1,
45
45
  maximum: MAX_EDIT_IMAGES,
46
46
  description: 'Number of most recent in-memory conversation images to edit.'
47
+ },
48
+ transparent_background: {
49
+ type: 'boolean',
50
+ description: 'Request a transparent background; defaults to false.'
51
+ },
52
+ gif: {
53
+ type: 'object',
54
+ description: 'Request a simple looping GIF. Use {} for 9 frames at 200 ms per frame.',
55
+ properties: {
56
+ frame_count: { type: 'integer', minimum: 2, maximum: 16 },
57
+ frame_duration_ms: { type: 'integer', minimum: 20, maximum: 2000 }
58
+ },
59
+ additionalProperties: false
47
60
  }
48
61
  },
49
62
  required: ['prompt'],
@@ -53,6 +66,10 @@ export const codexImageGenToolDefinition = {
53
66
  export const bytedArkImageGenToolDefinition = {
54
67
  ...codexImageGenToolDefinition,
55
68
  name: 'byted_ark_image_gen',
69
+ inputSchema: {
70
+ ...codexImageGenToolDefinition.inputSchema,
71
+ properties: Object.fromEntries(Object.entries(codexImageGenToolDefinition.inputSchema.properties ?? {}).filter(([key]) => key !== 'transparent_background' && key !== 'gif'))
72
+ },
56
73
  description: 'Generate or edit one PNG using the configured Ark Images API, only when explicitly requested. First load skill({name:"byted_ark-imagegen"}). Omit both selectors for text-to-image; use absolute referenced_image_paths or num_last_images_to_include for image-to-image, never both. Up to five references, exactly one output; no group generation. Returns a managed image path, not inspected pixels.'
57
74
  };
58
75
  export async function executeCodexImageGen(arguments_, input) {
@@ -60,11 +77,11 @@ export async function executeCodexImageGen(arguments_, input) {
60
77
  const capability = input.configuration.imageGeneration;
61
78
  if (capability === undefined || capability.credentialProvider === undefined)
62
79
  throw new AgentError('MAR_AGENT_MODEL_CONFIG_INVALID', 'Image generation requires an independent credential provider.');
63
- const request = parseInput(arguments_);
64
- const images = await selectedEditImages(request, input);
65
80
  const ark = capability.provider === 'BYTED_ARK';
66
81
  if (!ark && capability.provider !== 'CODEX')
67
82
  throw new AgentError('MAR_AGENT_MODEL_CONFIG_INVALID', 'Unsupported image provider.');
83
+ const request = parseInput(arguments_, ark);
84
+ const images = await selectedEditImages(request, input);
68
85
  const endpoint = images.length === 0 ? capability.generateEndpoint : capability.editEndpoint;
69
86
  const body = JSON.stringify(ark
70
87
  ? {
@@ -93,11 +110,11 @@ export async function executeCodexImageGen(arguments_, input) {
93
110
  }))
94
111
  }),
95
112
  prompt: request.prompt,
96
- background: 'auto',
113
+ background: request.transparentBackground ? 'transparent' : 'opaque',
97
114
  model: capability.imageModelId,
98
- n: 1,
99
115
  quality: 'auto',
100
- size: 'auto'
116
+ size: 'auto',
117
+ ...(request.gif === undefined ? {} : { output_format: 'gif', ...request.gif })
101
118
  });
102
119
  const turnId = randomUUID();
103
120
  let reason = 'REQUEST';
@@ -136,8 +153,10 @@ export async function executeCodexImageGen(arguments_, input) {
136
153
  if (!response.ok)
137
154
  throw imageGenerationResponseError(response.status, payload);
138
155
  const encoded = imageBase64(payload);
139
- const data = decodePng(encoded);
140
- const fileName = generatedFileName(input.callId);
156
+ const { data, format } = decodeImage(encoded);
157
+ if (ark && format !== 'png')
158
+ throw new AgentError('MAR_AGENT_IMAGE_GENERATION_RESPONSE_INVALID', 'Ark image response must be a PNG.');
159
+ const fileName = generatedFileName(input.callId, format);
141
160
  const directory = join(input.sessionDirectory, 'generated_images');
142
161
  const path = join(directory, fileName);
143
162
  const displayPath = input.displayDirectory === undefined ? path : posix.join(input.displayDirectory, fileName);
@@ -160,7 +179,7 @@ export async function executeCodexImageGen(arguments_, input) {
160
179
  {
161
180
  kind: 'image',
162
181
  name: fileName,
163
- mimeType: 'image/png',
182
+ mimeType: format === 'gif' ? 'image/gif' : 'image/png',
164
183
  byteSize: data.byteLength,
165
184
  sha256,
166
185
  fileName
@@ -170,16 +189,21 @@ export async function executeCodexImageGen(arguments_, input) {
170
189
  }
171
190
  throw new AgentError('MAR_AGENT_IMAGE_GENERATION_FAILED', 'Image generation failed.');
172
191
  }
173
- function parseInput(value) {
192
+ function parseInput(value, ark) {
174
193
  if (value === null || typeof value !== 'object' || Array.isArray(value))
175
194
  return invalidInput();
176
195
  const input = value;
177
196
  const referencedImagePaths = input.referenced_image_paths === null ? undefined : input.referenced_image_paths;
178
197
  const numLastImagesToInclude = input.num_last_images_to_include === null ? undefined : input.num_last_images_to_include;
179
- if (Object.keys(input).some((key) => key !== 'prompt' && key !== 'referenced_image_paths' && key !== 'num_last_images_to_include') ||
198
+ const transparentBackground = input.transparent_background ?? false;
199
+ if (Object.keys(input).some((key) => key !== 'prompt' &&
200
+ key !== 'referenced_image_paths' &&
201
+ key !== 'num_last_images_to_include' &&
202
+ (ark || (key !== 'gif' && key !== 'transparent_background'))) ||
180
203
  typeof input.prompt !== 'string' ||
181
204
  input.prompt.trim().length === 0 ||
182
205
  input.prompt.length > 32_768 ||
206
+ typeof transparentBackground !== 'boolean' ||
183
207
  (referencedImagePaths !== undefined &&
184
208
  (!Array.isArray(referencedImagePaths) ||
185
209
  referencedImagePaths.length > MAX_EDIT_IMAGES ||
@@ -194,12 +218,32 @@ function parseInput(value) {
194
218
  return invalidInput();
195
219
  return {
196
220
  prompt: input.prompt,
221
+ transparentBackground,
222
+ ...(input.gif === undefined || input.gif === null ? {} : { gif: parseGif(input.gif) }),
197
223
  ...(paths?.length ? { referencedImagePaths: [...paths] } : {}),
198
224
  ...(numLastImagesToInclude === undefined
199
225
  ? {}
200
226
  : { numLastImagesToInclude: numLastImagesToInclude })
201
227
  };
202
228
  }
229
+ function parseGif(value) {
230
+ if (value === null || typeof value !== 'object' || Array.isArray(value))
231
+ return invalidInput();
232
+ const options = value;
233
+ if (Object.keys(options).some((key) => key !== 'frame_count' && key !== 'frame_duration_ms'))
234
+ return invalidInput();
235
+ const count = options.frame_count ?? undefined;
236
+ const duration = options.frame_duration_ms ?? undefined;
237
+ if ((count !== undefined &&
238
+ (!Number.isInteger(count) || count < 2 || count > 16)) ||
239
+ (duration !== undefined &&
240
+ (!Number.isInteger(duration) || duration < 20 || duration > 2000)))
241
+ return invalidInput();
242
+ return {
243
+ ...(count === undefined ? {} : { frame_count: count }),
244
+ ...(duration === undefined ? {} : { frame_duration_ms: duration })
245
+ };
246
+ }
203
247
  async function selectedEditImages(request, input) {
204
248
  if (request.referencedImagePaths !== undefined) {
205
249
  const images = [];
@@ -310,31 +354,36 @@ function imageBase64(value) {
310
354
  throw new AgentError('MAR_AGENT_IMAGE_GENERATION_RESPONSE_INVALID', 'Image response is invalid.');
311
355
  return first;
312
356
  }
313
- function decodePng(encoded) {
357
+ function decodeImage(encoded) {
314
358
  if (encoded.length % 4 !== 0 || !/^[A-Za-z0-9+/]+={0,2}$/u.test(encoded))
315
359
  throw new AgentError('MAR_AGENT_IMAGE_GENERATION_RESPONSE_INVALID', 'Image response is invalid.');
316
360
  const data = Buffer.from(encoded, 'base64');
361
+ const signature = data.subarray(0, 6);
362
+ const format = signature.equals(Buffer.from('GIF87a')) || signature.equals(Buffer.from('GIF89a'))
363
+ ? 'gif'
364
+ : 'png';
317
365
  if (data.byteLength === 0 ||
318
366
  data.byteLength > IMAGE_MAX_BYTES ||
319
367
  data.toString('base64') !== encoded ||
320
- !data.subarray(0, PNG_SIGNATURE.length).equals(PNG_SIGNATURE))
321
- throw new AgentError('MAR_AGENT_IMAGE_GENERATION_RESPONSE_INVALID', 'Image response is not a supported PNG.');
322
- return data;
368
+ (format === 'png' && !data.subarray(0, PNG_SIGNATURE.length).equals(PNG_SIGNATURE)))
369
+ throw new AgentError('MAR_AGENT_IMAGE_GENERATION_RESPONSE_INVALID', 'Image response is not a supported PNG or GIF.');
370
+ return { data, format };
323
371
  }
324
- function generatedFileName(callId) {
372
+ function generatedFileName(callId, format) {
325
373
  const normalized = callId
326
374
  .normalize('NFKC')
327
375
  .replace(/[^a-zA-Z0-9._-]+/gu, '_')
328
376
  .replace(/^[_\-.]+|[_\-.]+$/gu, '')
329
377
  .slice(0, 96);
330
378
  const stem = normalized.length > 0 ? normalized : createHash('sha256').update(callId).digest('hex');
331
- const fileName = `${stem.startsWith('image_') ? stem : `image_${stem}`}.png`;
379
+ const fileName = `${stem.startsWith('image_') ? stem : `image_${stem}`}.${format}`;
332
380
  return basename(fileName);
333
381
  }
334
382
  function imageGenerationResponseError(status, value) {
335
- const error = value !== null && typeof value === 'object' && !Array.isArray(value)
336
- ? value.error
383
+ const payload = value !== null && typeof value === 'object' && !Array.isArray(value)
384
+ ? value
337
385
  : undefined;
386
+ const error = payload?.error;
338
387
  const record = error !== null && typeof error === 'object' && !Array.isArray(error)
339
388
  ? error
340
389
  : undefined;
@@ -343,7 +392,11 @@ function imageGenerationResponseError(status, value) {
343
392
  const code = /^[a-zA-Z0-9._-]{1,80}$/u.test(rawCode)
344
393
  ? rawCode
345
394
  : 'MAR_AGENT_IMAGE_GENERATION_FAILED';
346
- const rawMessage = typeof record?.message === 'string' ? record.message.trim() : '';
395
+ const rawMessage = typeof record?.message === 'string'
396
+ ? record.message.trim()
397
+ : typeof payload?.detail === 'string'
398
+ ? payload.detail.trim()
399
+ : '';
347
400
  const message = rawMessage.length > 0 &&
348
401
  rawMessage.length <= 1_000 &&
349
402
  !/\b(?:authorization|bearer|api[_ -]?key|access[_ -]?token|refresh[_ -]?token|password|secret|proxy-authorization|chatgpt-account-id)\b|socks5:\/\//iu.test(rawMessage)
@@ -78,11 +78,13 @@ export class MarAgentSessionRuntimeRegistry {
78
78
  this.#assertUsable(entry, lifetime);
79
79
  }
80
80
  const request = nativeId === undefined ? input : { ...input, externalSessionId: nativeId };
81
- let created;
82
- created = await createSessionRuntime(request, nativeId ?? input.sessionId, fingerprint, configuration, this.resources, () => created !== undefined && entry.runtime === created && entry.release === undefined
81
+ const created = {};
82
+ created.runtime = await createSessionRuntime(request, nativeId ?? input.sessionId, fingerprint, configuration, this.resources, () => created.runtime !== undefined &&
83
+ entry.runtime === created.runtime &&
84
+ entry.release === undefined
83
85
  ? entry.current?.runId
84
86
  : undefined);
85
- uncommitted = created;
87
+ uncommitted = created.runtime;
86
88
  this.#addAlias(entry, uncommitted.session.id);
87
89
  nodeLog('runner.mar-agent.runtime.created', {
88
90
  runtimeId: uncommitted.runtimeId,
@@ -1,4 +1,4 @@
1
- import { fileSpecifierParser } from '@myagentroam/code-navigation';
1
+ import { fileSpecifierParser } from '../../code-navigation/index.js';
2
2
  const MAX_REFERENCE_REPARSE_POSITIONS = 8;
3
3
  export function reparseFileReference(path, requested) {
4
4
  const parser = fileSpecifierParser(path, requested.sourceContext.text);
@@ -3,7 +3,7 @@ import { terminalDataFrameSchema } from '@myagentroam/protocol';
3
3
  import { nodeTerminalConnectEndpoint } from '../connection/endpoints.js';
4
4
  import { isPlainRecord } from '../util/records.js';
5
5
  import { TerminalRelayState } from './terminal-relay-state.js';
6
- import { TerminalRelaySender } from '@myagentroam/marctl/src/terminal-relay-sender.mjs';
6
+ import { TerminalRelaySender } from '../marctl/src/terminal-relay-sender.mjs';
7
7
  export class NodeTerminalChannel {
8
8
  options;
9
9
  socket;
@@ -187,13 +187,16 @@ export class SessionCatalogService {
187
187
  for (const record of candidates) {
188
188
  if (selected.size >= query.limit)
189
189
  break;
190
+ const remaining = query.limit - selected.size;
190
191
  const path = [];
191
192
  let current = record;
192
193
  while (current !== undefined && !selected.has(current.id)) {
193
194
  path.push(current);
195
+ if (path.length > remaining)
196
+ break;
194
197
  current = byId.get(current.metadata.parentSessionId ?? '');
195
198
  }
196
- if (path.length > query.limit - selected.size)
199
+ if (path.length > remaining)
197
200
  continue;
198
201
  for (const ancestor of path.reverse())
199
202
  selected.set(ancestor.id, ancestor);
@@ -3,8 +3,8 @@ import { constants } from 'node:fs';
3
3
  import { access, open, realpath, rename, rm, stat, writeFile } from 'node:fs/promises';
4
4
  import { homedir } from 'node:os';
5
5
  import { relative, resolve, sep } from 'node:path';
6
- import { isNavigationSymbol } from '@myagentroam/code-navigation';
7
- import { supportsSymbolNavigationPath } from '@myagentroam/code-navigation/symbol-navigation';
6
+ import { isNavigationSymbol } from '../code-navigation/index.js';
7
+ import { supportsSymbolNavigationPath } from '../code-navigation/symbol-navigation.js';
8
8
  import { workspaceFileReferenceSchema } from '@myagentroam/protocol';
9
9
  import { bundledCtagsPath, BUNDLED_CTAGS_VERSION, repairBundledCtagsExecutable } from '../ctags-binary.js';
10
10
  import { nodeLog } from '../operational.js';
@@ -65,7 +65,7 @@ async function gitExcludeTarget(workspace, includeParentRepository) {
65
65
  .relative(root, await realpath(workspace))
66
66
  .split(path.sep)
67
67
  .join('/');
68
- const escaped = relative.replace(/[\\*?\[\]#! ]/g, '\\$&');
68
+ const escaped = relative.replace(/[\\*?[\]#! ]/g, '\\$&');
69
69
  return { exclude: await resolveGitExclude(root), prefix: relative === '' ? '/' : `/${escaped}/` };
70
70
  }
71
71
  async function mutateGitExclude(workspace, mutate, includeParentRepository) {
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "MyAgentRoam Node runtime CLI.",
5
5
  "license": "Apache-2.0 AND GPL-2.0-or-later",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist/**/*.js",
9
+ "dist/marctl/**/*.mjs",
10
+ "dist/marctl/**/*.cjs",
11
+ "dist/marctl/package.json",
9
12
  "scripts/install-web-browser.mjs",
10
- "vendor/ripgrep/**/*",
11
- "vendor/ctags/**/*",
12
13
  "dist/config.d.ts",
13
14
  "LICENSE",
14
15
  "NOTICE"
@@ -29,6 +30,7 @@
29
30
  "dependencies": {
30
31
  "@anthropic-ai/claude-agent-sdk": "0.3.233",
31
32
  "@modelcontextprotocol/sdk": "1.32.0",
33
+ "@myagentroam/binaries": "0.10.1",
32
34
  "@opencode-ai/sdk": "1.18.20",
33
35
  "minimatch": "^10.2.6",
34
36
  "node-datachannel": "0.33.4",
@@ -40,14 +42,14 @@
40
42
  "turndown-plugin-gfm": "^1.0.2",
41
43
  "ws": "^8.21.3",
42
44
  "zod": "4.4.3",
43
- "@myagentroam/agent": "0.12.0",
44
- "@myagentroam/marctl": "0.12.0",
45
- "@myagentroam/code-navigation": "0.11.1",
46
- "@myagentroam/protocol": "0.12.0"
45
+ "@myagentroam/protocol": "0.12.2",
46
+ "@myagentroam/agent": "0.12.2"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/turndown": "^5.0.6",
50
- "@types/ws": "^8.18.1"
50
+ "@types/ws": "^8.18.1",
51
+ "@myagentroam/code-navigation": "0.11.1",
52
+ "@myagentroam/marctl": "0.12.2"
51
53
  },
52
54
  "exports": {
53
55
  "./config": {
@@ -59,7 +61,7 @@
59
61
  },
60
62
  "scripts": {
61
63
  "postinstall": "node scripts/install-web-browser.mjs",
62
- "build": "node ../scripts/clean-build-output.mjs dist && tsc -p tsconfig.json",
64
+ "build": "node ../scripts/clean-build-output.mjs dist && tsc -p tsconfig.json && node ../scripts/stage-node-internals.mjs",
63
65
  "stage:computer-use-runtime": "node ../scripts/stage-computer-use-runtime.mjs",
64
66
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
65
67
  "dev": "tsx watch src/main.ts",
@@ -1,22 +0,0 @@
1
- This directory distributes Universal Ctags binaries as a separate executable
2
- work. All bundled binaries are official upstream artifacts built from commit
3
- ab95af198f8eaeb6d50dc96e3adf52e769d3e5f0.
4
-
5
- Universal Ctags is licensed under GPL-2.0-or-later. Its complete corresponding
6
- source is included at:
7
-
8
- source/universal-ctags-ab95af198f8eaeb6d50dc96e3adf52e769d3e5f0.tar.gz
9
-
10
- The official source URL, per-platform release URLs, archive SHA-256 values and
11
- executable SHA-256 values are recorded in manifest.json.
12
-
13
- Linux x64/ARM64 and macOS x64/ARM64 come from the official
14
- universal-ctags/ctags-nightly-build 2026.09.16 release. Their upstream package
15
- metadata and dependency notices are preserved under
16
- licenses/official-snapshot/<target>/.
17
-
18
- Windows x64 comes from the official universal-ctags/ctags-win32
19
- 2026-09-16/p6.2.20260913.0-2-gab95af1 release. Its distributed license texts
20
- are preserved under licenses/win32-x64/.
21
-
22
- No bundled Ctags executable is built by this project.
Binary file
Binary file