@aiaiai-pt/martha-cli 0.50.0 → 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 +27 -0
- package/dist/index.js +41 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@ 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
|
+
|
|
16
|
+
## [0.51.1] — 2026-07-17
|
|
17
|
+
|
|
18
|
+
### Fixed — hosted embed cache migration (#955)
|
|
19
|
+
|
|
20
|
+
- Hosted bundle URLs and generated HTML snippets now use the one-time `0.3.0`
|
|
21
|
+
cache key needed to escape the former immutable stable-file policy.
|
|
22
|
+
- HTML snippets apply the same key to `stylesheet-url`, because the loader
|
|
23
|
+
query is not inherited by the sibling CSS request.
|
|
24
|
+
|
|
25
|
+
## [0.51.0] — 2026-07-17
|
|
26
|
+
|
|
27
|
+
### Added — customer-configurable agent display names (#951)
|
|
28
|
+
|
|
29
|
+
- `martha agents create --display-name <name>` sets the customer-facing chat
|
|
30
|
+
identity without changing the stable technical agent key.
|
|
31
|
+
- Agent YAML/JSON create and update files round-trip `display_name`; list and
|
|
32
|
+
detail output now show both the display name and technical key.
|
|
33
|
+
|
|
7
34
|
## [0.49.0] — 2026-07-15
|
|
8
35
|
|
|
9
36
|
### Added — UMS-gated second-party approval governance (#583 G1+G2)
|
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.
|
|
11122
|
+
var CLI_VERSION = "0.51.2";
|
|
11123
11123
|
|
|
11124
11124
|
// src/commands/sessions.ts
|
|
11125
11125
|
function relativeTime(iso) {
|
|
@@ -11549,12 +11549,19 @@ var agentsConfig = {
|
|
|
11549
11549
|
},
|
|
11550
11550
|
normalizeBody: normalizeAgentBody,
|
|
11551
11551
|
extraCreateOptions: (cmd) => {
|
|
11552
|
-
cmd.option("--name <name>", "
|
|
11552
|
+
cmd.option("--name <name>", "Stable technical agent key").option("--display-name <name>", "Customer-facing name shown in chat").option("--reasoning <mode>", "Where the agent reasons: 'martha' (Martha-hosted, default) or " + "'self-hosted' (your service; reached via webhook)").option("--enable-host-runner", "Enable a host runner + mint a runner key: attach `martha runner` as this " + "agent's host executor (channel tool.* only). Alias: --runner-key").option("--runner-key", "Alias for --enable-host-runner").option("--model <model>", "LLM model (e.g. anthropic/claude-sonnet-4-6)").option("--provider <provider>", "LLM provider (anthropic, openai)").option("--prompt <text>", "System prompt").option("--description <text>", "Agent description").option("--temperature <n>", "Temperature (0-1)").option("--max-tokens <n>", "Max output tokens").option("--tags <tags>", "Capability domains (comma-separated)").option("--local-tools <tools>", "Local tools (comma-separated)").option("--type <type>", "Deprecated: use --reasoning. cloud=Martha-hosted, external=self-hosted").option("--auth <method>", "Deprecated: use --enable-host-runner. service-account (self-hosted only) or api-key");
|
|
11553
11553
|
},
|
|
11554
11554
|
buildInlineBody: (opts) => {
|
|
11555
11555
|
if (!opts.name)
|
|
11556
11556
|
return null;
|
|
11557
11557
|
const body = { name: opts.name };
|
|
11558
|
+
if (opts.displayName !== undefined) {
|
|
11559
|
+
const displayName = String(opts.displayName).trim();
|
|
11560
|
+
if (!displayName) {
|
|
11561
|
+
throw new CLIError("--display-name must contain visible text", 4 /* Validation */);
|
|
11562
|
+
}
|
|
11563
|
+
body.display_name = displayName;
|
|
11564
|
+
}
|
|
11558
11565
|
if (opts.description)
|
|
11559
11566
|
body.description = opts.description;
|
|
11560
11567
|
if (opts.prompt)
|
|
@@ -11607,6 +11614,10 @@ var agentsConfig = {
|
|
|
11607
11614
|
},
|
|
11608
11615
|
listColumns: [
|
|
11609
11616
|
{ header: "NAME", accessor: (item) => String(item.name ?? "") },
|
|
11617
|
+
{
|
|
11618
|
+
header: "DISPLAY NAME",
|
|
11619
|
+
accessor: (item) => String(item.display_name ?? "-")
|
|
11620
|
+
},
|
|
11610
11621
|
{
|
|
11611
11622
|
header: "MODEL",
|
|
11612
11623
|
accessor: (item) => {
|
|
@@ -11621,8 +11632,11 @@ var agentsConfig = {
|
|
|
11621
11632
|
{ header: "VER", accessor: (item) => String(item.version ?? 1) }
|
|
11622
11633
|
],
|
|
11623
11634
|
renderDetail: (agent) => {
|
|
11624
|
-
console.log(source_default.bold(`Agent: ${agent.name}
|
|
11635
|
+
console.log(source_default.bold(`Agent: ${agent.display_name ?? agent.name}
|
|
11625
11636
|
`));
|
|
11637
|
+
console.log(` Technical key: ${agent.name}`);
|
|
11638
|
+
if (agent.display_name)
|
|
11639
|
+
console.log(` Display name: ${agent.display_name}`);
|
|
11626
11640
|
if (agent.description)
|
|
11627
11641
|
console.log(` ${agent.description}
|
|
11628
11642
|
`);
|
|
@@ -13064,11 +13078,12 @@ function parseJobToolRequests(data, toolName) {
|
|
|
13064
13078
|
}
|
|
13065
13079
|
|
|
13066
13080
|
// src/lib/local-tool-runner.ts
|
|
13067
|
-
|
|
13081
|
+
function selectedClientOptions(clientId) {
|
|
13082
|
+
return clientId ? { params: { selected_client: clientId } } : undefined;
|
|
13083
|
+
}
|
|
13084
|
+
async function uploadImageArtifact(ctx, sessionId, png, clientId) {
|
|
13068
13085
|
try {
|
|
13069
|
-
const mint = await ctx.api.post(`/api/chat/${encodeURIComponent(sessionId)}/local-artifact-upload`, {
|
|
13070
|
-
content_type: "image/png"
|
|
13071
|
-
});
|
|
13086
|
+
const mint = await ctx.api.post(`/api/chat/${encodeURIComponent(sessionId)}/local-artifact-upload`, { content_type: "image/png" }, selectedClientOptions(clientId));
|
|
13072
13087
|
const put = await fetch(mint.upload_url, {
|
|
13073
13088
|
method: "PUT",
|
|
13074
13089
|
headers: { "Content-Type": "image/png" },
|
|
@@ -13184,7 +13199,7 @@ async function resolveHostScreenshot(ctx, sessionId, req, state) {
|
|
|
13184
13199
|
} catch (e) {
|
|
13185
13200
|
return { error: true, message: `screenshot failed: ${String(e)}` };
|
|
13186
13201
|
}
|
|
13187
|
-
const uploaded = await uploadImageArtifact(ctx, sessionId, png);
|
|
13202
|
+
const uploaded = await uploadImageArtifact(ctx, sessionId, png, state.clientId);
|
|
13188
13203
|
if ("error" in uploaded)
|
|
13189
13204
|
return { error: true, message: uploaded.error };
|
|
13190
13205
|
return {
|
|
@@ -13211,7 +13226,7 @@ async function resolveHostBrowser(ctx, sessionId, req, state) {
|
|
|
13211
13226
|
if ("error" in result)
|
|
13212
13227
|
return { error: true, message: result.message };
|
|
13213
13228
|
if ("png" in result) {
|
|
13214
|
-
const uploaded = await uploadImageArtifact(ctx, sessionId, result.png);
|
|
13229
|
+
const uploaded = await uploadImageArtifact(ctx, sessionId, result.png, state.clientId);
|
|
13215
13230
|
if ("error" in uploaded)
|
|
13216
13231
|
return { error: true, message: uploaded.error };
|
|
13217
13232
|
return {
|
|
@@ -13438,27 +13453,29 @@ function createLocalExecState(opts) {
|
|
|
13438
13453
|
cwd: opts.cwd,
|
|
13439
13454
|
autoYes: opts.autoYes,
|
|
13440
13455
|
localAgent: opts.localAgent,
|
|
13456
|
+
clientId: opts.clientId,
|
|
13441
13457
|
handled: new Set,
|
|
13442
13458
|
journal: new Journal(opts.cwd),
|
|
13443
13459
|
secrets: new Map,
|
|
13444
13460
|
claimed: new Set
|
|
13445
13461
|
};
|
|
13446
13462
|
}
|
|
13447
|
-
function makeChatTransport(ctx, sessionId) {
|
|
13463
|
+
function makeChatTransport(ctx, sessionId, clientId) {
|
|
13448
13464
|
const base = `/api/chat/${encodeURIComponent(sessionId)}`;
|
|
13465
|
+
const requestOptions = selectedClientOptions(clientId);
|
|
13449
13466
|
return {
|
|
13450
13467
|
async claim(toolCallId, secretHash) {
|
|
13451
13468
|
await ctx.api.post(`${base}/tool-claim`, {
|
|
13452
13469
|
tool_call_id: toolCallId,
|
|
13453
13470
|
secret_hash: secretHash
|
|
13454
|
-
});
|
|
13471
|
+
}, requestOptions);
|
|
13455
13472
|
},
|
|
13456
13473
|
async postResult(toolCallId, result, execSecret) {
|
|
13457
13474
|
await ctx.api.post(`${base}/tool-result`, {
|
|
13458
13475
|
tool_call_id: toolCallId,
|
|
13459
13476
|
result,
|
|
13460
13477
|
...execSecret !== undefined ? { exec_secret: execSecret } : {}
|
|
13461
|
-
});
|
|
13478
|
+
}, requestOptions);
|
|
13462
13479
|
}
|
|
13463
13480
|
};
|
|
13464
13481
|
}
|
|
@@ -13559,7 +13576,8 @@ async function sendMessage(ctx, sessionId, message, opts = {}) {
|
|
|
13559
13576
|
const localExecState = opts.localExec ? createLocalExecState({
|
|
13560
13577
|
cwd: opts.localExec.cwd,
|
|
13561
13578
|
autoYes: opts.localExec.autoYes,
|
|
13562
|
-
localAgent: opts.localExec.agent
|
|
13579
|
+
localAgent: opts.localExec.agent,
|
|
13580
|
+
clientId: opts.clientId
|
|
13563
13581
|
}) : null;
|
|
13564
13582
|
const reqBody = { content: message };
|
|
13565
13583
|
if (opts.localExec)
|
|
@@ -13613,7 +13631,7 @@ async function sendMessage(ctx, sessionId, message, opts = {}) {
|
|
|
13613
13631
|
if (opts.onToolStatus)
|
|
13614
13632
|
opts.onToolStatus(event.data);
|
|
13615
13633
|
if (localExecState) {
|
|
13616
|
-
await handleToolStatusData(ctx, sessionId, event.data, localExecState, makeChatTransport(ctx, sessionId));
|
|
13634
|
+
await handleToolStatusData(ctx, sessionId, event.data, localExecState, makeChatTransport(ctx, sessionId, opts.clientId));
|
|
13617
13635
|
}
|
|
13618
13636
|
break;
|
|
13619
13637
|
case "clear":
|
|
@@ -18877,6 +18895,7 @@ init_errors();
|
|
|
18877
18895
|
|
|
18878
18896
|
// src/lib/embed.ts
|
|
18879
18897
|
init_errors();
|
|
18898
|
+
var HOSTED_EMBED_CACHE_KEY = "0.3.0";
|
|
18880
18899
|
var EMBED_FEATURE_KEYS = [
|
|
18881
18900
|
"uploads",
|
|
18882
18901
|
"history",
|
|
@@ -18943,12 +18962,13 @@ function getEmbedAssetBaseUrl(apiUrl, override) {
|
|
|
18943
18962
|
}
|
|
18944
18963
|
function bundleUrls(assetBaseUrl) {
|
|
18945
18964
|
const base = normalizeAssetBaseUrl(assetBaseUrl);
|
|
18965
|
+
const asset = (filename) => `${base}${filename}?v=${HOSTED_EMBED_CACHE_KEY}`;
|
|
18946
18966
|
return {
|
|
18947
|
-
webComponent:
|
|
18948
|
-
esm:
|
|
18949
|
-
react:
|
|
18950
|
-
svelte:
|
|
18951
|
-
css:
|
|
18967
|
+
webComponent: asset("martha-chat.ce.js"),
|
|
18968
|
+
esm: asset("martha-chat.es.js"),
|
|
18969
|
+
react: asset("martha-chat.react.js"),
|
|
18970
|
+
svelte: asset("martha-chat.svelte.js"),
|
|
18971
|
+
css: asset("martha-chat.css")
|
|
18952
18972
|
};
|
|
18953
18973
|
}
|
|
18954
18974
|
function normalizeOrigin(input) {
|
|
@@ -19130,7 +19150,8 @@ function renderHtmlSnippet(options) {
|
|
|
19130
19150
|
const urls = bundleUrls(options.assetBaseUrl);
|
|
19131
19151
|
const attrs = [
|
|
19132
19152
|
`api-url=${jsString(options.apiUrl)}`,
|
|
19133
|
-
`client-key=${jsString(options.clientKey)}
|
|
19153
|
+
`client-key=${jsString(options.clientKey)}`,
|
|
19154
|
+
`stylesheet-url=${jsString(urls.css)}`
|
|
19134
19155
|
];
|
|
19135
19156
|
if (options.mode === "launcher")
|
|
19136
19157
|
attrs.push("launcher");
|