@pipeline-moe/client-core 0.1.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/api.d.ts +238 -0
- package/dist/api.js +216 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/state.d.ts +78 -0
- package/dist/state.js +300 -0
- package/dist/store.d.ts +88 -0
- package/dist/store.js +279 -0
- package/dist/types.d.ts +208 -0
- package/dist/types.js +1 -0
- package/package.json +44 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export interface RosterItem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
color: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
tools: string[];
|
|
7
|
+
active: boolean;
|
|
8
|
+
status: "idle" | "active" | "thinking" | "working" | "compacting" | "retrying";
|
|
9
|
+
/** Retry metadata, present when status is "retrying". */
|
|
10
|
+
retry?: {
|
|
11
|
+
attempt: number;
|
|
12
|
+
maxAttempts: number;
|
|
13
|
+
delayMs: number;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
};
|
|
16
|
+
/** Per-agent model "provider/id", or undefined when on the default. */
|
|
17
|
+
model?: string;
|
|
18
|
+
/** Per-agent thinking level, or undefined when inheriting from global config. */
|
|
19
|
+
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
20
|
+
/** May run concurrently with adjacent parallel-flagged agents. */
|
|
21
|
+
parallel: boolean;
|
|
22
|
+
/** Context token usage — populated after each turn via SSE status event. */
|
|
23
|
+
contextUsage?: {
|
|
24
|
+
tokens: number | null;
|
|
25
|
+
contextWindow: number;
|
|
26
|
+
percent: number | null;
|
|
27
|
+
};
|
|
28
|
+
/** Session stats — populated after each turn via SSE status event. */
|
|
29
|
+
sessionStats?: {
|
|
30
|
+
userMessages: number;
|
|
31
|
+
assistantMessages: number;
|
|
32
|
+
toolCalls: number;
|
|
33
|
+
totalMessages: number;
|
|
34
|
+
tokens: {
|
|
35
|
+
input: number;
|
|
36
|
+
output: number;
|
|
37
|
+
cacheRead: number;
|
|
38
|
+
cacheWrite: number;
|
|
39
|
+
total: number;
|
|
40
|
+
};
|
|
41
|
+
cost: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** A model offered for per-agent selection (GET /api/models). */
|
|
45
|
+
export interface ModelInfo {
|
|
46
|
+
provider: string;
|
|
47
|
+
id: string;
|
|
48
|
+
ref: string;
|
|
49
|
+
name: string;
|
|
50
|
+
local: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface ToolActivity {
|
|
53
|
+
toolCallId: string;
|
|
54
|
+
toolName: string;
|
|
55
|
+
args?: unknown;
|
|
56
|
+
status: "running" | "ok" | "error";
|
|
57
|
+
result?: string;
|
|
58
|
+
ts: number;
|
|
59
|
+
}
|
|
60
|
+
export interface Message {
|
|
61
|
+
index: number;
|
|
62
|
+
author: string;
|
|
63
|
+
authorName: string;
|
|
64
|
+
text: string;
|
|
65
|
+
ts: number;
|
|
66
|
+
activity?: ToolActivity[];
|
|
67
|
+
/** Reasoning trace (agent messages only, persisted after turn completion). */
|
|
68
|
+
reasoning?: string;
|
|
69
|
+
/** Image paths (workspace-relative, e.g. "media/abc.png"). */
|
|
70
|
+
images?: string[];
|
|
71
|
+
/** If this message is a question posed to the user via ask_user. */
|
|
72
|
+
question?: string;
|
|
73
|
+
}
|
|
74
|
+
/** Full persona, as returned by GET /api/participants/:id (for the edit form). */
|
|
75
|
+
export interface PersonaDetail {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
color: string;
|
|
79
|
+
icon: string;
|
|
80
|
+
tools: string[];
|
|
81
|
+
systemPrompt: string;
|
|
82
|
+
model?: string;
|
|
83
|
+
/** Per-agent thinking level, or undefined when inheriting from global config. */
|
|
84
|
+
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
85
|
+
/** Thinking levels supported by the current model (from pi session). */
|
|
86
|
+
availableThinkingLevels?: string[];
|
|
87
|
+
/** Custom instructions for context compaction. */
|
|
88
|
+
compactionInstructions?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface Receipt {
|
|
91
|
+
participantId: string;
|
|
92
|
+
created: string[];
|
|
93
|
+
modified: string[];
|
|
94
|
+
deleted: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface WorkspaceFile {
|
|
97
|
+
path: string;
|
|
98
|
+
size: number;
|
|
99
|
+
}
|
|
100
|
+
export interface Notice {
|
|
101
|
+
id: number;
|
|
102
|
+
msg: string;
|
|
103
|
+
level: "info" | "error";
|
|
104
|
+
}
|
|
105
|
+
export interface ConversationMeta {
|
|
106
|
+
id: string;
|
|
107
|
+
title: string;
|
|
108
|
+
createdAt: number;
|
|
109
|
+
updatedAt: number;
|
|
110
|
+
messageCount: number;
|
|
111
|
+
}
|
|
112
|
+
/** A saved room preset. */
|
|
113
|
+
export interface PresetPersona {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
color: string;
|
|
117
|
+
icon: string;
|
|
118
|
+
tools: string[];
|
|
119
|
+
systemPrompt?: string;
|
|
120
|
+
model?: string;
|
|
121
|
+
thinkingLevel?: string;
|
|
122
|
+
active: boolean;
|
|
123
|
+
parallel?: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface PresetFile {
|
|
126
|
+
name: string;
|
|
127
|
+
personas: PresetPersona[];
|
|
128
|
+
}
|
|
129
|
+
/** How agent→agent handoffs are routed within a room. */
|
|
130
|
+
export type RoutingMode = "auto" | "semi" | "manual";
|
|
131
|
+
/** A proposed handoff awaiting human approval (semi/manual routing). */
|
|
132
|
+
export interface RouteProposal {
|
|
133
|
+
from: string;
|
|
134
|
+
target: string;
|
|
135
|
+
targetName: string;
|
|
136
|
+
}
|
|
137
|
+
/** A human decision on a proposed handoff. */
|
|
138
|
+
export interface RouteDecision {
|
|
139
|
+
action: "approve" | "redirect" | "drop";
|
|
140
|
+
targetIds?: string[];
|
|
141
|
+
}
|
|
142
|
+
/** Room settings payload (GET/PATCH /settings). */
|
|
143
|
+
export interface RoomSettings {
|
|
144
|
+
chaining: boolean;
|
|
145
|
+
routingMode: RoutingMode;
|
|
146
|
+
defaultAgent: string | null;
|
|
147
|
+
fallbackAgent?: string | null;
|
|
148
|
+
maxChainHops: number;
|
|
149
|
+
circuitBreaker: boolean;
|
|
150
|
+
defaultThinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
151
|
+
allowCloud: boolean;
|
|
152
|
+
compactionReserveTokens: number;
|
|
153
|
+
maxRooms: number;
|
|
154
|
+
pendingRoute: {
|
|
155
|
+
proposals: RouteProposal[];
|
|
156
|
+
} | null;
|
|
157
|
+
}
|
|
158
|
+
/** A built-in persona template (GET /api/persona-templates) for the Add-agent picker. */
|
|
159
|
+
export interface PersonaTemplate {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
color: string;
|
|
163
|
+
icon: string;
|
|
164
|
+
tools: string[];
|
|
165
|
+
model?: string;
|
|
166
|
+
}
|
|
167
|
+
/** A room listed by GET /api/rooms. */
|
|
168
|
+
export interface RoomSummary {
|
|
169
|
+
roomId: string;
|
|
170
|
+
name: string;
|
|
171
|
+
participantCount: number;
|
|
172
|
+
goalStatus: string;
|
|
173
|
+
goalText: string | null;
|
|
174
|
+
}
|
|
175
|
+
/** A closed room with on-disk data, listed by GET /api/rooms/resumable. */
|
|
176
|
+
export interface ResumableRoom {
|
|
177
|
+
roomId: string;
|
|
178
|
+
name: string;
|
|
179
|
+
workspaceDir?: string;
|
|
180
|
+
lastActivity: number;
|
|
181
|
+
messageCount: number;
|
|
182
|
+
hasMeta: boolean;
|
|
183
|
+
}
|
|
184
|
+
/** Live state of an in-flight OAuth device/auth flow (from oauth_progress SSE). */
|
|
185
|
+
export interface OAuthProgress {
|
|
186
|
+
provider: string;
|
|
187
|
+
status: "device_code" | "auth_url" | "progress" | "success" | "error";
|
|
188
|
+
verificationUri?: string;
|
|
189
|
+
userCode?: string;
|
|
190
|
+
url?: string;
|
|
191
|
+
instructions?: string;
|
|
192
|
+
message?: string;
|
|
193
|
+
}
|
|
194
|
+
/** A provider listed by GET /api/providers. */
|
|
195
|
+
export interface ProviderInfo {
|
|
196
|
+
name: string;
|
|
197
|
+
displayName: string;
|
|
198
|
+
configured: boolean;
|
|
199
|
+
source?: string;
|
|
200
|
+
label?: string;
|
|
201
|
+
explicitlyEnabled: boolean;
|
|
202
|
+
/** Whether this provider supports OAuth login (e.g. Anthropic, GitHub). */
|
|
203
|
+
supportsOAuth?: boolean;
|
|
204
|
+
models: Array<{
|
|
205
|
+
id: string;
|
|
206
|
+
name: string;
|
|
207
|
+
}>;
|
|
208
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeline-moe/client-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Framework-agnostic client for a pipeline-moe server: typed REST surface, pure SSE reducer, and an effectful room store. Consumed by the web and terminal clients.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/DAXZEIT/pipeline-moe.git",
|
|
10
|
+
"directory": "packages/client-core"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"pipeline-moe",
|
|
14
|
+
"multi-agent",
|
|
15
|
+
"sse",
|
|
16
|
+
"client"
|
|
17
|
+
],
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./types": {
|
|
26
|
+
"types": "./dist/types.d.ts",
|
|
27
|
+
"default": "./dist/types.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -p tsconfig.build.json",
|
|
38
|
+
"prepare": "tsc -p tsconfig.build.json",
|
|
39
|
+
"typecheck": "tsc --noEmit"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"typescript": "^5.6.0"
|
|
43
|
+
}
|
|
44
|
+
}
|