@taico/events 0.0.2 → 0.0.3

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/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './types/task-events.js';
2
+ export * from './types/thread-events.js';
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './types/task-events.js';
2
+ export * from './types/thread-events.js';
@@ -19,6 +19,7 @@ export declare const TaskWireEvents: {
19
19
  readonly TASK_ASSIGNED: "task.assigned";
20
20
  readonly TASK_STATUS_CHANGED: "task.status_changed";
21
21
  readonly TASK_COMMENTED: "task.commented";
22
+ readonly TASK_ARTEFACT_ADDED: "task.artefact_added";
22
23
  readonly INPUT_REQUEST_ANSWERED: "input.request.answered";
23
24
  readonly TASK_ACTIVITY: "task.activity";
24
25
  readonly TASK_ACTIVITY_POST: "task.activity.post";
@@ -53,6 +54,7 @@ export interface TaskWirePayload {
53
54
  assigneeActor: EventActor | null;
54
55
  sessionId: string;
55
56
  comments: CommentWirePayload[];
57
+ artefacts: ArtefactWirePayload[];
56
58
  inputRequests: InputRequestWirePayload[];
57
59
  tags: TagWirePayload[];
58
60
  createdByActor: EventActor;
@@ -72,6 +74,17 @@ export interface CommentWirePayload {
72
74
  content: string;
73
75
  createdAt: string;
74
76
  }
77
+ /**
78
+ * Artefact structure as sent over the wire
79
+ * Matches ArtefactResponseDto from backend
80
+ */
81
+ export interface ArtefactWirePayload {
82
+ id: string;
83
+ taskId: string;
84
+ name: string;
85
+ link: string;
86
+ createdAt: string;
87
+ }
75
88
  /**
76
89
  * Input request structure as sent over the wire
77
90
  * Matches InputRequestResponseDto from backend
@@ -146,6 +159,14 @@ export interface TaskCommentedWireEvent {
146
159
  payload: CommentWirePayload;
147
160
  actor: MinimalEventActor;
148
161
  }
162
+ /**
163
+ * Artefact added event
164
+ * Emitted when an artefact is added to a task
165
+ */
166
+ export interface TaskArtefactAddedWireEvent {
167
+ payload: ArtefactWirePayload;
168
+ actor: MinimalEventActor;
169
+ }
149
170
  /**
150
171
  * Input request answered event
151
172
  * Emitted when an input request is answered
@@ -168,7 +189,7 @@ export interface TaskActivityWireEvent {
168
189
  /**
169
190
  * Union type of all task wire events
170
191
  */
171
- export type TaskWireEvent = TaskCreatedWireEvent | TaskUpdatedWireEvent | TaskDeletedWireEvent | TaskAssignedWireEvent | TaskStatusChangedWireEvent | TaskCommentedWireEvent | InputRequestAnsweredWireEvent;
192
+ export type TaskWireEvent = TaskCreatedWireEvent | TaskUpdatedWireEvent | TaskDeletedWireEvent | TaskAssignedWireEvent | TaskStatusChangedWireEvent | TaskCommentedWireEvent | TaskArtefactAddedWireEvent | InputRequestAnsweredWireEvent;
172
193
  /**
173
194
  * Type guards for event identification
174
195
  */
@@ -19,6 +19,7 @@ export const TaskWireEvents = {
19
19
  TASK_ASSIGNED: 'task.assigned',
20
20
  TASK_STATUS_CHANGED: 'task.status_changed',
21
21
  TASK_COMMENTED: 'task.commented',
22
+ TASK_ARTEFACT_ADDED: 'task.artefact_added',
22
23
  INPUT_REQUEST_ANSWERED: 'input.request.answered',
23
24
  TASK_ACTIVITY: 'task.activity',
24
25
  TASK_ACTIVITY_POST: 'task.activity.post',
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Thread Wire Event Types for WebSocket Communication
3
+ *
4
+ * These types define the structure of events sent between backend and frontend
5
+ * via WebSocket for the Threads domain. They serve as a contract between the
6
+ * backend gateway and frontend consumers.
7
+ *
8
+ * Import these types in both backend (for emission) and frontend (for reception)
9
+ * to ensure type safety across the wire protocol.
10
+ */
11
+ import type { MinimalEventActor, TagWirePayload } from './task-events.js';
12
+ /**
13
+ * Wire event names for Threads domain
14
+ * These are the stable, external event identifiers sent over the wire protocol.
15
+ */
16
+ export declare const ThreadWireEvents: {
17
+ readonly THREAD_CREATED: "thread.created";
18
+ readonly THREAD_UPDATED: "thread.updated";
19
+ readonly THREAD_DELETED: "thread.deleted";
20
+ readonly THREAD_TITLE_UPDATED: "thread.title.updated";
21
+ readonly MESSAGE_CREATED: "thread.message.created";
22
+ readonly AGENT_ACTIVITY: "thread.agent.activity";
23
+ };
24
+ export type ThreadWireEventName = (typeof ThreadWireEvents)[keyof typeof ThreadWireEvents];
25
+ /**
26
+ * Task summary structure as sent over the wire
27
+ */
28
+ export interface TaskSummaryWirePayload {
29
+ id: string;
30
+ name: string;
31
+ status: 'NOT_STARTED' | 'IN_PROGRESS' | 'FOR_REVIEW' | 'DONE';
32
+ }
33
+ /**
34
+ * Context block summary structure as sent over the wire
35
+ */
36
+ export interface ContextBlockSummaryWirePayload {
37
+ id: string;
38
+ title: string;
39
+ }
40
+ export declare enum ActorType {
41
+ HUMAN = "human",
42
+ AGENT = "agent"
43
+ }
44
+ export interface Actor {
45
+ id: string;
46
+ type: ActorType;
47
+ slug: string;
48
+ displayName: string;
49
+ avatarUrl: string | null;
50
+ introduction: string | null;
51
+ }
52
+ /**
53
+ * Thread structure as sent over the wire
54
+ * Matches ThreadResponseDto from backend
55
+ */
56
+ export interface ThreadWirePayload {
57
+ id: string;
58
+ title: string;
59
+ createdByActorId: string;
60
+ createdByActor: Actor;
61
+ parentTaskId: string | null;
62
+ parentTask: TaskSummaryWirePayload | null;
63
+ stateBlockId: string;
64
+ stateBlock: ContextBlockSummaryWirePayload;
65
+ tags: TagWirePayload[];
66
+ tasks: TaskSummaryWirePayload[];
67
+ contextBlocks: ContextBlockSummaryWirePayload[];
68
+ participantActorIds: string[];
69
+ participants: Actor[];
70
+ rowVersion: number;
71
+ createdAt: string;
72
+ updatedAt: string;
73
+ }
74
+ /**
75
+ * Thread message structure as sent over the wire
76
+ * Matches ThreadMessageResponseDto from backend
77
+ */
78
+ export interface ThreadMessageWirePayload {
79
+ id: string;
80
+ threadId: string;
81
+ content: string;
82
+ createdByActorId: string | null;
83
+ createdByActor: Actor | null;
84
+ createdAt: string;
85
+ updatedAt: string;
86
+ }
87
+ /**
88
+ * Thread created event
89
+ * Emitted when a new thread is created
90
+ */
91
+ export interface ThreadCreatedWireEvent {
92
+ payload: ThreadWirePayload;
93
+ actor: MinimalEventActor;
94
+ }
95
+ /**
96
+ * Thread updated event
97
+ * Emitted when a thread is updated
98
+ */
99
+ export interface ThreadUpdatedWireEvent {
100
+ payload: ThreadWirePayload;
101
+ actor: MinimalEventActor;
102
+ }
103
+ /**
104
+ * Thread deleted event
105
+ * Emitted when a thread is deleted
106
+ */
107
+ export interface ThreadDeletedWireEvent {
108
+ payload: {
109
+ threadId: string;
110
+ };
111
+ actor: MinimalEventActor;
112
+ }
113
+ /**
114
+ * Thread title updated event
115
+ * Emitted when a thread title changes after initial creation.
116
+ */
117
+ export interface ThreadTitleUpdatedWireEvent {
118
+ payload: {
119
+ threadId: string;
120
+ title: string;
121
+ };
122
+ actor: MinimalEventActor;
123
+ }
124
+ /**
125
+ * Message created event
126
+ * Emitted when a message is created in a thread
127
+ */
128
+ export interface MessageCreatedWireEvent {
129
+ payload: ThreadMessageWirePayload;
130
+ actor: MinimalEventActor;
131
+ }
132
+ export type ThreadAgentActivityKind = 'thinking' | 'tool_calling';
133
+ /**
134
+ * Agent activity event
135
+ * Emitted for ephemeral assistant actions (thinking/tool calling)
136
+ */
137
+ export interface AgentActivityWireEvent {
138
+ payload: {
139
+ threadId: string;
140
+ kind: ThreadAgentActivityKind;
141
+ };
142
+ actor: MinimalEventActor;
143
+ }
144
+ /**
145
+ * Union type of all thread wire events
146
+ */
147
+ export type ThreadWireEvent = ThreadCreatedWireEvent | ThreadUpdatedWireEvent | ThreadDeletedWireEvent | ThreadTitleUpdatedWireEvent | MessageCreatedWireEvent | AgentActivityWireEvent;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Thread Wire Event Types for WebSocket Communication
3
+ *
4
+ * These types define the structure of events sent between backend and frontend
5
+ * via WebSocket for the Threads domain. They serve as a contract between the
6
+ * backend gateway and frontend consumers.
7
+ *
8
+ * Import these types in both backend (for emission) and frontend (for reception)
9
+ * to ensure type safety across the wire protocol.
10
+ */
11
+ /**
12
+ * Wire event names for Threads domain
13
+ * These are the stable, external event identifiers sent over the wire protocol.
14
+ */
15
+ export const ThreadWireEvents = {
16
+ THREAD_CREATED: 'thread.created',
17
+ THREAD_UPDATED: 'thread.updated',
18
+ THREAD_DELETED: 'thread.deleted',
19
+ THREAD_TITLE_UPDATED: 'thread.title.updated',
20
+ MESSAGE_CREATED: 'thread.message.created',
21
+ AGENT_ACTIVITY: 'thread.agent.activity',
22
+ };
23
+ export var ActorType;
24
+ (function (ActorType) {
25
+ ActorType["HUMAN"] = "human";
26
+ ActorType["AGENT"] = "agent";
27
+ })(ActorType || (ActorType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taico/events",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -19,7 +19,9 @@
19
19
  "./package.json": "./package.json"
20
20
  },
21
21
  "scripts": {
22
- "build": "tsc -p tsconfig.build.json"
22
+ "build": "tsc -p tsconfig.build.json",
23
+ "pack": "npm run build && npm pack",
24
+ "release": "npm run build && npm publish --access public"
23
25
  },
24
26
  "devDependencies": {
25
27
  "typescript": "^5.6.3"