@wrongstack/tools 0.308.0 → 0.308.2

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/plan.js CHANGED
@@ -223,7 +223,7 @@ function broadcastTodoUpdate(context, todos) {
223
223
  const mailbox = getSharedProjectMailbox(projectDir);
224
224
  void mailbox.send({
225
225
  from: context.agentId,
226
- to: "*",
226
+ to: `@session:${sessionId}`,
227
227
  type: "status",
228
228
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
229
229
  body: JSON.stringify({
@@ -252,13 +252,17 @@ Reassess your current plan before continuing; do not rely on the initial todo sn
252
252
  state.appendMessage({ role: "user", content: [{ type: "text", text }] });
253
253
  }
254
254
  }
255
- function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2) {
255
+ function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2, options = {}) {
256
256
  const metaKanban = context.meta["kanban"];
257
257
  const metaBoardId = metaKanban && typeof metaKanban === "object" ? metaKanban["boardId"] : void 0;
258
258
  const activeBoardId2 = context.currentKanbanBoardId ?? (typeof metaBoardId === "string" ? metaBoardId : void 0);
259
259
  if (!activeBoardId2 || board.id !== activeBoardId2 || board.lifecycle?.mode !== "managed") {
260
260
  return [...context.todos];
261
261
  }
262
+ const ownerSessionId = options.sessionOwnerFromTags?.(board.tags);
263
+ if (ownerSessionId && ownerSessionId !== (context.session?.id ?? "")) {
264
+ return [...context.todos];
265
+ }
262
266
  const projectedTodos = orderTasksForTodos(
263
267
  board,
264
268
  board.tasks.filter(
@@ -332,6 +336,10 @@ function sessionBoardTitle(sessionId) {
332
336
  function sessionBoardTags(sessionId) {
333
337
  return ["session", SESSION_BOARD_TAG, sessionTag(sessionId)];
334
338
  }
339
+ function sessionIdFromTags(tags) {
340
+ const tag = tags?.find((candidate) => candidate.startsWith("session:"));
341
+ return tag?.slice("session:".length) || null;
342
+ }
335
343
  function sameColumns(columns) {
336
344
  return columns.length === SESSION_KANBAN_COLUMNS.length && columns.every((column, index) => column.id === SESSION_KANBAN_COLUMNS[index]?.id);
337
345
  }
@@ -511,7 +519,9 @@ function mirrorSessionTodosToKanban(projectRoot, todos, sessionId) {
511
519
  );
512
520
  }
513
521
  function applyManagedKanbanBoardToTodos2(context, board) {
514
- return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors);
522
+ return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors, {
523
+ sessionOwnerFromTags: sessionIdFromTags
524
+ });
515
525
  }
516
526
 
517
527
  // src/todo.ts
package/dist/pwsh.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { Tool } from '@wrongstack/core/types';
2
+ export interface PwshInput {
3
+ command: string;
4
+ workdir?: string | undefined;
5
+ timeout_ms?: number | undefined;
6
+ run_in_background?: boolean | undefined;
7
+ background?: boolean | undefined;
8
+ sandbox_permissions?: string | undefined;
9
+ justification?: string | undefined;
10
+ }
11
+ export interface PwshOutput {
12
+ output: string;
13
+ exit_code: number | null;
14
+ timed_out: boolean;
15
+ pid?: number | null | undefined;
16
+ job_id?: string | undefined;
17
+ error?: string | undefined;
18
+ }
19
+ export declare const PWSH_TOOL_DESCRIPTION: string;
20
+ export declare const PWSH_TOOL_USAGE_HINT: string;
21
+ export declare const pwshTool: Tool<PwshInput, PwshOutput>;
22
+ //# sourceMappingURL=pwsh.d.ts.map
@@ -24,7 +24,10 @@ export declare function applySessionKanbanBoardToTodos(context: Context, board:
24
24
  hasInFlightTodoMirror: (projectRoot: string | undefined, sessionId: string) => boolean;
25
25
  suppressedTodoMirrors: WeakSet<Context>;
26
26
  }): TodoItem[];
27
- export declare function applyManagedKanbanBoardToTodos(context: Context, board: KanbanBoard, suppressedTodoMirrors: WeakSet<Context>): TodoItem[];
27
+ export declare function applyManagedKanbanBoardToTodos(context: Context, board: KanbanBoard, suppressedTodoMirrors: WeakSet<Context>, options?: {
28
+ /** Extracts the owning session id from board tags (`session:<id>`). */
29
+ sessionOwnerFromTags?: ((tags: readonly string[] | undefined) => string | null) | undefined;
30
+ }): TodoItem[];
28
31
  export declare function applySessionKanbanTaskToSource(context: Context, task: KanbanTask, suppressedTodoMirrors: WeakSet<Context>, options?: {
29
32
  remove?: boolean | undefined;
30
33
  }): Promise<SessionKanbanSourceUpdate>;
@@ -210,7 +210,7 @@ function broadcastTodoUpdate(context, todos) {
210
210
  const mailbox = getSharedProjectMailbox(projectDir);
211
211
  void mailbox.send({
212
212
  from: context.agentId,
213
- to: "*",
213
+ to: `@session:${sessionId}`,
214
214
  type: "status",
215
215
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
216
216
  body: JSON.stringify({
@@ -268,13 +268,17 @@ function applySessionKanbanBoardToTodos(context, board, options) {
268
268
  broadcastTodoUpdate(context, context.todos);
269
269
  return [...context.todos];
270
270
  }
271
- function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2) {
271
+ function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2, options = {}) {
272
272
  const metaKanban = context.meta["kanban"];
273
273
  const metaBoardId = metaKanban && typeof metaKanban === "object" ? metaKanban["boardId"] : void 0;
274
274
  const activeBoardId = context.currentKanbanBoardId ?? (typeof metaBoardId === "string" ? metaBoardId : void 0);
275
275
  if (!activeBoardId || board.id !== activeBoardId || board.lifecycle?.mode !== "managed") {
276
276
  return [...context.todos];
277
277
  }
278
+ const ownerSessionId = options.sessionOwnerFromTags?.(board.tags);
279
+ if (ownerSessionId && ownerSessionId !== (context.session?.id ?? "")) {
280
+ return [...context.todos];
281
+ }
278
282
  const projectedTodos = orderTasksForTodos(
279
283
  board,
280
284
  board.tasks.filter(
@@ -955,7 +959,9 @@ function applySessionKanbanBoardToTodos2(context, board) {
955
959
  });
956
960
  }
957
961
  function applyManagedKanbanBoardToTodos2(context, board) {
958
- return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors);
962
+ return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors, {
963
+ sessionOwnerFromTags: sessionIdFromTags
964
+ });
959
965
  }
960
966
  function applySessionKanbanTaskToSource2(context, task, options = {}) {
961
967
  return applySessionKanbanTaskToSource(context, task, suppressedTodoMirrors, options);
package/dist/task.js CHANGED
@@ -183,7 +183,7 @@ function broadcastTodoUpdate(context, todos) {
183
183
  const mailbox = getSharedProjectMailbox(projectDir);
184
184
  void mailbox.send({
185
185
  from: context.agentId,
186
- to: "*",
186
+ to: `@session:${sessionId}`,
187
187
  type: "status",
188
188
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
189
189
  body: JSON.stringify({
@@ -212,13 +212,17 @@ Reassess your current plan before continuing; do not rely on the initial todo sn
212
212
  state.appendMessage({ role: "user", content: [{ type: "text", text }] });
213
213
  }
214
214
  }
215
- function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2) {
215
+ function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2, options = {}) {
216
216
  const metaKanban = context.meta["kanban"];
217
217
  const metaBoardId = metaKanban && typeof metaKanban === "object" ? metaKanban["boardId"] : void 0;
218
218
  const activeBoardId2 = context.currentKanbanBoardId ?? (typeof metaBoardId === "string" ? metaBoardId : void 0);
219
219
  if (!activeBoardId2 || board.id !== activeBoardId2 || board.lifecycle?.mode !== "managed") {
220
220
  return [...context.todos];
221
221
  }
222
+ const ownerSessionId = options.sessionOwnerFromTags?.(board.tags);
223
+ if (ownerSessionId && ownerSessionId !== (context.session?.id ?? "")) {
224
+ return [...context.todos];
225
+ }
222
226
  const projectedTodos = orderTasksForTodos(
223
227
  board,
224
228
  board.tasks.filter(
@@ -292,6 +296,10 @@ function sessionBoardTitle(sessionId) {
292
296
  function sessionBoardTags(sessionId) {
293
297
  return ["session", SESSION_BOARD_TAG, sessionTag(sessionId)];
294
298
  }
299
+ function sessionIdFromTags(tags) {
300
+ const tag = tags?.find((candidate) => candidate.startsWith("session:"));
301
+ return tag?.slice("session:".length) || null;
302
+ }
295
303
  function sameColumns(columns) {
296
304
  return columns.length === SESSION_KANBAN_COLUMNS.length && columns.every((column, index) => column.id === SESSION_KANBAN_COLUMNS[index]?.id);
297
305
  }
@@ -471,7 +479,9 @@ function mirrorSessionTasksToKanban(projectRoot, tasks, sessionId) {
471
479
  );
472
480
  }
473
481
  function applyManagedKanbanBoardToTodos2(context, board) {
474
- return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors);
482
+ return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors, {
483
+ sessionOwnerFromTags: sessionIdFromTags
484
+ });
475
485
  }
476
486
 
477
487
  // src/todo.ts
package/dist/todo.js CHANGED
@@ -332,7 +332,7 @@ function broadcastTodoUpdate(context, todos) {
332
332
  const mailbox = getSharedProjectMailbox(projectDir);
333
333
  void mailbox.send({
334
334
  from: context.agentId,
335
- to: "*",
335
+ to: `@session:${sessionId}`,
336
336
  type: "status",
337
337
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
338
338
  body: JSON.stringify({
@@ -361,13 +361,17 @@ Reassess your current plan before continuing; do not rely on the initial todo sn
361
361
  state.appendMessage({ role: "user", content: [{ type: "text", text }] });
362
362
  }
363
363
  }
364
- function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2) {
364
+ function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2, options = {}) {
365
365
  const metaKanban = context.meta["kanban"];
366
366
  const metaBoardId = metaKanban && typeof metaKanban === "object" ? metaKanban["boardId"] : void 0;
367
367
  const activeBoardId2 = context.currentKanbanBoardId ?? (typeof metaBoardId === "string" ? metaBoardId : void 0);
368
368
  if (!activeBoardId2 || board.id !== activeBoardId2 || board.lifecycle?.mode !== "managed") {
369
369
  return [...context.todos];
370
370
  }
371
+ const ownerSessionId = options.sessionOwnerFromTags?.(board.tags);
372
+ if (ownerSessionId && ownerSessionId !== (context.session?.id ?? "")) {
373
+ return [...context.todos];
374
+ }
371
375
  const projectedTodos = orderTasksForTodos(
372
376
  board,
373
377
  board.tasks.filter(
@@ -441,6 +445,10 @@ function sessionBoardTitle(sessionId) {
441
445
  function sessionBoardTags(sessionId) {
442
446
  return ["session", SESSION_BOARD_TAG, sessionTag(sessionId)];
443
447
  }
448
+ function sessionIdFromTags(tags) {
449
+ const tag = tags?.find((candidate) => candidate.startsWith("session:"));
450
+ return tag?.slice("session:".length) || null;
451
+ }
444
452
  function sameColumns(columns) {
445
453
  return columns.length === SESSION_KANBAN_COLUMNS.length && columns.every((column, index) => column.id === SESSION_KANBAN_COLUMNS[index]?.id);
446
454
  }
@@ -612,7 +620,9 @@ function mirrorSessionTodosToKanban(projectRoot, todos, sessionId) {
612
620
  );
613
621
  }
614
622
  function applyManagedKanbanBoardToTodos2(context, board) {
615
- return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors);
623
+ return applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors, {
624
+ sessionOwnerFromTags: sessionIdFromTags
625
+ });
616
626
  }
617
627
 
618
628
  // src/kanban-board-actions.ts