@inline-chat/hermes-agent-adapter 0.0.8-alpha.0 → 0.0.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/README.md +2 -2
- package/package.json +2 -2
- package/plugin/inline/plugin.yaml +1 -1
- package/plugin/inline/sidecar/index.mjs +112 -20
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ uv run ./hermes plugins list --plain --no-bundled
|
|
|
146
146
|
Expected local output includes:
|
|
147
147
|
|
|
148
148
|
```text
|
|
149
|
-
enabled user 0.0.8
|
|
149
|
+
enabled user 0.0.8 inline-platform
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
## Update Or Reinstall
|
|
@@ -172,7 +172,7 @@ mismatch, rerun the same command after rebuilding or upgrading the package.
|
|
|
172
172
|
against Hermes Agent `0.20.0` from source commit `3c27eb6`.
|
|
173
173
|
- Node.js: `>=20` is required for the bundled sidecar. Hermes-managed Node 22,
|
|
174
174
|
system Node, or an explicit `INLINE_NODE_BIN` path all work.
|
|
175
|
-
- Inline transport: the sidecar uses `@inline-chat/realtime-sdk@0.0.
|
|
175
|
+
- Inline transport: the sidecar uses `@inline-chat/realtime-sdk@0.0.15` and is
|
|
176
176
|
bundled into the npm package, so Hermes startup does not run `npm install`.
|
|
177
177
|
- Live sends require a valid Inline user or bot token in `INLINE_TOKEN`,
|
|
178
178
|
`INLINE_BOT_TOKEN`, `platforms.inline.token`, or `inline.token`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inline-chat/hermes-agent-adapter",
|
|
3
|
-
"version": "0.0.8
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Hermes Agent platform adapter for Inline, with a native Python plugin and bundled Inline realtime sidecar.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"check": "bun run typecheck && bun run lint && bun run test"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@inline-chat/realtime-sdk": "0.0.15
|
|
63
|
+
"@inline-chat/realtime-sdk": "0.0.15",
|
|
64
64
|
"yaml": "2.9.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -7741,7 +7741,9 @@ class DialogFolder$Type extends import_runtime4.MessageType {
|
|
|
7741
7741
|
super("DialogFolder", [
|
|
7742
7742
|
{ no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
|
|
7743
7743
|
{ no: 2, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
7744
|
-
{ no: 3, name: "order", kind: "scalar", T: 9 }
|
|
7744
|
+
{ no: 3, name: "order", kind: "scalar", T: 9 },
|
|
7745
|
+
{ no: 4, name: "emoji", kind: "scalar", opt: true, T: 9 },
|
|
7746
|
+
{ no: 5, name: "pinned_order", kind: "scalar", opt: true, T: 9 }
|
|
7745
7747
|
]);
|
|
7746
7748
|
}
|
|
7747
7749
|
create(value) {
|
|
@@ -7766,6 +7768,12 @@ class DialogFolder$Type extends import_runtime4.MessageType {
|
|
|
7766
7768
|
case 3:
|
|
7767
7769
|
message.order = reader.string();
|
|
7768
7770
|
break;
|
|
7771
|
+
case 4:
|
|
7772
|
+
message.emoji = reader.string();
|
|
7773
|
+
break;
|
|
7774
|
+
case 5:
|
|
7775
|
+
message.pinnedOrder = reader.string();
|
|
7776
|
+
break;
|
|
7769
7777
|
default:
|
|
7770
7778
|
let u = options.readUnknownField;
|
|
7771
7779
|
if (u === "throw")
|
|
@@ -7784,6 +7792,10 @@ class DialogFolder$Type extends import_runtime4.MessageType {
|
|
|
7784
7792
|
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.title);
|
|
7785
7793
|
if (message.order !== "")
|
|
7786
7794
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.order);
|
|
7795
|
+
if (message.emoji !== undefined)
|
|
7796
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.emoji);
|
|
7797
|
+
if (message.pinnedOrder !== undefined)
|
|
7798
|
+
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.pinnedOrder);
|
|
7787
7799
|
let u = options.writeUnknownFields;
|
|
7788
7800
|
if (u !== false)
|
|
7789
7801
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -22317,7 +22329,8 @@ class CreateDialogFolderInput$Type extends import_runtime4.MessageType {
|
|
|
22317
22329
|
super("CreateDialogFolderInput", [
|
|
22318
22330
|
{ no: 1, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
22319
22331
|
{ no: 2, name: "peers", kind: "message", repeat: 1, T: () => InputPeer },
|
|
22320
|
-
{ no: 3, name: "order", kind: "scalar", opt: true, T: 9 }
|
|
22332
|
+
{ no: 3, name: "order", kind: "scalar", opt: true, T: 9 },
|
|
22333
|
+
{ no: 4, name: "pinned_order", kind: "scalar", opt: true, T: 9 }
|
|
22321
22334
|
]);
|
|
22322
22335
|
}
|
|
22323
22336
|
create(value) {
|
|
@@ -22341,6 +22354,9 @@ class CreateDialogFolderInput$Type extends import_runtime4.MessageType {
|
|
|
22341
22354
|
case 3:
|
|
22342
22355
|
message.order = reader.string();
|
|
22343
22356
|
break;
|
|
22357
|
+
case 4:
|
|
22358
|
+
message.pinnedOrder = reader.string();
|
|
22359
|
+
break;
|
|
22344
22360
|
default:
|
|
22345
22361
|
let u = options.readUnknownField;
|
|
22346
22362
|
if (u === "throw")
|
|
@@ -22359,6 +22375,8 @@ class CreateDialogFolderInput$Type extends import_runtime4.MessageType {
|
|
|
22359
22375
|
InputPeer.internalBinaryWrite(message.peers[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
22360
22376
|
if (message.order !== undefined)
|
|
22361
22377
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.order);
|
|
22378
|
+
if (message.pinnedOrder !== undefined)
|
|
22379
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.pinnedOrder);
|
|
22362
22380
|
let u = options.writeUnknownFields;
|
|
22363
22381
|
if (u !== false)
|
|
22364
22382
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -22422,13 +22440,19 @@ class UpdateDialogFolderInput$Type extends import_runtime4.MessageType {
|
|
|
22422
22440
|
{ no: 1, name: "folder_id", kind: "scalar", T: 3, L: 0 },
|
|
22423
22441
|
{ no: 2, name: "title", kind: "scalar", oneof: "titleUpdate", T: 9 },
|
|
22424
22442
|
{ no: 3, name: "clear_title", kind: "scalar", oneof: "titleUpdate", T: 8 },
|
|
22425
|
-
{ no: 4, name: "order", kind: "scalar", opt: true, T: 9 }
|
|
22443
|
+
{ no: 4, name: "order", kind: "scalar", opt: true, T: 9 },
|
|
22444
|
+
{ no: 5, name: "emoji", kind: "scalar", oneof: "emojiUpdate", T: 9 },
|
|
22445
|
+
{ no: 6, name: "clear_emoji", kind: "scalar", oneof: "emojiUpdate", T: 8 },
|
|
22446
|
+
{ no: 7, name: "pinned_order", kind: "scalar", oneof: "pinnedOrderUpdate", T: 9 },
|
|
22447
|
+
{ no: 8, name: "clear_pinned_order", kind: "scalar", oneof: "pinnedOrderUpdate", T: 8 }
|
|
22426
22448
|
]);
|
|
22427
22449
|
}
|
|
22428
22450
|
create(value) {
|
|
22429
22451
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
22430
22452
|
message.folderId = 0n;
|
|
22431
22453
|
message.titleUpdate = { oneofKind: undefined };
|
|
22454
|
+
message.emojiUpdate = { oneofKind: undefined };
|
|
22455
|
+
message.pinnedOrderUpdate = { oneofKind: undefined };
|
|
22432
22456
|
if (value !== undefined)
|
|
22433
22457
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
22434
22458
|
return message;
|
|
@@ -22456,6 +22480,30 @@ class UpdateDialogFolderInput$Type extends import_runtime4.MessageType {
|
|
|
22456
22480
|
case 4:
|
|
22457
22481
|
message.order = reader.string();
|
|
22458
22482
|
break;
|
|
22483
|
+
case 5:
|
|
22484
|
+
message.emojiUpdate = {
|
|
22485
|
+
oneofKind: "emoji",
|
|
22486
|
+
emoji: reader.string()
|
|
22487
|
+
};
|
|
22488
|
+
break;
|
|
22489
|
+
case 6:
|
|
22490
|
+
message.emojiUpdate = {
|
|
22491
|
+
oneofKind: "clearEmoji",
|
|
22492
|
+
clearEmoji: reader.bool()
|
|
22493
|
+
};
|
|
22494
|
+
break;
|
|
22495
|
+
case 7:
|
|
22496
|
+
message.pinnedOrderUpdate = {
|
|
22497
|
+
oneofKind: "pinnedOrder",
|
|
22498
|
+
pinnedOrder: reader.string()
|
|
22499
|
+
};
|
|
22500
|
+
break;
|
|
22501
|
+
case 8:
|
|
22502
|
+
message.pinnedOrderUpdate = {
|
|
22503
|
+
oneofKind: "clearPinnedOrder",
|
|
22504
|
+
clearPinnedOrder: reader.bool()
|
|
22505
|
+
};
|
|
22506
|
+
break;
|
|
22459
22507
|
default:
|
|
22460
22508
|
let u = options.readUnknownField;
|
|
22461
22509
|
if (u === "throw")
|
|
@@ -22476,6 +22524,14 @@ class UpdateDialogFolderInput$Type extends import_runtime4.MessageType {
|
|
|
22476
22524
|
writer.tag(3, import_runtime.WireType.Varint).bool(message.titleUpdate.clearTitle);
|
|
22477
22525
|
if (message.order !== undefined)
|
|
22478
22526
|
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.order);
|
|
22527
|
+
if (message.emojiUpdate.oneofKind === "emoji")
|
|
22528
|
+
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.emojiUpdate.emoji);
|
|
22529
|
+
if (message.emojiUpdate.oneofKind === "clearEmoji")
|
|
22530
|
+
writer.tag(6, import_runtime.WireType.Varint).bool(message.emojiUpdate.clearEmoji);
|
|
22531
|
+
if (message.pinnedOrderUpdate.oneofKind === "pinnedOrder")
|
|
22532
|
+
writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.pinnedOrderUpdate.pinnedOrder);
|
|
22533
|
+
if (message.pinnedOrderUpdate.oneofKind === "clearPinnedOrder")
|
|
22534
|
+
writer.tag(8, import_runtime.WireType.Varint).bool(message.pinnedOrderUpdate.clearPinnedOrder);
|
|
22479
22535
|
let u = options.writeUnknownFields;
|
|
22480
22536
|
if (u !== false)
|
|
22481
22537
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -35355,6 +35411,7 @@ var HASH_READ_SIZE = 1024 * 1024;
|
|
|
35355
35411
|
var MAX_NEGOTIATED_PART_SIZE = 16 * 1024 * 1024;
|
|
35356
35412
|
var DEFAULT_GLOBAL_CONCURRENCY = 3;
|
|
35357
35413
|
var DEFAULT_UPLOAD_CONCURRENCY = 2;
|
|
35414
|
+
var MAX_PART_ATTEMPTS = 2;
|
|
35358
35415
|
var MAX_FINISH_RECONCILIATION_ATTEMPTS = 3;
|
|
35359
35416
|
var FINISH_RECONCILIATION_DELAY_SECONDS = 1;
|
|
35360
35417
|
var MAX_PROCESSING_RETRY_SECONDS = 30;
|
|
@@ -35376,7 +35433,10 @@ var sourceHash = async (source, signal) => {
|
|
|
35376
35433
|
if (signal?.aborted)
|
|
35377
35434
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
35378
35435
|
const length = Math.min(HASH_READ_SIZE, source.byteCount - offset);
|
|
35379
|
-
|
|
35436
|
+
const bytes = await exactRead(source, offset, length);
|
|
35437
|
+
if (signal?.aborted)
|
|
35438
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
35439
|
+
hash.update(bytes);
|
|
35380
35440
|
}
|
|
35381
35441
|
return hash.digest();
|
|
35382
35442
|
};
|
|
@@ -35459,9 +35519,19 @@ class NativeUploadClient {
|
|
|
35459
35519
|
settled: false
|
|
35460
35520
|
};
|
|
35461
35521
|
this.#jobs.push(job);
|
|
35522
|
+
const signal = input.signal;
|
|
35523
|
+
if (signal) {
|
|
35524
|
+
const onAbort = () => this.#abort(job);
|
|
35525
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
35526
|
+
job.removeAbortListener = () => signal.removeEventListener("abort", onAbort);
|
|
35527
|
+
}
|
|
35528
|
+
if (signal?.aborted) {
|
|
35529
|
+
this.#abort(job);
|
|
35530
|
+
return;
|
|
35531
|
+
}
|
|
35462
35532
|
input.onProgress?.({ acceptedBytes: acceptedBytes(job), totalBytes: input.source.byteCount });
|
|
35463
|
-
|
|
35464
|
-
|
|
35533
|
+
if (!job.settled)
|
|
35534
|
+
this.#pump();
|
|
35465
35535
|
});
|
|
35466
35536
|
}
|
|
35467
35537
|
#pump() {
|
|
@@ -35506,22 +35576,16 @@ class NativeUploadClient {
|
|
|
35506
35576
|
const offset = partIndex * job.upload.partSize;
|
|
35507
35577
|
const length = Math.min(job.upload.partSize, job.input.source.byteCount - offset);
|
|
35508
35578
|
const data = await exactRead(job.input.source, offset, length);
|
|
35509
|
-
|
|
35579
|
+
if (job.settled)
|
|
35580
|
+
return;
|
|
35581
|
+
await this.#savePart(job, partIndex, data);
|
|
35582
|
+
if (job.settled)
|
|
35583
|
+
return;
|
|
35510
35584
|
job.accepted.add(partIndex);
|
|
35511
35585
|
job.input.onProgress?.({ acceptedBytes: acceptedBytes(job), totalBytes: job.input.source.byteCount });
|
|
35512
35586
|
} catch (error) {
|
|
35513
35587
|
if (!job.settled && !job.input.signal?.aborted) {
|
|
35514
|
-
|
|
35515
|
-
const state = await this.rpc.state({ uploadId: job.upload.uploadId });
|
|
35516
|
-
if (state.acceptedParts.includes(partIndex)) {
|
|
35517
|
-
job.accepted.add(partIndex);
|
|
35518
|
-
job.input.onProgress?.({ acceptedBytes: acceptedBytes(job), totalBytes: job.input.source.byteCount });
|
|
35519
|
-
} else {
|
|
35520
|
-
this.#reject(job, error);
|
|
35521
|
-
}
|
|
35522
|
-
} catch {
|
|
35523
|
-
this.#reject(job, error);
|
|
35524
|
-
}
|
|
35588
|
+
this.#reject(job, error);
|
|
35525
35589
|
}
|
|
35526
35590
|
} finally {
|
|
35527
35591
|
job.queued.delete(partIndex);
|
|
@@ -35532,6 +35596,32 @@ class NativeUploadClient {
|
|
|
35532
35596
|
this.#finish(job);
|
|
35533
35597
|
}
|
|
35534
35598
|
}
|
|
35599
|
+
async#savePart(job, partIndex, data) {
|
|
35600
|
+
for (let attempt = 0;attempt < MAX_PART_ATTEMPTS; attempt += 1) {
|
|
35601
|
+
if (job.settled || job.input.signal?.aborted) {
|
|
35602
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
35603
|
+
}
|
|
35604
|
+
try {
|
|
35605
|
+
await this.rpc.savePart({ uploadId: job.upload.uploadId, partIndex, data });
|
|
35606
|
+
return;
|
|
35607
|
+
} catch (error) {
|
|
35608
|
+
if (job.settled || job.input.signal?.aborted) {
|
|
35609
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
35610
|
+
}
|
|
35611
|
+
let state;
|
|
35612
|
+
try {
|
|
35613
|
+
state = await this.rpc.state({ uploadId: job.upload.uploadId });
|
|
35614
|
+
} catch {
|
|
35615
|
+
throw error;
|
|
35616
|
+
}
|
|
35617
|
+
validatePartIndices(state.acceptedParts, job.upload.partCount);
|
|
35618
|
+
if (state.acceptedParts.includes(partIndex))
|
|
35619
|
+
return;
|
|
35620
|
+
if (state.status !== UploadStatus.UPLOADING || attempt + 1 === MAX_PART_ATTEMPTS)
|
|
35621
|
+
throw error;
|
|
35622
|
+
}
|
|
35623
|
+
}
|
|
35624
|
+
}
|
|
35535
35625
|
async#finish(job) {
|
|
35536
35626
|
if (job.settled || job.active > 0)
|
|
35537
35627
|
return;
|
|
@@ -35610,11 +35700,11 @@ class NativeUploadClient {
|
|
|
35610
35700
|
this.#reject(job, error);
|
|
35611
35701
|
}
|
|
35612
35702
|
}
|
|
35613
|
-
|
|
35703
|
+
#abort(job) {
|
|
35614
35704
|
if (job.settled)
|
|
35615
35705
|
return;
|
|
35616
|
-
await this.rpc.cancel({ uploadId: job.upload.uploadId }).catch(() => {});
|
|
35617
35706
|
this.#reject(job, new NativeUploadError("canceled", "Upload was canceled"));
|
|
35707
|
+
this.rpc.cancel({ uploadId: job.upload.uploadId }).catch(() => {});
|
|
35618
35708
|
}
|
|
35619
35709
|
#reject(job, error) {
|
|
35620
35710
|
if (job.settled)
|
|
@@ -35624,6 +35714,8 @@ class NativeUploadClient {
|
|
|
35624
35714
|
job.reject(error instanceof Error ? error : new Error(String(error)));
|
|
35625
35715
|
}
|
|
35626
35716
|
#remove(job) {
|
|
35717
|
+
job.removeAbortListener?.();
|
|
35718
|
+
job.removeAbortListener = undefined;
|
|
35627
35719
|
const index = this.#jobs.indexOf(job);
|
|
35628
35720
|
if (index >= 0)
|
|
35629
35721
|
this.#jobs.splice(index, 1);
|