@anhlp/alp-protocol 0.0.1-beta.5 → 0.0.1-beta.7
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 +59 -0
- package/dist/contract-v1.js +1 -1
- package/dist/rpc.d.ts +17 -1
- package/dist/wire.d.ts +1 -0
- package/dist/wire.js +2 -2
- package/fixtures/v1/cases.json +86 -0
- package/package.json +1 -1
- package/schema/methods-v1.json +70 -0
- package/src/contract-v1.js +1 -1
- package/src/rpc.ts +9 -1
- package/src/wire.js +2 -2
package/src/rpc.ts
CHANGED
|
@@ -38,7 +38,10 @@ export type TerminalNotification = { jsonrpc: '2.0'; method: 'terminal.event'; p
|
|
|
38
38
|
export type HistoryItem = Envelope | { cursor: number; oversized: { bytes: number } };
|
|
39
39
|
export type HistoryPage = { generation: string; items: HistoryItem[]; olderCursor?: string; hasOlder: boolean; tipCursor: number };
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
/** One entry of session.commands: inserted as `/<name>` into the composer. */
|
|
42
|
+
export type SessionCommand = { name: string; description: string; argumentHint?: string; kind: 'command' | 'skill' };
|
|
43
|
+
|
|
44
|
+
export type Capability = 'session.interrupt.turn' | 'session.fork' | 'session.rewind' | 'session.reload' | 'session.resumeCommand' | 'session.commands' | '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';
|
|
42
45
|
|
|
43
46
|
/** `data.reason` values alpd sets on errors (docs/protocol/alp-json-rpc-v1.md §5.3). */
|
|
44
47
|
export type ErrorReason =
|
|
@@ -261,6 +264,11 @@ export type RpcMethodMap = {
|
|
|
261
264
|
params: { sessionId: string };
|
|
262
265
|
result: { status: 'started' | 'deferred' | 'running' };
|
|
263
266
|
};
|
|
267
|
+
/** The slash commands and skills a live session's composer offers after "/" (capability `session.commands`, t-f628). */
|
|
268
|
+
'session.commands': {
|
|
269
|
+
params: { sessionId: string };
|
|
270
|
+
result: { commands: SessionCommand[] };
|
|
271
|
+
};
|
|
264
272
|
'session.resumeCommand': {
|
|
265
273
|
params: { sessionId: string };
|
|
266
274
|
result: ResumeCommand;
|
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({ 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' });
|
|
20
|
+
export const 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', sessionCommands: 'session.commands', sessionConfigureLive: 'session.configure.live', terminal: 'terminal', terminalCapture: 'terminal.capture', terminalWatch: 'terminal.watch' });
|
|
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`
|
|
@@ -27,7 +27,7 @@ export const CAPABILITY = Object.freeze({ sessionInterruptTurn: 'session.interru
|
|
|
27
27
|
export const 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 });
|
|
28
28
|
/** Decoded bytes of base64 `data` (padding aware), without decoding it. @param {string} data */
|
|
29
29
|
export const base64Bytes = data => Math.floor(data.length * 3 / 4) - (data.endsWith('==') ? 2 : data.endsWith('=') ? 1 : 0);
|
|
30
|
-
export const 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"]);
|
|
30
|
+
export const 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.commands", "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"]);
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Limits of workspace.files.list and workspace.files.read (capability `workspace.files.read`,
|