mem-os-python 1.6.27__py3-none-any.whl

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.
Files changed (253) hide show
  1. mem_os_python-1.6.27.dist-info/METADATA +1032 -0
  2. mem_os_python-1.6.27.dist-info/RECORD +253 -0
  3. mem_os_python-1.6.27.dist-info/WHEEL +4 -0
  4. mem_os_python-1.6.27.dist-info/entry_points.txt +2 -0
  5. mem_os_python-1.6.27.dist-info/licenses/LICENSE +21 -0
  6. memos/__init__.py +16 -0
  7. memos/_js/adapters/anthropic.d.ts +279 -0
  8. memos/_js/adapters/anthropic.d.ts.map +1 -0
  9. memos/_js/adapters/anthropic.js +348 -0
  10. memos/_js/adapters/anthropic.js.map +1 -0
  11. memos/_js/adapters/base.d.ts +10 -0
  12. memos/_js/adapters/base.d.ts.map +1 -0
  13. memos/_js/adapters/base.js +2 -0
  14. memos/_js/adapters/base.js.map +1 -0
  15. memos/_js/adapters/openai.d.ts +264 -0
  16. memos/_js/adapters/openai.d.ts.map +1 -0
  17. memos/_js/adapters/openai.js +342 -0
  18. memos/_js/adapters/openai.js.map +1 -0
  19. memos/_js/apps/explorer.d.ts +244 -0
  20. memos/_js/apps/explorer.d.ts.map +1 -0
  21. memos/_js/apps/explorer.js +738 -0
  22. memos/_js/apps/explorer.js.map +1 -0
  23. memos/_js/citations.d.ts +65 -0
  24. memos/_js/citations.d.ts.map +1 -0
  25. memos/_js/citations.js +143 -0
  26. memos/_js/citations.js.map +1 -0
  27. memos/_js/cli-browse.d.ts +3 -0
  28. memos/_js/cli-browse.d.ts.map +1 -0
  29. memos/_js/cli-browse.js +129 -0
  30. memos/_js/cli-browse.js.map +1 -0
  31. memos/_js/cli-completion.d.ts +31 -0
  32. memos/_js/cli-completion.d.ts.map +1 -0
  33. memos/_js/cli-completion.js +340 -0
  34. memos/_js/cli-completion.js.map +1 -0
  35. memos/_js/cli-help.d.ts +18 -0
  36. memos/_js/cli-help.d.ts.map +1 -0
  37. memos/_js/cli-help.js +357 -0
  38. memos/_js/cli-help.js.map +1 -0
  39. memos/_js/cli.d.ts +28 -0
  40. memos/_js/cli.d.ts.map +1 -0
  41. memos/_js/cli.js +2880 -0
  42. memos/_js/cli.js.map +1 -0
  43. memos/_js/compression.d.ts +25 -0
  44. memos/_js/compression.d.ts.map +1 -0
  45. memos/_js/compression.js +319 -0
  46. memos/_js/compression.js.map +1 -0
  47. memos/_js/confidence-machine.d.ts +99 -0
  48. memos/_js/confidence-machine.d.ts.map +1 -0
  49. memos/_js/confidence-machine.js +222 -0
  50. memos/_js/confidence-machine.js.map +1 -0
  51. memos/_js/context-pack.d.ts +506 -0
  52. memos/_js/context-pack.d.ts.map +1 -0
  53. memos/_js/context-pack.js +1435 -0
  54. memos/_js/context-pack.js.map +1 -0
  55. memos/_js/contradictions.d.ts +160 -0
  56. memos/_js/contradictions.d.ts.map +1 -0
  57. memos/_js/contradictions.js +255 -0
  58. memos/_js/contradictions.js.map +1 -0
  59. memos/_js/dashboard.d.ts +30 -0
  60. memos/_js/dashboard.d.ts.map +1 -0
  61. memos/_js/dashboard.js +302 -0
  62. memos/_js/dashboard.js.map +1 -0
  63. memos/_js/ebbinghaus.d.ts +29 -0
  64. memos/_js/ebbinghaus.d.ts.map +1 -0
  65. memos/_js/ebbinghaus.js +32 -0
  66. memos/_js/ebbinghaus.js.map +1 -0
  67. memos/_js/embedding-queue.d.ts +190 -0
  68. memos/_js/embedding-queue.d.ts.map +1 -0
  69. memos/_js/embedding-queue.js +316 -0
  70. memos/_js/embedding-queue.js.map +1 -0
  71. memos/_js/embeddings.d.ts +187 -0
  72. memos/_js/embeddings.d.ts.map +1 -0
  73. memos/_js/embeddings.js +633 -0
  74. memos/_js/embeddings.js.map +1 -0
  75. memos/_js/entity-extraction.d.ts +54 -0
  76. memos/_js/entity-extraction.d.ts.map +1 -0
  77. memos/_js/entity-extraction.js +325 -0
  78. memos/_js/entity-extraction.js.map +1 -0
  79. memos/_js/entity-index.d.ts +93 -0
  80. memos/_js/entity-index.d.ts.map +1 -0
  81. memos/_js/entity-index.js +165 -0
  82. memos/_js/entity-index.js.map +1 -0
  83. memos/_js/event-memory.d.ts +147 -0
  84. memos/_js/event-memory.d.ts.map +1 -0
  85. memos/_js/event-memory.js +290 -0
  86. memos/_js/event-memory.js.map +1 -0
  87. memos/_js/external-import.d.ts +98 -0
  88. memos/_js/external-import.d.ts.map +1 -0
  89. memos/_js/external-import.js +669 -0
  90. memos/_js/external-import.js.map +1 -0
  91. memos/_js/fidelity.d.ts +367 -0
  92. memos/_js/fidelity.d.ts.map +1 -0
  93. memos/_js/fidelity.js +911 -0
  94. memos/_js/fidelity.js.map +1 -0
  95. memos/_js/graph-expansion.d.ts +119 -0
  96. memos/_js/graph-expansion.d.ts.map +1 -0
  97. memos/_js/graph-expansion.js +213 -0
  98. memos/_js/graph-expansion.js.map +1 -0
  99. memos/_js/graph-mermaid.d.ts +13 -0
  100. memos/_js/graph-mermaid.d.ts.map +1 -0
  101. memos/_js/graph-mermaid.js +32 -0
  102. memos/_js/graph-mermaid.js.map +1 -0
  103. memos/_js/graph.d.ts +170 -0
  104. memos/_js/graph.d.ts.map +1 -0
  105. memos/_js/graph.js +482 -0
  106. memos/_js/graph.js.map +1 -0
  107. memos/_js/harness.d.ts +63 -0
  108. memos/_js/harness.d.ts.map +1 -0
  109. memos/_js/harness.js +93 -0
  110. memos/_js/harness.js.map +1 -0
  111. memos/_js/importance.d.ts +118 -0
  112. memos/_js/importance.d.ts.map +1 -0
  113. memos/_js/importance.js +144 -0
  114. memos/_js/importance.js.map +1 -0
  115. memos/_js/index.d.ts +51 -0
  116. memos/_js/index.d.ts.map +1 -0
  117. memos/_js/index.js +53 -0
  118. memos/_js/index.js.map +1 -0
  119. memos/_js/mcp.d.ts +58 -0
  120. memos/_js/mcp.d.ts.map +1 -0
  121. memos/_js/mcp.js +1853 -0
  122. memos/_js/mcp.js.map +1 -0
  123. memos/_js/memory.d.ts +1762 -0
  124. memos/_js/memory.d.ts.map +1 -0
  125. memos/_js/memory.js +6283 -0
  126. memos/_js/memory.js.map +1 -0
  127. memos/_js/procedural.d.ts +74 -0
  128. memos/_js/procedural.d.ts.map +1 -0
  129. memos/_js/procedural.js +125 -0
  130. memos/_js/procedural.js.map +1 -0
  131. memos/_js/project-config.d.ts +68 -0
  132. memos/_js/project-config.d.ts.map +1 -0
  133. memos/_js/project-config.js +59 -0
  134. memos/_js/project-config.js.map +1 -0
  135. memos/_js/proof-of-forgetting.d.ts +57 -0
  136. memos/_js/proof-of-forgetting.d.ts.map +1 -0
  137. memos/_js/proof-of-forgetting.js +80 -0
  138. memos/_js/proof-of-forgetting.js.map +1 -0
  139. memos/_js/provenance.d.ts +122 -0
  140. memos/_js/provenance.d.ts.map +1 -0
  141. memos/_js/provenance.js +182 -0
  142. memos/_js/provenance.js.map +1 -0
  143. memos/_js/quarantine-commands.d.ts +23 -0
  144. memos/_js/quarantine-commands.d.ts.map +1 -0
  145. memos/_js/quarantine-commands.js +42 -0
  146. memos/_js/quarantine-commands.js.map +1 -0
  147. memos/_js/quarantine.d.ts +120 -0
  148. memos/_js/quarantine.d.ts.map +1 -0
  149. memos/_js/quarantine.js +873 -0
  150. memos/_js/quarantine.js.map +1 -0
  151. memos/_js/redact.d.ts +12 -0
  152. memos/_js/redact.d.ts.map +1 -0
  153. memos/_js/redact.js +26 -0
  154. memos/_js/redact.js.map +1 -0
  155. memos/_js/repl.d.ts +57 -0
  156. memos/_js/repl.d.ts.map +1 -0
  157. memos/_js/repl.js +295 -0
  158. memos/_js/repl.js.map +1 -0
  159. memos/_js/rerank-local.d.ts +61 -0
  160. memos/_js/rerank-local.d.ts.map +1 -0
  161. memos/_js/rerank-local.js +210 -0
  162. memos/_js/rerank-local.js.map +1 -0
  163. memos/_js/retain-filter.d.ts +98 -0
  164. memos/_js/retain-filter.d.ts.map +1 -0
  165. memos/_js/retain-filter.js +232 -0
  166. memos/_js/retain-filter.js.map +1 -0
  167. memos/_js/retrieval.d.ts +265 -0
  168. memos/_js/retrieval.d.ts.map +1 -0
  169. memos/_js/retrieval.js +1018 -0
  170. memos/_js/retrieval.js.map +1 -0
  171. memos/_js/revert.d.ts +77 -0
  172. memos/_js/revert.d.ts.map +1 -0
  173. memos/_js/revert.js +252 -0
  174. memos/_js/revert.js.map +1 -0
  175. memos/_js/scope.d.ts +30 -0
  176. memos/_js/scope.d.ts.map +1 -0
  177. memos/_js/scope.js +71 -0
  178. memos/_js/scope.js.map +1 -0
  179. memos/_js/semantic-screen.d.ts +152 -0
  180. memos/_js/semantic-screen.d.ts.map +1 -0
  181. memos/_js/semantic-screen.js +290 -0
  182. memos/_js/semantic-screen.js.map +1 -0
  183. memos/_js/session-hooks.d.ts +127 -0
  184. memos/_js/session-hooks.d.ts.map +1 -0
  185. memos/_js/session-hooks.js +482 -0
  186. memos/_js/session-hooks.js.map +1 -0
  187. memos/_js/storage/sqlite.d.ts +427 -0
  188. memos/_js/storage/sqlite.d.ts.map +1 -0
  189. memos/_js/storage/sqlite.js +2428 -0
  190. memos/_js/storage/sqlite.js.map +1 -0
  191. memos/_js/sync.d.ts +213 -0
  192. memos/_js/sync.d.ts.map +1 -0
  193. memos/_js/sync.js +389 -0
  194. memos/_js/sync.js.map +1 -0
  195. memos/_js/tamper-log.d.ts +98 -0
  196. memos/_js/tamper-log.d.ts.map +1 -0
  197. memos/_js/tamper-log.js +327 -0
  198. memos/_js/tamper-log.js.map +1 -0
  199. memos/_js/temporal.d.ts +92 -0
  200. memos/_js/temporal.d.ts.map +1 -0
  201. memos/_js/temporal.js +536 -0
  202. memos/_js/temporal.js.map +1 -0
  203. memos/_js/time-travel.d.ts +38 -0
  204. memos/_js/time-travel.d.ts.map +1 -0
  205. memos/_js/time-travel.js +46 -0
  206. memos/_js/time-travel.js.map +1 -0
  207. memos/_js/timestamp-format.d.ts +18 -0
  208. memos/_js/timestamp-format.d.ts.map +1 -0
  209. memos/_js/timestamp-format.js +52 -0
  210. memos/_js/timestamp-format.js.map +1 -0
  211. memos/_js/triple-extraction.d.ts +31 -0
  212. memos/_js/triple-extraction.d.ts.map +1 -0
  213. memos/_js/triple-extraction.js +116 -0
  214. memos/_js/triple-extraction.js.map +1 -0
  215. memos/_js/types.d.ts +2474 -0
  216. memos/_js/types.d.ts.map +1 -0
  217. memos/_js/types.js +20 -0
  218. memos/_js/types.js.map +1 -0
  219. memos/_js/updater.d.ts +95 -0
  220. memos/_js/updater.d.ts.map +1 -0
  221. memos/_js/updater.js +268 -0
  222. memos/_js/updater.js.map +1 -0
  223. memos/_js/version.d.ts +17 -0
  224. memos/_js/version.d.ts.map +1 -0
  225. memos/_js/version.js +34 -0
  226. memos/_js/version.js.map +1 -0
  227. memos/_js/vision/clip-query-cache.d.ts +58 -0
  228. memos/_js/vision/clip-query-cache.d.ts.map +1 -0
  229. memos/_js/vision/clip-query-cache.js +79 -0
  230. memos/_js/vision/clip-query-cache.js.map +1 -0
  231. memos/_js/vision/clip.d.ts +113 -0
  232. memos/_js/vision/clip.d.ts.map +1 -0
  233. memos/_js/vision/clip.js +224 -0
  234. memos/_js/vision/clip.js.map +1 -0
  235. memos/_js/vision/fake-clip.d.ts +55 -0
  236. memos/_js/vision/fake-clip.d.ts.map +1 -0
  237. memos/_js/vision/fake-clip.js +122 -0
  238. memos/_js/vision/fake-clip.js.map +1 -0
  239. memos/_js/vision/index.d.ts +15 -0
  240. memos/_js/vision/index.d.ts.map +1 -0
  241. memos/_js/vision/index.js +13 -0
  242. memos/_js/vision/index.js.map +1 -0
  243. memos/_js/vision/store.d.ts +137 -0
  244. memos/_js/vision/store.d.ts.map +1 -0
  245. memos/_js/vision/store.js +383 -0
  246. memos/_js/vision/store.js.map +1 -0
  247. memos/adapters/__init__.py +0 -0
  248. memos/adapters/crewai.py +385 -0
  249. memos/adapters/langchain.py +301 -0
  250. memos/adapters/ollama.py +396 -0
  251. memos/server/__init__.py +0 -0
  252. memos/server/main.py +547 -0
  253. memos/server/routes.py +360 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Testable CLI command logic for the quarantine review queue.
3
+ *
4
+ * The CLI dispatches `memos quarantine list|release` through these
5
+ * helpers so the output format is asserted in unit tests rather than
6
+ * through awkward subprocess runs.
7
+ */
8
+ /**
9
+ * Render the quarantine review queue. JSON mode emits the raw nodes;
10
+ * human mode prints one line per memory: `[mem:hex]`-style short id,
11
+ * quarantine reason, and the first ~120 chars of content.
12
+ */
13
+ export function formatQuarantineList(nodes, json) {
14
+ if (json) {
15
+ return JSON.stringify(nodes, null, 2);
16
+ }
17
+ if (nodes.length === 0) {
18
+ return "Quarantine queue is empty.";
19
+ }
20
+ return nodes
21
+ .map((n) => {
22
+ const preview = n.content.length > 120 ? `${n.content.slice(0, 117)}...` : n.content;
23
+ const reason = n.quarantineReason ?? "unspecified";
24
+ return `[${n.id.slice(0, 8)}] (${n.provenance}) reason=${reason}: ${preview}`;
25
+ })
26
+ .join("\n");
27
+ }
28
+ /**
29
+ * Release a memory from quarantine and render the result. JSON mode
30
+ * emits the updated node; human mode confirms the release while
31
+ * reminding the operator that the memory keeps its low-trust marking
32
+ * for agent consumption.
33
+ */
34
+ export async function releaseQuarantined(memos, id, json) {
35
+ const node = await memos.releaseFromQuarantine(id);
36
+ if (json) {
37
+ return JSON.stringify(node, null, 2);
38
+ }
39
+ return (`Released ${id.slice(0, 8)} from quarantine.` +
40
+ " It is recallable again; agent tools still see it as untrusted until a reviewer promotes its provenance tier.");
41
+ }
42
+ //# sourceMappingURL=quarantine-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quarantine-commands.js","sourceRoot":"","sources":["../src/quarantine-commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAmB,EACnB,IAAa;IAEb,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,MAAM,OAAO,GACX,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACvE,MAAM,MAAM,GAAG,CAAC,CAAC,gBAAgB,IAAI,aAAa,CAAC;QACnD,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,YAAY,MAAM,KAAK,OAAO,EAAE,CAAC;IAChF,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAY,EACZ,EAAU,EACV,IAAa;IAEb,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACnD,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,CACL,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB;QAC7C,+GAA+G,CAChH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Write-gate quarantine — a local-heuristic classifier for
3
+ * instruction-like payloads in memory writes and imports.
4
+ *
5
+ * Runs synchronously on the `store()` hot path (pure regex scoring,
6
+ * microseconds per write — no LLM, no network). Content that scores at
7
+ * or above {@link QUARANTINE_FLAG_THRESHOLD} is still stored (add-only
8
+ * is preserved) but marked `quarantined: true`, which excludes it from
9
+ * recall by default until a human reviews it via
10
+ * `memos quarantine list|release`.
11
+ *
12
+ * The classifier first normalizes its input
13
+ * ({@link normalizeForScreening}): NFKC unicode folding, zero-width
14
+ * character stripping, Cyrillic/Greek homoglyph folding, single-newline
15
+ * collapsing, spaced-letter joining (`i g n o r e` → `ignore`), and
16
+ * whitespace collapsing. Injection clichés are additionally matched
17
+ * against a leetspeak-unfolded copy (`1gn0re` → `ignore`).
18
+ *
19
+ * Signal classes (each reports a stable machine-readable `code`):
20
+ *
21
+ * 1. Injection clichés — verbatim prompt-injection openers ("ignore
22
+ * previous instructions", "disregard your prior instructions",
23
+ * "do not tell the user", "pretend you are …", DAN/jailbreak
24
+ * patterns, chat-template role markers). Full-strength (2.0:
25
+ * quarantines on its own). Deliberately anchored to
26
+ * `previous`/`prior` so ordinary "ignore the old template" phrasing
27
+ * does NOT match.
28
+ * 2. Imperative exfiltration — an exfil verb (send, email, upload, dump,
29
+ * …) governing a credential noun (passwords, api keys, secrets, …).
30
+ * 1.5 alone; 2.0 when a URL/email destination appears anywhere in
31
+ * the write, or when verb+destination share a sentence and a
32
+ * credential noun appears anywhere. First-person possessives ("my
33
+ * password", "our api key") are exempt — "reset my password" is not
34
+ * an attack. On low-trust tiers (`tool-output`, `imported`) the
35
+ * bare verb+credential shape is 2.0 on its own — tool output that
36
+ * moves credentials is never benign.
37
+ * 3. Exfiltration-shaped — secret material (an `sk-…`/`AKIA…`/`ghp_…`
38
+ * token, a `-----BEGIN … PRIVATE KEY-----` block, or an
39
+ * `api key: <value>` assignment) next to a URL or an exfiltration
40
+ * verb. 2.0.
41
+ * 4. Encoded payloads — base64 blobs are decoded (whitespace-tolerant,
42
+ * depth-bounded) and the decoded text is re-screened: a blob that
43
+ * decodes to an injection scores 2.0 (`injection:encoded-
44
+ * instructions`); an opaque blob is 1.0 on its own (1.5 on
45
+ * low-trust tiers). A candidate only counts as a blob when it looks
46
+ * like real base64 (a digit, `+`/`/`, or `=` padding) — English prose
47
+ * that merely uses base64-alphabet words is not a blob.
48
+ * 5. Low-trust-tier dormant instructions (Trojan-Hippo shape) —
49
+ * conditional future-directed instructions ("when the user asks
50
+ * about X, always say Y", "from now on, include …", "never mention
51
+ * …") are 2.0, but ONLY for `tool-output`/`imported` tiers. Tool
52
+ * output is data, never behavioral instructions; the same phrasing
53
+ * in a user's own memory ("when I travel, always pack my charger")
54
+ * is silent.
55
+ * 6. Low-trust-tier trigger phrases (AgentPoison shape) — nonce-like
56
+ * tokens or trigger words ("code word", "activation token")
57
+ * co-occurring with instruction-shaped content. 2.0, low-trust
58
+ * tiers only.
59
+ *
60
+ * False-positive tuning: the negative corpus in
61
+ * `__tests__/fixtures/redteam-battery.ts` (60 ordinary memories —
62
+ * wifi passwords on the fridge, "send mom the photos", meeting notes
63
+ * with URLs, developer-mode phone settings, surprise parties) must
64
+ * score below threshold, including adversarial-benign cases such as
65
+ * security notes quoting attack clichés. Quoted clichés under
66
+ * meta-discussion framing ("how do I defend against 'ignore previous
67
+ * instructions'?", "the article explains DAN mode") halves every signal
68
+ * and caps total injection:* contribution at 1.0 — discussing an attack
69
+ * is not an attack. A single unquoted injection signal wearing a
70
+ * discussion-like prefix ("Security update: ignore previous
71
+ * instructions") still evades; that residual gap is documented in
72
+ * docs/provenance-trust.md.
73
+ *
74
+ * @module @mem-os/quarantine
75
+ */
76
+ import type { ProvenanceTier } from "./types.js";
77
+ /**
78
+ * Normalize write content before screening: NFKC folding, zero-width
79
+ * stripping, homoglyph folding, single-newline joining (paragraph
80
+ * breaks still split sentences), spaced-letter joining, and whitespace
81
+ * collapsing. Exported for testing.
82
+ */
83
+ export declare function normalizeForScreening(content: string): string;
84
+ /** Quarantine at or above this score. Tuned against the negative corpus. */
85
+ export declare const QUARANTINE_FLAG_THRESHOLD = 2;
86
+ export interface QuarantineSignal {
87
+ /** Stable machine-readable code, e.g. `injection:ignore-previous-instructions`. */
88
+ code: string;
89
+ /** Human-readable explanation. */
90
+ detail: string;
91
+ /** Points contributed toward {@link QUARANTINE_FLAG_THRESHOLD}. */
92
+ points: number;
93
+ }
94
+ export interface QuarantineVerdict {
95
+ flagged: boolean;
96
+ score: number;
97
+ signals: QuarantineSignal[];
98
+ /** `;`-joined signal codes — stored in `quarantine_reason`. */
99
+ reason: string;
100
+ }
101
+ export interface ScreenWriteOptions {
102
+ /**
103
+ * Provenance tier of the write. Low-trust tiers (`tool-output`,
104
+ * `imported`) get stricter screening: dormant-instruction and
105
+ * trigger-phrase signals activate, and bare verb+credential
106
+ * exfiltration quarantines on its own. Defaults to user-like
107
+ * (lenient) when omitted.
108
+ */
109
+ tier?: ProvenanceTier;
110
+ }
111
+ /**
112
+ * Screen one write for instruction-like payloads. Pure, synchronous,
113
+ * allocation-light — safe on the store() hot path.
114
+ *
115
+ * Pass `opts.tier` for tier-aware strictness: `tool-output` /
116
+ * `imported` writes additionally screen for dormant instructions and
117
+ * trigger phrases, and bare verb+credential exfiltration quarantines.
118
+ */
119
+ export declare function screenWrite(content: string, opts?: ScreenWriteOptions): QuarantineVerdict;
120
+ //# sourceMappingURL=quarantine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quarantine.d.ts","sourceRoot":"","sources":["../src/quarantine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA8EjD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAa7D;AA2XD,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAoC3C,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AA8aD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,kBAAuB,GAC5B,iBAAiB,CA2CnB"}