@clawos-dev/clawd 0.2.683 → 0.2.684
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/app-builder-plugin/mcp-server.cjs +10 -23
- package/dist/cli.cjs +36 -29
- package/dist/cloud-persona-conversations.html +74 -74
- package/dist/cloud-persona-metrics.html +1 -1
- package/dist/dispatch/mcp-server.cjs +10 -23
- package/dist/persona-defaults/persona-app-builder/mcp/clawd-app-builder/mcp-server.cjs +10 -23
- package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/mcp-server.cjs +10 -23
- package/dist/share-md-viewer-error.html +1 -1
- package/dist/share-md-viewer.html +1 -1
- package/dist/share-ui/assets/guest-4rwUzpVX.css +32 -0
- package/dist/share-ui/assets/{guest-Bw6pMIz_.js → guest-CA0VRyHp.js} +148 -153
- package/dist/share-ui/guest.html +2 -2
- package/package.json +1 -1
- package/dist/share-ui/assets/guest-Cd_FvZem.css +0 -32
|
@@ -31064,12 +31064,6 @@ var WorkspaceRepoSchema = external_exports.object({
|
|
|
31064
31064
|
private: external_exports.boolean(),
|
|
31065
31065
|
description: external_exports.string().nullable()
|
|
31066
31066
|
});
|
|
31067
|
-
var WorkspacePrSchema = external_exports.object({
|
|
31068
|
-
number: external_exports.number().int().positive(),
|
|
31069
|
-
url: external_exports.string().url().refine((u) => new URL(u).origin === "https://github.com"),
|
|
31070
|
-
base: external_exports.string(),
|
|
31071
|
-
head: external_exports.string()
|
|
31072
|
-
});
|
|
31073
31067
|
var WorkspaceStatusSchema = WorkspaceBindingSchema.extend({
|
|
31074
31068
|
initialCommit: external_exports.string(),
|
|
31075
31069
|
head: external_exports.string(),
|
|
@@ -31094,10 +31088,7 @@ var WorkspaceStatusSchema = WorkspaceBindingSchema.extend({
|
|
|
31094
31088
|
dirty: external_exports.boolean(),
|
|
31095
31089
|
conflicted: external_exports.boolean(),
|
|
31096
31090
|
version: external_exports.string(),
|
|
31097
|
-
measuredAt: external_exports.number()
|
|
31098
|
-
pendingPublication: external_exports.object({ operationId: Id, expectedVersion: external_exports.string(), stage: external_exports.string() }).optional(),
|
|
31099
|
-
pr: WorkspacePrSchema.nullable().optional(),
|
|
31100
|
-
savedAt: external_exports.number().nullable().optional()
|
|
31091
|
+
measuredAt: external_exports.number()
|
|
31101
31092
|
});
|
|
31102
31093
|
var Session = external_exports.object({ sessionId: Id });
|
|
31103
31094
|
var CloudWorkspaceArgsSchema = external_exports.discriminatedUnion("action", [
|
|
@@ -31117,17 +31108,12 @@ var CloudWorkspaceArgsSchema = external_exports.discriminatedUnion("action", [
|
|
|
31117
31108
|
branch: WorkspaceBranchSchema
|
|
31118
31109
|
}).strict(),
|
|
31119
31110
|
Session.extend({ action: external_exports.literal("status") }).strict(),
|
|
31111
|
+
// 只记「待切换分支」意图,不碰网关;branch 缺省 = 清除意图
|
|
31120
31112
|
Session.extend({
|
|
31121
|
-
action: external_exports.literal("
|
|
31122
|
-
branch: WorkspaceBranchSchema
|
|
31123
|
-
create: external_exports.boolean().optional()
|
|
31113
|
+
action: external_exports.literal("intend"),
|
|
31114
|
+
branch: WorkspaceBranchSchema.optional()
|
|
31124
31115
|
}).strict(),
|
|
31125
|
-
Session.extend({ action: external_exports.literal("diff"), filePath: FilePath }).strict()
|
|
31126
|
-
Session.extend({
|
|
31127
|
-
action: external_exports.literal("publish"),
|
|
31128
|
-
operationId: Id,
|
|
31129
|
-
expectedVersion: external_exports.string().min(1).max(128)
|
|
31130
|
-
}).strict()
|
|
31116
|
+
Session.extend({ action: external_exports.literal("diff"), filePath: FilePath }).strict()
|
|
31131
31117
|
]);
|
|
31132
31118
|
var CloudWorkspaceResultSchema = external_exports.object({
|
|
31133
31119
|
binding: WorkspaceBindingSchema.nullable().optional(),
|
|
@@ -31135,14 +31121,13 @@ var CloudWorkspaceResultSchema = external_exports.object({
|
|
|
31135
31121
|
repositories: external_exports.array(WorkspaceRepoSchema).optional(),
|
|
31136
31122
|
branches: external_exports.array(external_exports.string()).optional(),
|
|
31137
31123
|
hasMore: external_exports.boolean().optional(),
|
|
31138
|
-
cache: external_exports.enum(["warm", "cold"]).optional(),
|
|
31139
31124
|
diff: external_exports.object({
|
|
31140
31125
|
path: FilePath,
|
|
31141
31126
|
patch: external_exports.string(),
|
|
31142
31127
|
binary: external_exports.boolean(),
|
|
31143
|
-
truncated: external_exports.boolean()
|
|
31144
|
-
|
|
31145
|
-
|
|
31128
|
+
truncated: external_exports.boolean(),
|
|
31129
|
+
notStored: external_exports.boolean().optional()
|
|
31130
|
+
}).optional()
|
|
31146
31131
|
});
|
|
31147
31132
|
|
|
31148
31133
|
// ../protocol/src/subscription-channel.ts
|
|
@@ -33094,6 +33079,8 @@ var SessionFileSchema = external_exports.object({
|
|
|
33094
33079
|
cloudWorkspace: WorkspaceBindingSchema.optional(),
|
|
33095
33080
|
/** Accepted local turns whose terminal gateway status has not been observed. */
|
|
33096
33081
|
cloudPendingTurns: external_exports.array(external_exports.object({ id: external_exports.string().min(1), text: external_exports.string(), prepared: external_exports.boolean().optional() })).optional(),
|
|
33082
|
+
/** 用户在前端选的、尚未由 agent 执行的分支;下一条 query 发出时作为上下文注入,被网关接受后清除。 */
|
|
33083
|
+
cloudBranchIntent: WorkspaceBranchSchema.optional(),
|
|
33097
33084
|
/** Owner gateway session observed in ready; proves the remote Pod was opened. */
|
|
33098
33085
|
cloudGatewaySessionId: external_exports.string().min(1).optional(),
|
|
33099
33086
|
/** Persisted before sending so daemon restart can retry the same gateway command ID. */
|
package/dist/cli.cjs
CHANGED
|
@@ -4150,7 +4150,7 @@ var init_zod = __esm({
|
|
|
4150
4150
|
});
|
|
4151
4151
|
|
|
4152
4152
|
// ../protocol/src/cloud-workspace-schemas.ts
|
|
4153
|
-
var WORKSPACE_COMPARISON_VALUES, Id, RepoId, Part, WorkspaceBranchSchema, FilePath, WorkspaceBindingSchema, WorkspaceRepoSchema,
|
|
4153
|
+
var WORKSPACE_COMPARISON_VALUES, Id, RepoId, Part, WorkspaceBranchSchema, FilePath, WorkspaceBindingSchema, WorkspaceRepoSchema, WorkspaceStatusSchema, Session, CloudWorkspaceArgsSchema, CloudWorkspaceResultSchema;
|
|
4154
4154
|
var init_cloud_workspace_schemas = __esm({
|
|
4155
4155
|
"../protocol/src/cloud-workspace-schemas.ts"() {
|
|
4156
4156
|
"use strict";
|
|
@@ -4182,12 +4182,6 @@ var init_cloud_workspace_schemas = __esm({
|
|
|
4182
4182
|
private: external_exports.boolean(),
|
|
4183
4183
|
description: external_exports.string().nullable()
|
|
4184
4184
|
});
|
|
4185
|
-
WorkspacePrSchema = external_exports.object({
|
|
4186
|
-
number: external_exports.number().int().positive(),
|
|
4187
|
-
url: external_exports.string().url().refine((u2) => new URL(u2).origin === "https://github.com"),
|
|
4188
|
-
base: external_exports.string(),
|
|
4189
|
-
head: external_exports.string()
|
|
4190
|
-
});
|
|
4191
4185
|
WorkspaceStatusSchema = WorkspaceBindingSchema.extend({
|
|
4192
4186
|
initialCommit: external_exports.string(),
|
|
4193
4187
|
head: external_exports.string(),
|
|
@@ -4212,10 +4206,7 @@ var init_cloud_workspace_schemas = __esm({
|
|
|
4212
4206
|
dirty: external_exports.boolean(),
|
|
4213
4207
|
conflicted: external_exports.boolean(),
|
|
4214
4208
|
version: external_exports.string(),
|
|
4215
|
-
measuredAt: external_exports.number()
|
|
4216
|
-
pendingPublication: external_exports.object({ operationId: Id, expectedVersion: external_exports.string(), stage: external_exports.string() }).optional(),
|
|
4217
|
-
pr: WorkspacePrSchema.nullable().optional(),
|
|
4218
|
-
savedAt: external_exports.number().nullable().optional()
|
|
4209
|
+
measuredAt: external_exports.number()
|
|
4219
4210
|
});
|
|
4220
4211
|
Session = external_exports.object({ sessionId: Id });
|
|
4221
4212
|
CloudWorkspaceArgsSchema = external_exports.discriminatedUnion("action", [
|
|
@@ -4235,17 +4226,12 @@ var init_cloud_workspace_schemas = __esm({
|
|
|
4235
4226
|
branch: WorkspaceBranchSchema
|
|
4236
4227
|
}).strict(),
|
|
4237
4228
|
Session.extend({ action: external_exports.literal("status") }).strict(),
|
|
4229
|
+
// 只记「待切换分支」意图,不碰网关;branch 缺省 = 清除意图
|
|
4238
4230
|
Session.extend({
|
|
4239
|
-
action: external_exports.literal("
|
|
4240
|
-
branch: WorkspaceBranchSchema
|
|
4241
|
-
create: external_exports.boolean().optional()
|
|
4231
|
+
action: external_exports.literal("intend"),
|
|
4232
|
+
branch: WorkspaceBranchSchema.optional()
|
|
4242
4233
|
}).strict(),
|
|
4243
|
-
Session.extend({ action: external_exports.literal("diff"), filePath: FilePath }).strict()
|
|
4244
|
-
Session.extend({
|
|
4245
|
-
action: external_exports.literal("publish"),
|
|
4246
|
-
operationId: Id,
|
|
4247
|
-
expectedVersion: external_exports.string().min(1).max(128)
|
|
4248
|
-
}).strict()
|
|
4234
|
+
Session.extend({ action: external_exports.literal("diff"), filePath: FilePath }).strict()
|
|
4249
4235
|
]);
|
|
4250
4236
|
CloudWorkspaceResultSchema = external_exports.object({
|
|
4251
4237
|
binding: WorkspaceBindingSchema.nullable().optional(),
|
|
@@ -4253,14 +4239,13 @@ var init_cloud_workspace_schemas = __esm({
|
|
|
4253
4239
|
repositories: external_exports.array(WorkspaceRepoSchema).optional(),
|
|
4254
4240
|
branches: external_exports.array(external_exports.string()).optional(),
|
|
4255
4241
|
hasMore: external_exports.boolean().optional(),
|
|
4256
|
-
cache: external_exports.enum(["warm", "cold"]).optional(),
|
|
4257
4242
|
diff: external_exports.object({
|
|
4258
4243
|
path: FilePath,
|
|
4259
4244
|
patch: external_exports.string(),
|
|
4260
4245
|
binary: external_exports.boolean(),
|
|
4261
|
-
truncated: external_exports.boolean()
|
|
4262
|
-
|
|
4263
|
-
|
|
4246
|
+
truncated: external_exports.boolean(),
|
|
4247
|
+
notStored: external_exports.boolean().optional()
|
|
4248
|
+
}).optional()
|
|
4264
4249
|
});
|
|
4265
4250
|
}
|
|
4266
4251
|
});
|
|
@@ -8303,6 +8288,8 @@ var init_schemas = __esm({
|
|
|
8303
8288
|
cloudWorkspace: WorkspaceBindingSchema.optional(),
|
|
8304
8289
|
/** Accepted local turns whose terminal gateway status has not been observed. */
|
|
8305
8290
|
cloudPendingTurns: external_exports.array(external_exports.object({ id: external_exports.string().min(1), text: external_exports.string(), prepared: external_exports.boolean().optional() })).optional(),
|
|
8291
|
+
/** 用户在前端选的、尚未由 agent 执行的分支;下一条 query 发出时作为上下文注入,被网关接受后清除。 */
|
|
8292
|
+
cloudBranchIntent: WorkspaceBranchSchema.optional(),
|
|
8306
8293
|
/** Owner gateway session observed in ready; proves the remote Pod was opened. */
|
|
8307
8294
|
cloudGatewaySessionId: external_exports.string().min(1).optional(),
|
|
8308
8295
|
/** Persisted before sending so daemon restart can retry the same gateway command ID. */
|
|
@@ -48439,7 +48426,7 @@ var RUNTIME_PATCH_KEYS = [
|
|
|
48439
48426
|
"effort",
|
|
48440
48427
|
"cwd"
|
|
48441
48428
|
];
|
|
48442
|
-
var MARKER_PATCH_KEYS = ["pinnedAt", "pinSortOrder", "unreadAt", "archivedAt"];
|
|
48429
|
+
var MARKER_PATCH_KEYS = ["pinnedAt", "pinSortOrder", "unreadAt", "archivedAt", "cloudBranchIntent"];
|
|
48443
48430
|
function isMarkerOnlyPatch(patch) {
|
|
48444
48431
|
const keys = Object.keys(patch).filter(
|
|
48445
48432
|
(k3) => patch[k3] !== void 0
|
|
@@ -49620,6 +49607,11 @@ var SessionRunner = class {
|
|
|
49620
49607
|
},
|
|
49621
49608
|
onCloudTurnTerminal: (turnId) => {
|
|
49622
49609
|
if (isCurrent()) this.input({ kind: "cloud-turn-terminal", turnId });
|
|
49610
|
+
},
|
|
49611
|
+
pendingBranchIntent: () => this.state.file.cloudBranchIntent,
|
|
49612
|
+
onBranchIntentDelivered: (branch) => {
|
|
49613
|
+
if (isCurrent() && this.state.file.cloudBranchIntent === branch)
|
|
49614
|
+
this.input({ kind: "command", command: { kind: "update", patch: { cloudBranchIntent: void 0 } } });
|
|
49623
49615
|
}
|
|
49624
49616
|
});
|
|
49625
49617
|
if (isCurrent()) this.session = session;
|
|
@@ -50512,7 +50504,7 @@ var SessionManager = class {
|
|
|
50512
50504
|
});
|
|
50513
50505
|
return { response: value, broadcast };
|
|
50514
50506
|
}
|
|
50515
|
-
const updated = { ...existing, ...args.patch, updatedAt: nowIso2(this.deps) };
|
|
50507
|
+
const updated = isMarkerOnlyPatch(args.patch) ? { ...existing, ...args.patch } : { ...existing, ...args.patch, updatedAt: nowIso2(this.deps) };
|
|
50516
50508
|
if (args.patch.model !== void 0) {
|
|
50517
50509
|
delete updated.resolvedModel;
|
|
50518
50510
|
delete updated.resolvedEffort;
|
|
@@ -66813,6 +66805,11 @@ async function portableCloudInput(text, resolvers) {
|
|
|
66813
66805
|
|
|
66814
66806
|
// src/tools/cloud-turn-session.ts
|
|
66815
66807
|
var import_node_crypto16 = require("crypto");
|
|
66808
|
+
function withBranchIntent(text, branch) {
|
|
66809
|
+
return `${text}
|
|
66810
|
+
|
|
66811
|
+
<system-reminder>\u7528\u6237\u5728\u754C\u9762\u4E0A\u9009\u62E9\u4E86\u5206\u652F ${branch}\uFF0C\u5E0C\u671B\u672C\u4F1A\u8BDD\u5DE5\u4F5C\u5728\u8BE5\u5206\u652F\u4E0A\u3002\u5F00\u59CB\u5904\u7406\u672C\u6761\u6D88\u606F\u524D\uFF0C\u8BF7\u5148\u5207\u6362\u5230 ${branch}\uFF08\u672C\u5730\u6CA1\u6709\u5C31\u4ECE origin \u53D6\uFF09\uFF1B\u5982\u679C\u5DE5\u4F5C\u533A\u6709\u672A\u63D0\u4EA4\u7684\u6539\u52A8\uFF0C\u5148\u544A\u8BC9\u7528\u6237\u518D\u5904\u7406\u3002</system-reminder>`;
|
|
66812
|
+
}
|
|
66816
66813
|
function createCloudTurnSession(args) {
|
|
66817
66814
|
const { ctx, sink, client, personaId: personaId2, engine, instructions, engineSessionId, prepare } = args;
|
|
66818
66815
|
let conversationId = ctx.cloudConversationId ?? ctx.cloudExecutionId;
|
|
@@ -66840,7 +66837,9 @@ function createCloudTurnSession(args) {
|
|
|
66840
66837
|
live.add(commandId);
|
|
66841
66838
|
submission = submission.then(async () => {
|
|
66842
66839
|
try {
|
|
66843
|
-
const
|
|
66840
|
+
const intent = prepared ? void 0 : sink.pendingBranchIntent?.();
|
|
66841
|
+
const prepared0 = prepared ? text : await prepare(text);
|
|
66842
|
+
const portable = intent ? withBranchIntent(prepared0, intent) : prepared0;
|
|
66844
66843
|
if (closed || sink.onCommandPrepared?.(commandId, portable, prepared) === false) {
|
|
66845
66844
|
live.delete(commandId);
|
|
66846
66845
|
return;
|
|
@@ -66860,6 +66859,7 @@ function createCloudTurnSession(args) {
|
|
|
66860
66859
|
...ctx.personaMode ? { personaMode: ctx.personaMode } : {},
|
|
66861
66860
|
...ctx.titleOnly ? { purpose: "title" } : {}
|
|
66862
66861
|
});
|
|
66862
|
+
if (intent) sink.onBranchIntentDelivered?.(intent);
|
|
66863
66863
|
if (closed) {
|
|
66864
66864
|
stream.close();
|
|
66865
66865
|
return;
|
|
@@ -75005,7 +75005,13 @@ function buildCloudWorkspaceHandlers(deps) {
|
|
|
75005
75005
|
ERROR_CODES.VALIDATION_ERROR,
|
|
75006
75006
|
"Workspace operations require a cloud session"
|
|
75007
75007
|
);
|
|
75008
|
-
if (
|
|
75008
|
+
if (args.action === "intend") {
|
|
75009
|
+
if (!file.cloudWorkspace)
|
|
75010
|
+
throw new ClawdError(ERROR_CODES.VALIDATION_ERROR, "\u8BF7\u5148\u9009\u62E9\u4ED3\u5E93");
|
|
75011
|
+
const { broadcast } = deps.setBranchIntent(file.sessionId, args.branch);
|
|
75012
|
+
return { response: { type: "cloud:workspace:ok" }, broadcast };
|
|
75013
|
+
}
|
|
75014
|
+
if (args.action === "bind" && (!["idle", "running-idle", "stopped", "error"].includes(
|
|
75009
75015
|
deps.status(file.sessionId)
|
|
75010
75016
|
) || file.cloudPendingTurns?.length))
|
|
75011
75017
|
throw new ClawdError(ERROR_CODES.VALIDATION_ERROR, "\u8BF7\u7B49\u5F85\u5F53\u524D\u4EFB\u52A1\u5B8C\u6210");
|
|
@@ -75350,7 +75356,7 @@ function computeMethodAccess(args) {
|
|
|
75350
75356
|
}
|
|
75351
75357
|
|
|
75352
75358
|
// src/version.ts
|
|
75353
|
-
var version = "0.2.
|
|
75359
|
+
var version = "0.2.684".length > 0 ? "0.2.684" : "dev";
|
|
75354
75360
|
|
|
75355
75361
|
// src/cli-probe/probe.ts
|
|
75356
75362
|
var fs86 = __toESM(require("fs"), 1);
|
|
@@ -78871,6 +78877,7 @@ async function startDaemon(config) {
|
|
|
78871
78877
|
getFile: (id) => manager.get({ sessionId: id }).response,
|
|
78872
78878
|
status: (id) => manager.getCurrentStatus(id),
|
|
78873
78879
|
bind: (id, binding, conversationId) => manager.bindCloudWorkspace(id, binding, conversationId),
|
|
78880
|
+
setBranchIntent: (id, branch) => manager.update({ sessionId: id, patch: { cloudBranchIntent: branch } }),
|
|
78874
78881
|
command: (file, input) => {
|
|
78875
78882
|
const personaId2 = personaIdFromCloudCwd(file.cwd);
|
|
78876
78883
|
if (!personaId2)
|