@securecoms/agent-bridge 0.8.0 → 0.10.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/dist/bin.js +442 -88
- package/dist/bridge-agent.d.ts +62 -0
- package/dist/config.d.ts +4 -0
- package/dist/http-server.d.ts +4 -4
- package/dist/index.js +417 -63
- package/dist/memory/openclaw-provider.d.ts +10 -1
- package/dist/memory/openclaw-workspace-facts.d.ts +38 -0
- package/dist/memory/provider.d.ts +2 -1
- package/package.json +1 -1
- package/connectors/hermes/__pycache__/__init__.cpython-311.pyc +0 -0
- package/connectors/hermes/__pycache__/adapter.cpython-311.pyc +0 -0
- package/connectors/hermes/__pycache__/gate.cpython-311.pyc +0 -0
- package/connectors/hermes/__pycache__/securecoms_gate.cpython-311.pyc +0 -0
- package/connectors/hermes/__pycache__/securecoms_transport.cpython-311.pyc +0 -0
- package/connectors/hermes/__pycache__/transport.cpython-311.pyc +0 -0
- package/connectors/hermes/tests/__pycache__/conftest.cpython-311-pytest-8.4.0.pyc +0 -0
- package/connectors/hermes/tests/__pycache__/test_adapter_wiring.cpython-311-pytest-8.4.0.pyc +0 -0
- package/connectors/hermes/tests/__pycache__/test_gate.cpython-311-pytest-8.4.0.pyc +0 -0
- package/connectors/hermes/tests/__pycache__/test_securecoms_gate.cpython-311-pytest-8.4.0.pyc +0 -0
- package/connectors/hermes/tests/__pycache__/test_securecoms_transport.cpython-311-pytest-8.4.0.pyc +0 -0
- package/connectors/hermes/tests/__pycache__/test_transport.cpython-311-pytest-8.4.0.pyc +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { MemoryProvider } from "./provider.js";
|
|
2
2
|
import type { SqliteMlsStateStore, MemoryRecordInput, MemoryContextResult } from "@agentvault/connect-mls-store";
|
|
3
|
+
export interface OpenClawFactsOptions {
|
|
4
|
+
workspaceDir?: string;
|
|
5
|
+
factsCharBudget?: number;
|
|
6
|
+
}
|
|
3
7
|
/**
|
|
4
8
|
* MemoryProvider for an OpenClaw-hosted agent (Cortina). context() merges
|
|
5
9
|
* OpenClaw's own text history (read-only, plain session .jsonl) with the
|
|
@@ -12,9 +16,14 @@ export declare class OpenClawMemoryProvider implements MemoryProvider {
|
|
|
12
16
|
private readonly store;
|
|
13
17
|
private readonly baseDir;
|
|
14
18
|
private readonly agent;
|
|
19
|
+
private readonly factsOpts?;
|
|
15
20
|
private noSession;
|
|
16
21
|
private readFailed;
|
|
17
|
-
|
|
22
|
+
private factsMissing;
|
|
23
|
+
private factsReadFailed;
|
|
24
|
+
private factsTruncated;
|
|
25
|
+
private factsChars;
|
|
26
|
+
constructor(store: SqliteMlsStateStore, baseDir: string, agent: string, factsOpts?: OpenClawFactsOptions | undefined);
|
|
18
27
|
record(input: MemoryRecordInput): Promise<{
|
|
19
28
|
seq: number;
|
|
20
29
|
deduped: boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Spec D2 constants — pinned so tests are deterministic. "Chars" = UTF-16 code units. */
|
|
2
|
+
export declare const DEFAULT_FACTS_BUDGET = 8000;
|
|
3
|
+
export declare const MEMORY_MD_CAP = 6000;
|
|
4
|
+
export declare const MIN_FRAGMENT = 200;
|
|
5
|
+
export declare const MAX_SOURCE_BYTES: number;
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the agent's OpenClaw workspace dir (spec D4). Ladder, first hit wins:
|
|
8
|
+
* 1. explicit override (credential workspace_dir) — operator beats everything;
|
|
9
|
+
* 2. openclaw.json, resolved the way OpenClaw itself would:
|
|
10
|
+
* 2a. agents.list entry with id===agent and a NON-EMPTY string workspace (verbatim,
|
|
11
|
+
* never case-transformed — the live config declares "workspace-cortina" for an
|
|
12
|
+
* on-disk "workspace-Cortina" and works only because APFS is case-insensitive);
|
|
13
|
+
* 2b. else agents.defaults.workspace when it is a non-empty string (covers main,
|
|
14
|
+
* whose live entry has the workspace key ABSENT, and named agents w/o one);
|
|
15
|
+
* 3. derivation, LAST resort (openclaw.json missing/malformed/silent):
|
|
16
|
+
* main/"" → <base>/workspace, else <base>/workspace-<agent> verbatim.
|
|
17
|
+
* Empty agent is treated as "main" throughout (the factory passes agent ?? "").
|
|
18
|
+
* Total: always returns a path; existence is checked at read time, fail-safe.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveWorkspaceDir(baseDir: string, agent: string, override?: string): string;
|
|
21
|
+
export interface WorkspaceFactsResult {
|
|
22
|
+
/** 0..3 provenance-prefixed facts: MEMORY.md first, then dailies newest-first. */
|
|
23
|
+
facts: string[];
|
|
24
|
+
/** True when the budget clipped or dropped any source (includes the >1MB skip). */
|
|
25
|
+
truncated: boolean;
|
|
26
|
+
/** True when the resolved workspace yielded zero usable sources. False on budget-0 kill switch. */
|
|
27
|
+
missing: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read the workspace facts (spec D1-D3). READ-ONLY, total: never throws for any
|
|
31
|
+
* filesystem state — absence degrades to fewer/zero facts. Only MEMORY.md and
|
|
32
|
+
* memory/\d{4}-\d{2}-\d{2}\.md under the resolved dir are ever opened.
|
|
33
|
+
* Budget accounting is content-only; prefixes and markers are exempt (audit M2).
|
|
34
|
+
*/
|
|
35
|
+
export declare function readWorkspaceFacts(baseDir: string, agent: string, opts?: {
|
|
36
|
+
workspaceDir?: string;
|
|
37
|
+
charBudget?: number;
|
|
38
|
+
}): WorkspaceFactsResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SqliteMlsStateStore, MemoryRecordInput, MemoryContextResult } from "@agentvault/connect-mls-store";
|
|
2
|
+
import type { OpenClawFactsOptions } from "./openclaw-provider.js";
|
|
2
3
|
export interface MemoryProvider {
|
|
3
4
|
record(input: MemoryRecordInput): Promise<{
|
|
4
5
|
seq: number;
|
|
@@ -26,4 +27,4 @@ export declare class NullMemory implements MemoryProvider {
|
|
|
26
27
|
}>;
|
|
27
28
|
context(): Promise<MemoryContextResult>;
|
|
28
29
|
}
|
|
29
|
-
export declare function createMemoryProvider(provider: "securecoms" | "none" | "hermes" | "openclaw", store: SqliteMlsStateStore, baseDir?: string, agent?: string): MemoryProvider;
|
|
30
|
+
export declare function createMemoryProvider(provider: "securecoms" | "none" | "hermes" | "openclaw", store: SqliteMlsStateStore, baseDir?: string, agent?: string, openclawFacts?: OpenClawFactsOptions): MemoryProvider;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/connectors/hermes/tests/__pycache__/test_adapter_wiring.cpython-311-pytest-8.4.0.pyc
DELETED
|
Binary file
|
|
Binary file
|
package/connectors/hermes/tests/__pycache__/test_securecoms_gate.cpython-311-pytest-8.4.0.pyc
DELETED
|
Binary file
|