@clawos-dev/clawd 0.2.245 → 0.2.246
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/dist/cli.cjs
CHANGED
|
@@ -5126,7 +5126,13 @@ var init_schemas = __esm({
|
|
|
5126
5126
|
/** true = 只返回 mirror(originOwnerPrincipalId 非空,即「我在朋友 daemon 上创建」的本机存证)。 */
|
|
5127
5127
|
originOnly: external_exports.boolean().optional(),
|
|
5128
5128
|
/** 按 updatedAt desc(list 的既有排序)截断前 N 条。 */
|
|
5129
|
-
limit: external_exports.number().int().positive().optional()
|
|
5129
|
+
limit: external_exports.number().int().positive().optional(),
|
|
5130
|
+
/**
|
|
5131
|
+
* 分页起点(2026-07-18 android-tasks-tab 迭代追加):originOnly 过滤后、limit 截断前跳过
|
|
5132
|
+
* 前 N 条。与 limit 组合 = updatedAt desc 序上的一页。响应带 total(过滤后总数,见 handler)
|
|
5133
|
+
* 供客户端判 hasMore。老 daemon 不识别时忽略 → 回全量,客户端按全量兼容。
|
|
5134
|
+
*/
|
|
5135
|
+
offset: external_exports.number().int().nonnegative().optional()
|
|
5130
5136
|
});
|
|
5131
5137
|
SessionIdArgs = external_exports.object({ sessionId: external_exports.string().min(1) });
|
|
5132
5138
|
SessionUpdateArgs = external_exports.object({
|
|
@@ -5228,7 +5234,16 @@ var init_schemas = __esm({
|
|
|
5228
5234
|
sessionId: external_exports.string().min(1),
|
|
5229
5235
|
limit: external_exports.number().int().positive().max(5e3).optional(),
|
|
5230
5236
|
/** 不传时走 tail 语义:daemon 返回最后 limit 条(offset = max(0, total - limit)) */
|
|
5231
|
-
offset: external_exports.number().int().nonnegative().optional()
|
|
5237
|
+
offset: external_exports.number().int().nonnegative().optional(),
|
|
5238
|
+
/**
|
|
5239
|
+
* 瘦身投影(2026-07-18 android-tasks-tab 迭代,v2 语义):true = daemon 裁掉窄消费面客户端
|
|
5240
|
+
* (mobile)不渲染的大字段(input / output / raw / toolResultExtra / memories /
|
|
5241
|
+
* sourceToolAssistantUUID),meta 注入行 text 截 500 字符。**例外:出错的工具调用全量保留**——
|
|
5242
|
+
* 本页内 error 非空的 tool_result 保留 output,且其同 toolUseId 的 tool_call 保留 input
|
|
5243
|
+
* (用户要能看清「啥错了」;老板 2026-07-18 拍板:普通工具调用手机不渲染,错误全量展示)。
|
|
5244
|
+
* desktop 渲染 tool card 需全文,不用此参数。老 daemon 不识别 → 回全量,客户端向后兼容。
|
|
5245
|
+
*/
|
|
5246
|
+
slim: external_exports.boolean().optional()
|
|
5232
5247
|
});
|
|
5233
5248
|
HistorySubagentsArgs = external_exports.object({
|
|
5234
5249
|
cwd: external_exports.string().min(1),
|
|
@@ -11595,6 +11610,10 @@ function messageFromJsonl(obj) {
|
|
|
11595
11610
|
ts,
|
|
11596
11611
|
raw: obj
|
|
11597
11612
|
};
|
|
11613
|
+
if (toolResult.is_error === true && typeof toolResult.content === "string") {
|
|
11614
|
+
msg.error = toolResult.content;
|
|
11615
|
+
delete msg.output;
|
|
11616
|
+
}
|
|
11598
11617
|
if (toolResultExtra) msg.toolResultExtra = toolResultExtra;
|
|
11599
11618
|
if (sourceToolAssistantUUID) msg.sourceToolAssistantUUID = sourceToolAssistantUUID;
|
|
11600
11619
|
const answers = extractAskQuestionAnswers(o.toolUseResult);
|
|
@@ -53925,21 +53944,28 @@ function buildSessionHandlers(deps) {
|
|
|
53925
53944
|
const narrow = (sessions) => {
|
|
53926
53945
|
let out = sessions;
|
|
53927
53946
|
if (args.originOnly) out = out.filter((s) => s.originOwnerPrincipalId != null);
|
|
53928
|
-
|
|
53929
|
-
|
|
53947
|
+
const total = out.length;
|
|
53948
|
+
const offset = args.offset ?? 0;
|
|
53949
|
+
if (offset > 0 || args.limit != null) {
|
|
53950
|
+
out = out.slice(offset, args.limit != null ? offset + args.limit : void 0);
|
|
53951
|
+
}
|
|
53952
|
+
return { sessions: out, total };
|
|
53930
53953
|
};
|
|
53931
53954
|
const { response } = manager.list();
|
|
53932
53955
|
if (ctx && ctx.principal.kind === "guest") {
|
|
53933
53956
|
const sessions = response.sessions ?? [];
|
|
53934
53957
|
const guestDeviceId = ctx.principal.id;
|
|
53935
53958
|
const filtered = sessions.filter((s) => canAccessPersona(ctx.grants, s.ownerPersonaId, "read")).filter((s) => s.creatorPrincipalId === guestDeviceId);
|
|
53936
|
-
|
|
53959
|
+
const page2 = narrow(filtered);
|
|
53960
|
+
return { response: { type: "session:list", sessions: page2.sessions, total: page2.total } };
|
|
53937
53961
|
}
|
|
53962
|
+
const page = narrow(response.sessions ?? []);
|
|
53938
53963
|
return {
|
|
53939
53964
|
response: {
|
|
53940
53965
|
type: "session:list",
|
|
53941
53966
|
...response,
|
|
53942
|
-
sessions:
|
|
53967
|
+
sessions: page.sessions,
|
|
53968
|
+
total: page.total
|
|
53943
53969
|
}
|
|
53944
53970
|
};
|
|
53945
53971
|
};
|
|
@@ -54322,6 +54348,32 @@ function isPathInGuestBoundary(personaRoot, personaId, userWorkDir, absPath) {
|
|
|
54322
54348
|
|
|
54323
54349
|
// src/handlers/history.ts
|
|
54324
54350
|
init_protocol();
|
|
54351
|
+
var SLIM_INJECTED_TEXT_MAX = 500;
|
|
54352
|
+
function slimHistoryMessages(messages) {
|
|
54353
|
+
const errorToolUseIds = new Set(
|
|
54354
|
+
messages.filter((m2) => m2.kind === "tool_result" && m2.error !== void 0 && m2.toolUseId !== void 0).map((m2) => m2.toolUseId)
|
|
54355
|
+
);
|
|
54356
|
+
return messages.map((m2) => {
|
|
54357
|
+
const out = { kind: m2.kind };
|
|
54358
|
+
if (m2.text !== void 0) {
|
|
54359
|
+
out.text = m2.meta !== void 0 && m2.text.length > SLIM_INJECTED_TEXT_MAX ? m2.text.slice(0, SLIM_INJECTED_TEXT_MAX) : m2.text;
|
|
54360
|
+
}
|
|
54361
|
+
if (m2.tool !== void 0) out.tool = m2.tool;
|
|
54362
|
+
if (m2.toolUseId !== void 0) out.toolUseId = m2.toolUseId;
|
|
54363
|
+
if (m2.uuid !== void 0) out.uuid = m2.uuid;
|
|
54364
|
+
if (m2.ts !== void 0) out.ts = m2.ts;
|
|
54365
|
+
if (m2.meta !== void 0) out.meta = m2.meta;
|
|
54366
|
+
if (m2.error !== void 0) out.error = m2.error;
|
|
54367
|
+
if (m2.taskId !== void 0) out.taskId = m2.taskId;
|
|
54368
|
+
if (m2.parentToolUseId !== void 0) out.parentToolUseId = m2.parentToolUseId;
|
|
54369
|
+
if (m2.isSidechain !== void 0) out.isSidechain = m2.isSidechain;
|
|
54370
|
+
if (m2.askQuestionAnswers !== void 0) out.askQuestionAnswers = m2.askQuestionAnswers;
|
|
54371
|
+
const isErrorPair = m2.toolUseId !== void 0 && errorToolUseIds.has(m2.toolUseId);
|
|
54372
|
+
if (m2.kind === "tool_call" && isErrorPair && m2.input !== void 0) out.input = m2.input;
|
|
54373
|
+
if (m2.kind === "tool_result" && m2.error !== void 0 && m2.output !== void 0) out.output = m2.output;
|
|
54374
|
+
return out;
|
|
54375
|
+
});
|
|
54376
|
+
}
|
|
54325
54377
|
function assertGuestPath(ctx, absPath, personaRoot, method, usersRoot) {
|
|
54326
54378
|
if (!ctx || ctx.principal.kind !== "guest" || !personaRoot) return;
|
|
54327
54379
|
const userWorkDir = usersRoot ? deriveUserWorkDir(ctx.principal.id, usersRoot) : void 0;
|
|
@@ -54383,7 +54435,8 @@ function buildHistoryHandlers(deps) {
|
|
|
54383
54435
|
limit: args.limit,
|
|
54384
54436
|
offset: args.offset
|
|
54385
54437
|
});
|
|
54386
|
-
|
|
54438
|
+
const messages = args.slim ? slimHistoryMessages(res.messages) : res.messages;
|
|
54439
|
+
return { response: { type: "history:read", ...res, messages } };
|
|
54387
54440
|
};
|
|
54388
54441
|
const subagents = async (frame, _client, ctx) => {
|
|
54389
54442
|
const args = HistorySubagentsArgs.parse(frame);
|
|
@@ -40178,7 +40178,13 @@ var SessionListArgs = external_exports.object({
|
|
|
40178
40178
|
/** true = 只返回 mirror(originOwnerPrincipalId 非空,即「我在朋友 daemon 上创建」的本机存证)。 */
|
|
40179
40179
|
originOnly: external_exports.boolean().optional(),
|
|
40180
40180
|
/** 按 updatedAt desc(list 的既有排序)截断前 N 条。 */
|
|
40181
|
-
limit: external_exports.number().int().positive().optional()
|
|
40181
|
+
limit: external_exports.number().int().positive().optional(),
|
|
40182
|
+
/**
|
|
40183
|
+
* 分页起点(2026-07-18 android-tasks-tab 迭代追加):originOnly 过滤后、limit 截断前跳过
|
|
40184
|
+
* 前 N 条。与 limit 组合 = updatedAt desc 序上的一页。响应带 total(过滤后总数,见 handler)
|
|
40185
|
+
* 供客户端判 hasMore。老 daemon 不识别时忽略 → 回全量,客户端按全量兼容。
|
|
40186
|
+
*/
|
|
40187
|
+
offset: external_exports.number().int().nonnegative().optional()
|
|
40182
40188
|
});
|
|
40183
40189
|
var SessionIdArgs = external_exports.object({ sessionId: external_exports.string().min(1) });
|
|
40184
40190
|
var SessionUpdateArgs = external_exports.object({
|
|
@@ -40279,7 +40285,16 @@ var HistoryReadArgs = external_exports.object({
|
|
|
40279
40285
|
sessionId: external_exports.string().min(1),
|
|
40280
40286
|
limit: external_exports.number().int().positive().max(5e3).optional(),
|
|
40281
40287
|
/** 不传时走 tail 语义:daemon 返回最后 limit 条(offset = max(0, total - limit)) */
|
|
40282
|
-
offset: external_exports.number().int().nonnegative().optional()
|
|
40288
|
+
offset: external_exports.number().int().nonnegative().optional(),
|
|
40289
|
+
/**
|
|
40290
|
+
* 瘦身投影(2026-07-18 android-tasks-tab 迭代,v2 语义):true = daemon 裁掉窄消费面客户端
|
|
40291
|
+
* (mobile)不渲染的大字段(input / output / raw / toolResultExtra / memories /
|
|
40292
|
+
* sourceToolAssistantUUID),meta 注入行 text 截 500 字符。**例外:出错的工具调用全量保留**——
|
|
40293
|
+
* 本页内 error 非空的 tool_result 保留 output,且其同 toolUseId 的 tool_call 保留 input
|
|
40294
|
+
* (用户要能看清「啥错了」;老板 2026-07-18 拍板:普通工具调用手机不渲染,错误全量展示)。
|
|
40295
|
+
* desktop 渲染 tool card 需全文,不用此参数。老 daemon 不识别 → 回全量,客户端向后兼容。
|
|
40296
|
+
*/
|
|
40297
|
+
slim: external_exports.boolean().optional()
|
|
40283
40298
|
});
|
|
40284
40299
|
var HistorySubagentsArgs = external_exports.object({
|
|
40285
40300
|
cwd: external_exports.string().min(1),
|