@parall/sdk 1.30.0 → 1.32.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/client.d.ts +59 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +165 -22
- package/dist/constants.d.ts +31 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +242 -38
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +241 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/ws.d.ts +3 -3
- package/dist/ws.d.ts.map +1 -1
- package/dist/ws.js +12 -7
- package/package.json +1 -1
- package/src/client.ts +805 -170
- package/src/constants.ts +307 -86
- package/src/index.ts +7 -1
- package/src/types.ts +358 -25
- package/src/ws.ts +26 -11
package/src/constants.ts
CHANGED
|
@@ -4,59 +4,235 @@ export const API_BASE = '/api/v1';
|
|
|
4
4
|
// Wiki-service base path (served by wiki-service, routed via LB path rules)
|
|
5
5
|
export const WIKI_BASE = '/wiki/v1';
|
|
6
6
|
|
|
7
|
+
// Clip-service base path (served by clip-service, routed via LB path rules)
|
|
8
|
+
export const CLIP_BASE = '/clip/v1';
|
|
9
|
+
|
|
7
10
|
// LLM model catalog — mirrors server/pkg/llmproxy/models.go DefaultModels.
|
|
8
11
|
// SSOT is the Go side; keep this list in sync when models change. `provider`
|
|
9
12
|
// is used by clients to filter runtime-specific pickers. `runtime_names` is
|
|
10
13
|
// included for catalog completeness and agent runtime delivery; product UI
|
|
11
14
|
// should continue to display canonical model IDs/names.
|
|
12
15
|
export const PLATFORM_MODELS = [
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
{
|
|
17
|
+
id: 'anthropic/claude-opus-4.7',
|
|
18
|
+
name: 'Claude Opus 4.7',
|
|
19
|
+
provider: 'anthropic',
|
|
20
|
+
effortLevels: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
21
|
+
runtime_names: { 'claude-code': 'claude-opus-4-7' },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'anthropic/claude-opus-4.6',
|
|
25
|
+
name: 'Claude Opus 4.6',
|
|
26
|
+
provider: 'anthropic',
|
|
27
|
+
effortLevels: ['low', 'medium', 'high', 'max'],
|
|
28
|
+
runtime_names: { 'claude-code': 'claude-opus-4-6' },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'anthropic/claude-sonnet-4.6',
|
|
32
|
+
name: 'Claude Sonnet 4.6',
|
|
33
|
+
provider: 'anthropic',
|
|
34
|
+
effortLevels: ['low', 'medium', 'high', 'max'],
|
|
35
|
+
runtime_names: { 'claude-code': 'claude-sonnet-4-6' },
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'anthropic/claude-sonnet-4.5',
|
|
39
|
+
name: 'Claude Sonnet 4.5',
|
|
40
|
+
provider: 'anthropic',
|
|
41
|
+
effortLevels: [],
|
|
42
|
+
runtime_names: { 'claude-code': 'claude-sonnet-4-5' },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'anthropic/claude-haiku-4.5',
|
|
46
|
+
name: 'Claude Haiku 4.5',
|
|
47
|
+
provider: 'anthropic',
|
|
48
|
+
effortLevels: [],
|
|
49
|
+
runtime_names: { 'claude-code': 'claude-haiku-4-5' },
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'openai/gpt-5.5',
|
|
53
|
+
name: 'GPT-5.5',
|
|
54
|
+
provider: 'openai',
|
|
55
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
56
|
+
runtime_names: { codex: 'gpt-5.5' },
|
|
57
|
+
},
|
|
19
58
|
// GPT-5.5 Pro has no documented API-key effort control surface yet.
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
59
|
+
{
|
|
60
|
+
id: 'openai/gpt-5.5-pro',
|
|
61
|
+
name: 'GPT-5.5 Pro',
|
|
62
|
+
provider: 'openai',
|
|
63
|
+
effortLevels: [],
|
|
64
|
+
runtime_names: { codex: 'gpt-5.5-pro' },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'openai/gpt-5.4',
|
|
68
|
+
name: 'GPT-5.4',
|
|
69
|
+
provider: 'openai',
|
|
70
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
71
|
+
runtime_names: { codex: 'gpt-5.4' },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'openai/gpt-5.4-pro',
|
|
75
|
+
name: 'GPT-5.4 Pro',
|
|
76
|
+
provider: 'openai',
|
|
77
|
+
effortLevels: ['medium', 'high', 'xhigh'],
|
|
78
|
+
runtime_names: { codex: 'gpt-5.4-pro' },
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'google/gemini-3.1-pro-preview',
|
|
82
|
+
name: 'Gemini 3.1 Pro Preview',
|
|
83
|
+
provider: 'google',
|
|
84
|
+
effortLevels: [],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'google/gemini-3.1-pro-preview-customtools',
|
|
88
|
+
name: 'Gemini 3.1 Pro Preview Custom Tools',
|
|
89
|
+
provider: 'google',
|
|
90
|
+
effortLevels: [],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'google/gemini-3-pro-preview',
|
|
94
|
+
name: 'Gemini 3 Pro Preview',
|
|
95
|
+
provider: 'google',
|
|
96
|
+
effortLevels: [],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'google/gemini-3-flash-preview',
|
|
100
|
+
name: 'Gemini 3 Flash Preview',
|
|
101
|
+
provider: 'google',
|
|
102
|
+
effortLevels: [],
|
|
103
|
+
},
|
|
27
104
|
{ id: 'google/gemini-2.5-flash', name: 'Gemini 2.5 Flash', provider: 'google', effortLevels: [] },
|
|
28
|
-
{
|
|
29
|
-
|
|
105
|
+
{
|
|
106
|
+
id: 'google/gemini-3.1-flash-lite',
|
|
107
|
+
name: 'Gemini 3.1 Flash-Lite',
|
|
108
|
+
provider: 'google',
|
|
109
|
+
effortLevels: [],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'google/gemini-2.5-flash-lite',
|
|
113
|
+
name: 'Gemini 2.5 Flash-Lite',
|
|
114
|
+
provider: 'google',
|
|
115
|
+
effortLevels: [],
|
|
116
|
+
},
|
|
30
117
|
{ id: 'moonshotai/kimi-k2.6', name: 'Kimi K2.6', provider: 'moonshotai', effortLevels: [] },
|
|
31
118
|
{ id: 'moonshotai/kimi-k2.5', name: 'Kimi K2.5', provider: 'moonshotai', effortLevels: [] },
|
|
32
119
|
{ id: 'z-ai/glm-5.1', name: 'GLM 5.1', provider: 'z-ai', effortLevels: [] },
|
|
33
120
|
{ id: 'z-ai/glm-5', name: 'GLM 5', provider: 'z-ai', effortLevels: [] },
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
121
|
+
{
|
|
122
|
+
id: 'deepseek/deepseek-v4-pro',
|
|
123
|
+
name: 'DeepSeek V4 Pro',
|
|
124
|
+
provider: 'deepseek',
|
|
125
|
+
effortLevels: [],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'deepseek/deepseek-v4-flash',
|
|
129
|
+
name: 'DeepSeek V4 Flash',
|
|
130
|
+
provider: 'deepseek',
|
|
131
|
+
effortLevels: [],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: 'qwen/qwen3.6-max-preview',
|
|
135
|
+
name: 'Qwen3.6 Max Preview',
|
|
136
|
+
provider: 'qwen',
|
|
137
|
+
effortLevels: [],
|
|
138
|
+
},
|
|
37
139
|
{ id: 'qwen/qwen3.6-plus', name: 'Qwen3.6 Plus', provider: 'qwen', effortLevels: [] },
|
|
38
|
-
{
|
|
140
|
+
{
|
|
141
|
+
id: 'qwen/qwen3.6-plus-2026-04-02',
|
|
142
|
+
name: 'Qwen3.6 Plus 2026-04-02',
|
|
143
|
+
provider: 'qwen',
|
|
144
|
+
effortLevels: [],
|
|
145
|
+
},
|
|
39
146
|
{ id: 'qwen/qwen3.5-plus', name: 'Qwen3.5 Plus', provider: 'qwen', effortLevels: [] },
|
|
40
|
-
{
|
|
147
|
+
{
|
|
148
|
+
id: 'qwen/qwen3.5-plus-2026-02-15',
|
|
149
|
+
name: 'Qwen3.5 Plus 2026-02-15',
|
|
150
|
+
provider: 'qwen',
|
|
151
|
+
effortLevels: [],
|
|
152
|
+
},
|
|
41
153
|
{ id: 'qwen/qwen3.6-flash', name: 'Qwen3.6 Flash', provider: 'qwen', effortLevels: [] },
|
|
42
|
-
{
|
|
154
|
+
{
|
|
155
|
+
id: 'qwen/qwen3.6-flash-2026-04-16',
|
|
156
|
+
name: 'Qwen3.6 Flash 2026-04-16',
|
|
157
|
+
provider: 'qwen',
|
|
158
|
+
effortLevels: [],
|
|
159
|
+
},
|
|
43
160
|
{ id: 'qwen/qwen3-coder-plus', name: 'Qwen3 Coder Plus', provider: 'qwen', effortLevels: [] },
|
|
44
161
|
] as const;
|
|
45
162
|
|
|
46
163
|
// Hidden from new-agent pickers, but available to editors so persisted Beta
|
|
47
164
|
// agent defaults remain representable.
|
|
48
165
|
export const PLATFORM_LEGACY_MODELS = [
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
|
|
166
|
+
{
|
|
167
|
+
id: 'openai/gpt-5.4-mini',
|
|
168
|
+
name: 'GPT-5.4 Mini',
|
|
169
|
+
provider: 'openai',
|
|
170
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
171
|
+
runtime_names: { codex: 'gpt-5.4-mini' },
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: 'openai/gpt-5-mini',
|
|
175
|
+
name: 'GPT-5 Mini',
|
|
176
|
+
provider: 'openai',
|
|
177
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
178
|
+
runtime_names: { codex: 'gpt-5-mini' },
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: 'openai/gpt-5.4-nano',
|
|
182
|
+
name: 'GPT-5.4 Nano',
|
|
183
|
+
provider: 'openai',
|
|
184
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
185
|
+
runtime_names: { codex: 'gpt-5.4-nano' },
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'openai/gpt-5-nano',
|
|
189
|
+
name: 'GPT-5 Nano',
|
|
190
|
+
provider: 'openai',
|
|
191
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
192
|
+
runtime_names: { codex: 'gpt-5-nano' },
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: 'openai/gpt-5.3-codex',
|
|
196
|
+
name: 'GPT-5.3 Codex',
|
|
197
|
+
provider: 'openai',
|
|
198
|
+
effortLevels: ['low', 'medium', 'high', 'xhigh'],
|
|
199
|
+
runtime_names: { codex: 'gpt-5.3-codex' },
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: 'openai/gpt-5.2-codex',
|
|
203
|
+
name: 'GPT-5.2 Codex',
|
|
204
|
+
provider: 'openai',
|
|
205
|
+
effortLevels: ['low', 'medium', 'high', 'xhigh'],
|
|
206
|
+
runtime_names: { codex: 'gpt-5.2-codex' },
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: 'openai/gpt-5-codex',
|
|
210
|
+
name: 'GPT-5 Codex',
|
|
211
|
+
provider: 'openai',
|
|
212
|
+
effortLevels: ['minimal', 'low', 'medium', 'high', 'xhigh'],
|
|
213
|
+
runtime_names: { codex: 'gpt-5-codex' },
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'openai/o4-mini',
|
|
217
|
+
name: 'o4 Mini',
|
|
218
|
+
provider: 'openai',
|
|
219
|
+
effortLevels: ['low', 'medium', 'high'],
|
|
220
|
+
runtime_names: { codex: 'o4-mini' },
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: 'openai/gpt-4.1',
|
|
224
|
+
name: 'GPT-4.1',
|
|
225
|
+
provider: 'openai',
|
|
226
|
+
effortLevels: [],
|
|
227
|
+
runtime_names: { codex: 'gpt-4.1' },
|
|
228
|
+
},
|
|
58
229
|
{ id: 'google/gemini-2.5-pro', name: 'Gemini 2.5 Pro', provider: 'google', effortLevels: [] },
|
|
59
|
-
{
|
|
230
|
+
{
|
|
231
|
+
id: 'qwen/qwen3.5-plus-02-15',
|
|
232
|
+
name: 'Qwen3.5 Plus 02-15 Legacy',
|
|
233
|
+
provider: 'qwen',
|
|
234
|
+
effortLevels: [],
|
|
235
|
+
},
|
|
60
236
|
] as const;
|
|
61
237
|
|
|
62
238
|
// Mirrors server/pkg/llmproxy/models.go DefaultModelIDForRuntime. Go remains
|
|
@@ -110,12 +286,12 @@ export const ENDPOINTS = {
|
|
|
110
286
|
ORG: (orgId: string) => `${API_BASE}/orgs/${orgId}`,
|
|
111
287
|
ORG_MEMBERS: (orgId: string) => `${API_BASE}/orgs/${orgId}/members`,
|
|
112
288
|
ORG_MEMBERS_ONLINE: (orgId: string) => `${API_BASE}/orgs/${orgId}/members/online`,
|
|
113
|
-
ORG_MEMBER: (orgId: string, userId: string) =>
|
|
114
|
-
`${API_BASE}/orgs/${orgId}/members/${userId}`,
|
|
289
|
+
ORG_MEMBER: (orgId: string, userId: string) => `${API_BASE}/orgs/${orgId}/members/${userId}`,
|
|
115
290
|
ORG_MEMBER_CHATS: (orgId: string, memberId: string) =>
|
|
116
291
|
`${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
|
|
117
292
|
ORG_MEMBER_TASKS: (orgId: string, memberId: string) =>
|
|
118
293
|
`${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
|
|
294
|
+
REF_SEARCH: (orgId: string) => `${API_BASE}/orgs/${orgId}/refs/search`,
|
|
119
295
|
|
|
120
296
|
// Direct messages (org-scoped, atomic find-or-create + send)
|
|
121
297
|
DM: (orgId: string) => `${API_BASE}/orgs/${orgId}/dm`,
|
|
@@ -177,8 +353,7 @@ export const ENDPOINTS = {
|
|
|
177
353
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/activity`,
|
|
178
354
|
AGENT_MONITOR: (orgId: string, agentId: string) =>
|
|
179
355
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/monitor`,
|
|
180
|
-
AGENT_ME: (orgId: string) =>
|
|
181
|
-
`${API_BASE}/orgs/${orgId}/agents/me`,
|
|
356
|
+
AGENT_ME: (orgId: string) => `${API_BASE}/orgs/${orgId}/agents/me`,
|
|
182
357
|
AGENT_NEW_SESSION: (orgId: string, agentId: string) =>
|
|
183
358
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/new-session`,
|
|
184
359
|
AGENT_SESSIONS: (orgId: string, agentId: string) =>
|
|
@@ -197,11 +372,7 @@ export const ENDPOINTS = {
|
|
|
197
372
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime-auth`,
|
|
198
373
|
AGENT_RUNTIME_AUTH_SESSIONS: (orgId: string, agentId: string) =>
|
|
199
374
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime-auth-sessions`,
|
|
200
|
-
AGENT_RUNTIME_AUTH_SESSION_COMPLETE: (
|
|
201
|
-
orgId: string,
|
|
202
|
-
agentId: string,
|
|
203
|
-
sessionId: string,
|
|
204
|
-
) =>
|
|
375
|
+
AGENT_RUNTIME_AUTH_SESSION_COMPLETE: (orgId: string, agentId: string, sessionId: string) =>
|
|
205
376
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime-auth-sessions/${sessionId}/complete`,
|
|
206
377
|
AGENT_RUNTIME: (orgId: string, agentId: string) =>
|
|
207
378
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/runtime`,
|
|
@@ -215,8 +386,7 @@ export const ENDPOINTS = {
|
|
|
215
386
|
`${API_BASE}/orgs/${orgId}/agents/${agentId}/provider-config`,
|
|
216
387
|
// Machines (org-scoped)
|
|
217
388
|
MACHINES: (orgId: string) => `${API_BASE}/orgs/${orgId}/machines`,
|
|
218
|
-
MACHINE: (orgId: string, machineId: string) =>
|
|
219
|
-
`${API_BASE}/orgs/${orgId}/machines/${machineId}`,
|
|
389
|
+
MACHINE: (orgId: string, machineId: string) => `${API_BASE}/orgs/${orgId}/machines/${machineId}`,
|
|
220
390
|
MACHINE_START: (orgId: string, machineId: string) =>
|
|
221
391
|
`${API_BASE}/orgs/${orgId}/machines/${machineId}/start`,
|
|
222
392
|
MACHINE_STOP: (orgId: string, machineId: string) =>
|
|
@@ -229,8 +399,7 @@ export const ENDPOINTS = {
|
|
|
229
399
|
`${API_BASE}/orgs/${orgId}/machines/${machineId}/spec`,
|
|
230
400
|
MACHINE_RESTART: (orgId: string, machineId: string) =>
|
|
231
401
|
`${API_BASE}/orgs/${orgId}/machines/${machineId}/restart`,
|
|
232
|
-
MACHINE_RESTART_ALL: (orgId: string) =>
|
|
233
|
-
`${API_BASE}/orgs/${orgId}/machines/restart-all`,
|
|
402
|
+
MACHINE_RESTART_ALL: (orgId: string) => `${API_BASE}/orgs/${orgId}/machines/restart-all`,
|
|
234
403
|
// Daemon-mode Machine management (org-scoped, user auth).
|
|
235
404
|
// POST creates a new daemon-mode Machine (daemon_mode=true always).
|
|
236
405
|
// Attach/Detach bind an agent to/from a daemon Machine.
|
|
@@ -256,6 +425,8 @@ export const ENDPOINTS = {
|
|
|
256
425
|
`${API_BASE}/orgs/${orgId}/machines/${machineId}/runtime-auth-sessions`,
|
|
257
426
|
MACHINE_RUNTIME_AUTH_SESSION_COMPLETE: (orgId: string, machineId: string, sessionId: string) =>
|
|
258
427
|
`${API_BASE}/orgs/${orgId}/machines/${machineId}/runtime-auth-sessions/${sessionId}/complete`,
|
|
428
|
+
MACHINE_REQUEST_UPDATE: (orgId: string, machineId: string) =>
|
|
429
|
+
`${API_BASE}/orgs/${orgId}/machines/${machineId}/request-update`,
|
|
259
430
|
MACHINE_BROWSE: (orgId: string, machineId: string) =>
|
|
260
431
|
`${API_BASE}/orgs/${orgId}/machines/${machineId}/browse`,
|
|
261
432
|
|
|
@@ -265,6 +436,9 @@ export const ENDPOINTS = {
|
|
|
265
436
|
MACHINES_ME: `${API_BASE}/machines/me`,
|
|
266
437
|
MACHINES_ME_AGENTS: `${API_BASE}/machines/me/agents`,
|
|
267
438
|
MACHINES_ME_HEALTH: `${API_BASE}/machines/me/health`,
|
|
439
|
+
MACHINES_ME_CLIP_INSTALLS: `${API_BASE}/machines/me/clip-installs`,
|
|
440
|
+
MACHINES_ME_CLIP_INSTALL_DONE: (clipId: string) =>
|
|
441
|
+
`${API_BASE}/machines/me/clip-installs/${clipId}/installed`,
|
|
268
442
|
MACHINES_ME_AGENT_LAUNCH_CREDENTIAL: (agentId: string) =>
|
|
269
443
|
`${API_BASE}/machines/me/agents/${agentId}/launch-credential`,
|
|
270
444
|
MACHINES_ME_AGENT_WORKSPACE_STATE: (agentId: string) =>
|
|
@@ -280,18 +454,18 @@ export const ENDPOINTS = {
|
|
|
280
454
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/archive`,
|
|
281
455
|
TASK_RESTORE: (orgId: string, taskId: string) =>
|
|
282
456
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/restore`,
|
|
283
|
-
TASK_WATCH: (orgId: string, taskId: string) =>
|
|
284
|
-
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/watch`,
|
|
457
|
+
TASK_WATCH: (orgId: string, taskId: string) => `${API_BASE}/orgs/${orgId}/tasks/${taskId}/watch`,
|
|
285
458
|
TASK_WATCHERS: (orgId: string, taskId: string) =>
|
|
286
459
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/watchers`,
|
|
460
|
+
TASK_SUBSCRIBER: (orgId: string, taskId: string, userId: string) =>
|
|
461
|
+
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/subscribers/${userId}`,
|
|
287
462
|
TASK_SUBTASKS: (orgId: string, taskId: string) =>
|
|
288
463
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/subtasks`,
|
|
289
464
|
TASK_RELATIONS: (orgId: string, taskId: string) =>
|
|
290
465
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/relations`,
|
|
291
466
|
TASK_RELATION: (orgId: string, taskId: string, relId: string) =>
|
|
292
467
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/relations/${relId}`,
|
|
293
|
-
TASK_RELATIONS_BY_TARGET: (orgId: string) =>
|
|
294
|
-
`${API_BASE}/orgs/${orgId}/task-relations`,
|
|
468
|
+
TASK_RELATIONS_BY_TARGET: (orgId: string) => `${API_BASE}/orgs/${orgId}/task-relations`,
|
|
295
469
|
TASK_COMMENTS: (orgId: string, taskId: string) =>
|
|
296
470
|
`${API_BASE}/orgs/${orgId}/tasks/${taskId}/comments`,
|
|
297
471
|
TASK_COMMENT: (orgId: string, taskId: string, commentId: string) =>
|
|
@@ -307,10 +481,13 @@ export const ENDPOINTS = {
|
|
|
307
481
|
SCHEDULES: (orgId: string) => `${API_BASE}/orgs/${orgId}/schedules`,
|
|
308
482
|
SCHEDULE: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}`,
|
|
309
483
|
SCHEDULE_PAUSE: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}/pause`,
|
|
310
|
-
SCHEDULE_RESUME: (orgId: string, id: string) =>
|
|
311
|
-
|
|
484
|
+
SCHEDULE_RESUME: (orgId: string, id: string) =>
|
|
485
|
+
`${API_BASE}/orgs/${orgId}/schedules/${id}/resume`,
|
|
486
|
+
SCHEDULE_CANCEL: (orgId: string, id: string) =>
|
|
487
|
+
`${API_BASE}/orgs/${orgId}/schedules/${id}/cancel`,
|
|
312
488
|
SCHEDULE_RUNS: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/schedules/${id}/runs`,
|
|
313
|
-
SCHEDULE_RUN: (orgId: string, runId: string) =>
|
|
489
|
+
SCHEDULE_RUN: (orgId: string, runId: string) =>
|
|
490
|
+
`${API_BASE}/orgs/${orgId}/schedule_runs/${runId}`,
|
|
314
491
|
|
|
315
492
|
// Invitations (org-scoped, admin)
|
|
316
493
|
ORG_INVITATIONS: (orgId: string) => `${API_BASE}/orgs/${orgId}/invitations`,
|
|
@@ -325,18 +502,33 @@ export const ENDPOINTS = {
|
|
|
325
502
|
INVITATION_DECLINE: (id: string) => `${API_BASE}/invitations/${id}/decline`,
|
|
326
503
|
INVITATION_BY_TOKEN: (token: string) => `${API_BASE}/invitations/by-token/${token}`,
|
|
327
504
|
|
|
505
|
+
// Org-level shareable invite link
|
|
506
|
+
ORG_INVITE_LINK: (orgId: string) => `${API_BASE}/orgs/${orgId}/invite-link`,
|
|
507
|
+
ORG_INVITE_LINK_REGENERATE: (orgId: string) => `${API_BASE}/orgs/${orgId}/invite-link/regenerate`,
|
|
508
|
+
ORG_INVITE_LINK_JOIN_REQUESTS: (orgId: string) =>
|
|
509
|
+
`${API_BASE}/orgs/${orgId}/invite-link/join-requests`,
|
|
510
|
+
ORG_INVITE_LINK_JOIN_REQUEST_DECIDE: (orgId: string, jrId: string) =>
|
|
511
|
+
`${API_BASE}/orgs/${orgId}/invite-link/join-requests/${jrId}/decide`,
|
|
512
|
+
INVITE_LINK_JOIN: `${API_BASE}/invite-link/join`,
|
|
513
|
+
|
|
328
514
|
// Wikis (org-scoped, served by wiki-service)
|
|
329
515
|
WIKIS: (orgId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis`,
|
|
330
516
|
WIKI: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}`,
|
|
331
517
|
WIKI_TREE: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/tree`,
|
|
332
518
|
WIKI_BLOB: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/blob`,
|
|
333
|
-
WIKI_NODE_SECTIONS: (orgId: string, wikiId: string) =>
|
|
334
|
-
|
|
335
|
-
|
|
519
|
+
WIKI_NODE_SECTIONS: (orgId: string, wikiId: string) =>
|
|
520
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/node-sections`,
|
|
521
|
+
WIKI_SEARCH: (orgId: string, wikiId: string) =>
|
|
522
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/search`,
|
|
523
|
+
WIKI_PAGE_INDEX: (orgId: string, wikiId: string) =>
|
|
524
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/page-index`,
|
|
336
525
|
WIKI_REFS: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/refs`,
|
|
337
|
-
WIKI_REFS_CHECK: (orgId: string, wikiId: string) =>
|
|
338
|
-
|
|
339
|
-
|
|
526
|
+
WIKI_REFS_CHECK: (orgId: string, wikiId: string) =>
|
|
527
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/refs/check`,
|
|
528
|
+
WIKI_ANCHOR_STATUS: (orgId: string, wikiId: string) =>
|
|
529
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/anchor-status`,
|
|
530
|
+
WIKI_CHANGESETS: (orgId: string, wikiId: string) =>
|
|
531
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/changesets`,
|
|
340
532
|
WIKI_CHANGESET: (orgId: string, wikiId: string, changesetId: string) =>
|
|
341
533
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/changesets/${changesetId}`,
|
|
342
534
|
WIKI_CHANGESET_DIFF: (orgId: string, wikiId: string, changesetId: string) =>
|
|
@@ -351,8 +543,7 @@ export const ENDPOINTS = {
|
|
|
351
543
|
// Wiki Binary Upload / Delete (Phase 2 of wiki-file-storage-design)
|
|
352
544
|
WIKI_UPLOADS: (orgId: string, wikiId: string) =>
|
|
353
545
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/uploads`,
|
|
354
|
-
WIKI_FILES: (orgId: string, wikiId: string) =>
|
|
355
|
-
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files`,
|
|
546
|
+
WIKI_FILES: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files`,
|
|
356
547
|
WIKI_FILE_PREVIEW_URL: (orgId: string, wikiId: string) =>
|
|
357
548
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files/preview-url`,
|
|
358
549
|
|
|
@@ -371,8 +562,7 @@ export const ENDPOINTS = {
|
|
|
371
562
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/commits`,
|
|
372
563
|
WIKI_FILE_COMMITS: (orgId: string, wikiId: string) =>
|
|
373
564
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/file-commits`,
|
|
374
|
-
WIKI_BLAME: (orgId: string, wikiId: string) =>
|
|
375
|
-
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/blame`,
|
|
565
|
+
WIKI_BLAME: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/blame`,
|
|
376
566
|
|
|
377
567
|
// Wiki Operations (audit log)
|
|
378
568
|
WIKI_OPERATIONS: (orgId: string, wikiId: string) =>
|
|
@@ -389,7 +579,8 @@ export const ENDPOINTS = {
|
|
|
389
579
|
INBOX_UNREAD_COUNT: (orgId: string) => `${API_BASE}/orgs/${orgId}/inbox/unread-count`,
|
|
390
580
|
INBOX_ITEM_READ: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/inbox/${id}/read`,
|
|
391
581
|
INBOX_ITEM_UNREAD: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/inbox/${id}/unread`,
|
|
392
|
-
INBOX_ITEM_ARCHIVE: (orgId: string, id: string) =>
|
|
582
|
+
INBOX_ITEM_ARCHIVE: (orgId: string, id: string) =>
|
|
583
|
+
`${API_BASE}/orgs/${orgId}/inbox/${id}/archive`,
|
|
393
584
|
// Snooze/Unsnooze deferred until un-snooze cron worker is implemented
|
|
394
585
|
INBOX_MARK_ALL_READ: (orgId: string) => `${API_BASE}/orgs/${orgId}/inbox/mark-all-read`,
|
|
395
586
|
INBOX_ARCHIVE_ALL: (orgId: string) => `${API_BASE}/orgs/${orgId}/inbox/archive-all`,
|
|
@@ -399,14 +590,17 @@ export const ENDPOINTS = {
|
|
|
399
590
|
// Dispatch (agent event delivery)
|
|
400
591
|
DISPATCH: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch`,
|
|
401
592
|
DISPATCH_PENDING_COUNT: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/pending-count`,
|
|
593
|
+
DISPATCH_RECEIVED: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/received`,
|
|
402
594
|
DISPATCH_ACK: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/ack`,
|
|
403
595
|
DISPATCH_ACK_BY_ID: (orgId: string, id: string) => `${API_BASE}/orgs/${orgId}/dispatch/${id}/ack`,
|
|
596
|
+
DISPATCH_BY_MESSAGES: (orgId: string) => `${API_BASE}/orgs/${orgId}/dispatch/by-messages`,
|
|
404
597
|
|
|
405
598
|
// Unread
|
|
406
599
|
UNREAD: `${API_BASE}/me/unread`,
|
|
407
600
|
ORG_UNREAD: (orgId: string) => `${API_BASE}/orgs/${orgId}/unread`,
|
|
408
|
-
CHAT_READ: (orgId: string, chatId: string) =>
|
|
409
|
-
|
|
601
|
+
CHAT_READ: (orgId: string, chatId: string) => `${API_BASE}/orgs/${orgId}/chats/${chatId}/read`,
|
|
602
|
+
THREAD_UNREAD: (orgId: string, chatId: string, threadRootId: string) =>
|
|
603
|
+
`${API_BASE}/orgs/${orgId}/chats/${chatId}/threads/${threadRootId}/unread`,
|
|
410
604
|
|
|
411
605
|
// References (org-scoped)
|
|
412
606
|
REFS_RESOLVE: (orgId: string) => `${API_BASE}/orgs/${orgId}/refs/resolve`,
|
|
@@ -439,6 +633,20 @@ export const ENDPOINTS = {
|
|
|
439
633
|
// unauthenticated `/internal/admin/*` surface and must not bleed into the
|
|
440
634
|
// public SDK. Admin dashboard hits the URL directly from its own client.
|
|
441
635
|
|
|
636
|
+
// Clips (org-scoped, served by clip-service)
|
|
637
|
+
CLIPS: (orgId: string) => `${CLIP_BASE}/orgs/${orgId}/clips`,
|
|
638
|
+
CLIP: (orgId: string, clipId: string) => `${CLIP_BASE}/orgs/${orgId}/clips/${clipId}`,
|
|
639
|
+
CLIP_AGENTS: (orgId: string, clipId: string) =>
|
|
640
|
+
`${CLIP_BASE}/orgs/${orgId}/clips/${clipId}/agents`,
|
|
641
|
+
AGENT_CLIPS: (orgId: string, agentId: string) =>
|
|
642
|
+
`${CLIP_BASE}/orgs/${orgId}/agents/${agentId}/clips`,
|
|
643
|
+
AGENT_CLIP: (orgId: string, agentId: string, clipId: string) =>
|
|
644
|
+
`${CLIP_BASE}/orgs/${orgId}/agents/${agentId}/clips/${clipId}`,
|
|
645
|
+
CLIP_INVOKE: (orgId: string) => `${CLIP_BASE}/orgs/${orgId}/invoke`,
|
|
646
|
+
CLIP_ONLINE: (orgId: string) => `${CLIP_BASE}/orgs/${orgId}/online`,
|
|
647
|
+
|
|
648
|
+
// Clip registry (global, served by clip-service → Pinix Hub proxy)
|
|
649
|
+
CLIP_REGISTRY: () => `${CLIP_BASE}/registry/clips`,
|
|
442
650
|
} as const;
|
|
443
651
|
|
|
444
652
|
// WebSocket event types
|
|
@@ -480,6 +688,8 @@ export const WS_EVENTS = {
|
|
|
480
688
|
INVITATION_ACCEPTED: 'invitation.accepted',
|
|
481
689
|
INVITATION_DECLINED: 'invitation.declined',
|
|
482
690
|
INVITATION_REVOKED: 'invitation.revoked',
|
|
691
|
+
ORG_JOIN_REQUEST_NEW: 'org.join_request.new',
|
|
692
|
+
ORG_INVITE_LINK_JOINED: 'org.invite_link.joined',
|
|
483
693
|
AGENT_CONFIG_UPDATE: 'agent_config.update',
|
|
484
694
|
PRESENCE_UPDATE: 'presence.update',
|
|
485
695
|
WIKI_CHANGESET_CREATED: 'wiki.changeset.created',
|
|
@@ -493,6 +703,7 @@ export const WS_EVENTS = {
|
|
|
493
703
|
INBOX_BULK_UPDATE: 'inbox.bulk_update',
|
|
494
704
|
READ_POSITION_UPDATED: 'read_position.updated',
|
|
495
705
|
DISPATCH_NEW: 'dispatch.new',
|
|
706
|
+
DISPATCH_RECEIVED: 'dispatch.received',
|
|
496
707
|
SCHEDULE_CREATED: 'schedule.created',
|
|
497
708
|
SCHEDULE_UPDATED: 'schedule.updated',
|
|
498
709
|
SCHEDULE_DELETED: 'schedule.deleted',
|
|
@@ -508,7 +719,13 @@ export const WS_EVENTS = {
|
|
|
508
719
|
MACHINE_STOP: 'machine.stop',
|
|
509
720
|
MACHINE_WORKSPACE_SETUP_REQUESTED: 'machine.workspace.setup.requested',
|
|
510
721
|
MACHINE_FILESYSTEM_BROWSE: 'machine.filesystem.browse',
|
|
722
|
+
MACHINE_UPDATE: 'machine.update',
|
|
723
|
+
MACHINE_CONFIG_UPDATED: 'machine.config.updated',
|
|
724
|
+
MACHINE_CLIP_INSTALL: 'machine.clip.install',
|
|
511
725
|
AGENT_NEW_SESSION: 'agent.new_session',
|
|
726
|
+
CLIP_INSTALLED: 'clip.installed',
|
|
727
|
+
CLIP_REMOVED: 'clip.removed',
|
|
728
|
+
CLIP_UPDATED: 'clip.updated',
|
|
512
729
|
} as const;
|
|
513
730
|
|
|
514
731
|
// Canonical target URI builders for unified comments.
|
|
@@ -546,30 +763,28 @@ function encodeHeadingSegment(seg: string): string {
|
|
|
546
763
|
// produce byte-identical target_uri across Go and TS SDKs for any legal
|
|
547
764
|
// filename (including ones with ', (, ), !, *, space, #, ?, %, etc.).
|
|
548
765
|
function encodePathSegment(seg: string): string {
|
|
549
|
-
return
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
766
|
+
return (
|
|
767
|
+
encodeURIComponent(seg)
|
|
768
|
+
// Un-escape what Go's encodePath passes through
|
|
769
|
+
.replace(/%24/g, '$')
|
|
770
|
+
.replace(/%26/g, '&')
|
|
771
|
+
.replace(/%2B/g, '+')
|
|
772
|
+
.replace(/%2C/g, ',')
|
|
773
|
+
.replace(/%3A/g, ':')
|
|
774
|
+
.replace(/%3B/g, ';')
|
|
775
|
+
.replace(/%3D/g, '=')
|
|
776
|
+
.replace(/%40/g, '@')
|
|
777
|
+
// Encode what Go escapes but encodeURIComponent leaves raw
|
|
778
|
+
.replace(/!/g, '%21')
|
|
779
|
+
.replace(/'/g, '%27')
|
|
780
|
+
.replace(/\(/g, '%28')
|
|
781
|
+
.replace(/\)/g, '%29')
|
|
782
|
+
.replace(/\*/g, '%2A')
|
|
783
|
+
);
|
|
565
784
|
}
|
|
566
785
|
|
|
567
786
|
function encodeWikiPath(path: string): string {
|
|
568
|
-
return path
|
|
569
|
-
.replace(/^\//, '')
|
|
570
|
-
.split('/')
|
|
571
|
-
.map(encodePathSegment)
|
|
572
|
-
.join('/');
|
|
787
|
+
return path.replace(/^\//, '').split('/').map(encodePathSegment).join('/');
|
|
573
788
|
}
|
|
574
789
|
|
|
575
790
|
export const COMMENT_TARGET = {
|
|
@@ -582,7 +797,13 @@ export const COMMENT_TARGET = {
|
|
|
582
797
|
const encoded = headingSegments.map(encodeHeadingSegment).join('::');
|
|
583
798
|
return `prll://${wikiId}/${encodeWikiPath(path)}?rev=${rev}#h=${encoded}`;
|
|
584
799
|
},
|
|
585
|
-
wikiLineRange: (
|
|
800
|
+
wikiLineRange: (
|
|
801
|
+
wikiId: string,
|
|
802
|
+
path: string,
|
|
803
|
+
rev: string,
|
|
804
|
+
lineStart: number,
|
|
805
|
+
lineEnd: number,
|
|
806
|
+
) => {
|
|
586
807
|
const frag = lineStart === lineEnd ? `l=${lineStart}` : `l=${lineStart}-${lineEnd}`;
|
|
587
808
|
return `prll://${wikiId}/${encodeWikiPath(path)}?rev=${rev}#${frag}`;
|
|
588
809
|
},
|
package/src/index.ts
CHANGED
|
@@ -3,4 +3,10 @@ export * from './constants.js';
|
|
|
3
3
|
export { ParallClient, ApiError } from './client.js';
|
|
4
4
|
export type { ParallClientOptions } from './client.js';
|
|
5
5
|
export { ParallWs } from './ws.js';
|
|
6
|
-
export type {
|
|
6
|
+
export type {
|
|
7
|
+
ParallWsOptions,
|
|
8
|
+
WsConnectionState,
|
|
9
|
+
WsEventType,
|
|
10
|
+
WsEventHandler,
|
|
11
|
+
WsClientEventMap,
|
|
12
|
+
} from './ws.js';
|