@brivioio/api-server-types 7.46.0 → 7.47.0

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
@@ -6,6 +6,7 @@ export * from './candidateEmailMessages.types';
6
6
  export * from './candidateSearchResults.types';
7
7
  export * from './jobRoleChatHistory.types';
8
8
  export * from './jobRoles.types';
9
+ export * from './liveActivity.types';
9
10
  export * from './meetingBots.types';
10
11
  export * from './organizationDomains.types';
11
12
  export * from './organizationUsers.types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './candidateEmailMessages.types';
6
6
  export * from './candidateSearchResults.types';
7
7
  export * from './jobRoleChatHistory.types';
8
8
  export * from './jobRoles.types';
9
+ export * from './liveActivity.types';
9
10
  export * from './meetingBots.types';
10
11
  export * from './organizationDomains.types';
11
12
  export * from './organizationUsers.types';
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Wire DTOs for the super-admin "Live Activity" feature: a real-time view of
3
+ * every agent run executing in this (single) process, plus the graceful
4
+ * drain / kill-switch lifecycle.
5
+ *
6
+ * These are pure transport shapes (serialized over SSE / JSON), so all
7
+ * timestamps are ISO strings and all ids are strings — there are no mongoose
8
+ * types here on purpose.
9
+ */
10
+ /** The distinct kinds of Agent-SDK work that can run in the process. */
11
+ export declare enum EAgentRunKind {
12
+ JOB_ROLE_CHAT = "JOB_ROLE_CHAT",
13
+ CANDIDATE_SOURCING = "CANDIDATE_SOURCING",
14
+ CANDIDATE_OUTREACH = "CANDIDATE_OUTREACH",
15
+ CANDIDATE_EVALUATION = "CANDIDATE_EVALUATION",
16
+ ORGANIZATION_DEEP_PROFILE = "ORGANIZATION_DEEP_PROFILE",
17
+ SLACK_CHANNEL_SIGNALS = "SLACK_CHANNEL_SIGNALS"
18
+ }
19
+ /** Severity for a single line in the live activity log. */
20
+ export declare enum EActivityLogLevel {
21
+ INFO = "INFO",
22
+ SUCCESS = "SUCCESS",
23
+ WARN = "WARN",
24
+ ERROR = "ERROR"
25
+ }
26
+ /** Whether the process is serving normally or draining toward shutdown. */
27
+ export declare enum EServerLifecycle {
28
+ RUNNING = "RUNNING",
29
+ DRAINING = "DRAINING"
30
+ }
31
+ /**
32
+ * A subagent currently executing inside a parent run. Detected from the SDK
33
+ * stream via `Task`/`Agent` tool-use blocks; closed when the matching
34
+ * tool_result arrives.
35
+ */
36
+ export interface IActiveSubagent {
37
+ toolUseId: string;
38
+ subagentType: string;
39
+ description: string;
40
+ startedAt: string;
41
+ /** Last tool the subagent invoked, surfaced as a human line. */
42
+ currentActivity: string | null;
43
+ }
44
+ /** Optional kind-specific live metrics shown on a run card. */
45
+ export interface IAgentRunMetrics {
46
+ searchesRun?: number;
47
+ poolSize?: number;
48
+ shortlistSize?: number;
49
+ emailsSent?: number;
50
+ }
51
+ /** A single agent run that is currently in flight. */
52
+ export interface IActiveAgentRun {
53
+ runId: string;
54
+ kind: EAgentRunKind;
55
+ organizationId: string | null;
56
+ organizationName: string | null;
57
+ jobRoleId: string | null;
58
+ jobRoleTitle: string | null;
59
+ /** Short human label, e.g. "Sourcing · Senior Backend Engineer". */
60
+ label: string;
61
+ /** Live one-line detail of what the run is doing right now. */
62
+ detail: string;
63
+ startedAt: string;
64
+ lastActivityAt: string;
65
+ toolCallCount: number;
66
+ activeSubagents: IActiveSubagent[];
67
+ metrics: IAgentRunMetrics;
68
+ }
69
+ /** A single timestamped line in the rolling activity log. */
70
+ export interface IActivityLogEntry {
71
+ id: string;
72
+ at: string;
73
+ level: EActivityLogLevel;
74
+ kind: EAgentRunKind | null;
75
+ runId: string | null;
76
+ organizationName: string | null;
77
+ jobRoleTitle: string | null;
78
+ message: string;
79
+ }
80
+ /** State of an in-progress drain (kill switch). Null when serving normally. */
81
+ export interface IDrainState {
82
+ startedAt: string;
83
+ initiatedByEmail: string | null;
84
+ /** How many runs were in flight when drain began. */
85
+ activeRunsAtStart: number;
86
+ /** How many runs are still in flight right now. */
87
+ activeRunsRemaining: number;
88
+ /** True once a force-quit has been requested (don't wait for runs). */
89
+ forceRequested: boolean;
90
+ /** True once the process teardown has actually been triggered. */
91
+ exiting: boolean;
92
+ }
93
+ /** Full point-in-time picture, sent on connect and on demand. */
94
+ export interface ILiveActivitySnapshot {
95
+ serverLifecycle: EServerLifecycle;
96
+ drain: IDrainState | null;
97
+ activeRuns: IActiveAgentRun[];
98
+ recentLog: IActivityLogEntry[];
99
+ /** The count that gates the deploy-safety banner. */
100
+ activeRunCount: number;
101
+ generatedAt: string;
102
+ }
103
+ /** SSE envelope pushed to the dashboard. */
104
+ export type TLiveActivityStreamEvent = {
105
+ type: 'snapshot';
106
+ payload: ILiveActivitySnapshot;
107
+ } | {
108
+ type: 'run_started';
109
+ payload: IActiveAgentRun;
110
+ } | {
111
+ type: 'run_updated';
112
+ payload: IActiveAgentRun;
113
+ } | {
114
+ type: 'run_ended';
115
+ payload: {
116
+ runId: string;
117
+ };
118
+ } | {
119
+ type: 'log';
120
+ payload: IActivityLogEntry;
121
+ } | {
122
+ type: 'drain';
123
+ payload: {
124
+ lifecycle: EServerLifecycle;
125
+ drain: IDrainState | null;
126
+ };
127
+ } | {
128
+ type: 'heartbeat';
129
+ payload: {
130
+ at: string;
131
+ };
132
+ };
133
+ //# sourceMappingURL=liveActivity.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveActivity.types.d.ts","sourceRoot":"","sources":["../src/liveActivity.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wEAAwE;AACxE,oBAAY,aAAa;IACvB,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,yBAAyB,8BAA8B;IACvD,qBAAqB,0BAA0B;CAChD;AAED,2DAA2D;AAC3D,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;CA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AC;QAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;KAAE,CAAA;CAAE,GACtF;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Wire DTOs for the super-admin "Live Activity" feature: a real-time view of
3
+ * every agent run executing in this (single) process, plus the graceful
4
+ * drain / kill-switch lifecycle.
5
+ *
6
+ * These are pure transport shapes (serialized over SSE / JSON), so all
7
+ * timestamps are ISO strings and all ids are strings — there are no mongoose
8
+ * types here on purpose.
9
+ */
10
+ /** The distinct kinds of Agent-SDK work that can run in the process. */
11
+ export var EAgentRunKind;
12
+ (function (EAgentRunKind) {
13
+ EAgentRunKind["JOB_ROLE_CHAT"] = "JOB_ROLE_CHAT";
14
+ EAgentRunKind["CANDIDATE_SOURCING"] = "CANDIDATE_SOURCING";
15
+ EAgentRunKind["CANDIDATE_OUTREACH"] = "CANDIDATE_OUTREACH";
16
+ EAgentRunKind["CANDIDATE_EVALUATION"] = "CANDIDATE_EVALUATION";
17
+ EAgentRunKind["ORGANIZATION_DEEP_PROFILE"] = "ORGANIZATION_DEEP_PROFILE";
18
+ EAgentRunKind["SLACK_CHANNEL_SIGNALS"] = "SLACK_CHANNEL_SIGNALS";
19
+ })(EAgentRunKind || (EAgentRunKind = {}));
20
+ /** Severity for a single line in the live activity log. */
21
+ export var EActivityLogLevel;
22
+ (function (EActivityLogLevel) {
23
+ EActivityLogLevel["INFO"] = "INFO";
24
+ EActivityLogLevel["SUCCESS"] = "SUCCESS";
25
+ EActivityLogLevel["WARN"] = "WARN";
26
+ EActivityLogLevel["ERROR"] = "ERROR";
27
+ })(EActivityLogLevel || (EActivityLogLevel = {}));
28
+ /** Whether the process is serving normally or draining toward shutdown. */
29
+ export var EServerLifecycle;
30
+ (function (EServerLifecycle) {
31
+ EServerLifecycle["RUNNING"] = "RUNNING";
32
+ EServerLifecycle["DRAINING"] = "DRAINING";
33
+ })(EServerLifecycle || (EServerLifecycle = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brivioio/api-server-types",
3
- "version": "7.46.0",
3
+ "version": "7.47.0",
4
4
  "description": "TypeScript type definitions for Brivio API Server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",