@anhlp/alp-protocol 0.0.0-beta.1 → 0.10.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/README.md +1 -11
- package/dist/dto.d.ts +0 -68
- package/dist/events.d.ts +0 -8
- package/dist/rpc.d.ts +1 -471
- package/dist/wire.d.ts +0 -22
- package/dist/wire.js +2 -6
- package/package.json +7 -34
- package/schema/ipc-v1.json +366 -1319
- package/schema/methods-v1.json +956 -3476
- package/src/dto.ts +0 -37
- package/src/events.ts +1 -8
- package/src/rpc.ts +1 -97
- package/src/wire.js +2 -9
- package/LICENSE +0 -202
- package/NOTICE +0 -7
- package/conformance/cases.json +0 -951
- package/conformance/run.d.mts +0 -32
- package/conformance/run.mjs +0 -403
- package/dist/contract-v1.d.ts +0 -4171
- package/dist/contract-v1.js +0 -5
- package/dist/contract.d.ts +0 -25
- package/dist/contract.js +0 -28
- package/dist/validate.d.ts +0 -12
- package/dist/validate.js +0 -147
- package/fixtures/v1/cases.json +0 -2827
- package/src/contract-v1.js +0 -2
- package/src/contract.js +0 -44
- package/src/validate.js +0 -113
package/README.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
# @anhlp/alp-protocol
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
schema checker, golden fixtures and a conformance runner. No Node, runtime or provider dependencies in
|
|
5
|
-
the public contract (the conformance runner alone uses `node:net`).
|
|
6
|
-
|
|
7
|
-
- Specification: [docs/protocol/alp-json-rpc-v1.md](../../docs/protocol/alp-json-rpc-v1.md)
|
|
8
|
-
- Client integration: [docs/protocol/v1-client-integration.md](../../docs/protocol/v1-client-integration.md)
|
|
9
|
-
- Normative schema: `schema/methods-v1.json` (methods, errors, capabilities, definitions); messages: `schema/ipc-v1.json`
|
|
10
|
-
- Golden values: `fixtures/v1/cases.json` (`node scripts/fixtures.mjs` writes it)
|
|
11
|
-
- Conformance: `node conformance/run.mjs --socket <path> [--profiles …]` against any implementation
|
|
12
|
-
|
|
13
|
-
After editing `schema/methods-v1.json`, run `npm run generate --workspace=@anhlp/alp-protocol` (a test fails while `src/contract-v1.js` is stale).
|
|
3
|
+
Stable JSON-RPC v1, portable session/event DTOs, JSON Schema and fixtures.
|
|
14
4
|
|
|
15
5
|
Build: `npm run build --workspace=@anhlp/alp-protocol`. Test: `npm run test --workspace=@anhlp/alp-protocol`.
|
|
16
6
|
|
package/dist/dto.d.ts
CHANGED
|
@@ -34,71 +34,3 @@ export type Pin = {
|
|
|
34
34
|
/** The task the claiming assignment works on. */
|
|
35
35
|
task?: string;
|
|
36
36
|
};
|
|
37
|
-
/** A project's task as task screens show it (schema/methods-v1.json `taskRow`). */
|
|
38
|
-
export type TaskRow = {
|
|
39
|
-
id: string;
|
|
40
|
-
title: string;
|
|
41
|
-
type: string;
|
|
42
|
-
priority: number;
|
|
43
|
-
status: 'open' | 'in_progress' | 'review' | 'closed';
|
|
44
|
-
/** Changes with every write; task.update and task.gate.resolve refuse an older one given as `ifRev`. */
|
|
45
|
-
rev: number;
|
|
46
|
-
parent?: string;
|
|
47
|
-
assignee?: string;
|
|
48
|
-
ready: boolean;
|
|
49
|
-
blockedBy?: string[];
|
|
50
|
-
waits?: string[];
|
|
51
|
-
approvals?: Array<{
|
|
52
|
-
gate: string;
|
|
53
|
-
note: string;
|
|
54
|
-
}>;
|
|
55
|
-
handoff?: {
|
|
56
|
-
outcome: string;
|
|
57
|
-
summary: string;
|
|
58
|
-
agent?: string;
|
|
59
|
-
};
|
|
60
|
-
closed?: {
|
|
61
|
-
reason: string;
|
|
62
|
-
summary?: string;
|
|
63
|
-
at: string;
|
|
64
|
-
};
|
|
65
|
-
description?: string;
|
|
66
|
-
labels?: string[];
|
|
67
|
-
paths?: string[];
|
|
68
|
-
progress?: {
|
|
69
|
-
done: number;
|
|
70
|
-
total: number;
|
|
71
|
-
};
|
|
72
|
-
createdAt?: string;
|
|
73
|
-
updatedAt: string;
|
|
74
|
-
};
|
|
75
|
-
export type LibraryKind = 'agents' | 'skills' | 'mcp' | 'hooks' | 'teams' | 'providers';
|
|
76
|
-
export type LibraryScope = 'library' | 'project';
|
|
77
|
-
export type LibrarySource = 'builtin' | 'library' | 'project';
|
|
78
|
-
/** Letters, digits, '.', '_' or '-', not '.' or '..'. */
|
|
79
|
-
export type EntryName = string;
|
|
80
|
-
export type LibraryEntryRow = {
|
|
81
|
-
name: string;
|
|
82
|
-
source: LibrarySource;
|
|
83
|
-
overrides?: LibrarySource;
|
|
84
|
-
description?: string;
|
|
85
|
-
usedBy?: string[];
|
|
86
|
-
};
|
|
87
|
-
export type TeamRow = {
|
|
88
|
-
id: string;
|
|
89
|
-
label?: string;
|
|
90
|
-
description?: string;
|
|
91
|
-
source: LibrarySource;
|
|
92
|
-
overrides?: LibrarySource;
|
|
93
|
-
error?: string;
|
|
94
|
-
};
|
|
95
|
-
/** language null: unset, so `default` applies. */
|
|
96
|
-
export type LanguageSetting = {
|
|
97
|
-
language: string | null;
|
|
98
|
-
applies: string;
|
|
99
|
-
default: string;
|
|
100
|
-
};
|
|
101
|
-
/** Stands for a stored secret in library.get content; sent back in library.save it keeps the stored value. */
|
|
102
|
-
export type SecretMarker = {
|
|
103
|
-
$secret: 'keep';
|
|
104
|
-
};
|
package/dist/events.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { RuntimeKind, MailEvent, Pin } from './dto.js';
|
|
2
2
|
/** Provider-neutral session events (plans/reference/ALPD.md §4). Viewers project them; the runtime never imports a viewer. */
|
|
3
|
-
/** `code: 'outcome_unknown'` when the provider may or may not have received the request (ALPD §66). */
|
|
4
3
|
export type AlpError = {
|
|
5
4
|
message: string;
|
|
6
|
-
code?: string;
|
|
7
5
|
};
|
|
8
6
|
export type TimelineItem = {
|
|
9
7
|
kind: 'user_message';
|
|
@@ -214,12 +212,6 @@ export type Envelope = {
|
|
|
214
212
|
epoch: string;
|
|
215
213
|
/** Strictly increasing per session. */
|
|
216
214
|
seq: number;
|
|
217
|
-
/**
|
|
218
|
-
* Position in its tree's stored timeline, set by alpd on the events it keeps: strictly
|
|
219
|
-
* increasing per root across restarts, so `session.attach { after }` replays only what
|
|
220
|
-
* a reconnecting client missed (ALPD §66).
|
|
221
|
-
*/
|
|
222
|
-
cursor?: number;
|
|
223
215
|
ts: string;
|
|
224
216
|
event: AlpEvent;
|
|
225
217
|
};
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
/** Portable JSON-RPC structures; implementations and provider SDKs stay outside protocol. */
|
|
2
|
-
import type { RuntimeKind, Pin } from './dto.js';
|
|
3
|
-
import type { AlpError, Envelope, SessionSnapshot, TreeStatus, UserQuestion } from './events.js';
|
|
4
|
-
import type { PauseState, PromptContent, RecallAnswer, SessionPreview, SessionSpec, SessionSummary } from './session.js';
|
|
5
|
-
import type { EntryName, LanguageSetting, LibraryEntryRow, LibraryKind, LibraryScope, LibrarySource, TaskRow, TeamRow } from './dto.js';
|
|
6
2
|
export type RpcId = string | number | null;
|
|
7
3
|
export type RpcErrorData = {
|
|
8
4
|
code: number;
|
|
@@ -28,471 +24,5 @@ export type RpcResponse = {
|
|
|
28
24
|
export type EventNotification = {
|
|
29
25
|
jsonrpc: '2.0';
|
|
30
26
|
method: 'event';
|
|
31
|
-
params: Envelope;
|
|
27
|
+
params: import('./events.js').Envelope;
|
|
32
28
|
};
|
|
33
|
-
/** Names a daemon may list in its daemon.hello result (schema/methods-v1.json `capabilities`). */
|
|
34
|
-
export type Capability = 'attach.after' | 'prompt.receipts' | 'extension.methods' | 'team' | 'task' | 'library' | 'settings.language';
|
|
35
|
-
/** `data.reason` values alpd sets on errors (docs/protocol/alp-json-rpc-v1.md §5.3). */
|
|
36
|
-
export type ErrorReason = 'hello_required' | 'protocol_version' | 'invalid_params' | 'invalid_id' | 'batch_unsupported' | 'frame_too_large' | 'response_too_large' | 'persistence_failed' | 'outcome_unknown' | 'key_conflict' | 'invalid_path' | 'invalid_scope' | 'invalid_entry' | 'secret_marker' | 'not_alp_project' | 'unknown_task' | 'not_found' | 'unsafe_path' | 'revision_conflict' | 'task_state' | 'in_use' | 'busy' | 'unreadable';
|
|
37
|
-
type Empty = Record<string, never>;
|
|
38
|
-
/**
|
|
39
|
-
* Params and result of every v1 method, as schema/methods-v1.json defines them; the protocol tests
|
|
40
|
-
* type-check the golden fixtures against this map, so the two cannot drift. Results may carry
|
|
41
|
-
* properties this map does not name: clients ignore them.
|
|
42
|
-
*/
|
|
43
|
-
export type RpcMethodMap = {
|
|
44
|
-
'daemon.hello': {
|
|
45
|
-
params: {
|
|
46
|
-
protocolVersion: 1;
|
|
47
|
-
client?: {
|
|
48
|
-
name: string;
|
|
49
|
-
version: string;
|
|
50
|
-
};
|
|
51
|
-
capabilities?: string[];
|
|
52
|
-
};
|
|
53
|
-
result: {
|
|
54
|
-
protocolVersion: 1;
|
|
55
|
-
daemonVersion?: string;
|
|
56
|
-
pid?: number;
|
|
57
|
-
capabilities?: string[];
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
'daemon.status': {
|
|
61
|
-
params: Empty;
|
|
62
|
-
result: {
|
|
63
|
-
pid: number;
|
|
64
|
-
startedAt: string;
|
|
65
|
-
version: string;
|
|
66
|
-
protocolVersion: number;
|
|
67
|
-
sessions: number;
|
|
68
|
-
questions: number;
|
|
69
|
-
previousExit?: {
|
|
70
|
-
kind: 'clean' | 'crash';
|
|
71
|
-
at?: string;
|
|
72
|
-
};
|
|
73
|
-
persistence?: Record<string, unknown>;
|
|
74
|
-
health: {
|
|
75
|
-
live: boolean;
|
|
76
|
-
ready: boolean;
|
|
77
|
-
checks: Array<{
|
|
78
|
-
id: string;
|
|
79
|
-
ok: boolean;
|
|
80
|
-
code?: string;
|
|
81
|
-
message?: string;
|
|
82
|
-
}>;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
'daemon.shutdown': {
|
|
87
|
-
params: Empty;
|
|
88
|
-
result: Empty;
|
|
89
|
-
};
|
|
90
|
-
'daemon.pause': {
|
|
91
|
-
params: {
|
|
92
|
-
runtime?: RuntimeKind;
|
|
93
|
-
now?: boolean;
|
|
94
|
-
reason?: string;
|
|
95
|
-
};
|
|
96
|
-
result: PauseState;
|
|
97
|
-
};
|
|
98
|
-
'daemon.resume': {
|
|
99
|
-
params: {
|
|
100
|
-
runtime?: RuntimeKind;
|
|
101
|
-
};
|
|
102
|
-
result: PauseState;
|
|
103
|
-
};
|
|
104
|
-
'daemon.pauses': {
|
|
105
|
-
params: Empty;
|
|
106
|
-
result: PauseState;
|
|
107
|
-
};
|
|
108
|
-
'daemon.usage': {
|
|
109
|
-
params: {
|
|
110
|
-
refresh?: boolean;
|
|
111
|
-
};
|
|
112
|
-
result: {
|
|
113
|
-
providers: Array<Record<string, unknown>>;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
'catalog.get': {
|
|
117
|
-
params: Empty;
|
|
118
|
-
result: {
|
|
119
|
-
models: Array<Record<string, unknown>>;
|
|
120
|
-
modes: Array<Record<string, unknown>>;
|
|
121
|
-
thinkingOptions?: unknown;
|
|
122
|
-
defaultModel: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
'assignment.recall': {
|
|
126
|
-
params: {
|
|
127
|
-
assignmentId?: string;
|
|
128
|
-
taskId?: string;
|
|
129
|
-
projectRoot?: string;
|
|
130
|
-
question: string;
|
|
131
|
-
};
|
|
132
|
-
result: RecallAnswer;
|
|
133
|
-
};
|
|
134
|
-
'board.list': {
|
|
135
|
-
params: {
|
|
136
|
-
projectRoot: string;
|
|
137
|
-
};
|
|
138
|
-
result: {
|
|
139
|
-
pins: Pin[];
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
'question.list': {
|
|
143
|
-
params: {
|
|
144
|
-
projectRoot?: string;
|
|
145
|
-
};
|
|
146
|
-
result: {
|
|
147
|
-
questions: UserQuestion[];
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
'question.answer': {
|
|
151
|
-
params: {
|
|
152
|
-
questionId: string;
|
|
153
|
-
text?: string;
|
|
154
|
-
dismiss?: boolean;
|
|
155
|
-
reason?: string;
|
|
156
|
-
};
|
|
157
|
-
result: {
|
|
158
|
-
questionId: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
'session.create': {
|
|
162
|
-
params: {
|
|
163
|
-
sessionId?: string;
|
|
164
|
-
spec: SessionSpec;
|
|
165
|
-
history?: 'skip' | 'replay';
|
|
166
|
-
delegation?: boolean;
|
|
167
|
-
resume?: boolean;
|
|
168
|
-
};
|
|
169
|
-
result: {
|
|
170
|
-
session: SessionSnapshot;
|
|
171
|
-
attached: boolean;
|
|
172
|
-
resumed?: true;
|
|
173
|
-
durable?: boolean;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
'session.preview': {
|
|
177
|
-
params: {
|
|
178
|
-
spec: SessionSpec;
|
|
179
|
-
};
|
|
180
|
-
result: {
|
|
181
|
-
preview: SessionPreview;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
'session.attach': {
|
|
185
|
-
params: {
|
|
186
|
-
sessionId: string;
|
|
187
|
-
replay?: boolean;
|
|
188
|
-
after?: number;
|
|
189
|
-
};
|
|
190
|
-
result: {
|
|
191
|
-
session: SessionSummary;
|
|
192
|
-
cursor: number;
|
|
193
|
-
reset?: true;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
'session.release': {
|
|
197
|
-
params: {
|
|
198
|
-
sessionId: string;
|
|
199
|
-
};
|
|
200
|
-
result: {
|
|
201
|
-
closed: boolean;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
'session.prompt': {
|
|
205
|
-
params: {
|
|
206
|
-
sessionId: string;
|
|
207
|
-
clientMessageId: string;
|
|
208
|
-
delivery?: 'auto' | 'steer';
|
|
209
|
-
content: PromptContent;
|
|
210
|
-
};
|
|
211
|
-
/** `{}` from a daemon without prompt.receipts. */
|
|
212
|
-
result: {
|
|
213
|
-
outcome?: 'accepted' | 'failed';
|
|
214
|
-
error?: AlpError;
|
|
215
|
-
duplicate?: boolean;
|
|
216
|
-
durable?: boolean;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
'session.interrupt': {
|
|
220
|
-
params: {
|
|
221
|
-
sessionId: string;
|
|
222
|
-
};
|
|
223
|
-
result: Empty;
|
|
224
|
-
};
|
|
225
|
-
'session.configure': {
|
|
226
|
-
params: {
|
|
227
|
-
sessionId: string;
|
|
228
|
-
mode?: string;
|
|
229
|
-
};
|
|
230
|
-
result: {
|
|
231
|
-
session: SessionSnapshot;
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
'session.close': {
|
|
235
|
-
params: {
|
|
236
|
-
sessionId: string;
|
|
237
|
-
};
|
|
238
|
-
result: Empty;
|
|
239
|
-
};
|
|
240
|
-
'session.rename': {
|
|
241
|
-
params: {
|
|
242
|
-
sessionId: string;
|
|
243
|
-
title: string;
|
|
244
|
-
};
|
|
245
|
-
result: {
|
|
246
|
-
session: SessionSummary;
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
'session.archive': {
|
|
250
|
-
params: {
|
|
251
|
-
sessionId: string;
|
|
252
|
-
archived?: boolean;
|
|
253
|
-
};
|
|
254
|
-
result: {
|
|
255
|
-
session: SessionSummary;
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
'session.get': {
|
|
259
|
-
params: {
|
|
260
|
-
sessionId: string;
|
|
261
|
-
};
|
|
262
|
-
result: {
|
|
263
|
-
session: SessionSummary;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
'session.list': {
|
|
267
|
-
params: {
|
|
268
|
-
projectRoot?: string;
|
|
269
|
-
rootsOnly?: boolean;
|
|
270
|
-
includeClosed?: boolean;
|
|
271
|
-
includeArchived?: boolean;
|
|
272
|
-
};
|
|
273
|
-
result: {
|
|
274
|
-
sessions: SessionSummary[];
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
'session.status': {
|
|
278
|
-
params: {
|
|
279
|
-
sessionId: string;
|
|
280
|
-
};
|
|
281
|
-
result: {
|
|
282
|
-
status: TreeStatus;
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
'session.message': {
|
|
286
|
-
params: {
|
|
287
|
-
sessionId: string;
|
|
288
|
-
text: string;
|
|
289
|
-
};
|
|
290
|
-
result: Empty;
|
|
291
|
-
};
|
|
292
|
-
'session.log': {
|
|
293
|
-
params: {
|
|
294
|
-
sessionId: string;
|
|
295
|
-
};
|
|
296
|
-
result: {
|
|
297
|
-
rootId: string;
|
|
298
|
-
entries: Array<Record<string, unknown>>;
|
|
299
|
-
};
|
|
300
|
-
};
|
|
301
|
-
'extension.register': {
|
|
302
|
-
params: {
|
|
303
|
-
method: string;
|
|
304
|
-
};
|
|
305
|
-
result: {
|
|
306
|
-
registered: string;
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
'extension.unregister': {
|
|
310
|
-
params: {
|
|
311
|
-
method: string;
|
|
312
|
-
};
|
|
313
|
-
result: {
|
|
314
|
-
unregistered: string;
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
'team.list': {
|
|
318
|
-
params: {
|
|
319
|
-
projectRoot?: string;
|
|
320
|
-
};
|
|
321
|
-
result: {
|
|
322
|
-
projectRoot: string | null;
|
|
323
|
-
teams: TeamRow[];
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
'task.list': {
|
|
327
|
-
params: {
|
|
328
|
-
projectRoot: string;
|
|
329
|
-
};
|
|
330
|
-
result: {
|
|
331
|
-
projectRoot: string;
|
|
332
|
-
tasks: TaskRow[];
|
|
333
|
-
unreadable: Array<{
|
|
334
|
-
file: string;
|
|
335
|
-
error: string;
|
|
336
|
-
}>;
|
|
337
|
-
revision: string;
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
'task.create': {
|
|
341
|
-
params: {
|
|
342
|
-
projectRoot: string;
|
|
343
|
-
title: string;
|
|
344
|
-
priority?: number;
|
|
345
|
-
requestId?: string;
|
|
346
|
-
};
|
|
347
|
-
result: {
|
|
348
|
-
id: string;
|
|
349
|
-
duplicate?: true;
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
'task.update': {
|
|
353
|
-
params: {
|
|
354
|
-
projectRoot: string;
|
|
355
|
-
id: string;
|
|
356
|
-
action: 'close' | 'reopen';
|
|
357
|
-
note?: string;
|
|
358
|
-
ifRev?: number;
|
|
359
|
-
};
|
|
360
|
-
result: {
|
|
361
|
-
id: string;
|
|
362
|
-
status: string;
|
|
363
|
-
rev: number;
|
|
364
|
-
landed?: string;
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
|
-
'task.gate.resolve': {
|
|
368
|
-
params: {
|
|
369
|
-
projectRoot: string;
|
|
370
|
-
id: string;
|
|
371
|
-
gate: string;
|
|
372
|
-
note?: string;
|
|
373
|
-
ifRev?: number;
|
|
374
|
-
};
|
|
375
|
-
result: {
|
|
376
|
-
id: string;
|
|
377
|
-
status: string;
|
|
378
|
-
rev: number;
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
|
-
'library.list': {
|
|
382
|
-
params: {
|
|
383
|
-
kind: LibraryKind;
|
|
384
|
-
projectRoot?: string;
|
|
385
|
-
};
|
|
386
|
-
result: {
|
|
387
|
-
projectRoot: string | null;
|
|
388
|
-
entries: LibraryEntryRow[];
|
|
389
|
-
};
|
|
390
|
-
};
|
|
391
|
-
'library.get': {
|
|
392
|
-
params: {
|
|
393
|
-
kind: LibraryKind;
|
|
394
|
-
name: EntryName;
|
|
395
|
-
projectRoot?: string;
|
|
396
|
-
scope?: LibraryScope;
|
|
397
|
-
};
|
|
398
|
-
/** `content` carries `{ $secret: 'keep' }` in place of each secret value; `secrets` lists their JSON Pointers. */
|
|
399
|
-
result: {
|
|
400
|
-
kind: LibraryKind;
|
|
401
|
-
name: string;
|
|
402
|
-
source: LibrarySource;
|
|
403
|
-
overrides?: LibrarySource;
|
|
404
|
-
content: Record<string, unknown>;
|
|
405
|
-
revision: string | null;
|
|
406
|
-
usedBy: string[];
|
|
407
|
-
librarySkills?: string[];
|
|
408
|
-
secrets?: string[];
|
|
409
|
-
};
|
|
410
|
-
};
|
|
411
|
-
'library.save': {
|
|
412
|
-
params: {
|
|
413
|
-
kind: LibraryKind;
|
|
414
|
-
name: EntryName;
|
|
415
|
-
scope: LibraryScope;
|
|
416
|
-
projectRoot?: string;
|
|
417
|
-
content: Record<string, unknown>;
|
|
418
|
-
revision?: string | null;
|
|
419
|
-
sync?: 'none' | 'known-projects';
|
|
420
|
-
};
|
|
421
|
-
result: {
|
|
422
|
-
revision: string | null;
|
|
423
|
-
syncedProjects?: number;
|
|
424
|
-
syncErrors?: string[];
|
|
425
|
-
};
|
|
426
|
-
};
|
|
427
|
-
'library.delete': {
|
|
428
|
-
params: {
|
|
429
|
-
kind: LibraryKind;
|
|
430
|
-
name: EntryName;
|
|
431
|
-
scope: LibraryScope;
|
|
432
|
-
projectRoot?: string;
|
|
433
|
-
revision?: string;
|
|
434
|
-
};
|
|
435
|
-
result: {
|
|
436
|
-
removed: true;
|
|
437
|
-
now?: 'builtin' | 'library';
|
|
438
|
-
};
|
|
439
|
-
};
|
|
440
|
-
'library.duplicate': {
|
|
441
|
-
params: {
|
|
442
|
-
kind: LibraryKind;
|
|
443
|
-
from: EntryName;
|
|
444
|
-
to: EntryName;
|
|
445
|
-
scope: LibraryScope;
|
|
446
|
-
projectRoot?: string;
|
|
447
|
-
};
|
|
448
|
-
result: {
|
|
449
|
-
revision: string | null;
|
|
450
|
-
};
|
|
451
|
-
};
|
|
452
|
-
'library.rename': {
|
|
453
|
-
params: {
|
|
454
|
-
kind: LibraryKind;
|
|
455
|
-
from: EntryName;
|
|
456
|
-
to: EntryName;
|
|
457
|
-
scope: LibraryScope;
|
|
458
|
-
projectRoot?: string;
|
|
459
|
-
};
|
|
460
|
-
result: {
|
|
461
|
-
revision: string | null;
|
|
462
|
-
};
|
|
463
|
-
};
|
|
464
|
-
'library.skills.set': {
|
|
465
|
-
params: {
|
|
466
|
-
agent: EntryName;
|
|
467
|
-
skills: EntryName[];
|
|
468
|
-
};
|
|
469
|
-
result: {
|
|
470
|
-
skills: string[];
|
|
471
|
-
};
|
|
472
|
-
};
|
|
473
|
-
'library.models': {
|
|
474
|
-
params: Empty;
|
|
475
|
-
result: {
|
|
476
|
-
models: Array<{
|
|
477
|
-
id: string;
|
|
478
|
-
label: string;
|
|
479
|
-
efforts: string[];
|
|
480
|
-
effort?: string;
|
|
481
|
-
}>;
|
|
482
|
-
};
|
|
483
|
-
};
|
|
484
|
-
'settings.language.get': {
|
|
485
|
-
params: Empty;
|
|
486
|
-
result: LanguageSetting;
|
|
487
|
-
};
|
|
488
|
-
'settings.language.set': {
|
|
489
|
-
params: {
|
|
490
|
-
language: string | null;
|
|
491
|
-
};
|
|
492
|
-
result: LanguageSetting;
|
|
493
|
-
};
|
|
494
|
-
};
|
|
495
|
-
export type RpcMethod = keyof RpcMethodMap;
|
|
496
|
-
export type RpcParams<M extends RpcMethod> = RpcMethodMap[M]['params'];
|
|
497
|
-
export type RpcResult<M extends RpcMethod> = RpcMethodMap[M]['result'];
|
|
498
|
-
export {};
|
package/dist/wire.d.ts
CHANGED
|
@@ -13,29 +13,7 @@ export class AlpRpcError extends Error {
|
|
|
13
13
|
export const ERROR: Readonly<{
|
|
14
14
|
failed: 1000;
|
|
15
15
|
notFound: 1001;
|
|
16
|
-
forbidden: 1003;
|
|
17
16
|
conflict: 1004;
|
|
18
|
-
unavailable: 1005;
|
|
19
17
|
protocol: 1006;
|
|
20
18
|
}>;
|
|
21
|
-
/** The JSON-RPC 2.0 codes alpd answers with (docs/protocol/alp-json-rpc-v1.md §5). */
|
|
22
|
-
export const RPC_ERROR: Readonly<{
|
|
23
|
-
parseError: -32700;
|
|
24
|
-
invalidRequest: -32600;
|
|
25
|
-
methodNotFound: -32601;
|
|
26
|
-
invalidParams: -32602;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Features a daemon lists in its daemon.hello result. A client uses a feature only when listed;
|
|
30
|
-
* a daemon that lists none (one older than this list) has none of them. Unknown names are ignored.
|
|
31
|
-
*/
|
|
32
|
-
export const CAPABILITY: Readonly<{
|
|
33
|
-
attachAfter: "attach.after";
|
|
34
|
-
promptReceipts: "prompt.receipts";
|
|
35
|
-
extensionMethods: "extension.methods";
|
|
36
|
-
team: "team";
|
|
37
|
-
task: "task";
|
|
38
|
-
library: "library";
|
|
39
|
-
settingsLanguage: "settings.language";
|
|
40
|
-
}>;
|
|
41
19
|
export const RPC_METHODS: readonly string[];
|
package/dist/wire.js
CHANGED
|
@@ -8,10 +8,8 @@ var AlpRpcError = class extends Error {
|
|
|
8
8
|
this.data = error?.data;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
var ERROR = Object.freeze({ failed: 1e3, notFound: 1001,
|
|
12
|
-
var
|
|
13
|
-
var CAPABILITY = Object.freeze({ attachAfter: "attach.after", promptReceipts: "prompt.receipts", extensionMethods: "extension.methods", team: "team", task: "task", library: "library", settingsLanguage: "settings.language" });
|
|
14
|
-
var RPC_METHODS = Object.freeze(["assignment.recall", "board.list", "catalog.get", "daemon.hello", "daemon.pause", "daemon.pauses", "daemon.resume", "daemon.shutdown", "daemon.status", "daemon.usage", "extension.register", "extension.unregister", "library.delete", "library.duplicate", "library.get", "library.list", "library.models", "library.rename", "library.save", "library.skills.set", "question.answer", "question.list", "session.archive", "session.attach", "session.close", "session.configure", "session.create", "session.get", "session.interrupt", "session.list", "session.log", "session.message", "session.preview", "session.prompt", "session.release", "session.rename", "session.status", "settings.language.get", "settings.language.set", "task.create", "task.gate.resolve", "task.list", "task.update", "team.list"]);
|
|
11
|
+
var ERROR = Object.freeze({ failed: 1e3, notFound: 1001, conflict: 1004, protocol: 1006 });
|
|
12
|
+
var RPC_METHODS = Object.freeze(["assignment.recall", "board.list", "catalog.get", "daemon.hello", "daemon.pause", "daemon.pauses", "daemon.resume", "daemon.shutdown", "daemon.status", "daemon.usage", "extension.register", "extension.unregister", "question.answer", "question.list", "session.archive", "session.attach", "session.close", "session.configure", "session.create", "session.get", "session.interrupt", "session.list", "session.log", "session.message", "session.preview", "session.prompt", "session.release", "session.rename", "session.status"]);
|
|
15
13
|
function encodeFrame(value) {
|
|
16
14
|
return `${JSON.stringify(value)}
|
|
17
15
|
`;
|
|
@@ -21,11 +19,9 @@ function decodeFrame(line) {
|
|
|
21
19
|
}
|
|
22
20
|
export {
|
|
23
21
|
AlpRpcError,
|
|
24
|
-
CAPABILITY,
|
|
25
22
|
ERROR,
|
|
26
23
|
MAX_FRAME,
|
|
27
24
|
PROTOCOL_VERSION,
|
|
28
|
-
RPC_ERROR,
|
|
29
25
|
RPC_METHODS,
|
|
30
26
|
decodeFrame,
|
|
31
27
|
encodeFrame
|