@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anhlp/alp-protocol",
3
- "version": "0.0.0-beta.1",
3
+ "version": "0.0.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "ALP protocol module",
6
6
  "files": [
@@ -107,6 +107,12 @@
107
107
  },
108
108
  "teamLabel": {
109
109
  "type": "string"
110
+ },
111
+ "promptImages": {
112
+ "type": "boolean"
113
+ },
114
+ "usage": {
115
+ "$ref": "#/$defs/usage"
110
116
  }
111
117
  },
112
118
  "required": [
@@ -124,6 +130,36 @@
124
130
  ],
125
131
  "additionalProperties": true
126
132
  },
133
+ "usage": {
134
+ "type": "object",
135
+ "properties": {
136
+ "contextWindowUsedTokens": {
137
+ "type": "integer",
138
+ "minimum": 0
139
+ },
140
+ "contextWindowMaxTokens": {
141
+ "type": "integer",
142
+ "minimum": 1
143
+ },
144
+ "inputTokens": {
145
+ "type": "integer",
146
+ "minimum": 0
147
+ },
148
+ "cachedInputTokens": {
149
+ "type": "integer",
150
+ "minimum": 0
151
+ },
152
+ "outputTokens": {
153
+ "type": "integer",
154
+ "minimum": 0
155
+ },
156
+ "totalCostUsd": {
157
+ "type": "number",
158
+ "minimum": 0
159
+ }
160
+ },
161
+ "additionalProperties": true
162
+ },
127
163
  "assignment": {
128
164
  "type": "object",
129
165
  "properties": {
@@ -723,6 +759,22 @@
723
759
  ],
724
760
  "additionalProperties": true
725
761
  },
762
+ {
763
+ "type": "object",
764
+ "properties": {
765
+ "type": {
766
+ "const": "usage"
767
+ },
768
+ "usage": {
769
+ "$ref": "#/$defs/usage"
770
+ }
771
+ },
772
+ "required": [
773
+ "type",
774
+ "usage"
775
+ ],
776
+ "additionalProperties": true
777
+ },
726
778
  {
727
779
  "type": "object",
728
780
  "properties": {
@@ -857,6 +909,7 @@
857
909
  "turn.started",
858
910
  "turn.ended",
859
911
  "item",
912
+ "usage",
860
913
  "mail",
861
914
  "assignment",
862
915
  "question",
@@ -888,6 +941,10 @@
888
941
  },
889
942
  "clientMessageId": {
890
943
  "type": "string"
944
+ },
945
+ "images": {
946
+ "type": "integer",
947
+ "minimum": 1
891
948
  }
892
949
  },
893
950
  "required": [
@@ -1048,53 +1105,7 @@
1048
1105
  "type": "string"
1049
1106
  },
1050
1107
  "detail": {
1051
- "oneOf": [
1052
- {
1053
- "type": "object",
1054
- "properties": {
1055
- "type": {
1056
- "const": "shell"
1057
- },
1058
- "command": {
1059
- "type": "string"
1060
- },
1061
- "cwd": {
1062
- "type": "string"
1063
- },
1064
- "output": {
1065
- "type": "string"
1066
- },
1067
- "exitCode": {
1068
- "type": [
1069
- "integer",
1070
- "null"
1071
- ]
1072
- }
1073
- },
1074
- "required": [
1075
- "type",
1076
- "command",
1077
- "output"
1078
- ],
1079
- "additionalProperties": true
1080
- },
1081
- {
1082
- "type": "object",
1083
- "properties": {
1084
- "type": {
1085
- "const": "unknown"
1086
- },
1087
- "input": {},
1088
- "output": {}
1089
- },
1090
- "required": [
1091
- "type",
1092
- "input",
1093
- "output"
1094
- ],
1095
- "additionalProperties": true
1096
- }
1097
- ]
1108
+ "$ref": "#/$defs/toolCallDetail"
1098
1109
  }
1099
1110
  },
1100
1111
  "required": [
@@ -1135,6 +1146,291 @@
1135
1146
  ],
1136
1147
  "additionalProperties": true
1137
1148
  },
1149
+ "toolCallDetail": {
1150
+ "oneOf": [
1151
+ {
1152
+ "type": "object",
1153
+ "properties": {
1154
+ "type": {
1155
+ "const": "shell"
1156
+ },
1157
+ "command": {
1158
+ "type": "string"
1159
+ },
1160
+ "cwd": {
1161
+ "type": "string"
1162
+ },
1163
+ "output": {
1164
+ "type": "string"
1165
+ },
1166
+ "exitCode": {
1167
+ "type": [
1168
+ "integer",
1169
+ "null"
1170
+ ]
1171
+ }
1172
+ },
1173
+ "required": [
1174
+ "type",
1175
+ "command",
1176
+ "output"
1177
+ ],
1178
+ "additionalProperties": true
1179
+ },
1180
+ {
1181
+ "type": "object",
1182
+ "properties": {
1183
+ "type": {
1184
+ "const": "read"
1185
+ },
1186
+ "filePath": {
1187
+ "type": "string"
1188
+ },
1189
+ "content": {
1190
+ "type": "string"
1191
+ },
1192
+ "offset": {
1193
+ "type": "integer"
1194
+ },
1195
+ "limit": {
1196
+ "type": "integer"
1197
+ }
1198
+ },
1199
+ "required": [
1200
+ "type",
1201
+ "filePath"
1202
+ ],
1203
+ "additionalProperties": true
1204
+ },
1205
+ {
1206
+ "type": "object",
1207
+ "properties": {
1208
+ "type": {
1209
+ "const": "edit"
1210
+ },
1211
+ "filePath": {
1212
+ "type": "string"
1213
+ },
1214
+ "oldString": {
1215
+ "type": "string"
1216
+ },
1217
+ "newString": {
1218
+ "type": "string"
1219
+ },
1220
+ "unifiedDiff": {
1221
+ "type": "string"
1222
+ }
1223
+ },
1224
+ "required": [
1225
+ "type",
1226
+ "filePath"
1227
+ ],
1228
+ "additionalProperties": true
1229
+ },
1230
+ {
1231
+ "type": "object",
1232
+ "properties": {
1233
+ "type": {
1234
+ "const": "write"
1235
+ },
1236
+ "filePath": {
1237
+ "type": "string"
1238
+ },
1239
+ "content": {
1240
+ "type": "string"
1241
+ }
1242
+ },
1243
+ "required": [
1244
+ "type",
1245
+ "filePath"
1246
+ ],
1247
+ "additionalProperties": true
1248
+ },
1249
+ {
1250
+ "type": "object",
1251
+ "properties": {
1252
+ "type": {
1253
+ "const": "search"
1254
+ },
1255
+ "query": {
1256
+ "type": "string"
1257
+ },
1258
+ "toolName": {
1259
+ "enum": [
1260
+ "search",
1261
+ "grep",
1262
+ "glob",
1263
+ "web_search"
1264
+ ]
1265
+ },
1266
+ "content": {
1267
+ "type": "string"
1268
+ },
1269
+ "filePaths": {
1270
+ "type": "array",
1271
+ "items": {
1272
+ "type": "string"
1273
+ }
1274
+ },
1275
+ "webResults": {
1276
+ "type": "array",
1277
+ "items": {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "title": {
1281
+ "type": "string"
1282
+ },
1283
+ "url": {
1284
+ "type": "string"
1285
+ }
1286
+ },
1287
+ "required": [
1288
+ "title",
1289
+ "url"
1290
+ ],
1291
+ "additionalProperties": true
1292
+ }
1293
+ },
1294
+ "numFiles": {
1295
+ "type": "integer"
1296
+ },
1297
+ "numMatches": {
1298
+ "type": "integer"
1299
+ },
1300
+ "truncated": {
1301
+ "type": "boolean"
1302
+ }
1303
+ },
1304
+ "required": [
1305
+ "type",
1306
+ "query"
1307
+ ],
1308
+ "additionalProperties": true
1309
+ },
1310
+ {
1311
+ "type": "object",
1312
+ "properties": {
1313
+ "type": {
1314
+ "const": "fetch"
1315
+ },
1316
+ "url": {
1317
+ "type": "string"
1318
+ },
1319
+ "prompt": {
1320
+ "type": "string"
1321
+ },
1322
+ "result": {
1323
+ "type": "string"
1324
+ },
1325
+ "code": {
1326
+ "type": "integer"
1327
+ }
1328
+ },
1329
+ "required": [
1330
+ "type",
1331
+ "url"
1332
+ ],
1333
+ "additionalProperties": true
1334
+ },
1335
+ {
1336
+ "type": "object",
1337
+ "properties": {
1338
+ "type": {
1339
+ "const": "sub_agent"
1340
+ },
1341
+ "subAgentType": {
1342
+ "type": "string"
1343
+ },
1344
+ "description": {
1345
+ "type": "string"
1346
+ },
1347
+ "log": {
1348
+ "type": "string"
1349
+ }
1350
+ },
1351
+ "required": [
1352
+ "type"
1353
+ ],
1354
+ "additionalProperties": true
1355
+ },
1356
+ {
1357
+ "type": "object",
1358
+ "properties": {
1359
+ "type": {
1360
+ "const": "plan"
1361
+ },
1362
+ "text": {
1363
+ "type": "string"
1364
+ }
1365
+ },
1366
+ "required": [
1367
+ "type",
1368
+ "text"
1369
+ ],
1370
+ "additionalProperties": true
1371
+ },
1372
+ {
1373
+ "type": "object",
1374
+ "properties": {
1375
+ "type": {
1376
+ "const": "plain_text"
1377
+ },
1378
+ "label": {
1379
+ "type": "string"
1380
+ },
1381
+ "text": {
1382
+ "type": "string"
1383
+ }
1384
+ },
1385
+ "required": [
1386
+ "type"
1387
+ ],
1388
+ "additionalProperties": true
1389
+ },
1390
+ {
1391
+ "type": "object",
1392
+ "properties": {
1393
+ "type": {
1394
+ "const": "unknown"
1395
+ },
1396
+ "input": {},
1397
+ "output": {}
1398
+ },
1399
+ "required": [
1400
+ "type",
1401
+ "input",
1402
+ "output"
1403
+ ],
1404
+ "additionalProperties": true
1405
+ },
1406
+ {
1407
+ "type": "object",
1408
+ "properties": {
1409
+ "type": {
1410
+ "type": "string",
1411
+ "not": {
1412
+ "enum": [
1413
+ "shell",
1414
+ "read",
1415
+ "edit",
1416
+ "write",
1417
+ "search",
1418
+ "fetch",
1419
+ "sub_agent",
1420
+ "plan",
1421
+ "plain_text",
1422
+ "unknown"
1423
+ ]
1424
+ }
1425
+ }
1426
+ },
1427
+ "required": [
1428
+ "type"
1429
+ ],
1430
+ "additionalProperties": true
1431
+ }
1432
+ ]
1433
+ },
1138
1434
  "alpError": {
1139
1435
  "type": "object",
1140
1436
  "properties": {
@@ -2002,6 +2298,38 @@
2002
2298
  "source"
2003
2299
  ],
2004
2300
  "additionalProperties": true
2301
+ },
2302
+ "promptImage": {
2303
+ "type": "object",
2304
+ "properties": {
2305
+ "type": {
2306
+ "const": "image"
2307
+ },
2308
+ "mimeType": {
2309
+ "enum": [
2310
+ "image/png",
2311
+ "image/jpeg",
2312
+ "image/gif",
2313
+ "image/webp"
2314
+ ]
2315
+ },
2316
+ "data": {
2317
+ "type": "string",
2318
+ "minLength": 4,
2319
+ "maxLength": 6990508,
2320
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$"
2321
+ },
2322
+ "name": {
2323
+ "type": "string",
2324
+ "maxLength": 255
2325
+ }
2326
+ },
2327
+ "required": [
2328
+ "type",
2329
+ "mimeType",
2330
+ "data"
2331
+ ],
2332
+ "additionalProperties": false
2005
2333
  }
2006
2334
  }
2007
2335
  }