@anhlp/alp-protocol 0.0.1-beta.6 → 0.0.1-beta.8

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/rpc.d.ts CHANGED
@@ -114,9 +114,16 @@ export type HistoryPage = {
114
114
  hasOlder: boolean;
115
115
  tipCursor: number;
116
116
  };
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';
117
+ /** One entry of session.commands: inserted as `/<name>` into the composer. */
118
+ export type SessionCommand = {
119
+ name: string;
120
+ description: string;
121
+ argumentHint?: string;
122
+ kind: 'command' | 'skill';
123
+ };
124
+ 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';
118
125
  /** `data.reason` values alpd sets on errors (docs/protocol/alp-json-rpc-v1.md §5.3). */
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';
126
+ 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' | 'native_command_unsupported' | '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';
120
127
  type Empty = Record<string, never>;
121
128
  /**
122
129
  * Params and result of every v1 method, as schema/methods-v1.json defines them; the protocol tests
@@ -1075,6 +1082,15 @@ export type RpcMethodMap = {
1075
1082
  status: 'started' | 'deferred' | 'running';
1076
1083
  };
1077
1084
  };
1085
+ /** The slash commands and skills a live session's composer offers after "/" (capability `session.commands`, t-f628). */
1086
+ 'session.commands': {
1087
+ params: {
1088
+ sessionId: string;
1089
+ };
1090
+ result: {
1091
+ commands: SessionCommand[];
1092
+ };
1093
+ };
1078
1094
  'session.resumeCommand': {
1079
1095
  params: {
1080
1096
  sessionId: string;
@@ -1346,6 +1362,7 @@ export type RpcMethodMap = {
1346
1362
  sessionId: string;
1347
1363
  dueAt: string;
1348
1364
  prompt: string;
1365
+ keepsSession?: boolean;
1349
1366
  };
1350
1367
  result: {
1351
1368
  job: ScheduleJob;
package/dist/wire.d.ts CHANGED
@@ -100,6 +100,7 @@ export const CAPABILITY: Readonly<{
100
100
  sessionRewind: "session.rewind";
101
101
  sessionReload: "session.reload";
102
102
  sessionResumeCommand: "session.resumeCommand";
103
+ sessionCommands: "session.commands";
103
104
  sessionConfigureLive: "session.configure.live";
104
105
  terminal: "terminal";
105
106
  terminalCapture: "terminal.capture";
@@ -199,6 +200,11 @@ export const TERMINAL: Readonly<{
199
200
  }>;
200
201
  /** The TERMINAL limits a daemon.hello `terminalLimits` carries (the size bounds are fixed). */
201
202
  export const TERMINAL_LIMIT_KEYS: readonly string[];
203
+ /**
204
+ * An agent's name: lower-case letters, digits and single hyphens, starting with a letter, 1 to 64
205
+ * characters. One pattern for `principal.agent` in daemon.hello and a gateway credential's agent.
206
+ */
207
+ export const AGENT_NAME: RegExp;
202
208
  export function isTerminalId(id: unknown): boolean;
203
209
  /** Room an attachment.chunk request needs besides its base64 data. */
204
210
  export const ATTACHMENT_CHUNK_OVERHEAD: number;
package/dist/wire.js CHANGED
@@ -10,10 +10,10 @@ 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", 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" });
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", sessionCommands: "session.commands", 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", "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"]);
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.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"]);
17
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({
@@ -44,6 +44,7 @@ var TERMINAL = Object.freeze({
44
44
  maxRows: 200
45
45
  });
46
46
  var TERMINAL_LIMIT_KEYS = Object.freeze(["maxPerPrincipal", "maxPerDaemon", "maxInputBytes", "maxOutputFrameBytes", "replayBytes", "idleMs", "maxLifetimeMs", "reconnectMs"]);
47
+ var AGENT_NAME = /^[a-z](?:[a-z0-9]|-(?=[a-z0-9])){0,63}$/;
47
48
  var isTerminalId = (id) => typeof id === "string" && /^term_[0-9a-f]{32}$/.test(id);
48
49
  var ATTACHMENT_CHUNK_OVERHEAD = 64 * 1024;
49
50
  function attachmentChunkBytes(maxFrame = MAX_FRAME, maxChunkBytes = ATTACHMENTS.maxChunkBytes) {
@@ -110,6 +111,7 @@ function resumeCommandOf(sessionId, platform) {
110
111
  return { argv, posix, windows, display: platform === "windows" ? windows : posix, platform };
111
112
  }
112
113
  export {
114
+ AGENT_NAME,
113
115
  ATTACHMENTS,
114
116
  ATTACHMENT_CHUNK_OVERHEAD,
115
117
  AlpRpcError,
@@ -101,7 +101,28 @@
101
101
  "method": "extension.invoke",
102
102
  "params": {
103
103
  "method": "web.pairing",
104
- "params": {}
104
+ "params": {},
105
+ "caller": {
106
+ "agent": false
107
+ }
108
+ }
109
+ }
110
+ },
111
+ {
112
+ "name": "extension.invoke request from an agent caller",
113
+ "check": "message",
114
+ "valid": true,
115
+ "value": {
116
+ "jsonrpc": "2.0",
117
+ "id": 4,
118
+ "method": "extension.invoke",
119
+ "params": {
120
+ "method": "web.pairing",
121
+ "params": {},
122
+ "caller": {
123
+ "agent": true,
124
+ "agentName": "lead"
125
+ }
105
126
  }
106
127
  }
107
128
  },
@@ -4407,6 +4428,72 @@
4407
4428
  "prompt": "Check the provider quota and continue."
4408
4429
  }
4409
4430
  },
4431
+ {
4432
+ "name": "schedule.create with keepsSession false",
4433
+ "check": "params",
4434
+ "method": "schedule.create",
4435
+ "valid": true,
4436
+ "value": {
4437
+ "projectRoot": "/work/project",
4438
+ "sessionId": "ses_0123456789abcdef",
4439
+ "dueAt": "2026-10-20T10:00:00.000Z",
4440
+ "prompt": "Check the provider quota and continue.",
4441
+ "keepsSession": false
4442
+ }
4443
+ },
4444
+ {
4445
+ "name": "schedule.create with a keepsSession that is not a boolean",
4446
+ "check": "params",
4447
+ "method": "schedule.create",
4448
+ "valid": false,
4449
+ "value": {
4450
+ "projectRoot": "/work/project",
4451
+ "sessionId": "ses_0123456789abcdef",
4452
+ "dueAt": "2026-10-20T10:00:00.000Z",
4453
+ "prompt": "Check the provider quota and continue.",
4454
+ "keepsSession": "no"
4455
+ }
4456
+ },
4457
+ {
4458
+ "name": "schedule.create result that does not keep its session",
4459
+ "check": "result",
4460
+ "method": "schedule.create",
4461
+ "valid": true,
4462
+ "value": {
4463
+ "job": {
4464
+ "id": "sch_0123456789abcdef",
4465
+ "projectRoot": "/work/project",
4466
+ "sessionId": "ses_0123456789abcdef",
4467
+ "prompt": "Check the provider quota and continue.",
4468
+ "dueAt": "2026-10-20T10:00:00.000Z",
4469
+ "status": "pending",
4470
+ "attempts": 0,
4471
+ "createdAt": "2026-10-20T09:59:00.000Z",
4472
+ "updatedAt": "2026-10-20T09:59:00.000Z",
4473
+ "keepsSession": false
4474
+ }
4475
+ }
4476
+ },
4477
+ {
4478
+ "name": "schedule.create result with keepsSession true",
4479
+ "check": "result",
4480
+ "method": "schedule.create",
4481
+ "valid": false,
4482
+ "value": {
4483
+ "job": {
4484
+ "id": "sch_0123456789abcdef",
4485
+ "projectRoot": "/work/project",
4486
+ "sessionId": "ses_0123456789abcdef",
4487
+ "prompt": "Check the provider quota and continue.",
4488
+ "dueAt": "2026-10-20T10:00:00.000Z",
4489
+ "status": "pending",
4490
+ "attempts": 0,
4491
+ "createdAt": "2026-10-20T09:59:00.000Z",
4492
+ "updatedAt": "2026-10-20T09:59:00.000Z",
4493
+ "keepsSession": true
4494
+ }
4495
+ }
4496
+ },
4410
4497
  {
4411
4498
  "name": "schedule.create result",
4412
4499
  "check": "result",
@@ -6572,6 +6659,92 @@
6572
6659
  "duplicate": true
6573
6660
  }
6574
6661
  },
6662
+ {
6663
+ "name": "session.commands params",
6664
+ "check": "params",
6665
+ "method": "session.commands",
6666
+ "valid": true,
6667
+ "value": {
6668
+ "sessionId": "ses_1"
6669
+ }
6670
+ },
6671
+ {
6672
+ "name": "session.commands params with an extra field",
6673
+ "check": "params",
6674
+ "method": "session.commands",
6675
+ "valid": false,
6676
+ "value": {
6677
+ "sessionId": "ses_1",
6678
+ "agent": "main"
6679
+ }
6680
+ },
6681
+ {
6682
+ "name": "session.commands result",
6683
+ "check": "result",
6684
+ "method": "session.commands",
6685
+ "valid": true,
6686
+ "value": {
6687
+ "commands": [
6688
+ {
6689
+ "name": "compact",
6690
+ "description": "Clear history but keep a summary",
6691
+ "argumentHint": "<instructions>",
6692
+ "kind": "command"
6693
+ },
6694
+ {
6695
+ "name": "alp:bug-loop",
6696
+ "description": "Diagnose a bug",
6697
+ "kind": "skill"
6698
+ }
6699
+ ]
6700
+ }
6701
+ },
6702
+ {
6703
+ "name": "session.commands result with a path",
6704
+ "check": "result",
6705
+ "method": "session.commands",
6706
+ "valid": false,
6707
+ "value": {
6708
+ "commands": [
6709
+ {
6710
+ "name": "xia",
6711
+ "description": "",
6712
+ "kind": "skill",
6713
+ "path": "/home/u/.alp/skills/xia/SKILL.md"
6714
+ }
6715
+ ]
6716
+ }
6717
+ },
6718
+ {
6719
+ "name": "session.commands result with a space in a name",
6720
+ "check": "result",
6721
+ "method": "session.commands",
6722
+ "valid": false,
6723
+ "value": {
6724
+ "commands": [
6725
+ {
6726
+ "name": "rm -rf",
6727
+ "description": "",
6728
+ "kind": "command"
6729
+ }
6730
+ ]
6731
+ }
6732
+ },
6733
+ {
6734
+ "name": "session.commands result of an unknown kind",
6735
+ "check": "result",
6736
+ "method": "session.commands",
6737
+ "valid": false,
6738
+ "value": {
6739
+ "commands": [
6740
+ {
6741
+ "name": "x",
6742
+ "description": "",
6743
+ "kind": "agent"
6744
+ }
6745
+ ]
6746
+ }
6747
+ },
6575
6748
  {
6576
6749
  "name": "session.resumeCommand params",
6577
6750
  "check": "params",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anhlp/alp-protocol",
3
- "version": "0.0.1-beta.6",
3
+ "version": "0.0.1-beta.8",
4
4
  "type": "module",
5
5
  "description": "ALP protocol module",
6
6
  "files": [
@@ -2670,6 +2670,9 @@
2670
2670
  },
2671
2671
  "lastError": {
2672
2672
  "$ref": "#/$defs/scheduleError"
2673
+ },
2674
+ "keepsSession": {
2675
+ "const": false
2673
2676
  }
2674
2677
  },
2675
2678
  "required": [
@@ -17,7 +17,7 @@
17
17
  "capabilities": {
18
18
  "attach.after": "session.attach accepts `after` and answers `cursor`/`reset`; envelopes kept in a tree timeline carry `cursor`.",
19
19
  "prompt.receipts": "session.prompt is answered at most once per (sessionId, clientMessageId) from a durable receipt; repeats answer the first outcome or outcome_unknown.",
20
- "extension.methods": "extension.register/unregister, and the daemon sends extension.invoke requests to the owning connection.",
20
+ "extension.methods": "extension.register/unregister (refused to an agent-marked connection, user_only), and the daemon sends extension.invoke requests to the owning connection, with a `caller: { agent, agentName? }` the daemon sets itself from the calling connection, never from the caller's params.",
21
21
  "team": "team.list: the teams a project can use, from the daemon host's built-ins, library and project.",
22
22
  "task": "task.list, task.create, task.update and task.gate.resolve on a project's .alp/tasks, written by the daemon under the task lock.",
23
23
  "library": "library.list/get/save/delete/duplicate/rename, library.skills.set and library.models on the daemon user's library and a project's .alp overrides; secrets are redacted on read.",
@@ -43,12 +43,13 @@
43
43
  "session.rewind": "session.rewind: a root's conversation from before a turn on, under the same session id; the later turns stay a recoverable branch, files are never changed, history generation advances (`history.reset` event). Same condition as session.fork.",
44
44
  "session.reload": "session.reload: restarts a live root's native process on its own conversation and configuration at the idle barrier (no turn, child, question, mail or parked work), keeping its session id, history and receipts; through the lifecycle journal. Listed with a store and a runtime that restarts a root on its own conversation, on macOS and Linux (not Windows).",
45
45
  "session.resumeCommand": "session.resumeCommand: the ALP CLI command (`alp attach <sessionId>`) that follows a session in a terminal, as argv and POSIX and Windows (cmd.exe) command lines built by alpd; for the clipboard only, never run, never a native runtime's command, credential, env or path.",
46
+ "session.commands": "session.commands: the slash commands and skills a live session's composer offers after \"/\" (its runtime's, then its agent's ALP skills): names, descriptions and argument hints only, never a path.",
46
47
  "session.configure.live": "session.configure takes model, thinking and team (with requestId and ifGeneration) besides mode, and session.configure.preview answers the configuration a change would run with: a live root's model, effort or team changes at the idle barrier (no turn, child, question, mail or parked work) through a controlled restart of its native process on the same conversation; the effective configuration is written only after the runtime took it, through the lifecycle journal (§12.9). Never another runtime and never more permissions. Listed with a store and a runtime that restarts a root with a new configuration, on macOS and Linux (not Windows).",
47
48
  "terminal": "terminal.create/list/attach/input/resize/close/revoke and terminal.event notifications: a real PTY shell on the daemon host as the daemon's account (a cwd is not a sandbox), served only when the host owner opted in (<ALP_HOME>/terminal.json allowRemoteTerminal) on macOS (full protection), Linux and Windows (best-effort).",
48
49
  "session.interrupt.turn": "session.interrupt accepts turnId and atomically cancels only that active turn, including its subtree. Conditional requests answer interrupted:true when canceled, false when the named turn is no longer active; false changes nothing. Without this capability clients must not send turnId or infer targeted cancellation from a legacy interrupt.",
49
50
  "terminal.capture": "terminal.capture: bounded daemon-owned rendered text, inclusive zero-based/negative line ranges; same terminal principal/host opt-in. Exceeding resource/result limits is an explicit refusal.",
50
51
  "terminal.watch": "terminal.watch/unwatch and terminal.changed: atomic scoped snapshot/subscription. Opaque per-subscription cursor, latest snapshot replaces invalidation history on reconnect/reset; older hosts use explicit polling fallback.",
51
- "catalog.live": "catalog.get answers the live model catalog (provider lists merged over ALP's static rows) with fetchedAt and per-provider status; catalog.refresh asks the providers again; alpd sends catalog.updated to every helloed connection when the catalog changes."
52
+ "catalog.live": "catalog.get answers the live model catalog (provider lists merged over ALP's static rows) with fetchedAt and per-provider status; catalog.refresh asks the providers again and probes enabled ACP providers. ACP providers (library providers/<id>.json) add rows acp:<id> and acp:<id>/<model> with runtime, provider, source, enabled and status, and a providers key acp:<id> whose status is unprobed, ok or failed; alpd sends catalog.updated to every helloed connection when the catalog changes."
52
53
  },
53
54
  "methods": {
54
55
  "assignment.recall": {
@@ -1470,6 +1471,9 @@
1470
1471
  "minLength": 1,
1471
1472
  "maxLength": 8000,
1472
1473
  "pattern": "\\S"
1474
+ },
1475
+ "keepsSession": {
1476
+ "type": "boolean"
1473
1477
  }
1474
1478
  },
1475
1479
  "required": [
@@ -1785,6 +1789,75 @@
1785
1789
  "additionalProperties": false
1786
1790
  }
1787
1791
  },
1792
+ "session.commands": {
1793
+ "x-alp": {
1794
+ "effect": "query",
1795
+ "scope": {
1796
+ "kind": "session",
1797
+ "param": "sessionId"
1798
+ },
1799
+ "capability": "session.commands",
1800
+ "idempotent": true
1801
+ },
1802
+ "params": {
1803
+ "type": "object",
1804
+ "properties": {
1805
+ "sessionId": {
1806
+ "type": "string",
1807
+ "minLength": 1,
1808
+ "maxLength": 128
1809
+ }
1810
+ },
1811
+ "required": [
1812
+ "sessionId"
1813
+ ],
1814
+ "additionalProperties": false
1815
+ },
1816
+ "result": {
1817
+ "type": "object",
1818
+ "properties": {
1819
+ "commands": {
1820
+ "type": "array",
1821
+ "maxItems": 1000,
1822
+ "items": {
1823
+ "type": "object",
1824
+ "properties": {
1825
+ "name": {
1826
+ "type": "string",
1827
+ "minLength": 1,
1828
+ "maxLength": 256,
1829
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f]+$"
1830
+ },
1831
+ "description": {
1832
+ "type": "string",
1833
+ "maxLength": 4096
1834
+ },
1835
+ "argumentHint": {
1836
+ "type": "string",
1837
+ "maxLength": 256
1838
+ },
1839
+ "kind": {
1840
+ "enum": [
1841
+ "command",
1842
+ "skill"
1843
+ ]
1844
+ }
1845
+ },
1846
+ "required": [
1847
+ "name",
1848
+ "description",
1849
+ "kind"
1850
+ ],
1851
+ "additionalProperties": false
1852
+ }
1853
+ }
1854
+ },
1855
+ "required": [
1856
+ "commands"
1857
+ ],
1858
+ "additionalProperties": false
1859
+ }
1860
+ },
1788
1861
  "session.configure": {
1789
1862
  "x-alp": {
1790
1863
  "effect": "mutation",
@@ -8851,6 +8924,9 @@
8851
8924
  },
8852
8925
  "lastError": {
8853
8926
  "$ref": "#/$defs/scheduleError"
8927
+ },
8928
+ "keepsSession": {
8929
+ "const": false
8854
8930
  }
8855
8931
  },
8856
8932
  "required": [