@lukstei/dsh-client-kanban 0.0.0-stage → 0.2.2-rc.5.4
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/LICENSE +21 -0
- package/README.md +181 -2
- package/cordis.patch.yml +3 -0
- package/dist/client.js +4089 -0
- package/dist/index.js +461 -0
- package/package.json +135 -3
- package/src/client/InFlightSidebar.tsx +606 -0
- package/src/client/KanbanCard.tsx +195 -0
- package/src/client/KanbanIcon.tsx +25 -0
- package/src/client/KanbanPane.tsx +576 -0
- package/src/client/KanbanPaneStatus.tsx +46 -0
- package/src/client/KanbanSection.tsx +177 -0
- package/src/client/KanbanStatusDot.tsx +14 -0
- package/src/client/KanbanTransitionDropdown.tsx +281 -0
- package/src/client/SessionLinks.tsx +72 -0
- package/src/client/dsh.d.ts +30 -0
- package/src/client/index.tsx +602 -0
- package/src/client/navigation.ts +93 -0
- package/src/client/sidebar-mode.ts +71 -0
- package/src/client/store.ts +811 -0
- package/src/client/styles.ts +1539 -0
- package/src/client/use-kanban.ts +52 -0
- package/src/fold.ts +213 -0
- package/src/index.ts +193 -0
- package/src/search-host.ts +77 -0
- package/src/search.ts +72 -0
- package/src/types.ts +80 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
2
|
+
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
3
|
+
import Schema from "@deepseek-ai/schemastery";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { TypertRemoteService, createTypertRemoteInfo } from "@deepseek-ai/dsh-typert-protocol";
|
|
6
|
+
// src/types.ts
|
|
7
|
+
const kanbanLinkSchema = z.object({
|
|
8
|
+
label: z.string().trim().min(1),
|
|
9
|
+
url: z.string().refine((value) => {
|
|
10
|
+
const url = URL.parse(value);
|
|
11
|
+
return url !== null && (url.protocol === "http:" || url.protocol === "https:");
|
|
12
|
+
}, "Expected an absolute HTTP(S) URL"),
|
|
13
|
+
priority: z.number().default(0)
|
|
14
|
+
});
|
|
15
|
+
const kanbanPayloadSchema = z.discriminatedUnion("action", [
|
|
16
|
+
z.object({
|
|
17
|
+
action: z.literal("init"),
|
|
18
|
+
createdAt: z.number(),
|
|
19
|
+
prompt: z.string().optional()
|
|
20
|
+
}),
|
|
21
|
+
z.object({
|
|
22
|
+
action: z.literal("done"),
|
|
23
|
+
doneAt: z.number()
|
|
24
|
+
}),
|
|
25
|
+
z.object({
|
|
26
|
+
action: z.literal("reopen"),
|
|
27
|
+
reopenedAt: z.number()
|
|
28
|
+
}),
|
|
29
|
+
z.object({
|
|
30
|
+
action: z.literal("delete"),
|
|
31
|
+
deletedAt: z.number()
|
|
32
|
+
}),
|
|
33
|
+
z.object({
|
|
34
|
+
action: z.literal("hold"),
|
|
35
|
+
heldAt: z.number()
|
|
36
|
+
}),
|
|
37
|
+
z.object({
|
|
38
|
+
action: z.literal("unhold"),
|
|
39
|
+
unheldAt: z.number()
|
|
40
|
+
}),
|
|
41
|
+
z.object({
|
|
42
|
+
action: z.literal("pin"),
|
|
43
|
+
pinnedAt: z.number()
|
|
44
|
+
}),
|
|
45
|
+
z.object({
|
|
46
|
+
action: z.literal("unpin"),
|
|
47
|
+
unpinnedAt: z.number()
|
|
48
|
+
}),
|
|
49
|
+
kanbanLinkSchema.extend({ action: z.literal("add-link") })
|
|
50
|
+
]);
|
|
51
|
+
// src/fold.ts
|
|
52
|
+
/**
|
|
53
|
+
* Purpose: Create the initial uninitialized Kanban state from a session header.
|
|
54
|
+
* Contract:
|
|
55
|
+
* - Inputs: Valid session header with id and createdAt timestamp.
|
|
56
|
+
* - Outputs: Uninitialized KanbanState with an empty link collection.
|
|
57
|
+
* - Throws / Errors: Never throws.
|
|
58
|
+
*/
|
|
59
|
+
function initialKanbanState(header) {
|
|
60
|
+
return {
|
|
61
|
+
sessionId: header.id,
|
|
62
|
+
createdAt: header.createdAt,
|
|
63
|
+
links: [],
|
|
64
|
+
initialized: false,
|
|
65
|
+
deleted: false
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Purpose: Fold a single session event into the existing Kanban state.
|
|
70
|
+
* Contract:
|
|
71
|
+
* - Inputs: Current KanbanState and a committed event with its canonical DSH payload.
|
|
72
|
+
* - Outputs: Next immutable KanbanState reflecting the event transition.
|
|
73
|
+
* - Throws / Errors: Never throws.
|
|
74
|
+
*/
|
|
75
|
+
function foldKanbanEvent(state, event) {
|
|
76
|
+
if (event.type === "command/run") {
|
|
77
|
+
const data = event.data;
|
|
78
|
+
if (data.name !== "kanban") return state;
|
|
79
|
+
if (data.args === void 0 || data.args.trim() === "") {
|
|
80
|
+
if (state.initialized || state.deleted) return state;
|
|
81
|
+
return {
|
|
82
|
+
...state,
|
|
83
|
+
initialized: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
let input;
|
|
87
|
+
try {
|
|
88
|
+
input = JSON.parse(data.args);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (!(error instanceof SyntaxError)) throw error;
|
|
91
|
+
return state;
|
|
92
|
+
}
|
|
93
|
+
const parsed = kanbanPayloadSchema.safeParse(input);
|
|
94
|
+
if (!parsed.success) return state;
|
|
95
|
+
const payload = parsed.data;
|
|
96
|
+
if (payload.action === "add-link") {
|
|
97
|
+
if (state.deleted) return state;
|
|
98
|
+
const link = {
|
|
99
|
+
label: payload.label,
|
|
100
|
+
url: payload.url,
|
|
101
|
+
priority: payload.priority
|
|
102
|
+
};
|
|
103
|
+
const existing = state.links.find((entry) => entry.url === link.url);
|
|
104
|
+
if (existing === void 0) return {
|
|
105
|
+
...state,
|
|
106
|
+
links: [...state.links, link]
|
|
107
|
+
};
|
|
108
|
+
if (existing.label === link.label && existing.priority === link.priority) return state;
|
|
109
|
+
return {
|
|
110
|
+
...state,
|
|
111
|
+
links: state.links.map((entry) => entry.url === link.url ? link : entry)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (payload.action === "init") {
|
|
115
|
+
if (state.initialized || state.deleted) return state;
|
|
116
|
+
return {
|
|
117
|
+
...state,
|
|
118
|
+
initialized: true,
|
|
119
|
+
createdAt: payload.createdAt,
|
|
120
|
+
...payload.prompt !== void 0 ? { prompt: payload.prompt } : {}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (payload.action === "delete") {
|
|
124
|
+
if (!state.initialized || state.deleted) return state;
|
|
125
|
+
return {
|
|
126
|
+
...state,
|
|
127
|
+
deleted: true
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (payload.action === "done") {
|
|
131
|
+
if (!state.initialized || state.deleted || state.doneAt !== void 0) return state;
|
|
132
|
+
const { heldAt: _, reviewAt: __, ...rest } = state;
|
|
133
|
+
return {
|
|
134
|
+
...rest,
|
|
135
|
+
doneAt: payload.doneAt
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (payload.action === "reopen") {
|
|
139
|
+
if (!state.initialized || state.deleted || state.doneAt === void 0) return state;
|
|
140
|
+
const { doneAt: _, ...rest } = state;
|
|
141
|
+
return {
|
|
142
|
+
...rest,
|
|
143
|
+
reviewAt: payload.reopenedAt
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (payload.action === "hold") {
|
|
147
|
+
if (!state.initialized || state.deleted) return state;
|
|
148
|
+
const { doneAt: _, reviewAt: __, ...rest } = state;
|
|
149
|
+
return {
|
|
150
|
+
...rest,
|
|
151
|
+
heldAt: payload.heldAt
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (payload.action === "unhold") {
|
|
155
|
+
if (!state.initialized || state.deleted || state.doneAt !== void 0 || state.reviewAt !== void 0) return state;
|
|
156
|
+
const { heldAt: _, ...rest } = state;
|
|
157
|
+
return {
|
|
158
|
+
...rest,
|
|
159
|
+
reviewAt: payload.unheldAt
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (payload.action === "pin") {
|
|
163
|
+
if (!state.initialized || state.deleted || state.doneAt === void 0) return state;
|
|
164
|
+
if (state.pinnedAt !== void 0) return state;
|
|
165
|
+
return {
|
|
166
|
+
...state,
|
|
167
|
+
pinnedAt: payload.pinnedAt
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (payload.action === "unpin") {
|
|
171
|
+
if (!state.initialized || state.deleted || state.pinnedAt === void 0) return state;
|
|
172
|
+
const { pinnedAt: _, ...rest } = state;
|
|
173
|
+
return rest;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (event.type === "assistant/message" || event.type === "user/message") {
|
|
177
|
+
if (state.deleted) return state;
|
|
178
|
+
const eventTime = typeof event.time === "number" ? event.time : void 0;
|
|
179
|
+
const nextActivity = eventTime !== void 0 && eventTime > (state.lastActivityAt ?? 0) ? eventTime : state.lastActivityAt;
|
|
180
|
+
if (event.type === "user/message") {
|
|
181
|
+
if (state.initialized && (state.doneAt !== void 0 || state.heldAt !== void 0 || state.reviewAt !== void 0)) {
|
|
182
|
+
const { doneAt: _, heldAt: __, reviewAt: ___, ...rest } = state;
|
|
183
|
+
return nextActivity !== state.lastActivityAt ? {
|
|
184
|
+
...rest,
|
|
185
|
+
lastActivityAt: nextActivity
|
|
186
|
+
} : rest;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (nextActivity !== state.lastActivityAt) return {
|
|
190
|
+
...state,
|
|
191
|
+
lastActivityAt: nextActivity
|
|
192
|
+
};
|
|
193
|
+
return state;
|
|
194
|
+
}
|
|
195
|
+
return state;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Purpose: Convert internal KanbanState into a public projection record.
|
|
199
|
+
* Contract:
|
|
200
|
+
* - Inputs: Current KanbanState.
|
|
201
|
+
* - Outputs: Public KanbanRecord with links sorted by ascending priority and collection order for ties, or null when uninitialized/deleted.
|
|
202
|
+
* - Throws / Errors: Never throws.
|
|
203
|
+
*/
|
|
204
|
+
function toKanbanRecord(state) {
|
|
205
|
+
if (!state.initialized || state.deleted) return null;
|
|
206
|
+
const { initialized: _, deleted: __, ...record } = state;
|
|
207
|
+
return {
|
|
208
|
+
...record,
|
|
209
|
+
links: record.links.toSorted((a, b) => a.priority - b.priority)
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
// src/search.ts
|
|
213
|
+
const sessionIdSchema = z.string().min(1).transform((id) => id);
|
|
214
|
+
const searchRequestSchema = z.strictObject({
|
|
215
|
+
query: z.string().trim().min(1),
|
|
216
|
+
sessionIds: z.array(sessionIdSchema)
|
|
217
|
+
});
|
|
218
|
+
const searchResultSchema = z.strictObject({
|
|
219
|
+
items: z.array(z.strictObject({
|
|
220
|
+
sessionId: sessionIdSchema,
|
|
221
|
+
snippet: z.string()
|
|
222
|
+
})),
|
|
223
|
+
hasMore: z.boolean()
|
|
224
|
+
});
|
|
225
|
+
const requestCodec = {
|
|
226
|
+
mode: "strict",
|
|
227
|
+
typeSymbol: "dsh-client-kanban#searchRequest",
|
|
228
|
+
create: () => searchRequestSchema
|
|
229
|
+
};
|
|
230
|
+
const searchRemote = createTypertRemoteInfo({
|
|
231
|
+
package: "dsh-client-kanban",
|
|
232
|
+
methods: { "kanban/search": {
|
|
233
|
+
service: "kanbanSearch",
|
|
234
|
+
invocation: { kind: "direct" },
|
|
235
|
+
parameters: [{
|
|
236
|
+
name: "request",
|
|
237
|
+
source: "json",
|
|
238
|
+
codec: requestCodec,
|
|
239
|
+
strictCodec: requestCodec
|
|
240
|
+
}],
|
|
241
|
+
cancellation: { parameter: "signal" },
|
|
242
|
+
result: {
|
|
243
|
+
mode: "strict",
|
|
244
|
+
typeSymbol: "dsh-client-kanban#searchResult",
|
|
245
|
+
create: () => searchResultSchema
|
|
246
|
+
}
|
|
247
|
+
} }
|
|
248
|
+
}, z);
|
|
249
|
+
// src/search-host.ts
|
|
250
|
+
var KanbanSearch = class extends TypertRemoteService {
|
|
251
|
+
static inject = [
|
|
252
|
+
"sessionQuery",
|
|
253
|
+
"remoteAccess",
|
|
254
|
+
"typert"
|
|
255
|
+
];
|
|
256
|
+
constructor(ctx) {
|
|
257
|
+
super(ctx, "kanbanSearch", { namespace: "kanban" });
|
|
258
|
+
ctx.typert.register({
|
|
259
|
+
package: searchRemote.package,
|
|
260
|
+
face: "host",
|
|
261
|
+
schemas: [],
|
|
262
|
+
model: {
|
|
263
|
+
services: [],
|
|
264
|
+
events: [],
|
|
265
|
+
objects: []
|
|
266
|
+
},
|
|
267
|
+
invocations: searchRemote.descriptors
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Purpose: Search only authorized sessions from the selected Kanban board.
|
|
272
|
+
* Contract:
|
|
273
|
+
* - Inputs: Strict Remote request containing query and board session IDs, and cancellation signal.
|
|
274
|
+
* - Outputs: At most 20 message-content hits, with a scoped continuation indicator.
|
|
275
|
+
* - Throws / Errors: Propagates cancellation and provider errors to the Gateway.
|
|
276
|
+
*/
|
|
277
|
+
async search(request, signal) {
|
|
278
|
+
signal.throwIfAborted();
|
|
279
|
+
const sessionIds = request.sessionIds.filter((id) => this.ctx.remoteAccess.allows({
|
|
280
|
+
kind: "session",
|
|
281
|
+
id
|
|
282
|
+
}));
|
|
283
|
+
if (sessionIds.length === 0) return {
|
|
284
|
+
items: [],
|
|
285
|
+
hasMore: false
|
|
286
|
+
};
|
|
287
|
+
const page = await this.ctx.sessionQuery.searchSessions({
|
|
288
|
+
query: request.query,
|
|
289
|
+
sessionFilters: [{
|
|
290
|
+
kind: "id",
|
|
291
|
+
values: sessionIds
|
|
292
|
+
}],
|
|
293
|
+
eventFilters: [{
|
|
294
|
+
kind: "type",
|
|
295
|
+
values: ["user/message", "assistant/message"]
|
|
296
|
+
}, {
|
|
297
|
+
kind: "surface",
|
|
298
|
+
values: ["current"]
|
|
299
|
+
}],
|
|
300
|
+
limit: 20
|
|
301
|
+
}, { signal });
|
|
302
|
+
signal.throwIfAborted();
|
|
303
|
+
return {
|
|
304
|
+
items: page.items.filter((hit) => this.ctx.remoteAccess.allows({
|
|
305
|
+
kind: "session",
|
|
306
|
+
id: hit.header.id
|
|
307
|
+
})).map((hit) => ({
|
|
308
|
+
sessionId: hit.header.id,
|
|
309
|
+
snippet: hit.bestMatch.snippet
|
|
310
|
+
})),
|
|
311
|
+
hasMore: page.nextCursor !== void 0
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
// src/index.ts
|
|
316
|
+
const name = "dsh-client-kanban";
|
|
317
|
+
const inject = [
|
|
318
|
+
"commands",
|
|
319
|
+
"sessionProjections",
|
|
320
|
+
"tools"
|
|
321
|
+
];
|
|
322
|
+
const defaultConfig = {
|
|
323
|
+
kanban_add_link_tool_enabled: true,
|
|
324
|
+
kanban_add_link_tool_instructions: "Collect important links relevant to the session. Keep link labels concise and unambiguous. Give links directly related to the task negative priorities; give supporting context links zero or positive priorities. For context links, briefly explain their relevance in the label. Examples: \"Task PR: jackwener/OpenCLI #32\", \"Task Ticket: EXAMPLE-2\", \"EXAMPLE-333: Acceptance criteria\"."
|
|
325
|
+
};
|
|
326
|
+
const Config = Schema.object({
|
|
327
|
+
kanban_add_link_tool_enabled: Schema.boolean().default(defaultConfig.kanban_add_link_tool_enabled).description("Whether kanban_add_link tool is enabled."),
|
|
328
|
+
kanban_add_link_tool_instructions: Schema.string().default(defaultConfig.kanban_add_link_tool_instructions).description("Instructions for kanban_add_link tool.")
|
|
329
|
+
});
|
|
330
|
+
const kanbanRecordSchema = z.object({
|
|
331
|
+
sessionId: z.string().transform((v) => SessionId(v)),
|
|
332
|
+
createdAt: z.number(),
|
|
333
|
+
doneAt: z.number().optional(),
|
|
334
|
+
heldAt: z.number().optional(),
|
|
335
|
+
reviewAt: z.number().optional(),
|
|
336
|
+
prompt: z.string().optional(),
|
|
337
|
+
pinnedAt: z.number().optional(),
|
|
338
|
+
links: z.array(kanbanLinkSchema).readonly(),
|
|
339
|
+
lastActivityAt: z.number().optional()
|
|
340
|
+
});
|
|
341
|
+
const kanbanStateSchema = kanbanRecordSchema.extend({
|
|
342
|
+
initialized: z.boolean(),
|
|
343
|
+
deleted: z.boolean()
|
|
344
|
+
});
|
|
345
|
+
/**
|
|
346
|
+
* Purpose: Register the Kanban projection, commands, link tool, and scoped search.
|
|
347
|
+
* Contract:
|
|
348
|
+
* - Inputs: Cordis context providing commands, sessionProjections, and tools, and validated plugin configuration.
|
|
349
|
+
* - Outputs: void; collected links persist in the caller's command events.
|
|
350
|
+
* - Throws / Errors: Missing services, invalid tool input, and failed command dispatch propagate.
|
|
351
|
+
*/
|
|
352
|
+
async function apply(ctx, config) {
|
|
353
|
+
ctx.plugin(KanbanSearch);
|
|
354
|
+
const kanbanHandle = await ctx.sessionProjections.register({
|
|
355
|
+
key: "kanban",
|
|
356
|
+
stateSchema: kanbanStateSchema,
|
|
357
|
+
init: (header) => initialKanbanState(header),
|
|
358
|
+
apply: (state, event) => foldKanbanEvent(state, event),
|
|
359
|
+
wire: {
|
|
360
|
+
viewSchema: kanbanRecordSchema.nullable(),
|
|
361
|
+
view: toKanbanRecord
|
|
362
|
+
},
|
|
363
|
+
stateVersion: 12
|
|
364
|
+
});
|
|
365
|
+
ctx.effect(() => {
|
|
366
|
+
return () => {
|
|
367
|
+
kanbanHandle.dispose();
|
|
368
|
+
};
|
|
369
|
+
});
|
|
370
|
+
ctx.commands.register({
|
|
371
|
+
name: "kanban",
|
|
372
|
+
description: "Enable this session in Kanban or manage lifecycle: /kanban [json-payload]",
|
|
373
|
+
handler: async (invocation) => {
|
|
374
|
+
if (!invocation.rawInput.trim()) return {
|
|
375
|
+
kind: "success",
|
|
376
|
+
text: "Session enabled in Kanban"
|
|
377
|
+
};
|
|
378
|
+
let input;
|
|
379
|
+
try {
|
|
380
|
+
input = JSON.parse(invocation.rawInput);
|
|
381
|
+
} catch (error) {
|
|
382
|
+
if (!(error instanceof SyntaxError)) throw error;
|
|
383
|
+
return {
|
|
384
|
+
kind: "error",
|
|
385
|
+
text: "Invalid kanban command payload: expected JSON"
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
const payload = kanbanPayloadSchema.safeParse(input);
|
|
389
|
+
if (!payload.success) return {
|
|
390
|
+
kind: "error",
|
|
391
|
+
text: payload.error.message
|
|
392
|
+
};
|
|
393
|
+
return {
|
|
394
|
+
kind: "success",
|
|
395
|
+
text: `Kanban action '${payload.data.action}' recorded`
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
if (!config.kanban_add_link_tool_enabled) return;
|
|
400
|
+
ctx.tools.register(defineTool({
|
|
401
|
+
name: "kanban_add_link",
|
|
402
|
+
description: `Collect a confirmed HTTP(S) URL for the current session. Reusing a URL updates its label and priority without duplicating it. Does not change Kanban status. ${config.kanban_add_link_tool_instructions}`,
|
|
403
|
+
parameters: {
|
|
404
|
+
label: {
|
|
405
|
+
type: "string",
|
|
406
|
+
required: true,
|
|
407
|
+
description: "Short descriptive label for the link."
|
|
408
|
+
},
|
|
409
|
+
url: {
|
|
410
|
+
type: "string",
|
|
411
|
+
required: true,
|
|
412
|
+
description: "Confirmed absolute HTTP or HTTPS URL."
|
|
413
|
+
},
|
|
414
|
+
priority: {
|
|
415
|
+
type: "number",
|
|
416
|
+
default: 0,
|
|
417
|
+
description: "Sort priority: lower numbers appear first. Negative values are high priority; positive values are low priority. Defaults to 0."
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
output: {
|
|
421
|
+
schema: {
|
|
422
|
+
type: "object",
|
|
423
|
+
properties: {
|
|
424
|
+
label: {
|
|
425
|
+
type: "string",
|
|
426
|
+
required: true
|
|
427
|
+
},
|
|
428
|
+
url: {
|
|
429
|
+
type: "string",
|
|
430
|
+
required: true
|
|
431
|
+
},
|
|
432
|
+
priority: {
|
|
433
|
+
type: "number",
|
|
434
|
+
required: true
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
additionalProperties: false
|
|
438
|
+
},
|
|
439
|
+
render: (_args, value) => [{
|
|
440
|
+
type: "text",
|
|
441
|
+
text: `Saved session link: ${value.label} (${value.url})`
|
|
442
|
+
}]
|
|
443
|
+
},
|
|
444
|
+
async execute(args, exec) {
|
|
445
|
+
exec.signal.throwIfAborted();
|
|
446
|
+
if (!exec.agent) throw new Error("Session link collection requires a caller agent");
|
|
447
|
+
const link = kanbanLinkSchema.parse(args);
|
|
448
|
+
if (kanbanHandle.stateOf(exec.agent.session).deleted) throw new Error("Cannot add links to a deleted Kanban task");
|
|
449
|
+
const execution = await ctx.commands.execute(exec.agent, `/kanban ${JSON.stringify({
|
|
450
|
+
action: "add-link",
|
|
451
|
+
...link
|
|
452
|
+
})}`, [], exec.signal);
|
|
453
|
+
if (!execution || execution.result.kind === "error") throw new Error(execution ? execution.result.text : "Failed to execute /kanban command");
|
|
454
|
+
return link;
|
|
455
|
+
}
|
|
456
|
+
}), { when: ({ agent }) => {
|
|
457
|
+
const state = kanbanHandle.stateOf(agent.session);
|
|
458
|
+
return state.initialized && !state.deleted;
|
|
459
|
+
} });
|
|
460
|
+
}
|
|
461
|
+
export { Config, apply, inject, name };
|
package/package.json
CHANGED
|
@@ -1,6 +1,138 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukstei/dsh-client-kanban",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.2-rc.5.4",
|
|
4
|
+
"description": "Multi-session vertical Kanban board plugin for DeepSeek Harness with native host persistence",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./src/index.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./client": "./dist/client.js",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"cordis.patch.yml",
|
|
21
|
+
"!src/**/*.spec.*",
|
|
22
|
+
"!src/**/*.test.*",
|
|
23
|
+
"!src/**/*.stories.*",
|
|
24
|
+
"!src/**/stories",
|
|
25
|
+
"!src/**/*.e2e.*",
|
|
26
|
+
"!src/**/__snapshots__",
|
|
27
|
+
"!src/**/fixtures"
|
|
28
|
+
],
|
|
29
|
+
"dsh": {
|
|
30
|
+
"bundle": {
|
|
31
|
+
"patch": "./cordis.patch.yml"
|
|
32
|
+
},
|
|
33
|
+
"client": {
|
|
34
|
+
"platform": "web",
|
|
35
|
+
"immediately": true,
|
|
36
|
+
"inject": [
|
|
37
|
+
"@deepseek-ai/dsh-api-gateway",
|
|
38
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
39
|
+
"@deepseek-ai/dsh-api-workspace-controller",
|
|
40
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
44
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
45
|
+
"@deepseek-ai/dsh-client-ui-session",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-chat",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@deepseek-ai/cordis": "4.1.0",
|
|
53
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.5",
|
|
54
|
+
"@deepseek-ai/dsh-api-gateway": "0.2.2-rc.5",
|
|
55
|
+
"@deepseek-ai/dsh-api-remote-access": "0.2.2-rc.5",
|
|
56
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.2-rc.5",
|
|
57
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.5",
|
|
58
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.2.2-rc.5",
|
|
59
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.2-rc.5",
|
|
60
|
+
"@deepseek-ai/dsh-client-store": "0.2.2-rc.5",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.5",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.5",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.5",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.5",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.5",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.2-rc.5",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.5",
|
|
70
|
+
"@deepseek-ai/dsh-commands": "0.2.2-rc.5",
|
|
71
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.5",
|
|
72
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.5",
|
|
73
|
+
"@deepseek-ai/dsh-session-query": "0.2.2-rc.5",
|
|
74
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.5",
|
|
75
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.5",
|
|
76
|
+
"@deepseek-ai/dsh-typert-registry": "0.2.2-rc.5",
|
|
77
|
+
"@deepseek-ai/dsh-util-code-language": "0.2.2-rc.5",
|
|
78
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.2-rc.5",
|
|
79
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
80
|
+
"@ladle/react": "^5.1.1",
|
|
81
|
+
"@lukstei/dsh-client-favicon": "0.2.2-rc.5.4",
|
|
82
|
+
"@lukstei/dsh-client-notify": "0.2.2-rc.5.4",
|
|
83
|
+
"@lukstei/dsh-client-split-view": "0.2.2-rc.5.4",
|
|
84
|
+
"@types/node": "^26.0.0",
|
|
85
|
+
"@types/react": "^19.3.0",
|
|
86
|
+
"react": "^19.3.1",
|
|
87
|
+
"react-dom": "^19.3.1",
|
|
88
|
+
"tsdown": "^0.23.0",
|
|
89
|
+
"typescript": "^7.0.2",
|
|
90
|
+
"vitest": "5.0.5"
|
|
91
|
+
},
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"zod": "4.6.6"
|
|
94
|
+
},
|
|
95
|
+
"peerDependencies": {
|
|
96
|
+
"@deepseek-ai/cordis": "*",
|
|
97
|
+
"@deepseek-ai/dsh-agent": "*",
|
|
98
|
+
"@deepseek-ai/dsh-api-gateway": "*",
|
|
99
|
+
"@deepseek-ai/dsh-api-remote-access": "*",
|
|
100
|
+
"@deepseek-ai/dsh-api-session-controller": "*",
|
|
101
|
+
"@deepseek-ai/dsh-api-workspace-controller": "*",
|
|
102
|
+
"@deepseek-ai/dsh-client-store": "*",
|
|
103
|
+
"@deepseek-ai/dsh-client-ui-primitives": "*",
|
|
104
|
+
"@deepseek-ai/dsh-client-ui-session": "*",
|
|
105
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "*",
|
|
106
|
+
"@deepseek-ai/dsh-client-ui-slots": "*",
|
|
107
|
+
"@deepseek-ai/dsh-commands": "*",
|
|
108
|
+
"@deepseek-ai/dsh-session": "*",
|
|
109
|
+
"@deepseek-ai/dsh-session-query": "*",
|
|
110
|
+
"@deepseek-ai/dsh-tools": "*",
|
|
111
|
+
"@deepseek-ai/dsh-typert-protocol": "*",
|
|
112
|
+
"@deepseek-ai/dsh-typert-registry": "*",
|
|
113
|
+
"@deepseek-ai/dsh-util-workspace-path": "*",
|
|
114
|
+
"@deepseek-ai/schemastery": "*",
|
|
115
|
+
"react": "*"
|
|
116
|
+
},
|
|
117
|
+
"license": "MIT",
|
|
118
|
+
"repository": {
|
|
119
|
+
"type": "git",
|
|
120
|
+
"url": "git+https://github.com/lukstei/dsh-plugins.git",
|
|
121
|
+
"directory": "packages/dsh-client-kanban"
|
|
122
|
+
},
|
|
123
|
+
"publishConfig": {
|
|
124
|
+
"access": "public"
|
|
125
|
+
},
|
|
126
|
+
"scripts": {
|
|
127
|
+
"build": "tsdown --config tsdown.config.ts --logLevel error",
|
|
128
|
+
"dev": "tsdown --config tsdown.config.ts --watch",
|
|
129
|
+
"check": "biome check --reporter=concise .",
|
|
130
|
+
"typecheck": "tsc --noEmit",
|
|
131
|
+
"test": "pnpm run build && vitest run --reporter=minimal",
|
|
132
|
+
"test:watch": "vitest",
|
|
133
|
+
"test:update": "vitest run -u",
|
|
134
|
+
"verify": "pnpm --silent run check && pnpm --silent run build && pnpm --silent run typecheck && pnpm --silent run test",
|
|
135
|
+
"ladle": "ladle serve",
|
|
136
|
+
"ladle:build": "mkdir -p build && ladle build"
|
|
137
|
+
}
|
|
6
138
|
}
|