principles-disciple 1.101.0 → 1.102.1
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
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.1",
|
|
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
|
|
|
@@ -50,9 +50,9 @@ export class PromptActivationReader {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (artifactRow === null) {
|
|
53
|
-
const warning = `artifact_not_found: artifactId=${activation.artifactId}; nextAction=
|
|
53
|
+
const warning = `artifact_not_found: artifactId=${activation.artifactId}; nextAction=check_pi_artifacts_table_or_remove_stale_activation`;
|
|
54
54
|
warnings.push(warning);
|
|
55
|
-
this.deps.logger?.
|
|
55
|
+
this.deps.logger?.info?.(`[PD:RuntimeV2] ${warning}`);
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
58
|
|
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
|
package/src/openclaw-sdk.ts
CHANGED
|
@@ -387,13 +387,13 @@ describe('Runtime V2 prompt activation injection', () => {
|
|
|
387
387
|
|
|
388
388
|
await insertPromptActivation({ artifactId, principleId });
|
|
389
389
|
|
|
390
|
-
const
|
|
390
|
+
const infoSpy = vi.fn();
|
|
391
391
|
const ctx = {
|
|
392
392
|
workspaceDir: tempWorkspaceDir,
|
|
393
393
|
trigger: 'user',
|
|
394
394
|
sessionId: 'test-session-v2',
|
|
395
395
|
api: {
|
|
396
|
-
logger: { info: vi.fn(),
|
|
396
|
+
logger: { info: infoSpy, warn: vi.fn(), error: vi.fn() },
|
|
397
397
|
runtime: {},
|
|
398
398
|
config: {},
|
|
399
399
|
},
|
|
@@ -404,8 +404,8 @@ describe('Runtime V2 prompt activation injection', () => {
|
|
|
404
404
|
|
|
405
405
|
expect(result).toBeDefined();
|
|
406
406
|
expect(result?.appendSystemContext).not.toContain(TEST_PRINCIPLE_TEXT);
|
|
407
|
-
const
|
|
408
|
-
const hasActivationWarning =
|
|
407
|
+
const infoCalls = infoSpy.mock.calls.map((c: unknown[]) => String(c[0]));
|
|
408
|
+
const hasActivationWarning = infoCalls.some((c: string) => c.includes('artifact_not_found') || c.includes('artifact_query_unexpected') || c.includes('activation'));
|
|
409
409
|
expect(hasActivationWarning).toBe(true);
|
|
410
410
|
});
|
|
411
411
|
|