@anhlp/alp-protocol 0.0.0-beta.2 → 0.0.1-beta.3
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/contract-v1.d.ts +37 -0
- package/dist/contract-v1.js +1 -1
- package/dist/rpc.d.ts +11 -2
- package/dist/wire.d.ts +1 -0
- package/dist/wire.js +1 -1
- package/package.json +1 -1
- package/schema/methods-v1.json +50 -1
- package/src/contract-v1.js +1 -1
- package/src/rpc.ts +7 -7
- package/src/wire.js +1 -1
package/src/rpc.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type RpcResponse = { jsonrpc: '2.0'; id: RpcId } & ({ result: unknown; er
|
|
|
11
11
|
export type EventNotification = { jsonrpc: '2.0'; method: 'event'; params: Envelope };
|
|
12
12
|
|
|
13
13
|
/** Names a daemon may list in its daemon.hello result (schema/methods-v1.json `capabilities`). */
|
|
14
|
-
export type Capability = 'attach.after' | 'prompt.receipts' | 'extension.methods' | 'team' | 'task' | 'library' | 'settings.language' | 'session.list.page' | 'question.watch' | 'question.watch.turns' | 'workspace.files' | 'workspace.files.read' | 'prompt.images';
|
|
14
|
+
export type Capability = 'attach.after' | 'prompt.receipts' | 'extension.methods' | 'team' | 'task' | 'library' | 'library.project.write' | 'settings.language' | 'session.list.page' | 'question.watch' | 'question.watch.turns' | 'workspace.files' | 'workspace.files.read' | 'prompt.images';
|
|
15
15
|
|
|
16
16
|
/** `data.reason` values alpd sets on errors (docs/protocol/alp-json-rpc-v1.md §5.3). */
|
|
17
17
|
export type ErrorReason =
|
|
@@ -19,7 +19,7 @@ export type ErrorReason =
|
|
|
19
19
|
| 'response_too_large' | 'persistence_failed' | 'outcome_unknown' | 'key_conflict'
|
|
20
20
|
// Project, task and library methods (docs/protocol/alp-json-rpc-v1.md §5.3).
|
|
21
21
|
| 'invalid_path' | 'invalid_scope' | 'invalid_entry' | 'secret_marker' | 'not_alp_project' | 'unknown_task' | 'not_found'
|
|
22
|
-
| 'unsafe_path' | 'revision_conflict' | 'task_state' | 'in_use' | 'busy' | 'unreadable'
|
|
22
|
+
| 'library_policy' | 'unsafe_path' | 'revision_conflict' | 'task_state' | 'in_use' | 'busy' | 'unreadable'
|
|
23
23
|
// workspace.files.search (§12.3); workspace.files.list and read (§12.4).
|
|
24
24
|
| 'not_directory' | 'blocked_path' | 'ignored' | 'linked' | 'binary' | 'too_large';
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ type Empty = Record<string, never>;
|
|
|
31
31
|
* properties this map does not name: clients ignore them.
|
|
32
32
|
*/
|
|
33
33
|
export type RpcMethodMap = {
|
|
34
|
-
'daemon.hello': { params: { protocolVersion: 1; client?: { name: string; version: string }; capabilities?: string[] }; result: { protocolVersion: 1; daemonVersion?: string; pid?: number; /** The daemon host's machine name (os.hostname()), a label for clients. */ hostname?: string; capabilities?: string[] } };
|
|
34
|
+
'daemon.hello': { params: { protocolVersion: 1; client?: { name: string; version: string }; capabilities?: string[] }; result: { protocolVersion: 1; daemonVersion?: string; pid?: number; /** The daemon host's machine name (os.hostname()), a label for clients. */ hostname?: string; promptImageLimits?: { maxCount: number; maxBytes: number; maxTotalBytes: number }; capabilities?: string[] } };
|
|
35
35
|
'daemon.status': {
|
|
36
36
|
params: Empty;
|
|
37
37
|
result: {
|
|
@@ -96,12 +96,12 @@ export type RpcMethodMap = {
|
|
|
96
96
|
result: { kind: LibraryKind; name: string; source: LibrarySource; overrides?: LibrarySource; content: Record<string, unknown>; revision: string | null; usedBy: string[]; librarySkills?: string[]; secrets?: string[] };
|
|
97
97
|
};
|
|
98
98
|
'library.save': {
|
|
99
|
-
params: { kind: LibraryKind; name: EntryName; scope: LibraryScope; projectRoot?: string; content: Record<string, unknown>; revision?: string | null; sync?: 'none' | 'known-projects' };
|
|
99
|
+
params: { kind: LibraryKind; name: EntryName; scope: LibraryScope; projectRoot?: string; policy?: 'project-data'; content: Record<string, unknown>; revision?: string | null; sync?: 'none' | 'known-projects' };
|
|
100
100
|
result: { revision: string | null; syncedProjects?: number; syncErrors?: string[] };
|
|
101
101
|
};
|
|
102
|
-
'library.delete': { params: { kind: LibraryKind; name: EntryName; scope: LibraryScope; projectRoot?: string; revision?: string }; result: { removed: true; now?: 'builtin' | 'library' } };
|
|
103
|
-
'library.duplicate': { params: { kind: LibraryKind; from: EntryName; to: EntryName; scope: LibraryScope; projectRoot?: string }; result: { revision: string | null } };
|
|
104
|
-
'library.rename': { params: { kind: LibraryKind; from: EntryName; to: EntryName; scope: LibraryScope; projectRoot?: string }; result: { revision: string | null } };
|
|
102
|
+
'library.delete': { params: { kind: LibraryKind; name: EntryName; scope: LibraryScope; projectRoot?: string; policy?: 'project-data'; revision?: string }; result: { removed: true; now?: 'builtin' | 'library' } };
|
|
103
|
+
'library.duplicate': { params: { kind: LibraryKind; from: EntryName; to: EntryName; scope: LibraryScope; projectRoot?: string; policy?: 'project-data' }; result: { revision: string | null } };
|
|
104
|
+
'library.rename': { params: { kind: LibraryKind; from: EntryName; to: EntryName; scope: LibraryScope; projectRoot?: string; policy?: 'project-data' }; result: { revision: string | null } };
|
|
105
105
|
'library.skills.set': { params: { agent: EntryName; skills: EntryName[] }; result: { skills: string[] } };
|
|
106
106
|
'library.models': { params: Empty; result: { models: Array<{ id: string; label: string; efforts: string[]; effort?: string }> } };
|
|
107
107
|
'settings.language.get': { params: Empty; result: LanguageSetting };
|
package/src/wire.js
CHANGED
|
@@ -17,7 +17,7 @@ export const RPC_ERROR = Object.freeze({ parseError: -32700, invalidRequest: -32
|
|
|
17
17
|
* Features a daemon lists in its daemon.hello result. A client uses a feature only when listed;
|
|
18
18
|
* a daemon that lists none (one older than this list) has none of them. Unknown names are ignored.
|
|
19
19
|
*/
|
|
20
|
-
export const CAPABILITY = Object.freeze({ attachAfter: 'attach.after', promptReceipts: 'prompt.receipts', extensionMethods: 'extension.methods', team: 'team', task: 'task', library: 'library', settingsLanguage: 'settings.language', sessionListPage: 'session.list.page', questionWatch: 'question.watch', questionWatchTurns: 'question.watch.turns', workspaceFiles: 'workspace.files', workspaceFilesRead: 'workspace.files.read', promptImages: 'prompt.images' });
|
|
20
|
+
export const CAPABILITY = Object.freeze({ attachAfter: 'attach.after', 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', workspaceFiles: 'workspace.files', workspaceFilesRead: 'workspace.files.read', promptImages: 'prompt.images' });
|
|
21
21
|
/**
|
|
22
22
|
* What alpd takes as images in one session.prompt (capability `prompt.images`): inline base64 of
|
|
23
23
|
* these types only, never a path or URL; at most `maxCount` of them, each at most `maxBytes`
|