@crewx/sdk 0.9.0-rc.168 → 0.9.0-rc.169

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.
@@ -0,0 +1,24 @@
1
+ import type { TaskStatus } from './task-status.js';
2
+ export declare const UNREAD_PREVIEW_MAX_LENGTH = 120;
3
+ export interface PublicTaskAnswerInput {
4
+ result: string | null;
5
+ status: string;
6
+ error: string | null;
7
+ metadata: string | null;
8
+ }
9
+ export interface UnreadReplyCandidate {
10
+ id: string;
11
+ threadId: string;
12
+ completedAt: string;
13
+ status: TaskStatus;
14
+ result: string | null;
15
+ error: string | null;
16
+ metadata: string | null;
17
+ }
18
+ export interface UnreadReplySummary {
19
+ unreadCount: number;
20
+ unreadPreview: string | null;
21
+ }
22
+ export declare function publicTaskAnswerContent(task: PublicTaskAnswerInput): string;
23
+ export declare function toPreviewPlainText(content: string, maxLength?: number): string;
24
+ export declare function summarizeUnreadReplies(candidates: readonly UnreadReplyCandidate[]): UnreadReplySummary;
@@ -3,6 +3,7 @@ import type { DrizzleHandle } from './db.js';
3
3
  import { RepositoryError } from './errors.js';
4
4
  import { threads } from '../schema/index.js';
5
5
  import { type TaskStatus } from './task-status.js';
6
+ import type { UnreadReplyCandidate } from './public-task-answer.js';
6
7
  import type { ThreadOriginRow } from './thread-origin-verdict.js';
7
8
  import type { TaskRow, TaskListRow } from './task.repository.js';
8
9
  export type { ThreadOriginRow } from './thread-origin-verdict.js';
@@ -32,6 +33,10 @@ export type CreateAppLaunchThreadResult = {
32
33
  } | {
33
34
  status: 'conflict';
34
35
  };
36
+ export interface UnreadReplyWatermark {
37
+ threadId: string;
38
+ readThroughAt: string | null;
39
+ }
35
40
  export interface TaskDescendantSummary {
36
41
  total: number;
37
42
  running: number;
@@ -127,6 +132,8 @@ export declare class ThreadRepository extends BaseSqliteRepository {
127
132
  };
128
133
  };
129
134
  getDescendantSummaryByTaskId(threadId: string, workspaceId?: string): Record<string, TaskDescendantSummary>;
135
+ listUnreadReplyCandidates(watermarks: readonly UnreadReplyWatermark[], workspaceId?: string): Map<string, UnreadReplyCandidate[]>;
136
+ private unreadReplyCandidatesQuery;
130
137
  getThreadTaskStatusBatch(threadIds: string[], workspaceId?: string): {
131
138
  tasksByThread: Map<string, TaskListRow[]>;
132
139
  descendantSummaryByTaskId: Record<string, TaskDescendantSummary>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/sdk",
3
- "version": "0.9.0-rc.168",
3
+ "version": "0.9.0-rc.169",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"