@clawos-dev/clawd 0.2.243 → 0.2.244
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
|
@@ -4681,7 +4681,7 @@ var init_persona_schemas = __esm({
|
|
|
4681
4681
|
});
|
|
4682
4682
|
|
|
4683
4683
|
// ../protocol/src/schemas.ts
|
|
4684
|
-
var SessionStatusSchema, UsageSchema, ContextUsageSchema, sessionMetaShape, SessionMetaSchema, ModelInfoSchema, ModeInfoSchema, ConfigFieldSchemaSchema, CapabilitiesGetArgs, ToolFeaturesSchema, CapabilitiesResponseSchema, AllowRuleSchema, SessionFileSchema, ParsedEventBase, HistoryUserMetaSchema, SubagentToolStatsSchema, StructuredPatchHunkSchema, ToolResultExtraSchema, MemoryEntrySchema, AskQuestionOptionSchema, AskQuestionItemSchema, ParsedEventSchema, SessionCreateArgs, SessionIdArgs, SessionUpdateArgs, SessionSendArgs, SessionRewindArgs, SessionRewindResponseSchema, SessionRewindDiffArgs, RewindDiffHunkSchema, RewindDiffFileSchema, SessionRewindDiffResponseSchema, SessionRewindableMessageIdsArgs, SessionRewindableMessageIdsResponseSchema, SessionResumeArgs, SessionForkArgs, SessionForkResponseSchema, SessionObserveArgs, SessionEventsArgs, PermissionRespondArgs, HistoryListArgs, HistoryReadArgs, HistorySubagentsArgs, HistorySubagentReadArgs, WorkspaceListArgs, WorkspaceReadArgs, SkillsListArgs, SkillEntrySchema, AgentEntrySchema, AgentsListArgs, AgentsListResponseSchema, SessionSubscribeArgs, SessionPinArgs, PeerSessionUpsertArgs, PeerSessionUpsertResponseSchema, PeerSessionRemoveArgs, PeerSessionRemoveResponseSchema, SessionReorderPinsArgs, GitRootArgs, GitRootResponseSchema, GitBranchArgs, GitBranchResponseSchema, GitBranchesArgs, GitBranchesResponseSchema, HistoryRecentDirsArgs, RecentDirEntrySchema, HistoryRecentDirsResponseSchema, SessionQuestionFrameSchema, SessionQuestionClearedFrameSchema, AnswerQuestionArgs, AnswerQuestionResponseSchema, CancelQuestionArgs, CancelQuestionResponseSchema, AuthRequestFrameSchema, AuthOkFrameSchema, TunnelReadyEventSchema, TunnelExitedEventSchema, TunnelUnavailableEventSchema, InfoRunningSessionSchema, InfoResponseSchema, PROJECT_PORT_MIN, PROJECT_PORT_MAX, projectNameRegex, DEFAULT_DEV_COMMAND, ProjectMetadataSchema, PROJECT_STAGE_VALUES, ProjectStageSchema, ProjectWithStatusSchema, ListProjectsArgsSchema, ListProjectsResultSchema, GetProjectArgsSchema, GetProjectResultSchema, CreateProjectArgsSchema, CreateProjectResultSchema, DeleteProjectArgsSchema, DeleteProjectResultSchema, UpdateProjectPortArgsSchema, UpdateProjectPortResultSchema, SetProdUrlArgsSchema, SetProdUrlResultSchema, StartDevServerArgsSchema, StartDevServerResultSchema, ASSISTANT_REPORTABLE_STAGES, ReportStageArgsSchema, ReportStageResultSchema, StopDevServerArgsSchema, StopDevServerResultSchema, AppBuilderProjectUpdatedEventSchema, PublishArgsSchema, PublishResultSchema, DismissPublishJobArgsSchema, DismissPublishJobResultSchema, AppBuilderPublishProgressEventSchema, AppBuilderPublishFailedEventSchema;
|
|
4684
|
+
var SessionStatusSchema, UsageSchema, ContextUsageSchema, sessionMetaShape, SessionMetaSchema, ModelInfoSchema, ModeInfoSchema, ConfigFieldSchemaSchema, CapabilitiesGetArgs, ToolFeaturesSchema, CapabilitiesResponseSchema, AllowRuleSchema, SessionFileSchema, ParsedEventBase, HistoryUserMetaSchema, SubagentToolStatsSchema, StructuredPatchHunkSchema, ToolResultExtraSchema, MemoryEntrySchema, AskQuestionOptionSchema, AskQuestionItemSchema, ParsedEventSchema, SessionCreateArgs, SessionListArgs, SessionIdArgs, SessionUpdateArgs, SessionSendArgs, SessionRewindArgs, SessionRewindResponseSchema, SessionRewindDiffArgs, RewindDiffHunkSchema, RewindDiffFileSchema, SessionRewindDiffResponseSchema, SessionRewindableMessageIdsArgs, SessionRewindableMessageIdsResponseSchema, SessionResumeArgs, SessionForkArgs, SessionForkResponseSchema, SessionObserveArgs, SessionEventsArgs, PermissionRespondArgs, HistoryListArgs, HistoryReadArgs, HistorySubagentsArgs, HistorySubagentReadArgs, WorkspaceListArgs, WorkspaceReadArgs, SkillsListArgs, SkillEntrySchema, AgentEntrySchema, AgentsListArgs, AgentsListResponseSchema, SessionSubscribeArgs, SessionPinArgs, PeerSessionUpsertArgs, PeerSessionUpsertResponseSchema, PeerSessionRemoveArgs, PeerSessionRemoveResponseSchema, SessionReorderPinsArgs, GitRootArgs, GitRootResponseSchema, GitBranchArgs, GitBranchResponseSchema, GitBranchesArgs, GitBranchesResponseSchema, HistoryRecentDirsArgs, RecentDirEntrySchema, HistoryRecentDirsResponseSchema, SessionQuestionFrameSchema, SessionQuestionClearedFrameSchema, AnswerQuestionArgs, AnswerQuestionResponseSchema, CancelQuestionArgs, CancelQuestionResponseSchema, AuthRequestFrameSchema, AuthOkFrameSchema, TunnelReadyEventSchema, TunnelExitedEventSchema, TunnelUnavailableEventSchema, InfoRunningSessionSchema, InfoResponseSchema, PROJECT_PORT_MIN, PROJECT_PORT_MAX, projectNameRegex, DEFAULT_DEV_COMMAND, ProjectMetadataSchema, PROJECT_STAGE_VALUES, ProjectStageSchema, ProjectWithStatusSchema, ListProjectsArgsSchema, ListProjectsResultSchema, GetProjectArgsSchema, GetProjectResultSchema, CreateProjectArgsSchema, CreateProjectResultSchema, DeleteProjectArgsSchema, DeleteProjectResultSchema, UpdateProjectPortArgsSchema, UpdateProjectPortResultSchema, SetProdUrlArgsSchema, SetProdUrlResultSchema, StartDevServerArgsSchema, StartDevServerResultSchema, ASSISTANT_REPORTABLE_STAGES, ReportStageArgsSchema, ReportStageResultSchema, StopDevServerArgsSchema, StopDevServerResultSchema, AppBuilderProjectUpdatedEventSchema, PublishArgsSchema, PublishResultSchema, DismissPublishJobArgsSchema, DismissPublishJobResultSchema, AppBuilderPublishProgressEventSchema, AppBuilderPublishFailedEventSchema;
|
|
4685
4685
|
var init_schemas = __esm({
|
|
4686
4686
|
"../protocol/src/schemas.ts"() {
|
|
4687
4687
|
"use strict";
|
|
@@ -4861,6 +4861,15 @@ var init_schemas = __esm({
|
|
|
4861
4861
|
* - native `session:*` handler 完全不感知 mirror(UI 操作 mirror 不走 native 路径)
|
|
4862
4862
|
*/
|
|
4863
4863
|
originOwnerPrincipalId: external_exports.string().min(1).optional(),
|
|
4864
|
+
/**
|
|
4865
|
+
* Mirror 的 persona 身份(2026-07-17 android-dispatch-task spec §3.2):
|
|
4866
|
+
* 该 mirror 在朋友 daemon 上是用哪个 persona 创建的(朋友侧的 persona id)。
|
|
4867
|
+
* 与 originOwnerPrincipalId 平行的「位置」语义——**不参与**本机 persona 反查
|
|
4868
|
+
* (那是 ownerPersonaId 的职责,mirror 上按 #750 防线 strip)。
|
|
4869
|
+
* 消费方:mobile picker「借的」组按 (originOwnerPrincipalId, originOwnerPersonaId) 去重。
|
|
4870
|
+
* 写入方:ui toMirrorSessionFile / mobile buildMirrorUpsertArgs 在 strip ownerPersonaId 时 stamp。
|
|
4871
|
+
*/
|
|
4872
|
+
originOwnerPersonaId: external_exports.string().min(1).optional(),
|
|
4864
4873
|
/**
|
|
4865
4874
|
* Dispatch 派生的 session 在 create 时记录源 session 的 sessionId(稳定 key);
|
|
4866
4875
|
* sidebar 据此把 dispatch 出来的 sub-session 折叠在源 session 下。非 dispatch session 缺省。
|
|
@@ -5113,6 +5122,12 @@ var init_schemas = __esm({
|
|
|
5113
5122
|
}).refine((args) => args.cwd != null || args.ownerPersonaId != null, {
|
|
5114
5123
|
message: "cwd \u4E0E ownerPersonaId \u81F3\u5C11\u4F20\u4E00\u4E2A"
|
|
5115
5124
|
});
|
|
5125
|
+
SessionListArgs = external_exports.object({
|
|
5126
|
+
/** true = 只返回 mirror(originOwnerPrincipalId 非空,即「我在朋友 daemon 上创建」的本机存证)。 */
|
|
5127
|
+
originOnly: external_exports.boolean().optional(),
|
|
5128
|
+
/** 按 updatedAt desc(list 的既有排序)截断前 N 条。 */
|
|
5129
|
+
limit: external_exports.number().int().positive().optional()
|
|
5130
|
+
});
|
|
5116
5131
|
SessionIdArgs = external_exports.object({ sessionId: external_exports.string().min(1) });
|
|
5117
5132
|
SessionUpdateArgs = external_exports.object({
|
|
5118
5133
|
sessionId: external_exports.string().min(1),
|
|
@@ -53905,15 +53920,28 @@ function buildSessionHandlers(deps) {
|
|
|
53905
53920
|
);
|
|
53906
53921
|
return { response: { type: "session:info", ...response }, broadcast };
|
|
53907
53922
|
};
|
|
53908
|
-
const list = async (
|
|
53923
|
+
const list = async (frame, _client, ctx) => {
|
|
53924
|
+
const args = SessionListArgs.parse(frame ?? {});
|
|
53925
|
+
const narrow = (sessions) => {
|
|
53926
|
+
let out = sessions;
|
|
53927
|
+
if (args.originOnly) out = out.filter((s) => s.originOwnerPrincipalId != null);
|
|
53928
|
+
if (args.limit != null) out = out.slice(0, args.limit);
|
|
53929
|
+
return out;
|
|
53930
|
+
};
|
|
53909
53931
|
const { response } = manager.list();
|
|
53910
53932
|
if (ctx && ctx.principal.kind === "guest") {
|
|
53911
53933
|
const sessions = response.sessions ?? [];
|
|
53912
53934
|
const guestDeviceId = ctx.principal.id;
|
|
53913
53935
|
const filtered = sessions.filter((s) => canAccessPersona(ctx.grants, s.ownerPersonaId, "read")).filter((s) => s.creatorPrincipalId === guestDeviceId);
|
|
53914
|
-
return { response: { type: "session:list", sessions: filtered } };
|
|
53936
|
+
return { response: { type: "session:list", sessions: narrow(filtered) } };
|
|
53915
53937
|
}
|
|
53916
|
-
return {
|
|
53938
|
+
return {
|
|
53939
|
+
response: {
|
|
53940
|
+
type: "session:list",
|
|
53941
|
+
...response,
|
|
53942
|
+
sessions: narrow(response.sessions ?? [])
|
|
53943
|
+
}
|
|
53944
|
+
};
|
|
53917
53945
|
};
|
|
53918
53946
|
const get = async (frame, _client, ctx) => {
|
|
53919
53947
|
const args = SessionIdArgs.parse(frame);
|
|
@@ -39913,6 +39913,15 @@ var SessionFileSchema = external_exports.object({
|
|
|
39913
39913
|
* - native `session:*` handler 完全不感知 mirror(UI 操作 mirror 不走 native 路径)
|
|
39914
39914
|
*/
|
|
39915
39915
|
originOwnerPrincipalId: external_exports.string().min(1).optional(),
|
|
39916
|
+
/**
|
|
39917
|
+
* Mirror 的 persona 身份(2026-07-17 android-dispatch-task spec §3.2):
|
|
39918
|
+
* 该 mirror 在朋友 daemon 上是用哪个 persona 创建的(朋友侧的 persona id)。
|
|
39919
|
+
* 与 originOwnerPrincipalId 平行的「位置」语义——**不参与**本机 persona 反查
|
|
39920
|
+
* (那是 ownerPersonaId 的职责,mirror 上按 #750 防线 strip)。
|
|
39921
|
+
* 消费方:mobile picker「借的」组按 (originOwnerPrincipalId, originOwnerPersonaId) 去重。
|
|
39922
|
+
* 写入方:ui toMirrorSessionFile / mobile buildMirrorUpsertArgs 在 strip ownerPersonaId 时 stamp。
|
|
39923
|
+
*/
|
|
39924
|
+
originOwnerPersonaId: external_exports.string().min(1).optional(),
|
|
39916
39925
|
/**
|
|
39917
39926
|
* Dispatch 派生的 session 在 create 时记录源 session 的 sessionId(稳定 key);
|
|
39918
39927
|
* sidebar 据此把 dispatch 出来的 sub-session 折叠在源 session 下。非 dispatch session 缺省。
|
|
@@ -40165,6 +40174,12 @@ var SessionCreateArgs = external_exports.object({
|
|
|
40165
40174
|
}).refine((args) => args.cwd != null || args.ownerPersonaId != null, {
|
|
40166
40175
|
message: "cwd \u4E0E ownerPersonaId \u81F3\u5C11\u4F20\u4E00\u4E2A"
|
|
40167
40176
|
});
|
|
40177
|
+
var SessionListArgs = external_exports.object({
|
|
40178
|
+
/** true = 只返回 mirror(originOwnerPrincipalId 非空,即「我在朋友 daemon 上创建」的本机存证)。 */
|
|
40179
|
+
originOnly: external_exports.boolean().optional(),
|
|
40180
|
+
/** 按 updatedAt desc(list 的既有排序)截断前 N 条。 */
|
|
40181
|
+
limit: external_exports.number().int().positive().optional()
|
|
40182
|
+
});
|
|
40168
40183
|
var SessionIdArgs = external_exports.object({ sessionId: external_exports.string().min(1) });
|
|
40169
40184
|
var SessionUpdateArgs = external_exports.object({
|
|
40170
40185
|
sessionId: external_exports.string().min(1),
|