@anhlp/alp-protocol 0.0.0-beta.1 → 0.0.0-beta.2

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.
@@ -21,7 +21,13 @@
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.",
24
- "settings.language": "settings.language.get/set: the language the daemon user reads, in the daemon's ALP_HOME/settings.json."
24
+ "settings.language": "settings.language.get/set: the language the daemon user reads, in the daemon's ALP_HOME/settings.json.",
25
+ "session.list.page": "session.list accepts `limit`, `cursor` and `query` and answers `nextCursor` while more sessions follow; without them it answers every session as before.",
26
+ "question.watch": "question.watch: the connection is told of `question` and `question.resolved` in every tree (of a projectRoot when given), attached or not.",
27
+ "question.watch.turns": "question.watch accepts `turns`: the connection is also told of `turn.ended` of every root in the trees it watches.",
28
+ "workspace.files": "workspace.files.search: files under a directory whose relative path matches a query; read-only, names only, links never followed.",
29
+ "workspace.files.read": "workspace.files.list and workspace.files.read: the entries of a directory and the content of a UTF-8 text file (at most 1 MiB) under a directory; read-only, links never followed, .git, .env* and key or credential files refused, .gitignore'd paths hidden unless asked.",
30
+ "prompt.images": "session.prompt takes inline image parts { type: \"image\", mimeType, data } (base64, no paths or URLs) within the image limits; a session snapshot says whether its runtime takes them in promptImages."
25
31
  },
26
32
  "methods": {
27
33
  "assignment.recall": {
@@ -224,6 +230,9 @@
224
230
  "pid": {
225
231
  "type": "integer"
226
232
  },
233
+ "hostname": {
234
+ "type": "string"
235
+ },
227
236
  "capabilities": {
228
237
  "type": "array",
229
238
  "items": {
@@ -1096,6 +1105,46 @@
1096
1105
  "additionalProperties": true
1097
1106
  }
1098
1107
  },
1108
+ "question.watch": {
1109
+ "x-alp": {
1110
+ "effect": "query",
1111
+ "scope": {
1112
+ "kind": "project",
1113
+ "param": "projectRoot",
1114
+ "required": false
1115
+ },
1116
+ "idempotent": true,
1117
+ "capability": "question.watch"
1118
+ },
1119
+ "params": {
1120
+ "type": "object",
1121
+ "properties": {
1122
+ "projectRoot": {
1123
+ "type": "string"
1124
+ },
1125
+ "turns": {
1126
+ "type": "boolean"
1127
+ }
1128
+ },
1129
+ "required": [],
1130
+ "additionalProperties": true
1131
+ },
1132
+ "result": {
1133
+ "type": "object",
1134
+ "properties": {
1135
+ "questions": {
1136
+ "type": "array",
1137
+ "items": {
1138
+ "$ref": "#/$defs/question"
1139
+ }
1140
+ }
1141
+ },
1142
+ "required": [
1143
+ "questions"
1144
+ ],
1145
+ "additionalProperties": true
1146
+ }
1147
+ },
1099
1148
  "session.archive": {
1100
1149
  "x-alp": {
1101
1150
  "effect": "mutation",
@@ -1399,6 +1448,28 @@
1399
1448
  },
1400
1449
  "includeArchived": {
1401
1450
  "type": "boolean"
1451
+ },
1452
+ "limit": {
1453
+ "type": "integer",
1454
+ "minimum": 1,
1455
+ "maximum": 1000
1456
+ },
1457
+ "cursor": {
1458
+ "type": "string",
1459
+ "minLength": 1,
1460
+ "maxLength": 1024
1461
+ },
1462
+ "query": {
1463
+ "type": "string",
1464
+ "maxLength": 200
1465
+ },
1466
+ "projectRoots": {
1467
+ "type": "array",
1468
+ "items": {
1469
+ "type": "string"
1470
+ },
1471
+ "minItems": 1,
1472
+ "maxItems": 1024
1402
1473
  }
1403
1474
  },
1404
1475
  "required": [],
@@ -1412,6 +1483,10 @@
1412
1483
  "items": {
1413
1484
  "$ref": "#/$defs/sessionSummary"
1414
1485
  }
1486
+ },
1487
+ "nextCursor": {
1488
+ "type": "string",
1489
+ "minLength": 1
1415
1490
  }
1416
1491
  },
1417
1492
  "required": [
@@ -1554,19 +1629,44 @@
1554
1629
  "content": {
1555
1630
  "type": "array",
1556
1631
  "items": {
1557
- "type": "object",
1558
- "properties": {
1559
- "type": {
1560
- "type": "string"
1632
+ "anyOf": [
1633
+ {
1634
+ "type": "object",
1635
+ "properties": {
1636
+ "type": {
1637
+ "const": "text"
1638
+ },
1639
+ "text": {
1640
+ "type": "string"
1641
+ }
1642
+ },
1643
+ "required": [
1644
+ "type"
1645
+ ],
1646
+ "additionalProperties": true
1561
1647
  },
1562
- "text": {
1563
- "type": "string"
1648
+ {
1649
+ "$ref": "#/$defs/promptImage"
1650
+ },
1651
+ {
1652
+ "type": "object",
1653
+ "properties": {
1654
+ "type": {
1655
+ "type": "string",
1656
+ "not": {
1657
+ "enum": [
1658
+ "text",
1659
+ "image"
1660
+ ]
1661
+ }
1662
+ }
1663
+ },
1664
+ "required": [
1665
+ "type"
1666
+ ],
1667
+ "additionalProperties": true
1564
1668
  }
1565
- },
1566
- "required": [
1567
- "type"
1568
- ],
1569
- "additionalProperties": true
1669
+ ]
1570
1670
  }
1571
1671
  }
1572
1672
  },
@@ -2075,6 +2175,216 @@
2075
2175
  ],
2076
2176
  "additionalProperties": true
2077
2177
  }
2178
+ },
2179
+ "workspace.files.search": {
2180
+ "x-alp": {
2181
+ "effect": "query",
2182
+ "scope": {
2183
+ "kind": "project",
2184
+ "param": "projectRoot",
2185
+ "required": true
2186
+ },
2187
+ "idempotent": true,
2188
+ "capability": "workspace.files",
2189
+ "risks": [
2190
+ "lists file names of the directory (not contents)"
2191
+ ]
2192
+ },
2193
+ "params": {
2194
+ "type": "object",
2195
+ "properties": {
2196
+ "projectRoot": {
2197
+ "type": "string"
2198
+ },
2199
+ "query": {
2200
+ "type": "string",
2201
+ "maxLength": 200
2202
+ },
2203
+ "limit": {
2204
+ "type": "integer",
2205
+ "minimum": 1,
2206
+ "maximum": 100
2207
+ }
2208
+ },
2209
+ "required": [
2210
+ "projectRoot"
2211
+ ],
2212
+ "additionalProperties": true
2213
+ },
2214
+ "result": {
2215
+ "type": "object",
2216
+ "properties": {
2217
+ "files": {
2218
+ "type": "array",
2219
+ "maxItems": 100,
2220
+ "items": {
2221
+ "type": "object",
2222
+ "properties": {
2223
+ "path": {
2224
+ "type": "string",
2225
+ "minLength": 1
2226
+ }
2227
+ },
2228
+ "required": [
2229
+ "path"
2230
+ ],
2231
+ "additionalProperties": true
2232
+ }
2233
+ },
2234
+ "truncated": {
2235
+ "type": "boolean"
2236
+ }
2237
+ },
2238
+ "required": [
2239
+ "files"
2240
+ ],
2241
+ "additionalProperties": true
2242
+ }
2243
+ },
2244
+ "workspace.files.list": {
2245
+ "x-alp": {
2246
+ "effect": "query",
2247
+ "scope": {
2248
+ "kind": "project",
2249
+ "param": "projectRoot",
2250
+ "required": true
2251
+ },
2252
+ "idempotent": true,
2253
+ "capability": "workspace.files.read",
2254
+ "risks": [
2255
+ "lists names, kinds, sizes and times of a directory's entries (not contents)"
2256
+ ]
2257
+ },
2258
+ "params": {
2259
+ "type": "object",
2260
+ "properties": {
2261
+ "projectRoot": {
2262
+ "type": "string"
2263
+ },
2264
+ "path": {
2265
+ "type": "string",
2266
+ "minLength": 1,
2267
+ "maxLength": 4096
2268
+ },
2269
+ "includeIgnored": {
2270
+ "type": "boolean"
2271
+ }
2272
+ },
2273
+ "required": [
2274
+ "projectRoot"
2275
+ ],
2276
+ "additionalProperties": true
2277
+ },
2278
+ "result": {
2279
+ "type": "object",
2280
+ "properties": {
2281
+ "entries": {
2282
+ "type": "array",
2283
+ "maxItems": 1000,
2284
+ "items": {
2285
+ "type": "object",
2286
+ "properties": {
2287
+ "name": {
2288
+ "type": "string",
2289
+ "minLength": 1
2290
+ },
2291
+ "path": {
2292
+ "type": "string",
2293
+ "minLength": 1
2294
+ },
2295
+ "kind": {
2296
+ "enum": [
2297
+ "file",
2298
+ "directory"
2299
+ ]
2300
+ },
2301
+ "size": {
2302
+ "type": "integer",
2303
+ "minimum": 0
2304
+ },
2305
+ "modifiedAt": {
2306
+ "type": "string"
2307
+ }
2308
+ },
2309
+ "required": [
2310
+ "name",
2311
+ "path",
2312
+ "kind"
2313
+ ],
2314
+ "additionalProperties": true
2315
+ }
2316
+ },
2317
+ "truncated": {
2318
+ "type": "boolean"
2319
+ }
2320
+ },
2321
+ "required": [
2322
+ "entries"
2323
+ ],
2324
+ "additionalProperties": true
2325
+ }
2326
+ },
2327
+ "workspace.files.read": {
2328
+ "x-alp": {
2329
+ "effect": "query",
2330
+ "scope": {
2331
+ "kind": "project",
2332
+ "param": "projectRoot",
2333
+ "required": true
2334
+ },
2335
+ "idempotent": true,
2336
+ "capability": "workspace.files.read",
2337
+ "risks": [
2338
+ "returns the content of a text file under the directory"
2339
+ ]
2340
+ },
2341
+ "params": {
2342
+ "type": "object",
2343
+ "properties": {
2344
+ "projectRoot": {
2345
+ "type": "string"
2346
+ },
2347
+ "path": {
2348
+ "type": "string",
2349
+ "minLength": 1,
2350
+ "maxLength": 4096
2351
+ },
2352
+ "includeIgnored": {
2353
+ "type": "boolean"
2354
+ }
2355
+ },
2356
+ "required": [
2357
+ "projectRoot",
2358
+ "path"
2359
+ ],
2360
+ "additionalProperties": true
2361
+ },
2362
+ "result": {
2363
+ "type": "object",
2364
+ "properties": {
2365
+ "path": {
2366
+ "type": "string",
2367
+ "minLength": 1
2368
+ },
2369
+ "content": {
2370
+ "type": "string"
2371
+ },
2372
+ "size": {
2373
+ "type": "integer",
2374
+ "minimum": 0,
2375
+ "maximum": 1048576
2376
+ },
2377
+ "modifiedAt": {
2378
+ "type": "string"
2379
+ }
2380
+ },
2381
+ "required": [
2382
+ "path",
2383
+ "content",
2384
+ "size"
2385
+ ],
2386
+ "additionalProperties": true
2387
+ }
2078
2388
  }
2079
2389
  },
2080
2390
  "$defs": {
@@ -2170,6 +2480,12 @@
2170
2480
  },
2171
2481
  "teamLabel": {
2172
2482
  "type": "string"
2483
+ },
2484
+ "promptImages": {
2485
+ "type": "boolean"
2486
+ },
2487
+ "usage": {
2488
+ "$ref": "#/$defs/usage"
2173
2489
  }
2174
2490
  },
2175
2491
  "required": [
@@ -2187,16 +2503,46 @@
2187
2503
  ],
2188
2504
  "additionalProperties": true
2189
2505
  },
2190
- "assignment": {
2506
+ "usage": {
2191
2507
  "type": "object",
2192
2508
  "properties": {
2193
- "id": {
2194
- "type": "string"
2509
+ "contextWindowUsedTokens": {
2510
+ "type": "integer",
2511
+ "minimum": 0
2195
2512
  },
2196
- "agent": {
2197
- "type": "string"
2513
+ "contextWindowMaxTokens": {
2514
+ "type": "integer",
2515
+ "minimum": 1
2198
2516
  },
2199
- "mode": {
2517
+ "inputTokens": {
2518
+ "type": "integer",
2519
+ "minimum": 0
2520
+ },
2521
+ "cachedInputTokens": {
2522
+ "type": "integer",
2523
+ "minimum": 0
2524
+ },
2525
+ "outputTokens": {
2526
+ "type": "integer",
2527
+ "minimum": 0
2528
+ },
2529
+ "totalCostUsd": {
2530
+ "type": "number",
2531
+ "minimum": 0
2532
+ }
2533
+ },
2534
+ "additionalProperties": true
2535
+ },
2536
+ "assignment": {
2537
+ "type": "object",
2538
+ "properties": {
2539
+ "id": {
2540
+ "type": "string"
2541
+ },
2542
+ "agent": {
2543
+ "type": "string"
2544
+ },
2545
+ "mode": {
2200
2546
  "type": "string"
2201
2547
  },
2202
2548
  "status": {
@@ -2786,6 +3132,22 @@
2786
3132
  ],
2787
3133
  "additionalProperties": true
2788
3134
  },
3135
+ {
3136
+ "type": "object",
3137
+ "properties": {
3138
+ "type": {
3139
+ "const": "usage"
3140
+ },
3141
+ "usage": {
3142
+ "$ref": "#/$defs/usage"
3143
+ }
3144
+ },
3145
+ "required": [
3146
+ "type",
3147
+ "usage"
3148
+ ],
3149
+ "additionalProperties": true
3150
+ },
2789
3151
  {
2790
3152
  "type": "object",
2791
3153
  "properties": {
@@ -2920,6 +3282,7 @@
2920
3282
  "turn.started",
2921
3283
  "turn.ended",
2922
3284
  "item",
3285
+ "usage",
2923
3286
  "mail",
2924
3287
  "assignment",
2925
3288
  "question",
@@ -2951,6 +3314,10 @@
2951
3314
  },
2952
3315
  "clientMessageId": {
2953
3316
  "type": "string"
3317
+ },
3318
+ "images": {
3319
+ "type": "integer",
3320
+ "minimum": 1
2954
3321
  }
2955
3322
  },
2956
3323
  "required": [
@@ -3111,53 +3478,7 @@
3111
3478
  "type": "string"
3112
3479
  },
3113
3480
  "detail": {
3114
- "oneOf": [
3115
- {
3116
- "type": "object",
3117
- "properties": {
3118
- "type": {
3119
- "const": "shell"
3120
- },
3121
- "command": {
3122
- "type": "string"
3123
- },
3124
- "cwd": {
3125
- "type": "string"
3126
- },
3127
- "output": {
3128
- "type": "string"
3129
- },
3130
- "exitCode": {
3131
- "type": [
3132
- "integer",
3133
- "null"
3134
- ]
3135
- }
3136
- },
3137
- "required": [
3138
- "type",
3139
- "command",
3140
- "output"
3141
- ],
3142
- "additionalProperties": true
3143
- },
3144
- {
3145
- "type": "object",
3146
- "properties": {
3147
- "type": {
3148
- "const": "unknown"
3149
- },
3150
- "input": {},
3151
- "output": {}
3152
- },
3153
- "required": [
3154
- "type",
3155
- "input",
3156
- "output"
3157
- ],
3158
- "additionalProperties": true
3159
- }
3160
- ]
3481
+ "$ref": "#/$defs/toolCallDetail"
3161
3482
  }
3162
3483
  },
3163
3484
  "required": [
@@ -3198,6 +3519,291 @@
3198
3519
  ],
3199
3520
  "additionalProperties": true
3200
3521
  },
3522
+ "toolCallDetail": {
3523
+ "oneOf": [
3524
+ {
3525
+ "type": "object",
3526
+ "properties": {
3527
+ "type": {
3528
+ "const": "shell"
3529
+ },
3530
+ "command": {
3531
+ "type": "string"
3532
+ },
3533
+ "cwd": {
3534
+ "type": "string"
3535
+ },
3536
+ "output": {
3537
+ "type": "string"
3538
+ },
3539
+ "exitCode": {
3540
+ "type": [
3541
+ "integer",
3542
+ "null"
3543
+ ]
3544
+ }
3545
+ },
3546
+ "required": [
3547
+ "type",
3548
+ "command",
3549
+ "output"
3550
+ ],
3551
+ "additionalProperties": true
3552
+ },
3553
+ {
3554
+ "type": "object",
3555
+ "properties": {
3556
+ "type": {
3557
+ "const": "read"
3558
+ },
3559
+ "filePath": {
3560
+ "type": "string"
3561
+ },
3562
+ "content": {
3563
+ "type": "string"
3564
+ },
3565
+ "offset": {
3566
+ "type": "integer"
3567
+ },
3568
+ "limit": {
3569
+ "type": "integer"
3570
+ }
3571
+ },
3572
+ "required": [
3573
+ "type",
3574
+ "filePath"
3575
+ ],
3576
+ "additionalProperties": true
3577
+ },
3578
+ {
3579
+ "type": "object",
3580
+ "properties": {
3581
+ "type": {
3582
+ "const": "edit"
3583
+ },
3584
+ "filePath": {
3585
+ "type": "string"
3586
+ },
3587
+ "oldString": {
3588
+ "type": "string"
3589
+ },
3590
+ "newString": {
3591
+ "type": "string"
3592
+ },
3593
+ "unifiedDiff": {
3594
+ "type": "string"
3595
+ }
3596
+ },
3597
+ "required": [
3598
+ "type",
3599
+ "filePath"
3600
+ ],
3601
+ "additionalProperties": true
3602
+ },
3603
+ {
3604
+ "type": "object",
3605
+ "properties": {
3606
+ "type": {
3607
+ "const": "write"
3608
+ },
3609
+ "filePath": {
3610
+ "type": "string"
3611
+ },
3612
+ "content": {
3613
+ "type": "string"
3614
+ }
3615
+ },
3616
+ "required": [
3617
+ "type",
3618
+ "filePath"
3619
+ ],
3620
+ "additionalProperties": true
3621
+ },
3622
+ {
3623
+ "type": "object",
3624
+ "properties": {
3625
+ "type": {
3626
+ "const": "search"
3627
+ },
3628
+ "query": {
3629
+ "type": "string"
3630
+ },
3631
+ "toolName": {
3632
+ "enum": [
3633
+ "search",
3634
+ "grep",
3635
+ "glob",
3636
+ "web_search"
3637
+ ]
3638
+ },
3639
+ "content": {
3640
+ "type": "string"
3641
+ },
3642
+ "filePaths": {
3643
+ "type": "array",
3644
+ "items": {
3645
+ "type": "string"
3646
+ }
3647
+ },
3648
+ "webResults": {
3649
+ "type": "array",
3650
+ "items": {
3651
+ "type": "object",
3652
+ "properties": {
3653
+ "title": {
3654
+ "type": "string"
3655
+ },
3656
+ "url": {
3657
+ "type": "string"
3658
+ }
3659
+ },
3660
+ "required": [
3661
+ "title",
3662
+ "url"
3663
+ ],
3664
+ "additionalProperties": true
3665
+ }
3666
+ },
3667
+ "numFiles": {
3668
+ "type": "integer"
3669
+ },
3670
+ "numMatches": {
3671
+ "type": "integer"
3672
+ },
3673
+ "truncated": {
3674
+ "type": "boolean"
3675
+ }
3676
+ },
3677
+ "required": [
3678
+ "type",
3679
+ "query"
3680
+ ],
3681
+ "additionalProperties": true
3682
+ },
3683
+ {
3684
+ "type": "object",
3685
+ "properties": {
3686
+ "type": {
3687
+ "const": "fetch"
3688
+ },
3689
+ "url": {
3690
+ "type": "string"
3691
+ },
3692
+ "prompt": {
3693
+ "type": "string"
3694
+ },
3695
+ "result": {
3696
+ "type": "string"
3697
+ },
3698
+ "code": {
3699
+ "type": "integer"
3700
+ }
3701
+ },
3702
+ "required": [
3703
+ "type",
3704
+ "url"
3705
+ ],
3706
+ "additionalProperties": true
3707
+ },
3708
+ {
3709
+ "type": "object",
3710
+ "properties": {
3711
+ "type": {
3712
+ "const": "sub_agent"
3713
+ },
3714
+ "subAgentType": {
3715
+ "type": "string"
3716
+ },
3717
+ "description": {
3718
+ "type": "string"
3719
+ },
3720
+ "log": {
3721
+ "type": "string"
3722
+ }
3723
+ },
3724
+ "required": [
3725
+ "type"
3726
+ ],
3727
+ "additionalProperties": true
3728
+ },
3729
+ {
3730
+ "type": "object",
3731
+ "properties": {
3732
+ "type": {
3733
+ "const": "plan"
3734
+ },
3735
+ "text": {
3736
+ "type": "string"
3737
+ }
3738
+ },
3739
+ "required": [
3740
+ "type",
3741
+ "text"
3742
+ ],
3743
+ "additionalProperties": true
3744
+ },
3745
+ {
3746
+ "type": "object",
3747
+ "properties": {
3748
+ "type": {
3749
+ "const": "plain_text"
3750
+ },
3751
+ "label": {
3752
+ "type": "string"
3753
+ },
3754
+ "text": {
3755
+ "type": "string"
3756
+ }
3757
+ },
3758
+ "required": [
3759
+ "type"
3760
+ ],
3761
+ "additionalProperties": true
3762
+ },
3763
+ {
3764
+ "type": "object",
3765
+ "properties": {
3766
+ "type": {
3767
+ "const": "unknown"
3768
+ },
3769
+ "input": {},
3770
+ "output": {}
3771
+ },
3772
+ "required": [
3773
+ "type",
3774
+ "input",
3775
+ "output"
3776
+ ],
3777
+ "additionalProperties": true
3778
+ },
3779
+ {
3780
+ "type": "object",
3781
+ "properties": {
3782
+ "type": {
3783
+ "type": "string",
3784
+ "not": {
3785
+ "enum": [
3786
+ "shell",
3787
+ "read",
3788
+ "edit",
3789
+ "write",
3790
+ "search",
3791
+ "fetch",
3792
+ "sub_agent",
3793
+ "plan",
3794
+ "plain_text",
3795
+ "unknown"
3796
+ ]
3797
+ }
3798
+ }
3799
+ },
3800
+ "required": [
3801
+ "type"
3802
+ ],
3803
+ "additionalProperties": true
3804
+ }
3805
+ ]
3806
+ },
3201
3807
  "alpError": {
3202
3808
  "type": "object",
3203
3809
  "properties": {
@@ -4065,6 +4671,38 @@
4065
4671
  "source"
4066
4672
  ],
4067
4673
  "additionalProperties": true
4674
+ },
4675
+ "promptImage": {
4676
+ "type": "object",
4677
+ "properties": {
4678
+ "type": {
4679
+ "const": "image"
4680
+ },
4681
+ "mimeType": {
4682
+ "enum": [
4683
+ "image/png",
4684
+ "image/jpeg",
4685
+ "image/gif",
4686
+ "image/webp"
4687
+ ]
4688
+ },
4689
+ "data": {
4690
+ "type": "string",
4691
+ "minLength": 4,
4692
+ "maxLength": 6990508,
4693
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$"
4694
+ },
4695
+ "name": {
4696
+ "type": "string",
4697
+ "maxLength": 255
4698
+ }
4699
+ },
4700
+ "required": [
4701
+ "type",
4702
+ "mimeType",
4703
+ "data"
4704
+ ],
4705
+ "additionalProperties": false
4068
4706
  }
4069
4707
  }
4070
4708
  }