@hasna/conversations 0.1.23 → 0.1.25
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/bin/index.js +90 -19
- package/bin/mcp.js +84 -17
- package/dist/lib/identity.d.ts +4 -0
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -3282,6 +3282,14 @@ function resolveIdentity(explicit) {
|
|
|
3282
3282
|
return envValue;
|
|
3283
3283
|
return getAutoName();
|
|
3284
3284
|
}
|
|
3285
|
+
function updateCachedAutoName(newName) {
|
|
3286
|
+
cachedAutoName = newName;
|
|
3287
|
+
try {
|
|
3288
|
+
mkdirSync3(dirname2(AGENT_ID_FILE), { recursive: true });
|
|
3289
|
+
writeFileSync(AGENT_ID_FILE, newName + `
|
|
3290
|
+
`, "utf-8");
|
|
3291
|
+
} catch {}
|
|
3292
|
+
}
|
|
3285
3293
|
var AGENT_ID_FILE, cachedAutoName = null;
|
|
3286
3294
|
var init_identity = __esm(() => {
|
|
3287
3295
|
init_names();
|
|
@@ -3509,7 +3517,7 @@ var init_poll = __esm(() => {
|
|
|
3509
3517
|
var require_package = __commonJS((exports, module) => {
|
|
3510
3518
|
module.exports = {
|
|
3511
3519
|
name: "@hasna/conversations",
|
|
3512
|
-
version: "0.1.
|
|
3520
|
+
version: "0.1.25",
|
|
3513
3521
|
description: "Real-time CLI messaging for AI agents",
|
|
3514
3522
|
type: "module",
|
|
3515
3523
|
bin: {
|
|
@@ -31141,6 +31149,62 @@ class ExperimentalServerTasks {
|
|
|
31141
31149
|
requestStream(request, resultSchema, options) {
|
|
31142
31150
|
return this._server.requestStream(request, resultSchema, options);
|
|
31143
31151
|
}
|
|
31152
|
+
createMessageStream(params, options) {
|
|
31153
|
+
const clientCapabilities = this._server.getClientCapabilities();
|
|
31154
|
+
if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
|
|
31155
|
+
throw new Error("Client does not support sampling tools capability.");
|
|
31156
|
+
}
|
|
31157
|
+
if (params.messages.length > 0) {
|
|
31158
|
+
const lastMessage = params.messages[params.messages.length - 1];
|
|
31159
|
+
const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
|
|
31160
|
+
const hasToolResults = lastContent.some((c) => c.type === "tool_result");
|
|
31161
|
+
const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
|
|
31162
|
+
const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
|
|
31163
|
+
const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
|
|
31164
|
+
if (hasToolResults) {
|
|
31165
|
+
if (lastContent.some((c) => c.type !== "tool_result")) {
|
|
31166
|
+
throw new Error("The last message must contain only tool_result content if any is present");
|
|
31167
|
+
}
|
|
31168
|
+
if (!hasPreviousToolUse) {
|
|
31169
|
+
throw new Error("tool_result blocks are not matching any tool_use from the previous message");
|
|
31170
|
+
}
|
|
31171
|
+
}
|
|
31172
|
+
if (hasPreviousToolUse) {
|
|
31173
|
+
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
31174
|
+
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
31175
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) {
|
|
31176
|
+
throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
31177
|
+
}
|
|
31178
|
+
}
|
|
31179
|
+
}
|
|
31180
|
+
return this.requestStream({
|
|
31181
|
+
method: "sampling/createMessage",
|
|
31182
|
+
params
|
|
31183
|
+
}, CreateMessageResultSchema, options);
|
|
31184
|
+
}
|
|
31185
|
+
elicitInputStream(params, options) {
|
|
31186
|
+
const clientCapabilities = this._server.getClientCapabilities();
|
|
31187
|
+
const mode = params.mode ?? "form";
|
|
31188
|
+
switch (mode) {
|
|
31189
|
+
case "url": {
|
|
31190
|
+
if (!clientCapabilities?.elicitation?.url) {
|
|
31191
|
+
throw new Error("Client does not support url elicitation.");
|
|
31192
|
+
}
|
|
31193
|
+
break;
|
|
31194
|
+
}
|
|
31195
|
+
case "form": {
|
|
31196
|
+
if (!clientCapabilities?.elicitation?.form) {
|
|
31197
|
+
throw new Error("Client does not support form elicitation.");
|
|
31198
|
+
}
|
|
31199
|
+
break;
|
|
31200
|
+
}
|
|
31201
|
+
}
|
|
31202
|
+
const normalizedParams = mode === "form" && params.mode === undefined ? { ...params, mode: "form" } : params;
|
|
31203
|
+
return this.requestStream({
|
|
31204
|
+
method: "elicitation/create",
|
|
31205
|
+
params: normalizedParams
|
|
31206
|
+
}, ElicitResultSchema, options);
|
|
31207
|
+
}
|
|
31144
31208
|
async getTask(taskId, options) {
|
|
31145
31209
|
return this._server.getTask({ taskId }, options);
|
|
31146
31210
|
}
|
|
@@ -31154,6 +31218,9 @@ class ExperimentalServerTasks {
|
|
|
31154
31218
|
return this._server.cancelTask({ taskId }, options);
|
|
31155
31219
|
}
|
|
31156
31220
|
}
|
|
31221
|
+
var init_server = __esm(() => {
|
|
31222
|
+
init_types2();
|
|
31223
|
+
});
|
|
31157
31224
|
|
|
31158
31225
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
31159
31226
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
@@ -31192,11 +31259,12 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
31192
31259
|
|
|
31193
31260
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
31194
31261
|
var Server;
|
|
31195
|
-
var
|
|
31262
|
+
var init_server2 = __esm(() => {
|
|
31196
31263
|
init_protocol();
|
|
31197
31264
|
init_types2();
|
|
31198
31265
|
init_ajv_provider();
|
|
31199
31266
|
init_zod_compat();
|
|
31267
|
+
init_server();
|
|
31200
31268
|
Server = class Server extends Protocol {
|
|
31201
31269
|
constructor(_serverInfo, options) {
|
|
31202
31270
|
super(options);
|
|
@@ -32338,7 +32406,7 @@ function createCompletionResult(suggestions) {
|
|
|
32338
32406
|
}
|
|
32339
32407
|
var EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT;
|
|
32340
32408
|
var init_mcp = __esm(() => {
|
|
32341
|
-
|
|
32409
|
+
init_server2();
|
|
32342
32410
|
init_zod_compat();
|
|
32343
32411
|
init_zod_json_schema_compat();
|
|
32344
32412
|
init_types2();
|
|
@@ -32486,7 +32554,7 @@ var init_mcp2 = __esm(() => {
|
|
|
32486
32554
|
content: exports_external.string(),
|
|
32487
32555
|
from: exports_external.string().optional(),
|
|
32488
32556
|
priority: exports_external.string().optional(),
|
|
32489
|
-
blocking: exports_external.boolean().optional()
|
|
32557
|
+
blocking: exports_external.coerce.boolean().optional()
|
|
32490
32558
|
}
|
|
32491
32559
|
}, async (args) => {
|
|
32492
32560
|
const { from: fromParam, to, content, priority, blocking } = args;
|
|
@@ -32510,8 +32578,8 @@ var init_mcp2 = __esm(() => {
|
|
|
32510
32578
|
to: exports_external.string().optional(),
|
|
32511
32579
|
space: exports_external.string().optional(),
|
|
32512
32580
|
since: exports_external.string().optional(),
|
|
32513
|
-
limit: exports_external.number().optional(),
|
|
32514
|
-
unread_only: exports_external.boolean().optional()
|
|
32581
|
+
limit: exports_external.coerce.number().optional(),
|
|
32582
|
+
unread_only: exports_external.coerce.boolean().optional()
|
|
32515
32583
|
}
|
|
32516
32584
|
}, async (args) => {
|
|
32517
32585
|
const messages = readMessages(args);
|
|
@@ -32534,7 +32602,7 @@ var init_mcp2 = __esm(() => {
|
|
|
32534
32602
|
server.registerTool("reply", {
|
|
32535
32603
|
description: "Reply to a message by ID.",
|
|
32536
32604
|
inputSchema: {
|
|
32537
|
-
message_id: exports_external.number(),
|
|
32605
|
+
message_id: exports_external.coerce.number(),
|
|
32538
32606
|
content: exports_external.string(),
|
|
32539
32607
|
from: exports_external.string().optional()
|
|
32540
32608
|
}
|
|
@@ -32565,8 +32633,8 @@ var init_mcp2 = __esm(() => {
|
|
|
32565
32633
|
description: "Mark messages read by IDs or all.",
|
|
32566
32634
|
inputSchema: {
|
|
32567
32635
|
from: exports_external.string().optional(),
|
|
32568
|
-
ids: exports_external.array(exports_external.number()).optional(),
|
|
32569
|
-
all: exports_external.boolean().optional()
|
|
32636
|
+
ids: exports_external.array(exports_external.coerce.number()).optional(),
|
|
32637
|
+
all: exports_external.coerce.boolean().optional()
|
|
32570
32638
|
}
|
|
32571
32639
|
}, async (args) => {
|
|
32572
32640
|
const { from: fromParam, ids, all } = args;
|
|
@@ -32593,7 +32661,7 @@ var init_mcp2 = __esm(() => {
|
|
|
32593
32661
|
space: exports_external.string().optional(),
|
|
32594
32662
|
from: exports_external.string().optional(),
|
|
32595
32663
|
to: exports_external.string().optional(),
|
|
32596
|
-
limit: exports_external.number().optional()
|
|
32664
|
+
limit: exports_external.coerce.number().optional()
|
|
32597
32665
|
}
|
|
32598
32666
|
}, async (args) => {
|
|
32599
32667
|
const { query, space, from, to, limit } = args;
|
|
@@ -32654,7 +32722,7 @@ var init_mcp2 = __esm(() => {
|
|
|
32654
32722
|
inputSchema: {
|
|
32655
32723
|
project_id: exports_external.string().optional(),
|
|
32656
32724
|
parent_id: exports_external.string().optional(),
|
|
32657
|
-
include_archived: exports_external.boolean().optional()
|
|
32725
|
+
include_archived: exports_external.coerce.boolean().optional()
|
|
32658
32726
|
}
|
|
32659
32727
|
}, async (args) => {
|
|
32660
32728
|
const { project_id, parent_id, include_archived } = args;
|
|
@@ -32680,7 +32748,7 @@ var init_mcp2 = __esm(() => {
|
|
|
32680
32748
|
content: exports_external.string(),
|
|
32681
32749
|
from: exports_external.string().optional(),
|
|
32682
32750
|
priority: exports_external.string().optional(),
|
|
32683
|
-
blocking: exports_external.boolean().optional()
|
|
32751
|
+
blocking: exports_external.coerce.boolean().optional()
|
|
32684
32752
|
}
|
|
32685
32753
|
}, async (args) => {
|
|
32686
32754
|
const { from: fromParam, space, content, priority, blocking } = args;
|
|
@@ -32710,7 +32778,7 @@ var init_mcp2 = __esm(() => {
|
|
|
32710
32778
|
inputSchema: {
|
|
32711
32779
|
space: exports_external.string(),
|
|
32712
32780
|
since: exports_external.string().optional(),
|
|
32713
|
-
limit: exports_external.number().optional()
|
|
32781
|
+
limit: exports_external.coerce.number().optional()
|
|
32714
32782
|
}
|
|
32715
32783
|
}, async (args) => {
|
|
32716
32784
|
const { space, since, limit } = args;
|
|
@@ -33020,7 +33088,7 @@ var init_mcp2 = __esm(() => {
|
|
|
33020
33088
|
server.registerTool("delete_message", {
|
|
33021
33089
|
description: "Delete a message (sender only).",
|
|
33022
33090
|
inputSchema: {
|
|
33023
|
-
id: exports_external.number(),
|
|
33091
|
+
id: exports_external.coerce.number(),
|
|
33024
33092
|
from: exports_external.string().optional()
|
|
33025
33093
|
}
|
|
33026
33094
|
}, async (args) => {
|
|
@@ -33040,7 +33108,7 @@ var init_mcp2 = __esm(() => {
|
|
|
33040
33108
|
server.registerTool("edit_message", {
|
|
33041
33109
|
description: "Edit message content (sender only).",
|
|
33042
33110
|
inputSchema: {
|
|
33043
|
-
id: exports_external.number(),
|
|
33111
|
+
id: exports_external.coerce.number(),
|
|
33044
33112
|
content: exports_external.string(),
|
|
33045
33113
|
from: exports_external.string().optional()
|
|
33046
33114
|
}
|
|
@@ -33061,7 +33129,7 @@ var init_mcp2 = __esm(() => {
|
|
|
33061
33129
|
server.registerTool("pin_message", {
|
|
33062
33130
|
description: "Pin a message.",
|
|
33063
33131
|
inputSchema: {
|
|
33064
|
-
id: exports_external.number()
|
|
33132
|
+
id: exports_external.coerce.number()
|
|
33065
33133
|
}
|
|
33066
33134
|
}, async ({ id }) => {
|
|
33067
33135
|
const msg = pinMessage(id);
|
|
@@ -33078,7 +33146,7 @@ var init_mcp2 = __esm(() => {
|
|
|
33078
33146
|
server.registerTool("unpin_message", {
|
|
33079
33147
|
description: "Unpin a message.",
|
|
33080
33148
|
inputSchema: {
|
|
33081
|
-
id: exports_external.number()
|
|
33149
|
+
id: exports_external.coerce.number()
|
|
33082
33150
|
}
|
|
33083
33151
|
}, async ({ id }) => {
|
|
33084
33152
|
const msg = unpinMessage(id);
|
|
@@ -33097,7 +33165,7 @@ var init_mcp2 = __esm(() => {
|
|
|
33097
33165
|
inputSchema: {
|
|
33098
33166
|
space: exports_external.string().optional(),
|
|
33099
33167
|
session_id: exports_external.string().optional(),
|
|
33100
|
-
limit: exports_external.number().optional()
|
|
33168
|
+
limit: exports_external.coerce.number().optional()
|
|
33101
33169
|
}
|
|
33102
33170
|
}, async (args) => {
|
|
33103
33171
|
const { space, session_id, limit } = args;
|
|
@@ -33123,7 +33191,7 @@ var init_mcp2 = __esm(() => {
|
|
|
33123
33191
|
server.registerTool("list_agents", {
|
|
33124
33192
|
description: "List agents with presence status.",
|
|
33125
33193
|
inputSchema: {
|
|
33126
|
-
online_only: exports_external.boolean().optional()
|
|
33194
|
+
online_only: exports_external.coerce.boolean().optional()
|
|
33127
33195
|
}
|
|
33128
33196
|
}, async (args) => {
|
|
33129
33197
|
const { online_only } = args;
|
|
@@ -33190,6 +33258,9 @@ var init_mcp2 = __esm(() => {
|
|
|
33190
33258
|
isError: true
|
|
33191
33259
|
};
|
|
33192
33260
|
}
|
|
33261
|
+
if (!fromParam) {
|
|
33262
|
+
updateCachedAutoName(newName);
|
|
33263
|
+
}
|
|
33193
33264
|
return {
|
|
33194
33265
|
content: [{ type: "text", text: JSON.stringify({ old_name: oldName, new_name: newName, renamed: true }) }]
|
|
33195
33266
|
};
|
package/bin/mcp.js
CHANGED
|
@@ -27263,6 +27263,62 @@ class ExperimentalServerTasks {
|
|
|
27263
27263
|
requestStream(request, resultSchema, options) {
|
|
27264
27264
|
return this._server.requestStream(request, resultSchema, options);
|
|
27265
27265
|
}
|
|
27266
|
+
createMessageStream(params, options) {
|
|
27267
|
+
const clientCapabilities = this._server.getClientCapabilities();
|
|
27268
|
+
if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
|
|
27269
|
+
throw new Error("Client does not support sampling tools capability.");
|
|
27270
|
+
}
|
|
27271
|
+
if (params.messages.length > 0) {
|
|
27272
|
+
const lastMessage = params.messages[params.messages.length - 1];
|
|
27273
|
+
const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
|
|
27274
|
+
const hasToolResults = lastContent.some((c) => c.type === "tool_result");
|
|
27275
|
+
const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
|
|
27276
|
+
const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
|
|
27277
|
+
const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
|
|
27278
|
+
if (hasToolResults) {
|
|
27279
|
+
if (lastContent.some((c) => c.type !== "tool_result")) {
|
|
27280
|
+
throw new Error("The last message must contain only tool_result content if any is present");
|
|
27281
|
+
}
|
|
27282
|
+
if (!hasPreviousToolUse) {
|
|
27283
|
+
throw new Error("tool_result blocks are not matching any tool_use from the previous message");
|
|
27284
|
+
}
|
|
27285
|
+
}
|
|
27286
|
+
if (hasPreviousToolUse) {
|
|
27287
|
+
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
27288
|
+
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
27289
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) {
|
|
27290
|
+
throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
27291
|
+
}
|
|
27292
|
+
}
|
|
27293
|
+
}
|
|
27294
|
+
return this.requestStream({
|
|
27295
|
+
method: "sampling/createMessage",
|
|
27296
|
+
params
|
|
27297
|
+
}, CreateMessageResultSchema, options);
|
|
27298
|
+
}
|
|
27299
|
+
elicitInputStream(params, options) {
|
|
27300
|
+
const clientCapabilities = this._server.getClientCapabilities();
|
|
27301
|
+
const mode = params.mode ?? "form";
|
|
27302
|
+
switch (mode) {
|
|
27303
|
+
case "url": {
|
|
27304
|
+
if (!clientCapabilities?.elicitation?.url) {
|
|
27305
|
+
throw new Error("Client does not support url elicitation.");
|
|
27306
|
+
}
|
|
27307
|
+
break;
|
|
27308
|
+
}
|
|
27309
|
+
case "form": {
|
|
27310
|
+
if (!clientCapabilities?.elicitation?.form) {
|
|
27311
|
+
throw new Error("Client does not support form elicitation.");
|
|
27312
|
+
}
|
|
27313
|
+
break;
|
|
27314
|
+
}
|
|
27315
|
+
}
|
|
27316
|
+
const normalizedParams = mode === "form" && params.mode === undefined ? { ...params, mode: "form" } : params;
|
|
27317
|
+
return this.requestStream({
|
|
27318
|
+
method: "elicitation/create",
|
|
27319
|
+
params: normalizedParams
|
|
27320
|
+
}, ElicitResultSchema, options);
|
|
27321
|
+
}
|
|
27266
27322
|
async getTask(taskId, options) {
|
|
27267
27323
|
return this._server.getTask({ taskId }, options);
|
|
27268
27324
|
}
|
|
@@ -29710,6 +29766,14 @@ function resolveIdentity(explicit) {
|
|
|
29710
29766
|
return envValue;
|
|
29711
29767
|
return getAutoName();
|
|
29712
29768
|
}
|
|
29769
|
+
function updateCachedAutoName(newName) {
|
|
29770
|
+
cachedAutoName = newName;
|
|
29771
|
+
try {
|
|
29772
|
+
mkdirSync3(dirname2(AGENT_ID_FILE), { recursive: true });
|
|
29773
|
+
writeFileSync(AGENT_ID_FILE, newName + `
|
|
29774
|
+
`, "utf-8");
|
|
29775
|
+
} catch {}
|
|
29776
|
+
}
|
|
29713
29777
|
|
|
29714
29778
|
// src/lib/presence.ts
|
|
29715
29779
|
init_db();
|
|
@@ -29782,7 +29846,7 @@ function renameAgent(oldName, newName) {
|
|
|
29782
29846
|
// package.json
|
|
29783
29847
|
var package_default = {
|
|
29784
29848
|
name: "@hasna/conversations",
|
|
29785
|
-
version: "0.1.
|
|
29849
|
+
version: "0.1.25",
|
|
29786
29850
|
description: "Real-time CLI messaging for AI agents",
|
|
29787
29851
|
type: "module",
|
|
29788
29852
|
bin: {
|
|
@@ -29871,7 +29935,7 @@ server.registerTool("send_message", {
|
|
|
29871
29935
|
content: exports_external.string(),
|
|
29872
29936
|
from: exports_external.string().optional(),
|
|
29873
29937
|
priority: exports_external.string().optional(),
|
|
29874
|
-
blocking: exports_external.boolean().optional()
|
|
29938
|
+
blocking: exports_external.coerce.boolean().optional()
|
|
29875
29939
|
}
|
|
29876
29940
|
}, async (args) => {
|
|
29877
29941
|
const { from: fromParam, to, content, priority, blocking } = args;
|
|
@@ -29895,8 +29959,8 @@ server.registerTool("read_messages", {
|
|
|
29895
29959
|
to: exports_external.string().optional(),
|
|
29896
29960
|
space: exports_external.string().optional(),
|
|
29897
29961
|
since: exports_external.string().optional(),
|
|
29898
|
-
limit: exports_external.number().optional(),
|
|
29899
|
-
unread_only: exports_external.boolean().optional()
|
|
29962
|
+
limit: exports_external.coerce.number().optional(),
|
|
29963
|
+
unread_only: exports_external.coerce.boolean().optional()
|
|
29900
29964
|
}
|
|
29901
29965
|
}, async (args) => {
|
|
29902
29966
|
const messages = readMessages(args);
|
|
@@ -29919,7 +29983,7 @@ server.registerTool("list_sessions", {
|
|
|
29919
29983
|
server.registerTool("reply", {
|
|
29920
29984
|
description: "Reply to a message by ID.",
|
|
29921
29985
|
inputSchema: {
|
|
29922
|
-
message_id: exports_external.number(),
|
|
29986
|
+
message_id: exports_external.coerce.number(),
|
|
29923
29987
|
content: exports_external.string(),
|
|
29924
29988
|
from: exports_external.string().optional()
|
|
29925
29989
|
}
|
|
@@ -29950,8 +30014,8 @@ server.registerTool("mark_read", {
|
|
|
29950
30014
|
description: "Mark messages read by IDs or all.",
|
|
29951
30015
|
inputSchema: {
|
|
29952
30016
|
from: exports_external.string().optional(),
|
|
29953
|
-
ids: exports_external.array(exports_external.number()).optional(),
|
|
29954
|
-
all: exports_external.boolean().optional()
|
|
30017
|
+
ids: exports_external.array(exports_external.coerce.number()).optional(),
|
|
30018
|
+
all: exports_external.coerce.boolean().optional()
|
|
29955
30019
|
}
|
|
29956
30020
|
}, async (args) => {
|
|
29957
30021
|
const { from: fromParam, ids, all } = args;
|
|
@@ -29978,7 +30042,7 @@ server.registerTool("search_messages", {
|
|
|
29978
30042
|
space: exports_external.string().optional(),
|
|
29979
30043
|
from: exports_external.string().optional(),
|
|
29980
30044
|
to: exports_external.string().optional(),
|
|
29981
|
-
limit: exports_external.number().optional()
|
|
30045
|
+
limit: exports_external.coerce.number().optional()
|
|
29982
30046
|
}
|
|
29983
30047
|
}, async (args) => {
|
|
29984
30048
|
const { query, space, from, to, limit } = args;
|
|
@@ -30039,7 +30103,7 @@ server.registerTool("list_spaces", {
|
|
|
30039
30103
|
inputSchema: {
|
|
30040
30104
|
project_id: exports_external.string().optional(),
|
|
30041
30105
|
parent_id: exports_external.string().optional(),
|
|
30042
|
-
include_archived: exports_external.boolean().optional()
|
|
30106
|
+
include_archived: exports_external.coerce.boolean().optional()
|
|
30043
30107
|
}
|
|
30044
30108
|
}, async (args) => {
|
|
30045
30109
|
const { project_id, parent_id, include_archived } = args;
|
|
@@ -30065,7 +30129,7 @@ server.registerTool("send_to_space", {
|
|
|
30065
30129
|
content: exports_external.string(),
|
|
30066
30130
|
from: exports_external.string().optional(),
|
|
30067
30131
|
priority: exports_external.string().optional(),
|
|
30068
|
-
blocking: exports_external.boolean().optional()
|
|
30132
|
+
blocking: exports_external.coerce.boolean().optional()
|
|
30069
30133
|
}
|
|
30070
30134
|
}, async (args) => {
|
|
30071
30135
|
const { from: fromParam, space, content, priority, blocking } = args;
|
|
@@ -30095,7 +30159,7 @@ server.registerTool("read_space", {
|
|
|
30095
30159
|
inputSchema: {
|
|
30096
30160
|
space: exports_external.string(),
|
|
30097
30161
|
since: exports_external.string().optional(),
|
|
30098
|
-
limit: exports_external.number().optional()
|
|
30162
|
+
limit: exports_external.coerce.number().optional()
|
|
30099
30163
|
}
|
|
30100
30164
|
}, async (args) => {
|
|
30101
30165
|
const { space, since, limit } = args;
|
|
@@ -30405,7 +30469,7 @@ server.registerTool("delete_project", {
|
|
|
30405
30469
|
server.registerTool("delete_message", {
|
|
30406
30470
|
description: "Delete a message (sender only).",
|
|
30407
30471
|
inputSchema: {
|
|
30408
|
-
id: exports_external.number(),
|
|
30472
|
+
id: exports_external.coerce.number(),
|
|
30409
30473
|
from: exports_external.string().optional()
|
|
30410
30474
|
}
|
|
30411
30475
|
}, async (args) => {
|
|
@@ -30425,7 +30489,7 @@ server.registerTool("delete_message", {
|
|
|
30425
30489
|
server.registerTool("edit_message", {
|
|
30426
30490
|
description: "Edit message content (sender only).",
|
|
30427
30491
|
inputSchema: {
|
|
30428
|
-
id: exports_external.number(),
|
|
30492
|
+
id: exports_external.coerce.number(),
|
|
30429
30493
|
content: exports_external.string(),
|
|
30430
30494
|
from: exports_external.string().optional()
|
|
30431
30495
|
}
|
|
@@ -30446,7 +30510,7 @@ server.registerTool("edit_message", {
|
|
|
30446
30510
|
server.registerTool("pin_message", {
|
|
30447
30511
|
description: "Pin a message.",
|
|
30448
30512
|
inputSchema: {
|
|
30449
|
-
id: exports_external.number()
|
|
30513
|
+
id: exports_external.coerce.number()
|
|
30450
30514
|
}
|
|
30451
30515
|
}, async ({ id }) => {
|
|
30452
30516
|
const msg = pinMessage(id);
|
|
@@ -30463,7 +30527,7 @@ server.registerTool("pin_message", {
|
|
|
30463
30527
|
server.registerTool("unpin_message", {
|
|
30464
30528
|
description: "Unpin a message.",
|
|
30465
30529
|
inputSchema: {
|
|
30466
|
-
id: exports_external.number()
|
|
30530
|
+
id: exports_external.coerce.number()
|
|
30467
30531
|
}
|
|
30468
30532
|
}, async ({ id }) => {
|
|
30469
30533
|
const msg = unpinMessage(id);
|
|
@@ -30482,7 +30546,7 @@ server.registerTool("get_pinned_messages", {
|
|
|
30482
30546
|
inputSchema: {
|
|
30483
30547
|
space: exports_external.string().optional(),
|
|
30484
30548
|
session_id: exports_external.string().optional(),
|
|
30485
|
-
limit: exports_external.number().optional()
|
|
30549
|
+
limit: exports_external.coerce.number().optional()
|
|
30486
30550
|
}
|
|
30487
30551
|
}, async (args) => {
|
|
30488
30552
|
const { space, session_id, limit } = args;
|
|
@@ -30508,7 +30572,7 @@ server.registerTool("heartbeat", {
|
|
|
30508
30572
|
server.registerTool("list_agents", {
|
|
30509
30573
|
description: "List agents with presence status.",
|
|
30510
30574
|
inputSchema: {
|
|
30511
|
-
online_only: exports_external.boolean().optional()
|
|
30575
|
+
online_only: exports_external.coerce.boolean().optional()
|
|
30512
30576
|
}
|
|
30513
30577
|
}, async (args) => {
|
|
30514
30578
|
const { online_only } = args;
|
|
@@ -30575,6 +30639,9 @@ server.registerTool("rename_agent", {
|
|
|
30575
30639
|
isError: true
|
|
30576
30640
|
};
|
|
30577
30641
|
}
|
|
30642
|
+
if (!fromParam) {
|
|
30643
|
+
updateCachedAutoName(newName);
|
|
30644
|
+
}
|
|
30578
30645
|
return {
|
|
30579
30646
|
content: [{ type: "text", text: JSON.stringify({ old_name: oldName, new_name: newName, renamed: true }) }]
|
|
30580
30647
|
};
|
package/dist/lib/identity.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export declare function resolveIdentity(explicit?: string): string;
|
|
|
14
14
|
* Throws if no identity is set via flag or env.
|
|
15
15
|
*/
|
|
16
16
|
export declare function requireIdentity(explicit?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Update the cached auto name after a successful rename.
|
|
19
|
+
*/
|
|
20
|
+
export declare function updateCachedAutoName(newName: string): void;
|
|
17
21
|
/**
|
|
18
22
|
* Reset the cached auto name (for testing).
|
|
19
23
|
*/
|