@anhlp/alp-protocol 0.0.1-beta.4 → 0.0.1-beta.6
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/connection.d.ts +9 -0
- package/dist/contract-v1.d.ts +1739 -1025
- package/dist/contract-v1.js +1 -1
- package/dist/dto.d.ts +6 -1
- package/dist/events.d.ts +6 -0
- package/dist/rpc.d.ts +179 -4
- package/dist/schedule.d.ts +5 -0
- package/dist/session.d.ts +2 -1
- package/dist/wire.d.ts +13 -1
- package/dist/wire.js +3 -3
- package/fixtures/v1/cases.json +811 -19
- package/package.json +1 -1
- package/schema/ipc-v1.json +92 -0
- package/schema/methods-v1.json +886 -20
- package/src/connection.ts +6 -0
- package/src/contract-v1.js +1 -1
- package/src/dto.ts +1 -1
- package/src/events.ts +2 -0
- package/src/rpc.ts +43 -7
- package/src/schedule.ts +5 -0
- package/src/session.ts +1 -1
- package/src/wire.js +7 -4
package/dist/dto.d.ts
CHANGED
|
@@ -50,7 +50,12 @@ export type TaskRow = {
|
|
|
50
50
|
waits?: string[];
|
|
51
51
|
approvals?: Array<{
|
|
52
52
|
gate: string;
|
|
53
|
-
note: string;
|
|
53
|
+
note: string; /** Answers to pick from; any approves. */
|
|
54
|
+
options?: string[]; /** The user's latest rejection; the gate stays open. */
|
|
55
|
+
rejected?: {
|
|
56
|
+
at: string;
|
|
57
|
+
reason?: string;
|
|
58
|
+
};
|
|
54
59
|
}>;
|
|
55
60
|
handoff?: {
|
|
56
61
|
outcome: string;
|
package/dist/events.d.ts
CHANGED
|
@@ -215,6 +215,12 @@ export type UserQuestion = {
|
|
|
215
215
|
body: string;
|
|
216
216
|
options?: string[];
|
|
217
217
|
askedAt: string;
|
|
218
|
+
/** A card that mirrors an open human gate of the project's tasks: choosing an option approves it, dismissing rejects it. It has no timeout. */
|
|
219
|
+
gate?: {
|
|
220
|
+
projectRoot: string;
|
|
221
|
+
taskId: string;
|
|
222
|
+
gateId: string;
|
|
223
|
+
};
|
|
218
224
|
};
|
|
219
225
|
export type SessionState = 'running' | 'waiting' | 'waiting_parent' | 'waiting_user' | 'idle';
|
|
220
226
|
/** A live tree at one moment, for dashboards (plans/reference/ALPD.md §17). */
|
package/dist/rpc.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export type TerminalInfo = {
|
|
|
48
48
|
exitCode?: number | null;
|
|
49
49
|
signal?: number | null;
|
|
50
50
|
endReason?: TerminalEndReason;
|
|
51
|
+
/** Absent: full native protection. root-only: best-effort Linux. none: Windows ConPTY, best-effort cleanup. */
|
|
52
|
+
protection?: 'root-only' | 'none';
|
|
51
53
|
};
|
|
52
54
|
/** Effective terminal limits a daemon.hello advertises with capability `terminal`. */
|
|
53
55
|
export type TerminalLimits = {
|
|
@@ -78,6 +80,21 @@ export type TerminalEvent = {
|
|
|
78
80
|
type: 'detached';
|
|
79
81
|
reason: 'replaced' | 'slow_consumer';
|
|
80
82
|
};
|
|
83
|
+
export type CatalogUpdatedNotification = {
|
|
84
|
+
jsonrpc: '2.0';
|
|
85
|
+
method: 'catalog.updated';
|
|
86
|
+
params: {
|
|
87
|
+
fetchedAt?: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export type TerminalChangedNotification = {
|
|
91
|
+
jsonrpc: '2.0';
|
|
92
|
+
method: 'terminal.changed';
|
|
93
|
+
params: {
|
|
94
|
+
watchId: string;
|
|
95
|
+
cursor: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
81
98
|
export type TerminalNotification = {
|
|
82
99
|
jsonrpc: '2.0';
|
|
83
100
|
method: 'terminal.event';
|
|
@@ -97,9 +114,9 @@ export type HistoryPage = {
|
|
|
97
114
|
hasOlder: boolean;
|
|
98
115
|
tipCursor: number;
|
|
99
116
|
};
|
|
100
|
-
export type Capability = 'session.interrupt.turn' | 'session.fork' | 'session.rewind' | 'session.reload' | 'session.resumeCommand' | 'session.configure.live' | 'terminal' | 'attachments' | 'workspace.git' | 'workspace.worktree' | 'workspace.registry' | 'session.history' | 'attach.after' | 'prompt.receipts' | 'extension.methods' | 'team' | 'task' | 'library' | 'library.project.write' | 'settings.language' | 'session.list.page' | 'question.watch' | 'question.watch.turns' | 'session.attention' | 'workspace.files' | 'workspace.files.read' | 'prompt.images' | 'schedule';
|
|
117
|
+
export type Capability = 'session.interrupt.turn' | 'session.fork' | 'session.rewind' | 'session.reload' | 'session.resumeCommand' | 'session.configure.live' | 'terminal' | 'terminal.capture' | 'terminal.watch' | 'attachments' | 'workspace.git' | 'workspace.git.facts' | 'workspace.worktree' | 'workspace.registry' | 'session.history' | 'attach.after' | 'prompt.receipts' | 'extension.methods' | 'team' | 'task' | 'library' | 'library.project.write' | 'settings.language' | 'session.list.page' | 'question.watch' | 'question.watch.turns' | 'session.attention' | 'workspace.files' | 'workspace.files.read' | 'workspace.files.browse' | 'host.directories' | 'prompt.images' | 'schedule' | 'catalog.live';
|
|
101
118
|
/** `data.reason` values alpd sets on errors (docs/protocol/alp-json-rpc-v1.md §5.3). */
|
|
102
|
-
export type ErrorReason = 'hello_required' | 'protocol_version' | 'invalid_params' | 'invalid_id' | 'batch_unsupported' | 'frame_too_large' | 'invalid_cursor' | 'stale_cursor' | 'history_gap' | 'stale_revision' | 'request_conflict' | 'cwd_mismatch' | 'workspace_mismatch' | 'corrupt_registry' | 'identity_changed' | 'response_too_large' | 'persistence_failed' | 'outcome_unknown' | 'key_conflict' | 'invalid_path' | 'invalid_scope' | 'invalid_entry' | 'secret_marker' | 'not_alp_project' | 'unknown_task' | 'not_found' | 'library_policy' | 'unsafe_path' | 'revision_conflict' | 'task_state' | 'in_use' | 'busy' | 'unreadable' | 'not_directory' | 'blocked_path' | 'ignored' | 'linked' | 'binary' | 'too_large' | 'not_repository' | 'unknown_ref' | 'invalid_compare' | 'stale_snapshot' | 'git_unavailable' | 'git_failed' | 'invalid_name' | 'invalid_data' | 'attachment_too_large' | 'offset_mismatch' | 'chunk_conflict' | 'upload_incomplete' | 'hash_mismatch' | 'upload_expired' | 'quota_exceeded' | 'attachment_referenced' | 'attachment_limit' | 'attachment_unavailable' | 'attachment_unsupported' | 'session_busy' | 'stale_generation' | 'turn_not_found' | 'turn_in_progress' | 'empty_prefix' | 'boundary_unmapped' | 'runtime_unsupported' | 'native_refused' | 'branch_not_found' | 'attachment_forbidden' | 'session_closed' | 'no_history' | 'runtime_mismatch' | 'agent_mismatch' | 'permission_escalation' | 'team_not_found' | 'terminal_disabled' | 'terminal_unsupported' | 'terminal_limit' | 'not_attached' | 'terminal_exited' | 'input_too_large';
|
|
119
|
+
export type ErrorReason = 'hello_required' | 'protocol_version' | 'invalid_params' | 'invalid_id' | 'batch_unsupported' | 'frame_too_large' | 'invalid_cursor' | 'stale_cursor' | 'history_gap' | 'stale_revision' | 'request_conflict' | 'cwd_mismatch' | 'workspace_mismatch' | 'corrupt_registry' | 'identity_changed' | 'response_too_large' | 'persistence_failed' | 'outcome_unknown' | 'key_conflict' | 'invalid_path' | 'invalid_scope' | 'invalid_entry' | 'secret_marker' | 'not_alp_project' | 'unknown_task' | 'not_found' | 'library_policy' | 'unsafe_path' | 'revision_conflict' | 'task_state' | 'in_use' | 'busy' | 'unreadable' | 'not_directory' | 'blocked_path' | 'ignored' | 'linked' | 'binary' | 'too_large' | 'outside' | 'changed' | 'not_repository' | 'unknown_ref' | 'invalid_compare' | 'stale_snapshot' | 'git_unavailable' | 'git_failed' | 'invalid_name' | 'invalid_data' | 'attachment_too_large' | 'offset_mismatch' | 'chunk_conflict' | 'upload_incomplete' | 'hash_mismatch' | 'upload_expired' | 'quota_exceeded' | 'attachment_referenced' | 'attachment_limit' | 'attachment_unavailable' | 'attachment_unsupported' | 'session_busy' | 'stale_generation' | 'turn_not_found' | 'turn_in_progress' | 'empty_prefix' | 'boundary_unmapped' | 'runtime_unsupported' | 'native_refused' | 'branch_not_found' | 'attachment_forbidden' | 'session_closed' | 'no_history' | 'runtime_mismatch' | 'agent_mismatch' | 'permission_escalation' | 'team_not_found' | 'terminal_capture_unavailable' | 'terminal_capture_too_large' | 'terminal_snapshot_too_large' | 'terminal_disabled' | 'terminal_unsupported' | 'terminal_limit' | 'not_attached' | 'terminal_exited' | 'input_too_large';
|
|
103
120
|
type Empty = Record<string, never>;
|
|
104
121
|
/**
|
|
105
122
|
* Params and result of every v1 method, as schema/methods-v1.json defines them; the protocol tests
|
|
@@ -202,6 +219,28 @@ export type GitDiffPage = {
|
|
|
202
219
|
truncated: boolean;
|
|
203
220
|
nextCursor?: string;
|
|
204
221
|
};
|
|
222
|
+
/**
|
|
223
|
+
* workspace.git.facts (capability `workspace.git.facts`, §12.5): an owner-only answer for a host
|
|
224
|
+
* directory, so `repoRoot` is a host path (the directory's real path, or the enclosing repository's
|
|
225
|
+
* top level for `not_repository_root`). Never forwarded by a gateway.
|
|
226
|
+
*/
|
|
227
|
+
export type GitCheckoutFacts = {
|
|
228
|
+
repoRoot: string;
|
|
229
|
+
branch: string | null;
|
|
230
|
+
detached: boolean;
|
|
231
|
+
head: string | null;
|
|
232
|
+
hasRemote: boolean;
|
|
233
|
+
remoteUrl: string | null;
|
|
234
|
+
dirty: boolean;
|
|
235
|
+
};
|
|
236
|
+
export type GitFacts = ({
|
|
237
|
+
kind: 'ok' | 'not_repository_root';
|
|
238
|
+
} & GitCheckoutFacts) | {
|
|
239
|
+
kind: 'unknown';
|
|
240
|
+
} | {
|
|
241
|
+
kind: 'unsupported';
|
|
242
|
+
reason: 'worktree_elsewhere' | 'inside_git_dir';
|
|
243
|
+
};
|
|
205
244
|
/**
|
|
206
245
|
* Capability `attachments` (§12.6). Principal context is set only by a trusted gateway on its own
|
|
207
246
|
* connection; a local client leaves it out and acts as the owner.
|
|
@@ -259,6 +298,7 @@ export type RpcMethodMap = {
|
|
|
259
298
|
cols: number;
|
|
260
299
|
rows: number;
|
|
261
300
|
requestId: string;
|
|
301
|
+
protectionAcknowledgment?: 'linux-root-only-v1';
|
|
262
302
|
};
|
|
263
303
|
result: {
|
|
264
304
|
terminal: TerminalInfo;
|
|
@@ -272,10 +312,41 @@ export type RpcMethodMap = {
|
|
|
272
312
|
terminals: TerminalInfo[];
|
|
273
313
|
};
|
|
274
314
|
};
|
|
315
|
+
'terminal.watch': {
|
|
316
|
+
params: PrincipalContext & {
|
|
317
|
+
workspaceId?: string;
|
|
318
|
+
after?: string;
|
|
319
|
+
};
|
|
320
|
+
result: {
|
|
321
|
+
terminals: TerminalInfo[];
|
|
322
|
+
watchId: string;
|
|
323
|
+
cursor: string;
|
|
324
|
+
reset: boolean;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
'terminal.unwatch': {
|
|
328
|
+
params: Empty;
|
|
329
|
+
result: {
|
|
330
|
+
closed: true;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
'terminal.capture': {
|
|
334
|
+
params: PrincipalContext & {
|
|
335
|
+
terminalId: string;
|
|
336
|
+
start?: number;
|
|
337
|
+
end?: number;
|
|
338
|
+
stripAnsi?: boolean;
|
|
339
|
+
};
|
|
340
|
+
result: {
|
|
341
|
+
lines: string[];
|
|
342
|
+
totalLines: number;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
275
345
|
'terminal.attach': {
|
|
276
346
|
params: PrincipalContext & {
|
|
277
347
|
terminalId: string;
|
|
278
348
|
after?: number;
|
|
349
|
+
protectionAcknowledgment?: 'linux-root-only-v1';
|
|
279
350
|
};
|
|
280
351
|
result: {
|
|
281
352
|
terminal: TerminalInfo;
|
|
@@ -400,6 +471,12 @@ export type RpcMethodMap = {
|
|
|
400
471
|
};
|
|
401
472
|
result: GitDiffPage;
|
|
402
473
|
};
|
|
474
|
+
'workspace.git.facts': {
|
|
475
|
+
params: {
|
|
476
|
+
directory: string;
|
|
477
|
+
};
|
|
478
|
+
result: GitFacts;
|
|
479
|
+
};
|
|
403
480
|
'workspace.worktree.options': {
|
|
404
481
|
params: {
|
|
405
482
|
workspaceId: string;
|
|
@@ -601,6 +678,27 @@ export type RpcMethodMap = {
|
|
|
601
678
|
modes: Array<Record<string, unknown>>;
|
|
602
679
|
thinkingOptions?: unknown;
|
|
603
680
|
defaultModel: string;
|
|
681
|
+
fetchedAt?: string;
|
|
682
|
+
providers?: Record<string, {
|
|
683
|
+
status: string;
|
|
684
|
+
fetchedAt?: string;
|
|
685
|
+
error?: string;
|
|
686
|
+
}>;
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
'catalog.refresh': {
|
|
690
|
+
params: Empty;
|
|
691
|
+
result: {
|
|
692
|
+
models: Array<Record<string, unknown>>;
|
|
693
|
+
modes: Array<Record<string, unknown>>;
|
|
694
|
+
thinkingOptions?: unknown;
|
|
695
|
+
defaultModel: string;
|
|
696
|
+
fetchedAt?: string;
|
|
697
|
+
providers?: Record<string, {
|
|
698
|
+
status: string;
|
|
699
|
+
fetchedAt?: string;
|
|
700
|
+
error?: string;
|
|
701
|
+
}>;
|
|
604
702
|
};
|
|
605
703
|
};
|
|
606
704
|
'assignment.recall': {
|
|
@@ -667,12 +765,14 @@ export type RpcMethodMap = {
|
|
|
667
765
|
truncated?: boolean;
|
|
668
766
|
};
|
|
669
767
|
};
|
|
670
|
-
/** Capability `workspace.files.read`: the entries of a directory under `projectRoot` (its root when `path` is left out); links, blocked and (unless `includeIgnored`) .gitignore'd entries left out. */
|
|
768
|
+
/** Capability `workspace.files.read`: the entries of a directory under `projectRoot` (its root when `path` is left out); links, blocked and (unless `includeIgnored`) .gitignore'd entries left out. With `workspace.files.browse`: `cursor` pages past 1000 entries; `internalLinks` lists links inside the root as what they lead to (`target`). */
|
|
671
769
|
'workspace.files.list': {
|
|
672
770
|
params: {
|
|
673
771
|
projectRoot: string;
|
|
674
772
|
path?: string;
|
|
675
773
|
includeIgnored?: boolean;
|
|
774
|
+
cursor?: string;
|
|
775
|
+
internalLinks?: boolean;
|
|
676
776
|
};
|
|
677
777
|
result: {
|
|
678
778
|
entries: Array<{
|
|
@@ -681,8 +781,11 @@ export type RpcMethodMap = {
|
|
|
681
781
|
kind: 'file' | 'directory';
|
|
682
782
|
size?: number;
|
|
683
783
|
modifiedAt?: string;
|
|
784
|
+
target?: string;
|
|
684
785
|
}>;
|
|
685
786
|
truncated?: boolean;
|
|
787
|
+
nextCursor?: string;
|
|
788
|
+
target?: string;
|
|
686
789
|
};
|
|
687
790
|
};
|
|
688
791
|
/** Capability `workspace.files.read`: a UTF-8 text file under `projectRoot`, at most 1 MiB; read-only, links not followed. */
|
|
@@ -699,6 +802,63 @@ export type RpcMethodMap = {
|
|
|
699
802
|
modifiedAt?: string;
|
|
700
803
|
};
|
|
701
804
|
};
|
|
805
|
+
/** Capability `workspace.files.browse`: every name under `projectRoot` holding `query`'s letters in order (or ending with it), in path order, in pages of a snapshot; read-only, links not entered. */
|
|
806
|
+
'workspace.files.find': {
|
|
807
|
+
params: {
|
|
808
|
+
projectRoot: string;
|
|
809
|
+
query?: string;
|
|
810
|
+
kinds?: Array<'file' | 'directory'>;
|
|
811
|
+
matchMode?: 'subsequence' | 'suffix';
|
|
812
|
+
limit?: number;
|
|
813
|
+
cursor?: string;
|
|
814
|
+
};
|
|
815
|
+
result: {
|
|
816
|
+
entries: Array<{
|
|
817
|
+
path: string;
|
|
818
|
+
kind: 'file' | 'directory';
|
|
819
|
+
}>;
|
|
820
|
+
nextCursor?: string;
|
|
821
|
+
truncated?: boolean;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
/** Capability `workspace.files.browse`: a file under `projectRoot` as a preview, text, image or binary, at most 50 MiB, its bytes in chunks from `offset`. */
|
|
825
|
+
'workspace.files.preview': {
|
|
826
|
+
params: {
|
|
827
|
+
projectRoot: string;
|
|
828
|
+
path: string;
|
|
829
|
+
includeIgnored?: boolean;
|
|
830
|
+
internalLinks?: boolean;
|
|
831
|
+
maxBytes?: number;
|
|
832
|
+
offset?: number;
|
|
833
|
+
revision?: string;
|
|
834
|
+
};
|
|
835
|
+
result: {
|
|
836
|
+
path: string;
|
|
837
|
+
target?: string;
|
|
838
|
+
kind: 'text' | 'image' | 'binary';
|
|
839
|
+
mimeType: string;
|
|
840
|
+
size: number;
|
|
841
|
+
modifiedAt: string;
|
|
842
|
+
revision: string;
|
|
843
|
+
encoding: 'base64' | 'none';
|
|
844
|
+
content?: string;
|
|
845
|
+
offset?: number;
|
|
846
|
+
nextOffset?: number;
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
/** Capability `host.directories`: directories of the daemon host whose path completes `query` (absolute or under ~), or whose name matches it under the home directory. */
|
|
850
|
+
'host.directories.search': {
|
|
851
|
+
params: {
|
|
852
|
+
query: string;
|
|
853
|
+
limit?: number;
|
|
854
|
+
};
|
|
855
|
+
result: {
|
|
856
|
+
entries: Array<{
|
|
857
|
+
path: string;
|
|
858
|
+
}>;
|
|
859
|
+
truncated?: boolean;
|
|
860
|
+
};
|
|
861
|
+
};
|
|
702
862
|
'question.answer': {
|
|
703
863
|
params: {
|
|
704
864
|
questionId: string;
|
|
@@ -903,6 +1063,18 @@ export type RpcMethodMap = {
|
|
|
903
1063
|
* The ALP CLI command that continues a session in a terminal, built by alpd (capability
|
|
904
1064
|
* `session.resumeCommand`, §12.8): argv and its POSIX and Windows command lines, for the clipboard only.
|
|
905
1065
|
*/
|
|
1066
|
+
/**
|
|
1067
|
+
* Compacts a live root's context (t-0e56): main writes a checkpoint by skill compact, then its runtime
|
|
1068
|
+
* compacts, or ALP starts a fresh conversation seeded with it. Idle: now; otherwise at its next turn boundary.
|
|
1069
|
+
*/
|
|
1070
|
+
'session.compact': {
|
|
1071
|
+
params: {
|
|
1072
|
+
sessionId: string;
|
|
1073
|
+
};
|
|
1074
|
+
result: {
|
|
1075
|
+
status: 'started' | 'deferred' | 'running';
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
906
1078
|
'session.resumeCommand': {
|
|
907
1079
|
params: {
|
|
908
1080
|
sessionId: string;
|
|
@@ -1039,7 +1211,10 @@ export type RpcMethodMap = {
|
|
|
1039
1211
|
id: string;
|
|
1040
1212
|
gate: string;
|
|
1041
1213
|
note?: string;
|
|
1042
|
-
ifRev?: number;
|
|
1214
|
+
ifRev?: number; /** One of a human gate's options; picking one approves it. */
|
|
1215
|
+
choice?: string; /** Record the user's rejection instead (note is the reason); the gate stays open. */
|
|
1216
|
+
reject?: boolean; /** Where the user decided, recorded on the gate. Default web. */
|
|
1217
|
+
channel?: 'paseo' | 'web';
|
|
1043
1218
|
};
|
|
1044
1219
|
result: {
|
|
1045
1220
|
id: string;
|
package/dist/schedule.d.ts
CHANGED
|
@@ -40,4 +40,9 @@ export type ScheduleJob = {
|
|
|
40
40
|
lateByMs?: number;
|
|
41
41
|
/** The last error of the job: why it failed, or why it still waits. */
|
|
42
42
|
lastError?: ScheduleError;
|
|
43
|
+
/**
|
|
44
|
+
* false: the job does not keep its session open while it waits, so an idle session may
|
|
45
|
+
* still be closed and the job then fails as session_closed. Absent: it keeps it open.
|
|
46
|
+
*/
|
|
47
|
+
keepsSession?: false;
|
|
43
48
|
};
|
package/dist/session.d.ts
CHANGED
|
@@ -124,7 +124,8 @@ export type Pause = {
|
|
|
124
124
|
since: string;
|
|
125
125
|
by: string;
|
|
126
126
|
reason: string;
|
|
127
|
-
resetsAt?: string; /**
|
|
127
|
+
resetsAt?: string; /** Why alpd paused by itself other than a usage limit: its disk takes no writes (t-2831). */
|
|
128
|
+
cause?: 'disk'; /** When alpd last asked the runtime about the limit (ALPD §58). */
|
|
128
129
|
checkedAt?: string;
|
|
129
130
|
};
|
|
130
131
|
export type PauseState = {
|
package/dist/wire.d.ts
CHANGED
|
@@ -71,11 +71,13 @@ export const RPC_ERROR: Readonly<{
|
|
|
71
71
|
*/
|
|
72
72
|
export const CAPABILITY: Readonly<{
|
|
73
73
|
sessionInterruptTurn: "session.interrupt.turn";
|
|
74
|
+
catalogLive: "catalog.live";
|
|
74
75
|
attachAfter: "attach.after";
|
|
75
76
|
sessionHistory: "session.history";
|
|
76
77
|
workspaceRegistry: "workspace.registry";
|
|
77
78
|
workspaceWorktree: "workspace.worktree";
|
|
78
79
|
workspaceGit: "workspace.git";
|
|
80
|
+
workspaceGitFacts: "workspace.git.facts";
|
|
79
81
|
promptReceipts: "prompt.receipts";
|
|
80
82
|
extensionMethods: "extension.methods";
|
|
81
83
|
team: "team";
|
|
@@ -89,6 +91,8 @@ export const CAPABILITY: Readonly<{
|
|
|
89
91
|
sessionAttention: "session.attention";
|
|
90
92
|
workspaceFiles: "workspace.files";
|
|
91
93
|
workspaceFilesRead: "workspace.files.read";
|
|
94
|
+
workspaceFilesBrowse: "workspace.files.browse";
|
|
95
|
+
hostDirectories: "host.directories";
|
|
92
96
|
promptImages: "prompt.images";
|
|
93
97
|
schedule: "schedule";
|
|
94
98
|
attachments: "attachments";
|
|
@@ -98,6 +102,8 @@ export const CAPABILITY: Readonly<{
|
|
|
98
102
|
sessionResumeCommand: "session.resumeCommand";
|
|
99
103
|
sessionConfigureLive: "session.configure.live";
|
|
100
104
|
terminal: "terminal";
|
|
105
|
+
terminalCapture: "terminal.capture";
|
|
106
|
+
terminalWatch: "terminal.watch";
|
|
101
107
|
}>;
|
|
102
108
|
/**
|
|
103
109
|
* What alpd takes as images in one session.prompt (capability `prompt.images`): inline base64 of
|
|
@@ -116,12 +122,18 @@ export const RPC_METHODS: readonly string[];
|
|
|
116
122
|
/**
|
|
117
123
|
* Limits of workspace.files.list and workspace.files.read (capability `workspace.files.read`,
|
|
118
124
|
* docs/protocol/alp-json-rpc-v1.md §12.4): a file of at most `maxReadBytes`, a listing of at most
|
|
119
|
-
* `maxListEntries` entries, a relative path of at most `maxPathLength` characters.
|
|
125
|
+
* `maxListEntries` entries, a relative path of at most `maxPathLength` characters. With
|
|
126
|
+
* `workspace.files.browse` (§12.11): a preview of a file of at most `maxPreviewBytes`, sent in chunks
|
|
127
|
+
* of at most `maxPreviewChunkBytes` decoded (their base64 fits one MAX_FRAME), and pages of at most
|
|
128
|
+
* `maxFindEntries` names from workspace.files.find.
|
|
120
129
|
*/
|
|
121
130
|
export const WORKSPACE_FILES: Readonly<{
|
|
122
131
|
maxReadBytes: number;
|
|
123
132
|
maxListEntries: 1000;
|
|
124
133
|
maxPathLength: 4096;
|
|
134
|
+
maxPreviewBytes: number;
|
|
135
|
+
maxPreviewChunkBytes: number;
|
|
136
|
+
maxFindEntries: 1000;
|
|
125
137
|
}>;
|
|
126
138
|
/**
|
|
127
139
|
* Limits of workspace.git.status and workspace.git.diff (capability `workspace.git`,
|
package/dist/wire.js
CHANGED
|
@@ -10,11 +10,11 @@ var AlpRpcError = class extends Error {
|
|
|
10
10
|
};
|
|
11
11
|
var ERROR = Object.freeze({ failed: 1e3, notFound: 1001, forbidden: 1003, conflict: 1004, unavailable: 1005, protocol: 1006 });
|
|
12
12
|
var RPC_ERROR = Object.freeze({ parseError: -32700, invalidRequest: -32600, methodNotFound: -32601, invalidParams: -32602 });
|
|
13
|
-
var CAPABILITY = Object.freeze({ sessionInterruptTurn: "session.interrupt.turn", attachAfter: "attach.after", sessionHistory: "session.history", workspaceRegistry: "workspace.registry", workspaceWorktree: "workspace.worktree", workspaceGit: "workspace.git", promptReceipts: "prompt.receipts", extensionMethods: "extension.methods", team: "team", task: "task", library: "library", libraryProjectWrite: "library.project.write", settingsLanguage: "settings.language", sessionListPage: "session.list.page", questionWatch: "question.watch", questionWatchTurns: "question.watch.turns", sessionAttention: "session.attention", workspaceFiles: "workspace.files", workspaceFilesRead: "workspace.files.read", promptImages: "prompt.images", schedule: "schedule", attachments: "attachments", sessionFork: "session.fork", sessionRewind: "session.rewind", sessionReload: "session.reload", sessionResumeCommand: "session.resumeCommand", sessionConfigureLive: "session.configure.live", terminal: "terminal" });
|
|
13
|
+
var CAPABILITY = Object.freeze({ sessionInterruptTurn: "session.interrupt.turn", catalogLive: "catalog.live", attachAfter: "attach.after", sessionHistory: "session.history", workspaceRegistry: "workspace.registry", workspaceWorktree: "workspace.worktree", workspaceGit: "workspace.git", workspaceGitFacts: "workspace.git.facts", promptReceipts: "prompt.receipts", extensionMethods: "extension.methods", team: "team", task: "task", library: "library", libraryProjectWrite: "library.project.write", settingsLanguage: "settings.language", sessionListPage: "session.list.page", questionWatch: "question.watch", questionWatchTurns: "question.watch.turns", sessionAttention: "session.attention", workspaceFiles: "workspace.files", workspaceFilesRead: "workspace.files.read", workspaceFilesBrowse: "workspace.files.browse", hostDirectories: "host.directories", promptImages: "prompt.images", schedule: "schedule", attachments: "attachments", sessionFork: "session.fork", sessionRewind: "session.rewind", sessionReload: "session.reload", sessionResumeCommand: "session.resumeCommand", sessionConfigureLive: "session.configure.live", terminal: "terminal", terminalCapture: "terminal.capture", terminalWatch: "terminal.watch" });
|
|
14
14
|
var PROMPT_IMAGES = Object.freeze({ mimeTypes: Object.freeze(["image/png", "image/jpeg", "image/gif", "image/webp"]), maxCount: 8, maxBytes: 5 * 1024 * 1024, maxTotalBytes: 11 * 1024 * 1024 });
|
|
15
15
|
var base64Bytes = (data) => Math.floor(data.length * 3 / 4) - (data.endsWith("==") ? 2 : data.endsWith("=") ? 1 : 0);
|
|
16
|
-
var RPC_METHODS = Object.freeze(["assignment.recall", "attachment.abort", "attachment.begin", "attachment.chunk", "attachment.commit", "attachment.delete", "attachment.get", "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", "project.list", "project.register", "project.remove", "question.answer", "question.list", "question.watch", "registry.owner", "registry.worktree", "schedule.cancel", "schedule.create", "schedule.get", "schedule.list", "session.archive", "session.attach", "session.attention.clear", "session.close", "session.configure", "session.configure.preview", "session.create", "session.fork", "session.get", "session.history", "session.interrupt", "session.list", "session.log", "session.message", "session.preview", "session.prompt", "session.release", "session.reload", "session.rename", "session.resumeCommand", "session.rewind", "session.status", "settings.language.get", "settings.language.set", "task.create", "task.gate.resolve", "task.list", "task.update", "team.list", "terminal.attach", "terminal.close", "terminal.create", "terminal.input", "terminal.list", "terminal.resize", "terminal.revoke", "workspace.files.list", "workspace.files.read", "workspace.files.search", "workspace.get", "workspace.git.diff", "workspace.git.status", "workspace.list", "workspace.update", "workspace.worktree.create", "workspace.worktree.options", "workspace.worktree.remove"]);
|
|
17
|
-
var WORKSPACE_FILES = Object.freeze({ maxReadBytes: 1024 * 1024, maxListEntries: 1e3, maxPathLength: 4096 });
|
|
16
|
+
var RPC_METHODS = Object.freeze(["assignment.recall", "attachment.abort", "attachment.begin", "attachment.chunk", "attachment.commit", "attachment.delete", "attachment.get", "board.list", "catalog.get", "catalog.refresh", "daemon.hello", "daemon.pause", "daemon.pauses", "daemon.resume", "daemon.shutdown", "daemon.status", "daemon.usage", "extension.register", "extension.unregister", "host.directories.search", "library.delete", "library.duplicate", "library.get", "library.list", "library.models", "library.rename", "library.save", "library.skills.set", "project.list", "project.register", "project.remove", "question.answer", "question.list", "question.watch", "registry.owner", "registry.worktree", "schedule.cancel", "schedule.create", "schedule.get", "schedule.list", "session.archive", "session.attach", "session.attention.clear", "session.close", "session.compact", "session.configure", "session.configure.preview", "session.create", "session.fork", "session.get", "session.history", "session.interrupt", "session.list", "session.log", "session.message", "session.preview", "session.prompt", "session.release", "session.reload", "session.rename", "session.resumeCommand", "session.rewind", "session.status", "settings.language.get", "settings.language.set", "task.create", "task.gate.resolve", "task.list", "task.update", "team.list", "terminal.attach", "terminal.close", "terminal.capture", "terminal.create", "terminal.input", "terminal.list", "terminal.watch", "terminal.unwatch", "terminal.resize", "terminal.revoke", "workspace.files.find", "workspace.files.list", "workspace.files.preview", "workspace.files.read", "workspace.files.search", "workspace.get", "workspace.git.diff", "workspace.git.facts", "workspace.git.status", "workspace.list", "workspace.update", "workspace.worktree.create", "workspace.worktree.options", "workspace.worktree.remove"]);
|
|
17
|
+
var WORKSPACE_FILES = Object.freeze({ maxReadBytes: 1024 * 1024, maxListEntries: 1e3, maxPathLength: 4096, maxPreviewBytes: 50 * 1024 * 1024, maxPreviewChunkBytes: 8 * 1024 * 1024, maxFindEntries: 1e3 });
|
|
18
18
|
var WORKSPACE_GIT = Object.freeze({ maxFileBytes: 1024 * 1024, maxTotalBytes: 2 * 1024 * 1024, maxUntracked: 200, maxStatusFiles: 1e3, maxRefLength: 255 });
|
|
19
19
|
var ATTACHMENTS = Object.freeze({
|
|
20
20
|
maxObjectBytes: 20 * 1024 * 1024,
|