@moolam/edge-agent 1.0.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/LICENSE +202 -0
- package/README.md +54 -0
- package/dist/cognitive_bindings.d.ts +329 -0
- package/dist/cognitive_bindings.d.ts.map +1 -0
- package/dist/cognitive_bindings.js +1293 -0
- package/dist/cognitive_bindings.js.map +1 -0
- package/dist/coldstart.d.ts +95 -0
- package/dist/coldstart.d.ts.map +1 -0
- package/dist/coldstart.js +224 -0
- package/dist/coldstart.js.map +1 -0
- package/dist/edge_agent.d.ts +216 -0
- package/dist/edge_agent.d.ts.map +1 -0
- package/dist/edge_agent.js +530 -0
- package/dist/edge_agent.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/local_vector_db.d.ts +115 -0
- package/dist/local_vector_db.d.ts.map +1 -0
- package/dist/local_vector_db.js +297 -0
- package/dist/local_vector_db.js.map +1 -0
- package/dist/slm_runtime.d.ts +158 -0
- package/dist/slm_runtime.d.ts.map +1 -0
- package/dist/slm_runtime.js +247 -0
- package/dist/slm_runtime.js.map +1 -0
- package/dist/trajectory_capture.d.ts +83 -0
- package/dist/trajectory_capture.d.ts.map +1 -0
- package/dist/trajectory_capture.js +193 -0
- package/dist/trajectory_capture.js.map +1 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @moolam/edge-agent
|
|
2
|
+
|
|
3
|
+
The offline-first on-device host. `EdgeAgent` runs the full cognitive loop against a local SLM and a local vector store, with zero connectivity, indefinitely. It is not a degraded cache of the cloud: it is a peer replica that acts independently and converges through CRDT sync when connectivity returns (ADR 0002).
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
| File | Responsibility |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `src/edge_agent.ts` | The host facade: `agentTurn()` composes local routing, prompt assembly, SLM inference, friction folding, and memory writes |
|
|
10
|
+
| `src/slm_runtime.ts` | The pluggable SLM seam: OpenAI-compatible localhost adapter shipped; llama.cpp, ONNX Runtime Mobile, AICore, and MLX adapters are roadmap Stage 2 |
|
|
11
|
+
| `src/local_vector_db.ts` | `LocalVectorDb`: SQLite-backed vector memory (Float32 BLOBs, exact cosine, kind-aware decay, corrections never evicted) behind the `StorageDriver` contract |
|
|
12
|
+
|
|
13
|
+
Friction telemetry comes from `@moolam/telemetry`; sync comes from `@moolam/sync-protocol`. Routing on-device is a greedy simplification of the cloud task router; on reconnect the cloud's LWW registers win without conflict (PRD ATR-06).
|
|
14
|
+
|
|
15
|
+
## Public API
|
|
16
|
+
|
|
17
|
+
`EdgeAgent`, `AgentReply`, `LocalVectorDb`, the SLM runtime interface and adapters, exported from `src/index.ts`.
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { EdgeAgent } from "@moolam/edge-agent";
|
|
23
|
+
|
|
24
|
+
const agent = new EdgeAgent({
|
|
25
|
+
subjectId: "subject-1",
|
|
26
|
+
deviceId: "device-a",
|
|
27
|
+
runtime: slmRuntime, // any SlmRuntime adapter
|
|
28
|
+
storage: storageDriver, // any StorageDriver (SQLite binding)
|
|
29
|
+
profile, // track, language, age band
|
|
30
|
+
// transport omitted = permanently-offline sovereign mode
|
|
31
|
+
});
|
|
32
|
+
await agent.initialize();
|
|
33
|
+
|
|
34
|
+
const reply = await agent.agentTurn("Explain this step to me.", frictionSample);
|
|
35
|
+
// works with the network cable cut; reply.servedLocally === true
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Contributing notes
|
|
39
|
+
|
|
40
|
+
- Every feature must answer "what does this do offline" at design time.
|
|
41
|
+
- Missing or corrupt on-disk weights must throw typed `SlmRuntimeInitError`
|
|
42
|
+
(`missing_weights` / `corrupt_weights`) — never crash-loop or fabricate.
|
|
43
|
+
See [`LocalWeightSlmRuntime`](./src/slm_runtime.ts) and the drill map in
|
|
44
|
+
[`docs/protocol/DEGRADATION-DRILL-CROSSREF.md`](../../docs/protocol/DEGRADATION-DRILL-CROSSREF.md).
|
|
45
|
+
- Memory store changes must preserve parity with the cloud `memory_graph.py` semantics (same decay, same kinds), or document why the divergence is substrate-specific.
|
|
46
|
+
- Performance budgets: first token ≤ 1.5s p95 on mid-range Android (NFR-01).
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
`examples/offline-edge/` runs a full turn with no network; `examples/memory/` exercises `LocalVectorDb` directly.
|
|
51
|
+
|
|
52
|
+
## Tests
|
|
53
|
+
|
|
54
|
+
Currently covered through the examples and the protocol smoke tests; per-package unit tests are a welcome contribution (see `CONTRIBUTING.md`).
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module cognitive_bindings
|
|
3
|
+
*
|
|
4
|
+
* ChatMessage[] → single SlmRuntime prompt string.
|
|
5
|
+
* SlmRuntime ↔ ModelInterface (generate / stream / embed)
|
|
6
|
+
* with deadlineMs (+ optional AbortSignal) passthrough; stream deltas
|
|
7
|
+
* (CK-03.2).
|
|
8
|
+
* On-device conformance SlmRuntime + ModelConformanceHarness
|
|
9
|
+
* factory; CK-03 + locality zero-egress proof in
|
|
10
|
+
* tests/model_adapter_conformance.test.mjs.
|
|
11
|
+
* LocalVectorDb ↔ MemoryInterface (remember/recall/forget);
|
|
12
|
+
* kind mapping incl. semantic; CK-02 harness factory.
|
|
13
|
+
* Kind-aware decay + correction pinning (see local_vector_db
|
|
14
|
+
* kindAwareDecayFactor / pinCorrectionsInWorkingSet); recall ordering tests.
|
|
15
|
+
* CreateEdgeCognitiveBindings factory (memory/model +
|
|
16
|
+
* edge reasoning/planning/tools/knowledge stubs).
|
|
17
|
+
* ConceptId→topicId remember wrap; coerce legacy SlmRuntime
|
|
18
|
+
* `descriptor` hosts so EdgeAgent.agentTurn can bind CognitiveCore.
|
|
19
|
+
*
|
|
20
|
+
* Invariants:
|
|
21
|
+
* - Identical inputs → identical prompt (B5 state-hash caching).
|
|
22
|
+
* - Empty messages → typed error (never call SlmRuntime).
|
|
23
|
+
* - Prompt / system budget exceeding contextWindow → typed overflow
|
|
24
|
+
* (never silent truncation).
|
|
25
|
+
* - Deadline abort propagates without hanging the turn.
|
|
26
|
+
* - Stream yields deltas, not cumulative text.
|
|
27
|
+
* - remember durable before resolve; recall subject-scoped.
|
|
28
|
+
*/
|
|
29
|
+
import type { AgentProfile, CognitiveBindings } from "@moolam/cognitive-core";
|
|
30
|
+
import type { ChatMessage, GenerateResult, KnowledgeConnectorInterface, MemoryInterface, MemoryKind, ModelDescriptor, ModelInterface, PlanningInterface, ReasoningInterface, SpeechInterface, ToolInterface, VisionInterface } from "@moolam/contracts";
|
|
31
|
+
import { LocalVectorDb } from "./local_vector_db.js";
|
|
32
|
+
import type { SlmModelCard, SlmRuntime } from "./slm_runtime.js";
|
|
33
|
+
/** Empty ChatMessage[] before any local generate. */
|
|
34
|
+
export declare const EDGE_PROMPT_OBLIGATION_EMPTY = "EDGE.PROMPT_EMPTY_MESSAGES";
|
|
35
|
+
/** Assembled prompt (or system slice) exceeds SlmModelCard.contextWindow. */
|
|
36
|
+
export declare const EDGE_PROMPT_OBLIGATION_OVERFLOW = "EDGE.PROMPT_CONTEXT_OVERFLOW";
|
|
37
|
+
/** Runtime role not in the ChatMessage contract. */
|
|
38
|
+
export declare const EDGE_PROMPT_OBLIGATION_INVALID_ROLE = "EDGE.PROMPT_INVALID_ROLE";
|
|
39
|
+
/** subjectId required for sovereignty / isolation. */
|
|
40
|
+
export declare const EDGE_PROMPT_OBLIGATION_SUBJECT = "EDGE.PROMPT_SUBJECT_REQUIRED";
|
|
41
|
+
/** Stable section markers — do not localize (determinism). */
|
|
42
|
+
export declare const EDGE_PROMPT_ROLE_MARKERS: Readonly<{
|
|
43
|
+
readonly system: "### system";
|
|
44
|
+
readonly user: "### user";
|
|
45
|
+
readonly assistant: "### assistant";
|
|
46
|
+
readonly tool: "### tool";
|
|
47
|
+
}>;
|
|
48
|
+
/** Trailing cue inviting the next assistant turn (completion-style SLMs). */
|
|
49
|
+
export declare const EDGE_PROMPT_ASSISTANT_CUE: string;
|
|
50
|
+
/**
|
|
51
|
+
* Conservative token estimate: ceil(UTF-16 length / 4). Used only for
|
|
52
|
+
* context-window gating — not billed usage.
|
|
53
|
+
*/
|
|
54
|
+
export declare function estimatePromptTokens(text: string): number;
|
|
55
|
+
export type ChatPromptAssemblyEvent = {
|
|
56
|
+
event: "edge_agent.chat_prompt_assembly";
|
|
57
|
+
subjectId: string;
|
|
58
|
+
deviceId?: string;
|
|
59
|
+
outcome: "ok" | "empty" | "overflow" | "invalid_role" | "subject_required";
|
|
60
|
+
messageCount: number;
|
|
61
|
+
systemCount: number;
|
|
62
|
+
toolCount: number;
|
|
63
|
+
estimatedTokens: number;
|
|
64
|
+
systemEstimatedTokens: number;
|
|
65
|
+
contextWindow: number;
|
|
66
|
+
};
|
|
67
|
+
export type AssembleChatMessagesOptions = {
|
|
68
|
+
/** From `SlmModelCard.contextWindow` — hard ceiling, no silent trim. */
|
|
69
|
+
contextWindow: number;
|
|
70
|
+
subjectId: string;
|
|
71
|
+
deviceId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* When true (default), append {@link EDGE_PROMPT_ASSISTANT_CUE} unless the
|
|
74
|
+
* last message is already an empty assistant placeholder.
|
|
75
|
+
*/
|
|
76
|
+
appendAssistantCue?: boolean;
|
|
77
|
+
emit?: (event: ChatPromptAssemblyEvent) => void;
|
|
78
|
+
};
|
|
79
|
+
export declare class ChatPromptAssemblyError extends Error {
|
|
80
|
+
readonly obligationId: string;
|
|
81
|
+
readonly failureClass: "validation" | "contract" | "cap";
|
|
82
|
+
readonly errorCode: string;
|
|
83
|
+
constructor(message: string, opts: {
|
|
84
|
+
obligationId: string;
|
|
85
|
+
failureClass?: "validation" | "contract" | "cap";
|
|
86
|
+
errorCode?: string;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Map ChatMessage[] → one SlmRuntime prompt string.
|
|
91
|
+
*
|
|
92
|
+
* Deterministic for identical inputs. Never truncates on overflow.
|
|
93
|
+
*/
|
|
94
|
+
export declare function assembleChatMessagesToPrompt(messages: readonly ChatMessage[], options: AssembleChatMessagesOptions): string;
|
|
95
|
+
export declare const EDGE_MODEL_OBLIGATION_DEADLINE = "EDGE.MODEL_DEADLINE";
|
|
96
|
+
/** Embed dimension changed after first measurement (CK-03.1). */
|
|
97
|
+
export declare const EDGE_MODEL_OBLIGATION_EMBED_DIM = "EDGE.MODEL_EMBED_DIM";
|
|
98
|
+
/** SlmRuntime card / load state invalid at adapter construction. */
|
|
99
|
+
export declare const EDGE_MODEL_OBLIGATION_INIT = "EDGE.MODEL_INIT";
|
|
100
|
+
export type SlmModelAdapterEvent = {
|
|
101
|
+
event: "edge_agent.slm_model_adapter";
|
|
102
|
+
subjectId: string;
|
|
103
|
+
deviceId?: string;
|
|
104
|
+
op: "generate" | "generateStream" | "embed" | "init";
|
|
105
|
+
outcome: "ok" | "deadline" | "error" | "empty" | "overflow" | "embed_dim" | "init_error" | "aborted";
|
|
106
|
+
locality: ModelDescriptor["locality"];
|
|
107
|
+
finishReason?: GenerateResult["finishReason"];
|
|
108
|
+
deltaCount?: number;
|
|
109
|
+
embedDim?: number;
|
|
110
|
+
};
|
|
111
|
+
export type SlmModelAdapterOptions = {
|
|
112
|
+
subjectId: string;
|
|
113
|
+
deviceId?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Declared locality for `ModelDescriptor`. Defaults to `on-device`
|
|
116
|
+
* (sovereign edge). Hosts wrapping a remote OpenAI-compatible endpoint
|
|
117
|
+
* MUST set `self-hosted` or `external-api` truthfully.
|
|
118
|
+
*/
|
|
119
|
+
locality?: ModelDescriptor["locality"];
|
|
120
|
+
/** When GenerateOptions.deadlineMs omitted. */
|
|
121
|
+
defaultDeadlineMs?: number;
|
|
122
|
+
/** Cooperative cancel; races with deadlineMs. */
|
|
123
|
+
signal?: AbortSignal;
|
|
124
|
+
emit?: (event: ChatPromptAssemblyEvent | SlmModelAdapterEvent) => void;
|
|
125
|
+
};
|
|
126
|
+
export declare class SlmModelAdapterError extends Error {
|
|
127
|
+
readonly obligationId: string;
|
|
128
|
+
readonly failureClass: "validation" | "contract" | "cap" | "downstream" | "config";
|
|
129
|
+
readonly errorCode: string;
|
|
130
|
+
constructor(message: string, opts: {
|
|
131
|
+
obligationId: string;
|
|
132
|
+
failureClass?: "validation" | "contract" | "cap" | "downstream" | "config";
|
|
133
|
+
errorCode?: string;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Convert runtime stream frames into CK-03.2 deltas.
|
|
138
|
+
* Cumulative prefixes → suffix-only; already-delta chunks passthrough.
|
|
139
|
+
*/
|
|
140
|
+
export declare function toStreamDeltas(frames: AsyncIterable<string>): AsyncGenerator<string, void, undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* Wrap an SlmRuntime as ModelInterface: assemble ChatMessage[] → prompt,
|
|
143
|
+
* honor deadlineMs / AbortSignal, stream CK-03.2 deltas, stable embed dim.
|
|
144
|
+
*/
|
|
145
|
+
export declare function createSlmModelAdapter(runtime: SlmRuntime, options: SlmModelAdapterOptions): ModelInterface;
|
|
146
|
+
export declare const EDGE_CONFORMANCE_EMBED_DIM = 8;
|
|
147
|
+
/**
|
|
148
|
+
* Deterministic assistant body derived from assembled prompt length — stream
|
|
149
|
+
* delta concatenation MUST equal this string (CK-03.2).
|
|
150
|
+
*/
|
|
151
|
+
export declare function conformanceSlmAssistantText(prompt: string): string;
|
|
152
|
+
export type OnDeviceConformanceSlmRuntimeOptions = {
|
|
153
|
+
card?: Partial<SlmModelCard>;
|
|
154
|
+
/**
|
|
155
|
+
* Violation fixture: issues third-party fetch during generate (locality liar).
|
|
156
|
+
* Honest on-device path MUST leave this false.
|
|
157
|
+
*/
|
|
158
|
+
egressDuringGenerate?: boolean;
|
|
159
|
+
/** Third-party URL used when {@link egressDuringGenerate} is true. */
|
|
160
|
+
egressUrl?: string;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Pure on-device SlmRuntime for CK-03 / locality proof — no network unless
|
|
164
|
+
* deliberately configured as a liar fixture.
|
|
165
|
+
*/
|
|
166
|
+
export declare function createOnDeviceConformanceSlmRuntime(options?: OnDeviceConformanceSlmRuntimeOptions): SlmRuntime;
|
|
167
|
+
/** CK-03 ModelConformanceHarness shape (network deny seam). */
|
|
168
|
+
export type SlmModelAdapterHarness = {
|
|
169
|
+
model: ModelInterface;
|
|
170
|
+
isNetworkAllowed(): boolean;
|
|
171
|
+
setNetworkAllowed(allowed: boolean): void;
|
|
172
|
+
};
|
|
173
|
+
export type CreateSlmModelAdapterHarnessOptions = {
|
|
174
|
+
deviceId?: string;
|
|
175
|
+
subjectId?: string;
|
|
176
|
+
locality?: ModelDescriptor["locality"];
|
|
177
|
+
createRuntime?: () => SlmRuntime;
|
|
178
|
+
emit?: SlmModelAdapterOptions["emit"];
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Factory for `runConformance({ registry: createModelObligationsRegistry() })`.
|
|
182
|
+
* Honors runner FactoryContext.subjectId when provided.
|
|
183
|
+
*/
|
|
184
|
+
export declare function createSlmModelAdapterHarnessFactory(options?: CreateSlmModelAdapterHarnessOptions): (ctx?: {
|
|
185
|
+
subjectId?: string;
|
|
186
|
+
}) => SlmModelAdapterHarness;
|
|
187
|
+
export declare const EDGE_MEMORY_OBLIGATION_SUBJECT = "EDGE.MEMORY_SUBJECT_REQUIRED";
|
|
188
|
+
/** Embedding dimension mismatch (store vs query / write). */
|
|
189
|
+
export declare const EDGE_MEMORY_OBLIGATION_EMBED_DIM = "EDGE.MEMORY_EMBED_DIM";
|
|
190
|
+
/** Bounded recall result set (NFR). */
|
|
191
|
+
export declare const EDGE_MEMORY_RECALL_LIMIT = 64;
|
|
192
|
+
/** Bounded scan overshoot when kind-filtering post-search. */
|
|
193
|
+
export declare const EDGE_MEMORY_SCAN_LIMIT = 256;
|
|
194
|
+
export type LocalVectorMemoryEvent = {
|
|
195
|
+
event: "edge_agent.local_vector_memory";
|
|
196
|
+
subjectId: string;
|
|
197
|
+
deviceId?: string;
|
|
198
|
+
op: "remember" | "recall" | "forget" | "associate" | "compact" | "init";
|
|
199
|
+
outcome: "ok" | "error" | "empty" | "embed_dim" | "subject_required";
|
|
200
|
+
itemCount?: number;
|
|
201
|
+
kind?: MemoryKind;
|
|
202
|
+
/** How many correction hits were returned (pin signal). */
|
|
203
|
+
correctionCount?: number;
|
|
204
|
+
/** How many episodic hits were returned after decay. */
|
|
205
|
+
episodicCount?: number;
|
|
206
|
+
};
|
|
207
|
+
export type LocalVectorMemoryAdapterOptions = {
|
|
208
|
+
deviceId?: string;
|
|
209
|
+
embed: (text: string) => Promise<Float32Array>;
|
|
210
|
+
/** Injected clock for LocalVectorDb episodic decay (CK-02.2). */
|
|
211
|
+
nowMs?: () => number;
|
|
212
|
+
episodicHalfLifeDays?: number;
|
|
213
|
+
emit?: (event: LocalVectorMemoryEvent) => void;
|
|
214
|
+
};
|
|
215
|
+
export declare class LocalVectorMemoryError extends Error {
|
|
216
|
+
readonly obligationId: string;
|
|
217
|
+
readonly failureClass: "validation" | "contract" | "config" | "downstream";
|
|
218
|
+
readonly errorCode: string;
|
|
219
|
+
constructor(message: string, opts: {
|
|
220
|
+
obligationId: string;
|
|
221
|
+
failureClass?: "validation" | "contract" | "config" | "downstream";
|
|
222
|
+
errorCode?: string;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Adapt LocalVectorDb to MemoryInterface.
|
|
227
|
+
* topicId ↔ conceptId; MemoryKind ↔ VectorMemoryKind (incl. semantic).
|
|
228
|
+
* remember embeds via injected embed() and awaits durable upsert before resolve.
|
|
229
|
+
*/
|
|
230
|
+
export declare function createLocalVectorMemoryAdapter(db: LocalVectorDb, options: LocalVectorMemoryAdapterOptions): MemoryInterface;
|
|
231
|
+
/** CK-02 MemoryConformanceHarness shape. */
|
|
232
|
+
export type LocalVectorMemoryHarness = {
|
|
233
|
+
memory: MemoryInterface;
|
|
234
|
+
reinstantiate(): Promise<MemoryInterface>;
|
|
235
|
+
nowMs(): number;
|
|
236
|
+
setNowMs(ms: number): void;
|
|
237
|
+
};
|
|
238
|
+
export type CreateLocalVectorMemoryHarnessOptions = {
|
|
239
|
+
deviceId?: string;
|
|
240
|
+
embedDim?: number;
|
|
241
|
+
episodicHalfLifeDays?: number;
|
|
242
|
+
emit?: LocalVectorMemoryAdapterOptions["emit"];
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Shared durable substrate + injectable clock for CK-02 probes.
|
|
246
|
+
* reinstantiate opens a fresh MemoryInterface over the same driver rows.
|
|
247
|
+
*/
|
|
248
|
+
export declare function createLocalVectorMemoryHarnessFactory(options?: CreateLocalVectorMemoryHarnessOptions): () => LocalVectorMemoryHarness;
|
|
249
|
+
export declare const EDGE_BINDINGS_OBLIGATION_SUBJECT = "EDGE.BINDINGS_SUBJECT_REQUIRED";
|
|
250
|
+
export type EdgeCognitiveBindingsEvent = {
|
|
251
|
+
event: "edge_agent.cognitive_bindings";
|
|
252
|
+
subjectId: string;
|
|
253
|
+
deviceId?: string;
|
|
254
|
+
outcome: "ok" | "error" | "subject_required";
|
|
255
|
+
domainId: string;
|
|
256
|
+
hasActiveConcept: boolean;
|
|
257
|
+
/** True when a SpeechInterface was injected into the binding set. */
|
|
258
|
+
hasSpeech?: boolean;
|
|
259
|
+
/** True when a VisionInterface was injected into the binding set. */
|
|
260
|
+
hasVision?: boolean;
|
|
261
|
+
servedLocally: true;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Map edge conceptId (task-graph / mastery key) → MemoryInterface.topicId.
|
|
265
|
+
* Empty / null → stable on-device default (never invent foreign ids).
|
|
266
|
+
*/
|
|
267
|
+
export declare function mapConceptIdToTopicId(conceptId: string | null | undefined): string;
|
|
268
|
+
/**
|
|
269
|
+
* Map CognitiveState.profile.track (task-graph vocabulary) → AgentProfile.domainId.
|
|
270
|
+
*/
|
|
271
|
+
export declare function mapTrackToDomainId(track: string | null | undefined): string;
|
|
272
|
+
/**
|
|
273
|
+
* Coerce host/test runtimes that still expose `descriptor` (pre-card) into a
|
|
274
|
+
* full {@link SlmRuntime} for {@link createSlmModelAdapter}. Never invents
|
|
275
|
+
* network paths — only fills card / stream / unload gaps locally.
|
|
276
|
+
*/
|
|
277
|
+
export declare function coerceSlmRuntimeForBindings(runtime: SlmRuntime): SlmRuntime;
|
|
278
|
+
export declare function createEdgeAgentProfile(input: {
|
|
279
|
+
track: string;
|
|
280
|
+
language: string;
|
|
281
|
+
charter?: string;
|
|
282
|
+
refusals?: string[];
|
|
283
|
+
}): AgentProfile;
|
|
284
|
+
export type CreateEdgeCognitiveBindingsOptions = {
|
|
285
|
+
subjectId: string;
|
|
286
|
+
deviceId: string;
|
|
287
|
+
runtime: SlmRuntime;
|
|
288
|
+
/** Initialized LocalVectorDb (shared with EdgeAgent.vectorDb). */
|
|
289
|
+
vectorDb: LocalVectorDb;
|
|
290
|
+
/** CognitiveState.profile.track → domainId. */
|
|
291
|
+
track: string;
|
|
292
|
+
language: string;
|
|
293
|
+
/** Active concept from router / friction → default topicId mapping. */
|
|
294
|
+
activeConceptId?: string | null;
|
|
295
|
+
locality?: ModelDescriptor["locality"];
|
|
296
|
+
charter?: string;
|
|
297
|
+
refusals?: string[];
|
|
298
|
+
reasoning?: ReasoningInterface;
|
|
299
|
+
planning?: PlanningInterface;
|
|
300
|
+
tools?: ToolInterface;
|
|
301
|
+
knowledge?: KnowledgeConnectorInterface;
|
|
302
|
+
/**
|
|
303
|
+
* Optional local STT/TTS (`SpeechInterface`). Injected into the edge
|
|
304
|
+
* CognitiveBindings set; text-only agents omit this.
|
|
305
|
+
*/
|
|
306
|
+
speech?: SpeechInterface;
|
|
307
|
+
/**
|
|
308
|
+
* Optional local VLM (`VisionInterface`). Injected into the edge
|
|
309
|
+
* CognitiveBindings set; text-only agents omit this.
|
|
310
|
+
*/
|
|
311
|
+
vision?: VisionInterface;
|
|
312
|
+
/**
|
|
313
|
+
* Default generate/stream deadline for the on-device model adapter (ms).
|
|
314
|
+
*/
|
|
315
|
+
defaultDeadlineMs?: number;
|
|
316
|
+
emit?: (event: EdgeCognitiveBindingsEvent | ChatPromptAssemblyEvent | SlmModelAdapterEvent | LocalVectorMemoryEvent) => void;
|
|
317
|
+
};
|
|
318
|
+
export type EdgeCognitiveBindingsBundle = {
|
|
319
|
+
bindings: CognitiveBindings;
|
|
320
|
+
profile: AgentProfile;
|
|
321
|
+
/** topicId derived from activeConceptId for remember/reflect paths. */
|
|
322
|
+
topicId: string;
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Assemble CognitiveBindings from edge config + Slm/LocalVector adapters.
|
|
326
|
+
* Does not call CognitiveCore.turn — wires the loop.
|
|
327
|
+
*/
|
|
328
|
+
export declare function createEdgeCognitiveBindings(options: CreateEdgeCognitiveBindingsOptions): EdgeCognitiveBindingsBundle;
|
|
329
|
+
//# sourceMappingURL=cognitive_bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cognitive_bindings.d.ts","sourceRoot":"","sources":["../src/cognitive_bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAA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