principles-disciple 1.205.0 → 1.207.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/dist/bundle.js +484 -444
- package/dist/core/principle-application-ledger.d.ts +45 -0
- package/dist/openclaw.plugin.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type PrincipleApplicationLevel = 'effect' | 'presence';
|
|
2
|
+
export type PrincipleApplicationKind = 'rule_blocked' | 'auto_correct_applied' | 'self_reported' | 'prompt_injected';
|
|
3
|
+
export interface PrincipleApplicationInput {
|
|
4
|
+
principleId: string;
|
|
5
|
+
activationId?: string;
|
|
6
|
+
ruleId?: string;
|
|
7
|
+
channel: 'code_tool_hook' | 'prompt';
|
|
8
|
+
level: PrincipleApplicationLevel;
|
|
9
|
+
kind: PrincipleApplicationKind;
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
toolName?: string;
|
|
12
|
+
filePath?: string;
|
|
13
|
+
digest?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Record one application event. Returns true when a row was written (or
|
|
17
|
+
* deduped), false on failure — callers must surface the reason (rc-9).
|
|
18
|
+
*/
|
|
19
|
+
export declare function recordPrincipleApplication(workspaceDir: string, input: PrincipleApplicationInput): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Align activation ids with the actually-injected principle subset (PRI-531
|
|
22
|
+
* review fix). Budget truncation can drop principles from the tail of the
|
|
23
|
+
* full list — pairing by raw index would attach the wrong activation_id to a
|
|
24
|
+
* presence row (rc-6-adjacent data pairing).
|
|
25
|
+
*/
|
|
26
|
+
export declare function alignActivationIds(principles: ReadonlyArray<{
|
|
27
|
+
principleId: string;
|
|
28
|
+
activationId?: string;
|
|
29
|
+
}>, injectedIds: ReadonlySet<string>): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Presence rows for a prompt injection event — one per principle, deduped per
|
|
32
|
+
* session×principle by the partial unique index (restarts included).
|
|
33
|
+
* Returns the number of NEW rows written (0 when all were already present).
|
|
34
|
+
* Failures are warned via the optional logger (rc-9) — never thrown.
|
|
35
|
+
*/
|
|
36
|
+
export declare function recordInjectionPresence(workspaceDir: string, principleIds: readonly string[], sessionId: string | undefined, activationIds?: readonly string[], logger?: {
|
|
37
|
+
warn?: (message: string) => void;
|
|
38
|
+
info?: (message: string) => void;
|
|
39
|
+
}): number;
|
|
40
|
+
export declare function recordSelfReportFromText(workspaceDir: string, text: unknown, sessionId: string | undefined, logger?: {
|
|
41
|
+
warn?: (message: string) => void;
|
|
42
|
+
info?: (message: string) => void;
|
|
43
|
+
}): number;
|
|
44
|
+
/** Test hook: close cached connections and reset the retention sweep clock. */
|
|
45
|
+
export declare function clearPrincipleApplicationLedgerCache(): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles. Stop correcting the same AI behavior across sessions.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.207.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onCapabilities": [
|
|
8
8
|
"hook"
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles. Stop correcting the same AI behavior across sessions.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.207.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onCapabilities": [
|
|
8
8
|
"hook"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.207.0",
|
|
4
4
|
"description": "Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles. Stop correcting the same AI behavior across sessions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|