create-principles-disciple 1.147.12 → 1.147.13
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/_release/product-identity.json +1 -1
- package/core/dist/runtime-v2/activation/adaptive-principle-intervention.d.ts +37 -0
- package/core/dist/runtime-v2/activation/adaptive-principle-intervention.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/adaptive-principle-intervention.js +41 -13
- package/core/dist/runtime-v2/activation/adaptive-principle-intervention.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +1 -1
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +1 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/host-runtime/package.json +1 -1
- package/package.json +3 -3
- package/plugin/dist/bundle.js +604 -603
- package/plugin/dist/hooks/controlled-admission.d.ts +87 -0
- package/plugin/dist/hooks/prompt.d.ts +1 -1
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { PluginHookBeforePromptBuildEvent } from '../openclaw-sdk.js';
|
|
2
|
+
import type { AdaptiveActivationConfig } from './adaptive-activation-config.js';
|
|
3
|
+
export declare const CONTROLLED_ADMISSION_ENV: {
|
|
4
|
+
readonly admissionFile: 'PD_AA_ADMISSION_FILE';
|
|
5
|
+
readonly experimentRoot: 'PD_AA_EXPERIMENT_ROOT';
|
|
6
|
+
};
|
|
7
|
+
export type ControlledAdmissionReason = 'admission_native_identity_present' | 'admission_path_outside_root' | 'admission_file_invalid' | 'admission_input_mismatch' | 'admission_input_parse_mismatch' | 'admission_manifest_mismatch' | 'admission_target_mismatch' | 'admission_mapping_mismatch' | 'admission_session_mismatch' | 'admission_agent_to_agent' | 'admission_scene_mismatch' | 'admission_expired' | 'admission_already_consumed' | 'admission_claim_write_failed';
|
|
8
|
+
export interface ControlledAdmissionEnvironment {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
admissionFile?: string;
|
|
11
|
+
experimentRoot?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ControlledAdmissionIdentity {
|
|
14
|
+
admissionId: string;
|
|
15
|
+
operator: string;
|
|
16
|
+
purpose: string;
|
|
17
|
+
inputSha256: string;
|
|
18
|
+
manifestSha256: string;
|
|
19
|
+
mappingSha256: string;
|
|
20
|
+
targetArtifactId: string;
|
|
21
|
+
targetActivationId: string;
|
|
22
|
+
expiresAt: string;
|
|
23
|
+
consumedAt: string;
|
|
24
|
+
consumedBy: {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
runId: string | null;
|
|
27
|
+
hookInvocationId: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface ControlledAdmissionManifest {
|
|
31
|
+
targetArtifactId: string;
|
|
32
|
+
targetActivationId: string;
|
|
33
|
+
sourceRef: string;
|
|
34
|
+
fixtureFile: string;
|
|
35
|
+
fixtureSha256: string;
|
|
36
|
+
expectedToolName: string;
|
|
37
|
+
expectedContentMarker: string;
|
|
38
|
+
configSnapshot: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface ControlledAdmissionClaim {
|
|
41
|
+
claimId: string;
|
|
42
|
+
identity: ControlledAdmissionIdentity;
|
|
43
|
+
manifest: ControlledAdmissionManifest;
|
|
44
|
+
admittedText: string;
|
|
45
|
+
hookInvocationId: string;
|
|
46
|
+
}
|
|
47
|
+
export type ControlledAdmissionClaimResult = {
|
|
48
|
+
status: 'disabled';
|
|
49
|
+
} | {
|
|
50
|
+
status: 'rejected';
|
|
51
|
+
reason: ControlledAdmissionReason;
|
|
52
|
+
detail?: string;
|
|
53
|
+
} | {
|
|
54
|
+
status: 'claimed';
|
|
55
|
+
claim: ControlledAdmissionClaim;
|
|
56
|
+
};
|
|
57
|
+
export interface ControlledAdmissionClaimRequest {
|
|
58
|
+
event: PluginHookBeforePromptBuildEvent;
|
|
59
|
+
workspaceDir: string;
|
|
60
|
+
sessionId: string | undefined;
|
|
61
|
+
runId?: string | null;
|
|
62
|
+
mapping: AdaptiveActivationConfig;
|
|
63
|
+
hookInvocationId: string;
|
|
64
|
+
now?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The controlled admission branch is opt-in per isolated process only. There is
|
|
68
|
+
* no persisted configuration and no plugin default that could enable it.
|
|
69
|
+
*/
|
|
70
|
+
export declare function readControlledAdmissionEnvironment(env?: NodeJS.ProcessEnv): ControlledAdmissionEnvironment;
|
|
71
|
+
export declare function isControlledAdmissionConfigured(env?: NodeJS.ProcessEnv): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Takes the same-round provider→prompt handoff for the exact host event object
|
|
74
|
+
* and hook invocation. A duplicate callback, a new run with the same input, a
|
|
75
|
+
* cross-session callback or a post-tool second request cannot take it: either
|
|
76
|
+
* the entry is already gone or its identity does not match.
|
|
77
|
+
*/
|
|
78
|
+
export declare function takeControlledAdmissionHandoff(event: PluginHookBeforePromptBuildEvent, hookInvocationId: string | undefined, now?: number): ControlledAdmissionClaim | null;
|
|
79
|
+
/** Journal close / abnormal exit removes the handoff entry; disk `consumedAt` stays authoritative. */
|
|
80
|
+
export declare function releaseControlledAdmissionClaim(claim: ControlledAdmissionClaim | null | undefined): void;
|
|
81
|
+
export declare function resetControlledAdmissionCacheForTest(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Exclusive read→validate→write consumption. The lock, every read, the consumed
|
|
84
|
+
* marker write and its rollback happen inside one mutual exclusion region, so
|
|
85
|
+
* two callers can never both observe an unconsumed admission.
|
|
86
|
+
*/
|
|
87
|
+
export declare function claimControlledAdmission(request: ControlledAdmissionClaimRequest): ControlledAdmissionClaimResult;
|
|
@@ -27,7 +27,7 @@ export declare function beginAdaptivePromptInvocation(ctx: PluginHookAgentContex
|
|
|
27
27
|
}, target: {
|
|
28
28
|
artifactId: string;
|
|
29
29
|
activationId: string;
|
|
30
|
-
}, runtimeMode: string): string;
|
|
30
|
+
}, runtimeMode: string, hookInvocationId?: string): string;
|
|
31
31
|
export declare function handleBeforePromptBuild(event: PluginHookBeforePromptBuildEvent, ctx: PluginHookAgentContext & {
|
|
32
32
|
api?: PromptHookApi;
|
|
33
33
|
}, sharedActivePrinciplePrompt?: ActivePrinciplePromptResult): Promise<PluginHookBeforePromptBuildResult | void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.7.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "2.6.
|
|
5
|
+
"version": "2.6.5",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/plugin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|