@lensmcp/protocol-types 1.23.7 → 1.23.9
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/lib/capture-demand.d.ts +35 -0
- package/lib/capture-demand.js +1 -1
- package/package.json +1 -1
package/lib/capture-demand.d.ts
CHANGED
|
@@ -58,3 +58,38 @@ export interface CaptureRequest {
|
|
|
58
58
|
/** Opaque id, so a reader can tell two same-millisecond requests apart. */
|
|
59
59
|
requestId?: string;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Session-rules file name (same directory).
|
|
63
|
+
*
|
|
64
|
+
* `visual.register_rule` had the dead-letter problem this module describes for
|
|
65
|
+
* capture requests, and kept it after they were fixed: it published
|
|
66
|
+
* `visual-rule-registered` onto the MCP's in-process bus, where only the
|
|
67
|
+
* reducer heard it. The reducer listed the rule and counted it ("1 rule
|
|
68
|
+
* registered"); the runner — the only process that RUNS rules — never learned
|
|
69
|
+
* it existed. So a registered rule could not produce a violation, and "0
|
|
70
|
+
* violations" read as a pass (issues/foodguard/27).
|
|
71
|
+
*
|
|
72
|
+
* Same cure: the MCP server writes the registered rules here and the runner
|
|
73
|
+
* reads them before each capture.
|
|
74
|
+
*/
|
|
75
|
+
export declare const CAPTURE_RULES_FILENAME = "capture-rules.json";
|
|
76
|
+
/** One rule registered through `visual.register_rule`. */
|
|
77
|
+
export interface CaptureSessionRule {
|
|
78
|
+
/** The rule, in the `lensmcp.rules.json` shape. Validate on read — it crossed
|
|
79
|
+
* a process boundary, and a hand-edited file must not crash a capture. */
|
|
80
|
+
rule: {
|
|
81
|
+
id: string;
|
|
82
|
+
type: string;
|
|
83
|
+
[key: string]: unknown;
|
|
84
|
+
};
|
|
85
|
+
/** pid of the MCP server that registered it. The rule lives exactly as long
|
|
86
|
+
* as that process: the reducer's own list is in that server's memory, so a
|
|
87
|
+
* rule outliving it would be evaluated by a runner and listed by nobody. */
|
|
88
|
+
registeredBy: number;
|
|
89
|
+
/** `Date.now()` at registration. */
|
|
90
|
+
registeredAt: number;
|
|
91
|
+
}
|
|
92
|
+
export interface CaptureSessionRules {
|
|
93
|
+
schemaVersion: 1;
|
|
94
|
+
rules: CaptureSessionRule[];
|
|
95
|
+
}
|
package/lib/capture-demand.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const CAPTURE_REQUEST_FILENAME="capture-request.json",CAPTURE_PRESENCE_FILENAME="capture-runner.json";
|
|
1
|
+
"use strict";export const CAPTURE_REQUEST_FILENAME="capture-request.json",CAPTURE_PRESENCE_FILENAME="capture-runner.json",CAPTURE_RULES_FILENAME="capture-rules.json";
|