@jmtrin/opencode-kevin 0.9.0 → 1.1.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 +21 -0
- package/README.md +575 -823
- package/dist/migrations/001_initial.sql +91 -91
- package/dist/migrations/002_indexes.sql +13 -13
- package/dist/migrations/003_v02_signal.sql +57 -57
- package/dist/migrations/004_v03_knowledge.sql +138 -138
- package/dist/migrations/005_v04_signal.sql +57 -57
- package/dist/migrations/006_v05_glassbox.sql +118 -118
- package/dist/migrations/007_v06_pull.sql +144 -144
- package/dist/migrations/011_v10_proven.sql +69 -0
- package/dist/migrations/012_v11_drift.sql +24 -0
- package/dist/plugin/Archiver.js +2 -18
- package/dist/plugin/ArtifactWriter.d.ts +25 -10
- package/dist/plugin/ArtifactWriter.js +43 -25
- package/dist/plugin/CausalChain.js +32 -14
- package/dist/plugin/ConflictDetector.js +7 -30
- package/dist/plugin/ContextInjector.js +0 -1
- package/dist/plugin/ConventionMiner.js +0 -1
- package/dist/plugin/Curator.js +0 -1
- package/dist/plugin/Feedback.js +2 -20
- package/dist/plugin/HookLiveness.d.ts +7 -0
- package/dist/plugin/HookLiveness.js +26 -28
- package/dist/plugin/InjectionLedger.js +104 -58
- package/dist/plugin/LessonFixer.js +0 -1
- package/dist/plugin/Materializer.js +1 -89
- package/dist/plugin/MemoryService.d.ts +59 -1
- package/dist/plugin/MemoryService.js +13 -107
- package/dist/plugin/Migrate.d.ts +1 -1
- package/dist/plugin/Migrate.js +30 -3
- package/dist/plugin/PatternMiner.js +0 -1
- package/dist/plugin/QualityGate.js +0 -1
- package/dist/plugin/Reflector.js +0 -1
- package/dist/plugin/RepoIdentity.js +0 -1
- package/dist/plugin/RepoTruth.js +0 -1
- package/dist/plugin/Retrospective.js +11 -1
- package/dist/plugin/SharedLayer.js +0 -1
- package/dist/plugin/Store.js +0 -1
- package/dist/plugin/ToolCallObserver.js +18 -6
- package/dist/plugin/capabilities.js +0 -1
- package/dist/plugin/columns.d.ts +11 -0
- package/dist/plugin/columns.js +54 -0
- package/dist/plugin/confidence.js +0 -1
- package/dist/plugin/contract.d.ts +54 -0
- package/dist/plugin/contract.js +383 -0
- package/dist/plugin/diff.js +0 -1
- package/dist/plugin/escape.d.ts +39 -0
- package/dist/plugin/escape.js +60 -0
- package/dist/plugin/fingerprint.js +0 -1
- package/dist/plugin/host.js +0 -1
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/index.js +448 -229
- package/dist/plugin/inferability.js +0 -1
- package/dist/plugin/kevin_approve.js +0 -1
- package/dist/plugin/kevin_audit.d.ts +31 -0
- package/dist/plugin/kevin_audit.js +60 -1
- package/dist/plugin/kevin_bench.d.ts +10 -0
- package/dist/plugin/kevin_bench.js +82 -0
- package/dist/plugin/kevin_conflicts.js +0 -1
- package/dist/plugin/kevin_contract.d.ts +8 -0
- package/dist/plugin/kevin_contract.js +59 -0
- package/dist/plugin/kevin_doctor.d.ts +5 -0
- package/dist/plugin/kevin_doctor.js +30 -2
- package/dist/plugin/kevin_facts.js +0 -1
- package/dist/plugin/kevin_forget.d.ts +33 -0
- package/dist/plugin/kevin_forget.js +260 -0
- package/dist/plugin/kevin_native.js +0 -1
- package/dist/plugin/kevin_propose.js +0 -1
- package/dist/plugin/kevin_publish.js +0 -1
- package/dist/plugin/kevin_why.js +1 -19
- package/dist/plugin/memory-format.js +0 -1
- package/dist/plugin/metrics.d.ts +1 -1
- package/dist/plugin/metrics.js +4 -1
- package/dist/plugin/native.js +0 -1
- package/dist/plugin/okf-export.js +0 -1
- package/dist/plugin/okf-import.js +0 -1
- package/dist/plugin/okf.js +0 -1
- package/dist/plugin/perf.d.ts +35 -0
- package/dist/plugin/perf.js +174 -0
- package/dist/plugin/query-tokenizer.js +56 -9
- package/dist/plugin/redact.js +0 -1
- package/dist/plugin/replay-types.js +0 -1
- package/dist/plugin/replay.js +0 -1
- package/dist/plugin/sqlite-adapter.js +0 -1
- package/dist/plugin/time-ms.d.ts +1 -0
- package/dist/plugin/time-ms.js +16 -0
- package/dist/plugin/uuid.js +0 -1
- package/package.json +22 -6
- package/dist/plugin/Archiver.js.map +0 -1
- package/dist/plugin/ArtifactWriter.js.map +0 -1
- package/dist/plugin/CausalChain.js.map +0 -1
- package/dist/plugin/ConflictDetector.js.map +0 -1
- package/dist/plugin/ContextInjector.js.map +0 -1
- package/dist/plugin/ConventionMiner.js.map +0 -1
- package/dist/plugin/Curator.js.map +0 -1
- package/dist/plugin/Feedback.js.map +0 -1
- package/dist/plugin/HookLiveness.js.map +0 -1
- package/dist/plugin/InjectionLedger.js.map +0 -1
- package/dist/plugin/LessonFixer.js.map +0 -1
- package/dist/plugin/Materializer.js.map +0 -1
- package/dist/plugin/MemoryService.js.map +0 -1
- package/dist/plugin/Migrate.js.map +0 -1
- package/dist/plugin/PatternMiner.js.map +0 -1
- package/dist/plugin/QualityGate.js.map +0 -1
- package/dist/plugin/Reflector.js.map +0 -1
- package/dist/plugin/RepoIdentity.js.map +0 -1
- package/dist/plugin/RepoTruth.js.map +0 -1
- package/dist/plugin/Retrospective.js.map +0 -1
- package/dist/plugin/SharedLayer.js.map +0 -1
- package/dist/plugin/Store.js.map +0 -1
- package/dist/plugin/ToolCallObserver.js.map +0 -1
- package/dist/plugin/capabilities.js.map +0 -1
- package/dist/plugin/confidence.js.map +0 -1
- package/dist/plugin/diff.js.map +0 -1
- package/dist/plugin/fingerprint.js.map +0 -1
- package/dist/plugin/host.js.map +0 -1
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/inferability.js.map +0 -1
- package/dist/plugin/kevin_approve.js.map +0 -1
- package/dist/plugin/kevin_audit.js.map +0 -1
- package/dist/plugin/kevin_conflicts.js.map +0 -1
- package/dist/plugin/kevin_doctor.js.map +0 -1
- package/dist/plugin/kevin_facts.js.map +0 -1
- package/dist/plugin/kevin_native.js.map +0 -1
- package/dist/plugin/kevin_propose.js.map +0 -1
- package/dist/plugin/kevin_publish.js.map +0 -1
- package/dist/plugin/kevin_why.js.map +0 -1
- package/dist/plugin/memory-format.js.map +0 -1
- package/dist/plugin/metrics.js.map +0 -1
- package/dist/plugin/native.js.map +0 -1
- package/dist/plugin/okf-export.js.map +0 -1
- package/dist/plugin/okf-import.js.map +0 -1
- package/dist/plugin/okf.js.map +0 -1
- package/dist/plugin/query-tokenizer.js.map +0 -1
- package/dist/plugin/redact.js.map +0 -1
- package/dist/plugin/replay-types.js.map +0 -1
- package/dist/plugin/replay.js.map +0 -1
- package/dist/plugin/sqlite-adapter.js.map +0 -1
- package/dist/plugin/uuid.js.map +0 -1
- package/migrations/001_initial.sql +0 -92
- package/migrations/002_indexes.sql +0 -14
- package/migrations/003_v02_signal.sql +0 -58
- package/migrations/004_v03_knowledge.sql +0 -138
- package/migrations/005_v04_signal.sql +0 -57
- package/migrations/006_v05_glassbox.sql +0 -118
- package/migrations/007_v06_pull.sql +0 -145
- package/migrations/008_v07_truth.sql +0 -124
- package/migrations/009_v08_team.sql +0 -100
- package/migrations/010_v09_native.sql +0 -78
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v1.0.0 (K10-027 / plan §5.7) — the untrusted-input boundary.
|
|
3
|
+
*
|
|
4
|
+
* One pure, total, idempotent escaping function per container Kevin
|
|
5
|
+
* writes stored text into. Every function here is a fixed point after
|
|
6
|
+
* one application — applying it twice equals applying it once — because
|
|
7
|
+
* a re-curated memory passes through the boundary on every regeneration
|
|
8
|
+
* and must not accumulate escaping.
|
|
9
|
+
*
|
|
10
|
+
* This module imports nothing and touches no filesystem. It is the
|
|
11
|
+
* boundary; the single enforcement point is ArtifactWriter (D6-01).
|
|
12
|
+
*/
|
|
13
|
+
const ENTITY_HEADS = /&(?!(amp|lt|gt|#\d+);)/g;
|
|
14
|
+
/**
|
|
15
|
+
* Neutralise text destined for the AGENTS.md marker block: HTML-escape
|
|
16
|
+
* (the memory-format discipline, made idempotent) so the literal
|
|
17
|
+
* `<!-- kevin:end -->` marker sequence and every comment terminator
|
|
18
|
+
* lose their meaning inside the block. The line-level strip of anything
|
|
19
|
+
* containing `kevin:begin`/`kevin:end` stays in
|
|
20
|
+
* ArtifactWriter.sanitizeArtifactBody — it is a filter, not an escape.
|
|
21
|
+
*/
|
|
22
|
+
export function escapeForMarkerBlock(text) {
|
|
23
|
+
return text
|
|
24
|
+
.replace(ENTITY_HEADS, "&")
|
|
25
|
+
.replace(/</g, "<")
|
|
26
|
+
.replace(/>/g, ">");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Neutralise fenced-code delimiters: any run of three or more backticks
|
|
30
|
+
* or tildes would close (or open) a markdown fence around the rendered
|
|
31
|
+
* block and let stored text masquerade as un-fenced document content.
|
|
32
|
+
* Each byte of the run becomes its numeric HTML entity, which renders
|
|
33
|
+
* identically but can never form a delimiter again.
|
|
34
|
+
*/
|
|
35
|
+
export function escapeForFence(text) {
|
|
36
|
+
return text
|
|
37
|
+
.replace(/`{3,}/g, (run) => "`".repeat(run.length))
|
|
38
|
+
.replace(/~{3,}/g, (run) => "~".repeat(run.length));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Neutralise bytes that would terminate an OKF v2 line: newline,
|
|
42
|
+
* carriage return and every other C0 control character become their
|
|
43
|
+
* JSON-style escapes, so a statement can never split into a second
|
|
44
|
+
* line even if a future writer forgets JSON.stringify. Quotation marks
|
|
45
|
+
* and backslashes are deliberately NOT touched here — the OKF line is
|
|
46
|
+
* canonical JSON and re-escaping them would corrupt parsing; JSON
|
|
47
|
+
* already guarantees they stay inside the string.
|
|
48
|
+
*/
|
|
49
|
+
export function escapeForOkfLine(text) {
|
|
50
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: neutralising control bytes is this function's entire job
|
|
51
|
+
return text.replace(/[\u0000-\u001f]/g, (c) => {
|
|
52
|
+
if (c === "\n")
|
|
53
|
+
return "\\n";
|
|
54
|
+
if (c === "\r")
|
|
55
|
+
return "\\r";
|
|
56
|
+
if (c === "\t")
|
|
57
|
+
return "\\t";
|
|
58
|
+
return `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`;
|
|
59
|
+
});
|
|
60
|
+
}
|
package/dist/plugin/host.js
CHANGED
package/dist/plugin/index.d.ts
CHANGED
|
@@ -16,10 +16,10 @@ export interface KevinPluginOptions {
|
|
|
16
16
|
* v0.4.0 (K4-021) — settings surfaced by `kevin_config` (plan §8.8).
|
|
17
17
|
* Unknown keys are rejected on `set` unless `strict: false`.
|
|
18
18
|
*/
|
|
19
|
-
export declare const KEVIN_CONFIG_KEYS: readonly ["quality_gate_enabled", "lesson_snippet_injection", "patternminer_enabled", "cross_project_enabled", "llm_reflection_enabled", "tool_calls_dedup_enabled", "deterministic_retrieval", "pre_prompt_budget_tokens", "archive_after_days", "curation_enabled", "agents_md_path", "skill_emission_enabled", "reference_emission_enabled", "injection_confidence_floor", "repo_truth_enabled", "convention_mining_enabled", "conflict_detection_enabled", "error_lesson_mode", "shared_layer_enabled", "okf_path", "share_requires_approval", "author_identity_mode", "shared_confidence_floor", "hook_liveness_enabled", "native_registration_enabled", "host_probe_history_enabled", "dead_hook_report_threshold"];
|
|
19
|
+
export declare const KEVIN_CONFIG_KEYS: readonly ["quality_gate_enabled", "lesson_snippet_injection", "patternminer_enabled", "cross_project_enabled", "llm_reflection_enabled", "tool_calls_dedup_enabled", "deterministic_retrieval", "pre_prompt_budget_tokens", "archive_after_days", "curation_enabled", "agents_md_path", "skill_emission_enabled", "reference_emission_enabled", "injection_confidence_floor", "repo_truth_enabled", "convention_mining_enabled", "conflict_detection_enabled", "error_lesson_mode", "shared_layer_enabled", "okf_path", "share_requires_approval", "author_identity_mode", "shared_confidence_floor", "hook_liveness_enabled", "native_registration_enabled", "host_probe_history_enabled", "dead_hook_report_threshold", "perf_enabled", "perf_ring_capacity", "perf_flush_on_idle", "contract_report_enabled"];
|
|
20
20
|
export declare const ERROR_LESSON_MODE_VALUES: readonly ["all", "triage_only"];
|
|
21
21
|
/** Plugin release version — stamped into generated files (K8-021/027). */
|
|
22
|
-
export declare const KEVIN_VERSION = "
|
|
22
|
+
export declare const KEVIN_VERSION = "1.1.0";
|
|
23
23
|
export interface RekeyCounts {
|
|
24
24
|
memories: number;
|
|
25
25
|
shared_entries: number;
|