@securecoms/agent-bridge 0.28.1 → 0.29.0
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 +192 -79
- package/dist/bin.js +2841 -169
- package/dist/bridge-agent.d.ts +190 -1
- package/dist/config.d.ts +2 -0
- package/dist/embedder.js +2 -1
- package/dist/index.js +2815 -143
- package/dist/memory/embedder/client.d.ts +20 -0
- package/dist/memory/embedder/protocol.d.ts +5 -0
- package/dist/memory/note-frames.d.ts +1 -1
- package/dist/memory/recall/recall-book.d.ts +12 -2
- package/dist/memory/unified/chunk.d.ts +12 -0
- package/dist/memory/unified/config.d.ts +7 -0
- package/dist/memory/unified/consumer-unified.d.ts +21 -0
- package/dist/memory/unified/escape.d.ts +23 -0
- package/dist/memory/unified/index-key.d.ts +8 -0
- package/dist/memory/unified/item-book.d.ts +70 -0
- package/dist/memory/unified/item-reembed.d.ts +20 -0
- package/dist/memory/unified/migrate.d.ts +68 -0
- package/dist/memory/unified/owner-scope.d.ts +48 -0
- package/dist/memory/unified/pin-rules.d.ts +18 -0
- package/dist/memory/unified/ranking-client.d.ts +48 -0
- package/dist/memory/unified/ranking-core-constants.d.ts +8 -0
- package/dist/memory/unified/ranking-core.d.ts +117 -0
- package/dist/memory/unified/ranking-inprocess.d.ts +3 -0
- package/dist/memory/unified/ranking-worker.d.ts +1 -0
- package/dist/memory/unified/read-book.d.ts +80 -0
- package/dist/memory/unified/switch.d.ts +8 -0
- package/dist/memory/unified/text.d.ts +15 -0
- package/dist/memory/unified/worker-protocol.d.ts +102 -0
- package/dist/memory-worker.js +583 -0
- package/dist/version.d.ts +1 -1
- package/dist/ws-server.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -705,102 +705,215 @@ including its key). Each proxied call is metered server-side
|
|
|
705
705
|
|
|
706
706
|
---
|
|
707
707
|
|
|
708
|
-
##
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
708
|
+
## Unified memory (0.29.0)
|
|
709
|
+
|
|
710
|
+
<!-- [COPY, NEW] Approved by Eric 2026-10-11 (plan Task 37). -->
|
|
711
|
+
|
|
712
|
+
Bridge 0.29.0 replaces the Markdown notes of 0.27 and the semantic memory of
|
|
713
|
+
0.28 with one memory. In this release it works in the owner's private chat
|
|
714
|
+
only. Rooms and other people's private chats are not remembered.
|
|
715
|
+
|
|
716
|
+
**What the agent remembers.**
|
|
717
|
+
|
|
718
|
+
- Each message the owner types in their private chat. A message that looks
|
|
719
|
+
like a password or a key is not saved at all.
|
|
720
|
+
- What the owner says on a call in their private chat, when the bridge gets
|
|
721
|
+
the turn as transcribed speech from a relay that the server verified as the
|
|
722
|
+
owner. A spoken turn that arrives before the bridge has its runtime config
|
|
723
|
+
after a restart is not saved. Spoken words cannot be pinned, and a call
|
|
724
|
+
cannot forget.
|
|
725
|
+
- The agent's own replies in that chat, as reference material. A message the
|
|
726
|
+
agent sends that does not reply to a message is not saved.
|
|
727
|
+
- Pinned facts. The owner asks the agent to pin a fact, and the bridge posts
|
|
728
|
+
`Pinned: "<fact>" Say "forget that" to remove it.` in the chat. Each word
|
|
729
|
+
that carries meaning must be a word the owner typed. Words spoken on a call
|
|
730
|
+
do not count. At most 200 pinned facts, each at most 400 characters.
|
|
731
|
+
- "Forget that". The owner types it in their private chat. The agent removes
|
|
732
|
+
one memory shown with that message, and the bridge posts
|
|
733
|
+
`Forgot: "<text>"`. The agent makes one change (a pin or a forget) per
|
|
734
|
+
owner message.
|
|
735
|
+
|
|
736
|
+
**Where it is kept.** Each memory is sealed per row in `bridge-state.db`
|
|
737
|
+
(schema v12) on the agent's machine. The bridge delivers memories only to the
|
|
738
|
+
`/v1/ws` socket of a runtime that declares `memory_unified` in its hello. A
|
|
739
|
+
harness socket never receives them. The model provider sees the memories
|
|
740
|
+
delivered with each turn. Beside the pinned facts, a typed turn gets at most
|
|
741
|
+
10 memories and a voice turn at most 3. The bridge waits up to 600 ms for a
|
|
742
|
+
typed turn's memory search and up to 250 ms for a voice turn's.
|
|
743
|
+
|
|
744
|
+
**Limits.** The limit is 2 GB or 100,000 memories, whichever comes first.
|
|
745
|
+
When it is full, the oldest automatic memories are removed first. Pinned facts
|
|
746
|
+
are never removed. At 80%, the app shows: "{name}'s memory is 80% full
|
|
747
|
+
({used} of {limit}). The limit is 2 GB or 100,000 memories, whichever comes
|
|
748
|
+
first. When it is full, the oldest automatic memories are removed first.
|
|
749
|
+
Pinned facts are never removed." The app also says: "The more {name}
|
|
750
|
+
remembers, the harder it is to find older details; pinned facts are always in
|
|
751
|
+
front of it."
|
|
752
|
+
|
|
753
|
+
**RAM.** Plan for about 102 to 104 MiB more memory per agent at 100,000
|
|
754
|
+
memories (measured 2026-10-11 in a standalone process on an x86_64 laptop). A
|
|
755
|
+
small store uses less.
|
|
756
|
+
|
|
757
|
+
**The search model.** The bridge downloads its search model from
|
|
758
|
+
downloads.securecoms.ai the first time the owner messages the agent in their
|
|
759
|
+
private chat with memory on, if the model files are not already on the
|
|
760
|
+
machine. On a machine that must make no such connection, set
|
|
761
|
+
`memory.model_source` to `import_only` in the credential file and copy the
|
|
762
|
+
model bundle in with `agent-bridge models import <dir>`. Without the model,
|
|
763
|
+
the agent finds memories by keyword only. On Windows it finds memories by
|
|
764
|
+
keyword only in this release.
|
|
765
|
+
|
|
766
|
+
If you embed the bridge as a library (`new BridgeAgent(cfg, deps)`), pass
|
|
767
|
+
`hostMachine: true`. Without it, no model is downloaded or loaded, no call
|
|
768
|
+
heartbeat is written, and the agent finds memories by keyword only. The
|
|
769
|
+
`agent-bridge` command passes it for you.
|
|
716
770
|
|
|
717
771
|
**Compatibility.**
|
|
718
772
|
|
|
719
|
-
- Install `@securecoms/agent-runtime` 0.
|
|
720
|
-
restart both (`launchctl bootout` then `bootstrap`, never `kickstart`).
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
`memory_notes` has connected in that bridge process. A 0.9.x runtime's
|
|
724
|
-
hello does not, so a 0.27 bridge with a 0.9.x runtime keeps today's facts
|
|
725
|
-
and recall, but it is not a supported pairing.
|
|
773
|
+
- Install `@securecoms/agent-runtime` 0.12.0 together with the bridge and
|
|
774
|
+
restart both (`launchctl bootout` then `bootstrap`, never `kickstart`). A
|
|
775
|
+
runtime whose hello does not declare `memory_unified` (0.11.0 or older) gets
|
|
776
|
+
no memories. That is not a supported pairing.
|
|
726
777
|
- Harness daemons (Hermes, OpenClaw) must name `memory.provider` in their
|
|
727
|
-
credential file. A daemon whose file omits it is treated as `securecoms
|
|
728
|
-
its
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
(`jq .memory.provider <credential-file>`) before
|
|
733
|
-
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
778
|
+
credential file. A daemon whose file omits it is treated as `securecoms`:
|
|
779
|
+
its bridge saves owner private-chat memories on disk, although its harness
|
|
780
|
+
socket never receives them. A global `npm install -g --prefix ~/.local`
|
|
781
|
+
reaches every daemon whose plist points at the global `dist/bin.js`, at its
|
|
782
|
+
next restart. Check each credential file
|
|
783
|
+
(`jq .memory.provider <credential-file>`) before you install.
|
|
784
|
+
- Memory is off in a freshly started bridge until a runtime-config refetch
|
|
785
|
+
succeeds. A bridge restarted while the backend is unreachable saves and
|
|
786
|
+
recalls nothing until the backend answers.
|
|
787
|
+
|
|
788
|
+
**Old notes and semantic memory.** The bridge copies a private chat's old
|
|
789
|
+
memory into unified memory in the background, after the owner's first typed
|
|
790
|
+
message in that chat on 0.29.0:
|
|
791
|
+
|
|
792
|
+
- 0.27 notes become pinned facts. The 200-fact limit does not apply to them.
|
|
793
|
+
- 0.28 semantic memory rows become automatic memories. Their search vectors
|
|
794
|
+
are kept.
|
|
795
|
+
- The chat's stored history becomes reference memories.
|
|
796
|
+
- A message forgotten in 0.28 is not copied. Text that looks like a password
|
|
797
|
+
or a key is not copied. Old facts, and the history of rooms and of other
|
|
798
|
+
people's private chats, are not copied.
|
|
799
|
+
|
|
800
|
+
The old tables stay in this release, so a rollback works. Clear all and
|
|
801
|
+
"forget that" also delete the matching old rows.
|
|
802
|
+
|
|
803
|
+
**Off switches.** There are four. Use the narrowest that fits.
|
|
804
|
+
|
|
805
|
+
- Agent memory off in the agent settings. The agent saves nothing new and
|
|
806
|
+
recalls nothing. It still sees the recent messages of the chat. Turning
|
|
807
|
+
memory off does not delete memories. Use Clear all for that.
|
|
808
|
+
- `memory.enabled: false` in the credential file, then a daemon restart. The
|
|
809
|
+
same effect, and the backend cannot turn it back on. Any value other than
|
|
810
|
+
`true` turns memory off.
|
|
811
|
+
- `memory.provider: "none"` in the credential file, then a daemon restart.
|
|
812
|
+
This turns memory off, and it also drops the recent history.
|
|
813
|
+
- `SECURECOMS_OWNER_DM_DEFAULT_GRANTS=off` in the bridge service environment.
|
|
814
|
+
This turns memory off, and it also drops the owner private-chat tools.
|
|
815
|
+
|
|
816
|
+
`SECURECOMS_TOOL_DENY=memory_note` (runtime environment) removes only the pin
|
|
817
|
+
and forget tool. The agent still saves and recalls memories.
|
|
738
818
|
|
|
739
819
|
**Known limitations.**
|
|
740
820
|
|
|
741
|
-
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
- Short notes in CJK or Thai (fewer than 2 space-separated tokens) are
|
|
746
|
-
refused.
|
|
747
|
-
- UUIDs and long letter-and-digit tokens are refused as possible secrets.
|
|
821
|
+
- A pin can reorder the owner's words or leave one out, including a negation
|
|
822
|
+
("don't pay Bob, pay Alice" can be pinned as "pay Bob"). Read the
|
|
823
|
+
`Pinned:` line, and say "forget that" if it is wrong.
|
|
824
|
+
- Clear all deletes memories. It does not delete chat history.
|
|
748
825
|
- Forget and clear are logical deletes: sealed bytes can stay in free
|
|
749
|
-
database pages until they are overwritten, and they still open
|
|
750
|
-
device key.
|
|
751
|
-
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
`memory.
|
|
766
|
-
`memory.
|
|
767
|
-
`memory.
|
|
768
|
-
`memory.
|
|
769
|
-
|
|
770
|
-
`
|
|
771
|
-
`
|
|
772
|
-
|
|
826
|
+
database pages or the WAL until they are overwritten, and they still open
|
|
827
|
+
under the device key.
|
|
828
|
+
- The model provider sees the memories that the bridge delivers.
|
|
829
|
+
|
|
830
|
+
**Log events.** All are content-free: counts and classes only, never memory
|
|
831
|
+
text. `memory.item_written` (`source`, `chunks`), `memory.item_skipped`
|
|
832
|
+
(`reason_class`), `memory.pin_written`, `memory.item_forgotten`,
|
|
833
|
+
`memory.note_refused` (`reason_class`), `memory.migration_ran` (`notes`,
|
|
834
|
+
`recall`, `history`, `skipped`, `excluded`, `aborted`, `unreadable`),
|
|
835
|
+
`memory.owner_scope_purged` (`count`), `memory.unified_off`
|
|
836
|
+
(`reason_class`: `off`, `unrecognized`, `local` or `clear_pending`),
|
|
837
|
+
`memory.ranking_worker_exited` (`inFlight`), and these failure events with the
|
|
838
|
+
error class only: `memory.unified_clear_failed`,
|
|
839
|
+
`memory.unified_switch_failed`, `memory.unified_report_failed`,
|
|
840
|
+
`memory.unified_prepare_failed`, `memory.unified_reply_failed`,
|
|
841
|
+
`memory.unified_boot_reconcile_failed`, `memory.migration_failed`,
|
|
842
|
+
`memory.owner_scope_sweep_failed`, `memory.note_write_failed`,
|
|
843
|
+
`memory.pinned_line_failed`, `memory.forgot_line_failed`,
|
|
844
|
+
`memory.evict_failed`, `memory.reembed_failed`, `memory.model_upkeep_failed`,
|
|
845
|
+
`memory.ranking_notify_failed` and `memory.ranking_worker_spawn_failed`.
|
|
846
|
+
|
|
847
|
+
**`/healthz` and the machine report.** `/healthz` adds `memory_hot_bytes`,
|
|
848
|
+
`memory_deadline_misses`, `memory_reads`, `memory_reads_discarded` and `pid`.
|
|
849
|
+
The machine report adds `memory_unified_enabled`, `memory_size_bytes`,
|
|
850
|
+
`memory_item_count`, `memory_db_bytes` and `memory_near_full`. All are
|
|
851
|
+
numbers or booleans.
|
|
773
852
|
|
|
774
853
|
**Upgrade order.** Upgrade and restart the bridge and the runtime together.
|
|
775
854
|
First check `memory.provider` in the credential file of every daemon that a
|
|
776
855
|
global install reaches (`jq .memory.provider <credential-file>`).
|
|
777
856
|
|
|
778
|
-
**Rollback.**
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
Semantic memory downloads its model from downloads.securecoms.ai when the owner first messages the agent in their private chat after semantic memory is turned on, not when the setting is saved. On a machine that must make no such connection, set `memory.model_source` to `import_only` in the credential file and copy the model bundle in with `agent-bridge models import <dir>`.
|
|
789
|
-
|
|
790
|
-
If you change the memory provider or turn off owner-DM defaults, semantic memory rows stay on the machine until their retention ends, but they are never used.
|
|
791
|
-
|
|
792
|
-
The bridge logs `memory.model_download_enabled` (no fields) once per process
|
|
793
|
-
when semantic memory is turned on with `model_source` `download`.
|
|
794
|
-
|
|
795
|
-
<!-- [COPY, NEW] (7b Task 19 fix round 2). Gate: Eric sign-off before npm publish (release PR). -->
|
|
796
|
-
|
|
797
|
-
If you embed the bridge as a library (`new BridgeAgent(cfg, deps)`), semantic recall stays inert unless you pass `hostMachine: true`: no model is downloaded or loaded, and no call heartbeat is written. The `agent-bridge` command passes it for you.
|
|
857
|
+
**Rollback.** Roll back the bridge and the runtime together, to 0.28.2 and
|
|
858
|
+
0.11.0, and restart both. A 0.28.2 bridge opens the database, ignores the
|
|
859
|
+
unified tables, and works on the old notes, semantic memory rows and history
|
|
860
|
+
that 0.29.0 kept. It does not see what 0.29.0 saved, pinned facts included. It
|
|
861
|
+
never removes or clears the unified tables, so the size limit does not apply
|
|
862
|
+
to them until you upgrade again. When 0.29.0 starts again, before it serves
|
|
863
|
+
anything, it removes copied pins whose old note was deleted during the
|
|
864
|
+
rollback, removes copied memories whose message was forgotten, and applies a
|
|
865
|
+
Clear all done during the rollback. Old rows added during the rollback are
|
|
866
|
+
copied after the owner's next typed message.
|
|
798
867
|
|
|
799
868
|
---
|
|
800
869
|
|
|
870
|
+
## Release notes: 0.29.0
|
|
871
|
+
|
|
872
|
+
<!-- [COPY, NEW] Approved by Eric 2026-10-11 (plan Task 37). -->
|
|
873
|
+
|
|
874
|
+
0.29.0 turns on unified memory in the owner's private chat. Install it
|
|
875
|
+
together with `@securecoms/agent-runtime` 0.12.0 and restart both. See
|
|
876
|
+
"Unified memory (0.29.0)" above.
|
|
877
|
+
|
|
878
|
+
- **One memory.** Typed messages, spoken call turns, the agent's replies and
|
|
879
|
+
pinned facts are kept in one sealed memory. Rooms and other people's private
|
|
880
|
+
chats are not remembered in this release.
|
|
881
|
+
- **Old memory moves.** 0.27 notes and 0.28 semantic memory rows are copied in
|
|
882
|
+
after the owner's next typed message. The old tables stay for one release.
|
|
883
|
+
- **Limits.** 2 GB or 100,000 memories, whichever comes first. Pinned facts are
|
|
884
|
+
never removed.
|
|
885
|
+
- **RAM.** About 102 to 104 MiB more per agent at 100,000 memories
|
|
886
|
+
(measured in a standalone process, not yet inside a running bridge).
|
|
887
|
+
- **Off switches.** A new credential key, `memory.enabled: false`, turns memory
|
|
888
|
+
off on the machine. `SECURECOMS_TOOL_DENY=memory_note` now removes only the
|
|
889
|
+
pin and forget tool; automatic memory continues.
|
|
890
|
+
- **Skills in the owner's private chat.** With runtime 0.12.0, the memory
|
|
891
|
+
tool gate refuses every skill on the owner's private-chat turns. Only
|
|
892
|
+
`current_time`, `echo`, `memory_note`, and `web_search`, `fetch_url`,
|
|
893
|
+
`http_request` (GET) and `sql_query` with arguments that pass the gate, run
|
|
894
|
+
there. Skills in rooms are not changed.
|
|
895
|
+
- **`/healthz`.** New `memory_hot_bytes`, `memory_deadline_misses`,
|
|
896
|
+
`memory_reads`, `memory_reads_discarded` and `pid`.
|
|
897
|
+
|
|
898
|
+
## Release notes: 0.28.2
|
|
899
|
+
|
|
900
|
+
<!-- [COPY, NEW] this section. Approved by Eric 2026-10-09 ("approve 0.28.2 copy"). -->
|
|
901
|
+
|
|
902
|
+
0.28.2 keeps semantic memory recall working after quiet periods. Install it in
|
|
903
|
+
place of 0.28.1 and restart the bridge. `@securecoms/agent-runtime` 0.11.0 is
|
|
904
|
+
unchanged.
|
|
905
|
+
|
|
906
|
+
- **After a quiet period.** When the agent has been idle for 30 minutes or
|
|
907
|
+
more, the first private message now waits for the memory search inside the
|
|
908
|
+
same time limit (600 ms typed, 250 ms in a voice call) instead of skipping it.
|
|
909
|
+
If the limit runs out, that message has no recall, and the next one does.
|
|
910
|
+
- **Idle is not an error.** The memory helper process still stops after 30 idle
|
|
911
|
+
minutes to free memory. The bridge no longer logs or reports that as
|
|
912
|
+
unavailable.
|
|
913
|
+
|
|
801
914
|
## Release notes: 0.28.1
|
|
802
915
|
|
|
803
|
-
<!-- [COPY, NEW] this section.
|
|
916
|
+
<!-- [COPY, NEW] this section. Approved by Eric 2026-10-09. -->
|
|
804
917
|
|
|
805
918
|
0.28.1 makes semantic memory recall more reliable. Install it in place of
|
|
806
919
|
0.28.0 and restart the bridge. `@securecoms/agent-runtime` 0.11.0 is unchanged.
|
|
@@ -829,7 +942,7 @@ with `@securecoms/agent-runtime` 0.11.0 and restart both.
|
|
|
829
942
|
- **`import_only`.** Set `memory.model_source` to `import_only` on a machine
|
|
830
943
|
that must make no model download.
|
|
831
944
|
- **`models import`.** `agent-bridge models import <dir>` copies a model bundle
|
|
832
|
-
in for `import_only` machines. <!-- [COPY, NEW] the one-line CLI confirmation "imported <names>" printed by `models import` (src/bin.ts).
|
|
945
|
+
in for `import_only` machines. <!-- [COPY, NEW] the one-line CLI confirmation "imported <names>" printed by `models import` (src/bin.ts). Approved by Eric 2026-10-09. -->
|
|
833
946
|
|
|
834
947
|
## Test commands
|
|
835
948
|
|