@arnilo/prism 0.0.13 → 0.0.14
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/CHANGELOG.md +12 -0
- package/README.md +8 -2
- package/dist/artifacts.d.ts +78 -0
- package/dist/artifacts.js +24 -0
- package/dist/contracts.d.ts +10 -0
- package/dist/contracts.js +8 -0
- package/dist/conversations.d.ts +50 -0
- package/dist/conversations.js +97 -0
- package/dist/credentials.d.ts +14 -0
- package/dist/credentials.js +9 -0
- package/dist/devices.d.ts +94 -0
- package/dist/devices.js +138 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +6 -3
- package/dist/providers/openai-primitives.js +5 -2
- package/docs/ag-ui.md +5 -0
- package/docs/browser-automation.md +3 -0
- package/docs/conversations.md +135 -0
- package/docs/credential-storage.md +28 -1
- package/docs/credentials-and-redaction.md +2 -0
- package/docs/database-persistence.md +5 -1
- package/docs/device-adapters.md +97 -0
- package/docs/host-security.md +4 -2
- package/docs/index.md +16 -12
- package/docs/migration.md +21 -0
- package/docs/performance.md +2 -0
- package/docs/policy-and-audit.md +1 -0
- package/docs/provider-caching.md +4 -0
- package/docs/provider-packages.md +4 -1
- package/docs/providers/alibaba.md +179 -0
- package/docs/providers/ollama.md +166 -0
- package/docs/release-and-install.md +75 -5
- package/docs/review-coverage-2026-07-25-phase-9.md +256 -0
- package/docs/server.md +4 -0
- package/docs/work-artifacts-and-review.md +100 -0
- package/docs/work-connectors.md +5 -1
- package/docs/work-tools.md +3 -0
- package/docs/workflows.md +4 -0
- package/docs/working-and-semantic-memory.md +20 -5
- package/package.json +1 -1
- package/templates/init/providers.json +22 -0
|
@@ -25,17 +25,27 @@ Ordinary Prism sessions do not require this package or any vector backend.
|
|
|
25
25
|
| `workingMemoryTemplate` | no | `{{path}}` template for context injection |
|
|
26
26
|
| `limits` | no | top-K, adjacent range, batch, payload, injected-token caps |
|
|
27
27
|
| `redactor` / `secrets` | no | Redact text/metadata before persist/inject |
|
|
28
|
+
| `requireConsent` | no | Strict mode: recall/injection excludes entries lacking explicit consent |
|
|
28
29
|
|
|
29
|
-
Semantic indexing:
|
|
30
|
+
Semantic indexing (entries carry consent/source/visibility; unset defaults to `{ source: "user", scope: "thread", visible: true }`):
|
|
30
31
|
|
|
31
32
|
```ts
|
|
32
|
-
await memory.remember({ entries: [{ id, text, metadata?, sequence? }] }, { wait?: boolean })
|
|
33
|
+
await memory.remember({ entries: [{ id, text, metadata?, consent?, sequence? }] }, { wait?: boolean })
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
Semantic recall:
|
|
36
|
+
Semantic recall (honors consent/visibility at assembly time):
|
|
36
37
|
|
|
37
38
|
```ts
|
|
38
|
-
await memory.recall(query, { topK?, messageRange?, signal? })
|
|
39
|
+
await memory.recall(query, { topK?, messageRange?, requireConsent?, signal? })
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Consent + lifecycle (real grant/correct/delete/retention on stored entries):
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
await memory.setConsent(entryId, { visible?: boolean, source?, scope? }) // grant/revoke; no re-embed
|
|
46
|
+
await memory.correct(entryId, text) // re-embeds, preserves consent
|
|
47
|
+
await memory.forget({ ids? }) // real delete (whole thread if no ids)
|
|
48
|
+
await memory.applyRetention({ maxAgeDays?, maxEntries?, batchSize? }) // bounded real-delete sweep
|
|
39
49
|
```
|
|
40
50
|
|
|
41
51
|
## Outputs / response / events
|
|
@@ -44,7 +54,10 @@ await memory.recall(query, { topK?, messageRange?, signal? })
|
|
|
44
54
|
| --- | --- |
|
|
45
55
|
| `updateWorking` / `getWorking` | Versioned `WorkingMemoryRecord` |
|
|
46
56
|
| `remember` | `{ accepted, pending, done }` — default `wait: false` indexes asynchronously |
|
|
47
|
-
| `recall` | `{ hits, adjacent }` tenant/thread scoped |
|
|
57
|
+
| `recall` | `{ hits, adjacent }` tenant/thread scoped; invisible/revoked entries excluded |
|
|
58
|
+
| `setConsent` / `correct` | Updated `MemoryVectorRecord` with stamped grant/revoke times |
|
|
59
|
+
| `forget` | Removed count (real delete) |
|
|
60
|
+
| `applyRetention` | `{ deleted, scanned }` bounded real-delete sweep |
|
|
48
61
|
| `createContextProvider()` | Inert `ContextProvider` blocks for working and/or semantic text |
|
|
49
62
|
| `createWorkingMemoryProcessor({ extract })` | Explicit host-invoked updater; never auto-runs |
|
|
50
63
|
|
|
@@ -131,6 +144,7 @@ const memory = createMemory({
|
|
|
131
144
|
- The working-memory processor is opt-in and host-invoked; middleware is not required.
|
|
132
145
|
- `createHashEmbedder()` is for tests/demos only; production hosts supply a real `Embedder`.
|
|
133
146
|
- Observational memory (`@arnilo/prism-compaction-observational-memory`) remains unchanged and composable.
|
|
147
|
+
- Consent is enforced at the single `recall()` gate, so both direct recall and `createContextProvider()` injection honor it; `visible: false` (or a revoked grant) keeps an entry out of prompts, events, exports, and telemetry. `setConsent`/`correct` re-upsert in place (consent change does not re-embed); `forget`/`applyRetention` are real deletes, not tombstones. Retention sweeps scan one thread and delete in bounded batches (default 500 / hard 5000) — no full-corpus scan per run. The PostgreSQL adapter persists consent in a `consent JSONB` column added by `buildMemoryDdl`.
|
|
134
148
|
- Profile bundles do not include this package yet.
|
|
135
149
|
|
|
136
150
|
Shared conformance:
|
|
@@ -149,6 +163,7 @@ await runMemoryConformance(() => ({
|
|
|
149
163
|
|
|
150
164
|
- Every write/query/delete requires `tenantId` + `resourceId`; semantic paths also require `threadId`.
|
|
151
165
|
- Cross-tenant and cross-thread access is denied.
|
|
166
|
+
- Revoked/invisible/non-consented memories never enter prompts, events, exports, or telemetry; `requireConsent: true` additionally drops consent-less (legacy) entries. Consent checks are O(hits) at recall, within the existing injected-token cap.
|
|
152
167
|
- Configure `secrets` / `redactor` so memory text and metadata cannot persist or inject raw canaries.
|
|
153
168
|
- Injected context is inert text — it cannot grant tools or permissions.
|
|
154
169
|
- Hard caps: top-K ≤ 32, messageRange ≤ 4, embed batch ≤ 128, injected tokens ≤ 8000, payload/working-memory byte limits enforced.
|
package/package.json
CHANGED
|
@@ -72,5 +72,27 @@
|
|
|
72
72
|
"imports": "import { createAgent } from \"@arnilo/prism\";\nimport {\n createNeuralWattProvider,\n defineNeuralWattModel,\n} from \"@arnilo/prism-provider-neuralwatt\";",
|
|
73
73
|
"providerExpression": "createNeuralWattProvider({\n apiKey: () => process.env.NEURALWATT_API_KEY,\n })",
|
|
74
74
|
"modelExpression": "defineNeuralWattModel({\n model: \"glm-5.2\",\n cache: { kind: \"implicit\" },\n })"
|
|
75
|
+
},
|
|
76
|
+
"alibaba": {
|
|
77
|
+
"id": "alibaba",
|
|
78
|
+
"packageName": "@arnilo/prism-provider-alibaba",
|
|
79
|
+
"envKey": "DASHSCOPE_API_KEY",
|
|
80
|
+
"envPlaceholder": "sk-...",
|
|
81
|
+
"modelProvider": "alibaba",
|
|
82
|
+
"modelName": "qwen-plus",
|
|
83
|
+
"imports": "import { createAgent } from \"@arnilo/prism\";\nimport {\n createAlibabaProvider,\n defineAlibabaModel,\n} from \"@arnilo/prism-provider-alibaba\";",
|
|
84
|
+
"providerExpression": "createAlibabaProvider({\n apiKey: () => process.env.DASHSCOPE_API_KEY,\n })",
|
|
85
|
+
"modelExpression": "defineAlibabaModel({ model: \"qwen-plus\" })"
|
|
86
|
+
},
|
|
87
|
+
"ollama": {
|
|
88
|
+
"id": "ollama",
|
|
89
|
+
"packageName": "@arnilo/prism-provider-ollama",
|
|
90
|
+
"envKey": "OLLAMA_API_KEY",
|
|
91
|
+
"envPlaceholder": "your-ollama-api-key",
|
|
92
|
+
"modelProvider": "ollama",
|
|
93
|
+
"modelName": "gpt-oss:20b",
|
|
94
|
+
"imports": "import { createAgent } from \"@arnilo/prism\";\nimport {\n createOllamaProvider,\n defineOllamaModel,\n} from \"@arnilo/prism-provider-ollama\";",
|
|
95
|
+
"providerExpression": "createOllamaProvider({\n apiKey: () => process.env.OLLAMA_API_KEY,\n })",
|
|
96
|
+
"modelExpression": "defineOllamaModel({ model: \"gpt-oss:20b\" })"
|
|
75
97
|
}
|
|
76
98
|
}
|