@norman-else/dsh-claude 0.1.16 → 0.1.18
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/INSTALL.md +55 -55
- package/LICENSE +21 -21
- package/README.md +191 -191
- package/cordis.patch.yml +12 -12
- package/legacy-preset/agent.cordis.yml +11 -11
- package/legacy-preset/preset.yml +4 -4
- package/lib/bin.mjs +0 -0
- package/lib/bin.mjs.map +1 -1
- package/lib/client.js +81 -5
- package/lib/client.js.map +1 -1
- package/lib/events-6xTApIQw.mjs.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/{presenters-CtgkpzZo.mjs → presenters-BWXp9d3p.mjs} +4 -2
- package/lib/presenters-BWXp9d3p.mjs.map +1 -0
- package/lib/preset-installer-B0NrA4Hi.mjs.map +1 -1
- package/lib/preset-route.mjs +1 -1
- package/lib/preset-route.mjs.map +1 -1
- package/package.json +134 -134
- package/preset/claude/agent.cordis.yml +11 -11
- package/preset/claude/preset.yml +4 -4
- package/lib/presenters-CtgkpzZo.mjs.map +0 -1
package/lib/client.js
CHANGED
|
@@ -165,6 +165,54 @@ window.__ModuleLoader__.load({
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
+
/** Keep one sidecar-backed task launcher mounted only while its DSH turn is open. */
|
|
169
|
+
const claudeActiveTasksDefinition = {
|
|
170
|
+
kind: "claude-active-tasks",
|
|
171
|
+
target: "chat",
|
|
172
|
+
match(event) {
|
|
173
|
+
if (event.type === "turn/start") return {
|
|
174
|
+
id: String(event.data.turn),
|
|
175
|
+
role: "start"
|
|
176
|
+
};
|
|
177
|
+
if (event.type === "turn/end" || event.type === "step/start" || event.type === "assistant/message") return {
|
|
178
|
+
id: String(event.data.turn),
|
|
179
|
+
role: "update"
|
|
180
|
+
};
|
|
181
|
+
return null;
|
|
182
|
+
},
|
|
183
|
+
start(_context, match) {
|
|
184
|
+
if (match.event.type !== "turn/start") throw new Error("Claude active tasks require turn/start");
|
|
185
|
+
return {
|
|
186
|
+
turn: match.event.data.turn,
|
|
187
|
+
active: true,
|
|
188
|
+
anchorSeq: match.event.seq + .1
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
update(context, match) {
|
|
192
|
+
if (match.event.type === "turn/end") return {
|
|
193
|
+
...context.state,
|
|
194
|
+
active: false
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
...context.state,
|
|
198
|
+
anchorSeq: match.event.seq + .1
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
buildViewNode(context) {
|
|
202
|
+
const state = context.state;
|
|
203
|
+
if (state === void 0) return null;
|
|
204
|
+
return {
|
|
205
|
+
key: context.key,
|
|
206
|
+
kind: "claude-active-tasks",
|
|
207
|
+
id: context.id,
|
|
208
|
+
target: "chat",
|
|
209
|
+
anchorSeq: state.anchorSeq,
|
|
210
|
+
location: context.start?.location ?? { kind: "unresolved" },
|
|
211
|
+
visibility: state.active ? "visible" : "hidden",
|
|
212
|
+
data: { turn: state.turn }
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
168
216
|
/** Publish a marker for turns containing standard assistant output from the Claude adapter. */
|
|
169
217
|
const claudeTurnDefinition = {
|
|
170
218
|
kind: "claudeCode",
|
|
@@ -942,9 +990,8 @@ window.__ModuleLoader__.load({
|
|
|
942
990
|
}
|
|
943
991
|
//#endregion
|
|
944
992
|
//#region src/client/ClaudeActivityTail.tsx
|
|
945
|
-
function
|
|
946
|
-
const
|
|
947
|
-
const summary = useMemo(() => summarizeTurnTasks(tasksForTurn(projection.tasks?.tasks ?? [], matched.turn)), [projection.tasks, matched.turn]);
|
|
993
|
+
function ClaudeTaskLauncher({ turn, tasks, t, openTasks }) {
|
|
994
|
+
const summary = useMemo(() => summarizeTurnTasks(tasksForTurn(tasks, turn)), [tasks, turn]);
|
|
948
995
|
if (summary === void 0) return null;
|
|
949
996
|
const label = summary.state === "running" ? t("tasksTurnRunning", { count: summary.running }) : summary.state === "failed" ? t("tasksTurnFailed", {
|
|
950
997
|
failed: summary.failed,
|
|
@@ -952,11 +999,11 @@ window.__ModuleLoader__.load({
|
|
|
952
999
|
}) : t("tasksTurnCompleted", { count: summary.completed });
|
|
953
1000
|
const glyph = summary.state === "running" ? "●" : summary.state === "failed" ? "×" : "✓";
|
|
954
1001
|
return /* @__PURE__ */ jsx("div", {
|
|
955
|
-
"data-claude-
|
|
1002
|
+
"data-claude-task-launcher": turn,
|
|
956
1003
|
children: /* @__PURE__ */ jsxs("button", {
|
|
957
1004
|
type: "button",
|
|
958
1005
|
style: tasksTurnLauncher,
|
|
959
|
-
onClick: () => openTasks(
|
|
1006
|
+
onClick: () => openTasks(turn),
|
|
960
1007
|
children: [
|
|
961
1008
|
/* @__PURE__ */ jsx("span", {
|
|
962
1009
|
className: summary.state === "running" ? "dsh-claude-act-running" : void 0,
|
|
@@ -977,6 +1024,28 @@ window.__ModuleLoader__.load({
|
|
|
977
1024
|
})
|
|
978
1025
|
});
|
|
979
1026
|
}
|
|
1027
|
+
function ClaudeActivityTail({ matched, useClaudeProjection, t, openTasks }) {
|
|
1028
|
+
const tasks = useClaudeProjection((value) => value.tasks?.tasks ?? []);
|
|
1029
|
+
return /* @__PURE__ */ jsx(ClaudeTaskLauncher, {
|
|
1030
|
+
turn: matched.turn,
|
|
1031
|
+
tasks,
|
|
1032
|
+
t,
|
|
1033
|
+
openTasks
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
//#endregion
|
|
1037
|
+
//#region src/client/ClaudeActiveTasksNode.tsx
|
|
1038
|
+
const EMPTY_TASKS$1 = [];
|
|
1039
|
+
/** Render the task launcher while the owning DSH turn is still open. */
|
|
1040
|
+
function ClaudeActiveTasksNode({ node, useClaudeProjection, t, openTasks }) {
|
|
1041
|
+
const tasks = useClaudeProjection((value) => value.tasks?.tasks ?? EMPTY_TASKS$1);
|
|
1042
|
+
return /* @__PURE__ */ jsx(ClaudeTaskLauncher, {
|
|
1043
|
+
turn: node.data.turn,
|
|
1044
|
+
tasks,
|
|
1045
|
+
t,
|
|
1046
|
+
openTasks
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
980
1049
|
//#endregion
|
|
981
1050
|
//#region src/client/ClaudeActivityNode.tsx
|
|
982
1051
|
const EMPTY_TASKS = [];
|
|
@@ -1936,6 +2005,7 @@ window.__ModuleLoader__.load({
|
|
|
1936
2005
|
ctx.effect(() => () => projections.dispose(), "dsh-claude: sidecar projection lifecycle");
|
|
1937
2006
|
ctx.effect(() => ctx.conversationEvents.register(claudeTurnDefinition), "dsh-claude: Claude turn marker");
|
|
1938
2007
|
ctx.effect(() => ctx.conversationEvents.register(claudeActivityStepDefinition), "dsh-claude: Claude activity flow node");
|
|
2008
|
+
ctx.effect(() => ctx.conversationEvents.register(claudeActiveTasksDefinition), "dsh-claude: active Claude tasks node");
|
|
1939
2009
|
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
|
1940
2010
|
name: "conversation.chat.node",
|
|
1941
2011
|
key: "claude-activity-step",
|
|
@@ -1988,6 +2058,12 @@ window.__ModuleLoader__.load({
|
|
|
1988
2058
|
closeTasksPanel();
|
|
1989
2059
|
};
|
|
1990
2060
|
}, "dsh-claude: tasks panel lifecycle");
|
|
2061
|
+
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
|
2062
|
+
name: "conversation.chat.node",
|
|
2063
|
+
key: "claude-active-tasks",
|
|
2064
|
+
locale: namespace,
|
|
2065
|
+
inject: (sessionId) => ({ openTasks: (turn) => openTasksPanel(sessionId, turn) })
|
|
2066
|
+
}, ClaudeActiveTasksNode));
|
|
1991
2067
|
ctx.slots.inject("conversation.chat.turnTail", () => ctx.slots.register({
|
|
1992
2068
|
name: "conversation.chat.turnTail",
|
|
1993
2069
|
select: selectClaudeTurn,
|