@aiaiai-pt/martha-cli 0.51.1 → 0.51.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to `@aiaiai-pt/martha-cli`. Format: [Keep a Changelog](https
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.51.2] — 2026-07-19
8
+
9
+ ### Fixed — selected-client local execution (#968)
10
+
11
+ - `martha chat --client <non-default> --local-exec` now carries the selected
12
+ client through tool claims, tool results, and local screenshot/browser
13
+ artifact uploads, while chats without a selected client keep the existing
14
+ auth-default behavior.
15
+
7
16
  ## [0.51.1] — 2026-07-17
8
17
 
9
18
  ### Fixed — hosted embed cache migration (#955)
package/dist/index.js CHANGED
@@ -11119,7 +11119,7 @@ init_config();
11119
11119
  init_errors();
11120
11120
 
11121
11121
  // src/version.ts
11122
- var CLI_VERSION = "0.51.1";
11122
+ var CLI_VERSION = "0.51.2";
11123
11123
 
11124
11124
  // src/commands/sessions.ts
11125
11125
  function relativeTime(iso) {
@@ -13078,11 +13078,12 @@ function parseJobToolRequests(data, toolName) {
13078
13078
  }
13079
13079
 
13080
13080
  // src/lib/local-tool-runner.ts
13081
- async function uploadImageArtifact(ctx, sessionId, png) {
13081
+ function selectedClientOptions(clientId) {
13082
+ return clientId ? { params: { selected_client: clientId } } : undefined;
13083
+ }
13084
+ async function uploadImageArtifact(ctx, sessionId, png, clientId) {
13082
13085
  try {
13083
- const mint = await ctx.api.post(`/api/chat/${encodeURIComponent(sessionId)}/local-artifact-upload`, {
13084
- content_type: "image/png"
13085
- });
13086
+ const mint = await ctx.api.post(`/api/chat/${encodeURIComponent(sessionId)}/local-artifact-upload`, { content_type: "image/png" }, selectedClientOptions(clientId));
13086
13087
  const put = await fetch(mint.upload_url, {
13087
13088
  method: "PUT",
13088
13089
  headers: { "Content-Type": "image/png" },
@@ -13198,7 +13199,7 @@ async function resolveHostScreenshot(ctx, sessionId, req, state) {
13198
13199
  } catch (e) {
13199
13200
  return { error: true, message: `screenshot failed: ${String(e)}` };
13200
13201
  }
13201
- const uploaded = await uploadImageArtifact(ctx, sessionId, png);
13202
+ const uploaded = await uploadImageArtifact(ctx, sessionId, png, state.clientId);
13202
13203
  if ("error" in uploaded)
13203
13204
  return { error: true, message: uploaded.error };
13204
13205
  return {
@@ -13225,7 +13226,7 @@ async function resolveHostBrowser(ctx, sessionId, req, state) {
13225
13226
  if ("error" in result)
13226
13227
  return { error: true, message: result.message };
13227
13228
  if ("png" in result) {
13228
- const uploaded = await uploadImageArtifact(ctx, sessionId, result.png);
13229
+ const uploaded = await uploadImageArtifact(ctx, sessionId, result.png, state.clientId);
13229
13230
  if ("error" in uploaded)
13230
13231
  return { error: true, message: uploaded.error };
13231
13232
  return {
@@ -13452,27 +13453,29 @@ function createLocalExecState(opts) {
13452
13453
  cwd: opts.cwd,
13453
13454
  autoYes: opts.autoYes,
13454
13455
  localAgent: opts.localAgent,
13456
+ clientId: opts.clientId,
13455
13457
  handled: new Set,
13456
13458
  journal: new Journal(opts.cwd),
13457
13459
  secrets: new Map,
13458
13460
  claimed: new Set
13459
13461
  };
13460
13462
  }
13461
- function makeChatTransport(ctx, sessionId) {
13463
+ function makeChatTransport(ctx, sessionId, clientId) {
13462
13464
  const base = `/api/chat/${encodeURIComponent(sessionId)}`;
13465
+ const requestOptions = selectedClientOptions(clientId);
13463
13466
  return {
13464
13467
  async claim(toolCallId, secretHash) {
13465
13468
  await ctx.api.post(`${base}/tool-claim`, {
13466
13469
  tool_call_id: toolCallId,
13467
13470
  secret_hash: secretHash
13468
- });
13471
+ }, requestOptions);
13469
13472
  },
13470
13473
  async postResult(toolCallId, result, execSecret) {
13471
13474
  await ctx.api.post(`${base}/tool-result`, {
13472
13475
  tool_call_id: toolCallId,
13473
13476
  result,
13474
13477
  ...execSecret !== undefined ? { exec_secret: execSecret } : {}
13475
- });
13478
+ }, requestOptions);
13476
13479
  }
13477
13480
  };
13478
13481
  }
@@ -13573,7 +13576,8 @@ async function sendMessage(ctx, sessionId, message, opts = {}) {
13573
13576
  const localExecState = opts.localExec ? createLocalExecState({
13574
13577
  cwd: opts.localExec.cwd,
13575
13578
  autoYes: opts.localExec.autoYes,
13576
- localAgent: opts.localExec.agent
13579
+ localAgent: opts.localExec.agent,
13580
+ clientId: opts.clientId
13577
13581
  }) : null;
13578
13582
  const reqBody = { content: message };
13579
13583
  if (opts.localExec)
@@ -13627,7 +13631,7 @@ async function sendMessage(ctx, sessionId, message, opts = {}) {
13627
13631
  if (opts.onToolStatus)
13628
13632
  opts.onToolStatus(event.data);
13629
13633
  if (localExecState) {
13630
- await handleToolStatusData(ctx, sessionId, event.data, localExecState, makeChatTransport(ctx, sessionId));
13634
+ await handleToolStatusData(ctx, sessionId, event.data, localExecState, makeChatTransport(ctx, sessionId, opts.clientId));
13631
13635
  }
13632
13636
  break;
13633
13637
  case "clear":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiaiai-pt/martha-cli",
3
- "version": "0.51.1",
3
+ "version": "0.51.2",
4
4
  "description": "Terminal-first client for the Martha AI platform",
5
5
  "homepage": "https://docs.martha.nomadriver.co",
6
6
  "repository": {