principles-disciple 1.101.0 → 1.102.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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/core/config-health.ts +14 -0
- package/src/index.ts +4 -4
- package/src/openclaw-sdk.ts +1 -0
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.102.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onCapabilities": [
|
|
8
8
|
"hook"
|
package/package.json
CHANGED
|
@@ -10,6 +10,20 @@
|
|
|
10
10
|
* needs to check conversation access state (PRI-346).
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* PRI-348: Extract the full plugin entry (including hooks) from the global OpenClaw config.
|
|
15
|
+
* Unlike api.pluginConfig (which is only the entry.config sub-object), this returns
|
|
16
|
+
* the entire entry including hooks, config, enabled, etc.
|
|
17
|
+
*/
|
|
18
|
+
export function getPluginEntry(config: unknown, pluginId: string): unknown {
|
|
19
|
+
if (!config || typeof config !== 'object' || Array.isArray(config)) return undefined;
|
|
20
|
+
const plugins = (config as Record<string, unknown>).plugins;
|
|
21
|
+
if (!plugins || typeof plugins !== 'object' || Array.isArray(plugins)) return undefined;
|
|
22
|
+
const entries = (plugins as Record<string, unknown>).entries;
|
|
23
|
+
if (!entries || typeof entries !== 'object' || Array.isArray(entries)) return undefined;
|
|
24
|
+
return (entries as Record<string, unknown>)[pluginId];
|
|
25
|
+
}
|
|
26
|
+
|
|
13
27
|
/** Keep in sync with @principles/core CONVERSATION_ACCESS_CONFIG_KEY */
|
|
14
28
|
const CONVERSATION_ACCESS_CONFIG_KEY = 'allowConversationAccess' as const;
|
|
15
29
|
|
package/src/index.ts
CHANGED
|
@@ -20,8 +20,8 @@ import type {
|
|
|
20
20
|
} from './openclaw-sdk.js';
|
|
21
21
|
import * as path from 'path';
|
|
22
22
|
import { loadFeatureFlagFromConfig } from './core/pd-config-loader.js';
|
|
23
|
-
import { checkConversationAccessConfig } from './core/config-health.js';
|
|
24
|
-
export { checkConversationAccessConfig } from './core/config-health.js';
|
|
23
|
+
import { checkConversationAccessConfig, getPluginEntry } from './core/config-health.js';
|
|
24
|
+
export { checkConversationAccessConfig, getPluginEntry } from './core/config-health.js';
|
|
25
25
|
export type { ConversationAccessCheckResult } from './core/config-health.js';
|
|
26
26
|
import { classifyTask } from './core/local-worker-routing.js';
|
|
27
27
|
import { completeShadowObservation, recordShadowRouting } from './core/shadow-observation-registry.js';
|
|
@@ -171,7 +171,7 @@ const plugin = {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
// PRI-343: Check allowConversationAccess — warn if llm_output/trajectory hooks blocked
|
|
174
|
-
const accessCheck = checkConversationAccessConfig(api.
|
|
174
|
+
const accessCheck = checkConversationAccessConfig(getPluginEntry(api.config, api.id));
|
|
175
175
|
if (!accessCheck.authorized) {
|
|
176
176
|
api.logger.error(
|
|
177
177
|
`[PD:health] conversation hooks (llm_output / trajectory) will be BLOCKED by OpenClaw.\n` +
|
|
@@ -539,7 +539,7 @@ const plugin = {
|
|
|
539
539
|
TrajectoryCollector.handleBeforeMessageWrite(event, {
|
|
540
540
|
...ctx,
|
|
541
541
|
workspaceDir: wsResult.workspaceDir,
|
|
542
|
-
pluginConfig: api.
|
|
542
|
+
pluginConfig: getPluginEntry(api.config, api.id),
|
|
543
543
|
});
|
|
544
544
|
} catch (err) {
|
|
545
545
|
// Non-critical: don't surface to user
|