create-principles-disciple 1.147.18 → 1.148.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/_release/product-identity.json +1 -1
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/config/pd-config-store.js +6 -6
- package/console/dist/server/index.d.ts +20 -0
- package/console/dist/server/index.js +104 -84
- package/console/dist/server/models/ApprovalsConsoleModel.d.ts +1 -1
- package/console/dist/server/models/ApprovalsConsoleModel.js +5 -2
- package/console/dist/server/models/GovernanceExperienceCollector.js +2 -1
- package/console/dist/server/models/GovernanceProjectionCollector.js +11 -10
- package/console/dist/server/models/IntentPageModel.js +1 -1
- package/console/dist/server/models/OwnerDecisionViewModel.d.ts +3 -2
- package/console/dist/server/models/OwnerDecisionViewModel.js +8 -7
- package/console/dist/server/routes/activations.js +5 -5
- package/console/dist/server/routes/approvals-grouped.js +2 -2
- package/console/dist/server/routes/approvals.js +7 -7
- package/console/dist/server/routes/config.d.ts +4 -4
- package/console/dist/server/routes/config.js +5 -5
- package/console/dist/server/routes/evidence-chain.d.ts +1 -1
- package/console/dist/server/routes/evidence-outcomes.d.ts +2 -2
- package/console/dist/server/routes/examiner.d.ts +12 -12
- package/console/dist/server/routes/examiner.js +2 -2
- package/console/dist/server/routes/failed-tasks.d.ts +4 -4
- package/console/dist/server/routes/failed-tasks.js +10 -10
- package/console/dist/server/routes/governance.d.ts +1 -1
- package/console/dist/server/routes/governance.js +3 -3
- package/console/dist/server/routes/intent-decisions.d.ts +6 -6
- package/console/dist/server/routes/intent-decisions.js +13 -13
- package/console/dist/server/routes/intent.js +6 -6
- package/console/dist/server/routes/lifecycle.js +3 -3
- package/console/dist/server/routes/onboarding.d.ts +1 -1
- package/console/dist/server/routes/onboarding.js +4 -4
- package/console/dist/server/routes/owner-decision.d.ts +5 -5
- package/console/dist/server/routes/owner-decision.js +3 -3
- package/console/dist/server/routes/owner-decisions.d.ts +3 -3
- package/console/dist/server/routes/owner-decisions.js +3 -3
- package/console/dist/server/routes/owner-identity.d.ts +1 -1
- package/console/dist/server/routes/owner-identity.js +1 -1
- package/console/dist/server/routes/principles.d.ts +4 -3
- package/console/dist/server/routes/principles.js +5 -4
- package/console/dist/server/routes/receipts.d.ts +2 -2
- package/console/dist/server/routes/receipts.js +4 -4
- package/console/dist/server.d.ts +2 -1
- package/console/dist/server.js +9 -1
- package/console/dist/shared/prompt-injection-contract.d.ts +1 -1
- package/console/dist/web/assets/app.js +23 -23
- package/core/dist/index.d.ts +1 -1
- package/core/dist/index.d.ts.map +1 -1
- package/core/dist/index.js +3 -2
- package/core/dist/index.js.map +1 -1
- package/core/dist/runtime/activation/approval-review-guard.d.ts +2 -2
- package/core/dist/runtime/activation/approval-review-guard.d.ts.map +1 -1
- package/core/dist/runtime/activation/approval-review-guard.js +6 -1
- package/core/dist/runtime/activation/approval-review-guard.js.map +1 -1
- package/core/dist/runtime/activation/prompt-budget-policy.d.ts +9 -1
- package/core/dist/runtime/activation/prompt-budget-policy.d.ts.map +1 -1
- package/core/dist/runtime/activation/prompt-budget-policy.js +9 -1
- package/core/dist/runtime/activation/prompt-budget-policy.js.map +1 -1
- package/core/dist/runtime/activation/recovery-control-surfaces.d.ts +1 -1
- package/core/dist/runtime/activation/recovery-control-surfaces.js +2 -2
- package/core/dist/runtime/activation/recovery-control-surfaces.js.map +1 -1
- package/core/dist/runtime/adapter/output-schema-registry.d.ts +1 -1
- package/core/dist/runtime/adapter/output-schema-registry.d.ts.map +1 -1
- package/core/dist/runtime/adapter/output-schema-registry.js +23 -18
- package/core/dist/runtime/adapter/output-schema-registry.js.map +1 -1
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +1 -1
- package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/schema-json-converter.d.ts +1 -1
- package/core/dist/runtime/adapter/schema-json-converter.js +1 -1
- package/core/dist/runtime/adapter/tools/diagnostician-tool.js +1 -1
- package/core/dist/runtime/adapter/tools/diagnostician-tool.js.map +1 -1
- package/core/dist/runtime/diagnostician-output.d.ts +2 -2
- package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-output.js +1 -1
- package/core/dist/runtime/diagnostician-output.js.map +1 -1
- package/core/dist/runtime/feature-flags/plugin-surface-registry.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/plugin-surface-registry.js +10 -0
- package/core/dist/runtime/feature-flags/plugin-surface-registry.js.map +1 -1
- package/core/dist/runtime/governance-experience-contract.d.ts +4 -4
- package/core/dist/runtime/governance-experience-contract.d.ts.map +1 -1
- package/core/dist/runtime/governance-experience-contract.js +3 -2
- package/core/dist/runtime/governance-experience-contract.js.map +1 -1
- package/core/dist/runtime/governance-experience.d.ts.map +1 -1
- package/core/dist/runtime/governance-experience.js +2 -1
- package/core/dist/runtime/governance-experience.js.map +1 -1
- package/core/dist/runtime/governance-projection-contract.d.ts +14 -14
- package/core/dist/runtime/governance-projection-contract.d.ts.map +1 -1
- package/core/dist/runtime/governance-projection-contract.js +4 -3
- package/core/dist/runtime/governance-projection-contract.js.map +1 -1
- package/core/dist/runtime/governance-projection.d.ts.map +1 -1
- package/core/dist/runtime/governance-projection.js +2 -1
- package/core/dist/runtime/governance-projection.js.map +1 -1
- package/core/dist/runtime/index.d.ts +2 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +2 -3
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/internalization/artificer-runner.d.ts +1 -1
- package/core/dist/runtime/internalization/artificer-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/artificer-runner.js +3 -2
- package/core/dist/runtime/internalization/artificer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.js +3 -2
- package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.js +3 -2
- package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.js +4 -3
- package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.js +3 -2
- package/core/dist/runtime/internalization/dreamer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/evaluator-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/evaluator-runner.js +3 -2
- package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.d.ts +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.js +3 -2
- package/core/dist/runtime/internalization/philosopher-runner.js.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-output.js +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-output.js.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rollout-reviewer-runner.js +3 -2
- package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/router-context-evidence.d.ts +1 -1
- package/core/dist/runtime/internalization/router-context-evidence.d.ts.map +1 -1
- package/core/dist/runtime/internalization/router-context-evidence.js +4 -1
- package/core/dist/runtime/internalization/router-context-evidence.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-runner.d.ts +1 -1
- package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-runner.js +3 -2
- package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
- package/core/dist/runtime/learning-lab/actor-action-output.d.ts +1 -1
- package/core/dist/runtime/learning-lab/actor-action-output.d.ts.map +1 -1
- package/core/dist/runtime/learning-lab/actor-action-output.js +1 -1
- package/core/dist/runtime/learning-lab/actor-action-output.js.map +1 -1
- package/core/dist/runtime/observer/correction-observer.d.ts.map +1 -1
- package/core/dist/runtime/observer/correction-observer.js +3 -2
- package/core/dist/runtime/observer/correction-observer.js.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.js +2 -1
- package/core/dist/runtime/owner-decision/owner-decision-view-contract.js.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view.d.ts +8 -8
- package/core/dist/runtime/owner-decision/owner-decision-view.d.ts.map +1 -1
- package/core/dist/runtime/owner-decision/owner-decision-view.js +10 -9
- package/core/dist/runtime/owner-decision/owner-decision-view.js.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-evaluation-output.d.ts +1 -1
- package/core/dist/runtime/principle-reuse/reuse-evaluation-output.d.ts.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-evaluation-output.js +1 -1
- package/core/dist/runtime/principle-reuse/reuse-evaluation-output.js.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.d.ts.map +1 -1
- package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.js +5 -4
- package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.js.map +1 -1
- package/core/dist/runtime/schema-version.d.ts +30 -14
- package/core/dist/runtime/schema-version.d.ts.map +1 -1
- package/core/dist/runtime/schema-version.js +33 -13
- package/core/dist/runtime/schema-version.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts +32 -1
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +819 -47
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/utils/config-file-io.d.ts +27 -1
- package/dist/utils/config-file-io.d.ts.map +1 -1
- package/dist/utils/config-file-io.js +78 -3
- package/dist/utils/config-file-io.js.map +1 -1
- package/host-runtime/dist/prompt-injection-budget-observation.js +10 -8
- package/host-runtime/dist/signal-classifier.d.ts +3 -1
- package/host-runtime/dist/signal-classifier.js +5 -3
- package/host-runtime/package.json +1 -1
- package/package.json +3 -3
- package/pd-cli/package.json +1 -1
- package/pd-mcp-server/dist/version.d.ts +1 -1
- package/pd-mcp-server/dist/version.js +1 -1
- package/pd-mcp-server/package.json +1 -1
- package/plugin/dist/bundle.js +441 -441
- package/plugin/dist/core/event-log.d.ts +5 -0
- package/plugin/dist/governance-audit.js +2 -2
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +9 -9
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/installers/workbuddy-host-installer.js +819 -47
- package/release-manager/dist/utils/config-file-io.js +78 -3
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Onboarding route - POST /api/
|
|
2
|
+
* Onboarding route - POST /api/onboarding/run-demo
|
|
3
3
|
*
|
|
4
4
|
* Spec: docs/superpowers/specs/2026-06-30-new-user-onboarding-design.md 6.3 change 5
|
|
5
5
|
*
|
|
@@ -135,7 +135,7 @@ function parseDemoStdout(stdout) {
|
|
|
135
135
|
* The demo typically completes in < 30s. We block on the subprocess so the
|
|
136
136
|
* response carries the validated demo result in a single round-trip - the
|
|
137
137
|
* frontend does not need to poll for the demo itself (it still polls
|
|
138
|
-
* /api/
|
|
138
|
+
* /api/evidence-chain in step 3 for live evidence detection).
|
|
139
139
|
*
|
|
140
140
|
* Failure modes (rc-9-no-silent-fallback - every path returns a structured
|
|
141
141
|
* error with reason + nextAction):
|
|
@@ -296,7 +296,7 @@ export async function handleOnboardingRoute(req, res, ctx) {
|
|
|
296
296
|
});
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
|
-
// -- POST /api/
|
|
299
|
+
// -- POST /api/onboarding/run-demo --
|
|
300
300
|
if (subPath === '/run-demo') {
|
|
301
301
|
if (req.method !== 'POST') {
|
|
302
302
|
sendStructuredError(res, {
|
|
@@ -315,7 +315,7 @@ export async function handleOnboardingRoute(req, res, ctx) {
|
|
|
315
315
|
statusCode: 404,
|
|
316
316
|
error: 'not_found',
|
|
317
317
|
reason: 'not_found',
|
|
318
|
-
nextAction: `Route /api/
|
|
318
|
+
nextAction: `Route /api/onboarding${subPath} not found. Use POST /api/onboarding/run-demo.`,
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
321
|
/** No persistent resources to dispose - included for parity with other routes. */
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* (SPEC §15). Read-only: the Owner decision projection never mutates; the
|
|
4
4
|
* approval/activation mutation services remain the final write authority.
|
|
5
5
|
*
|
|
6
|
-
* GET /api/
|
|
7
|
-
* GET /api/
|
|
6
|
+
* GET /api/principles/owner-decision-inbox (static; dispatch before /:id)
|
|
7
|
+
* GET /api/principles/:id/owner-decision-view
|
|
8
8
|
*
|
|
9
9
|
* Both ride the existing `principle_governance_projection_v2` flag (no new
|
|
10
10
|
* runtime flag, SPEC §16) and reuse the route family's auth/workspace
|
|
@@ -21,9 +21,9 @@ export interface OwnerDecisionRouteParams {
|
|
|
21
21
|
}>;
|
|
22
22
|
now: () => string;
|
|
23
23
|
}
|
|
24
|
-
/** GET /api/
|
|
24
|
+
/** GET /api/principles/owner-decision-inbox */
|
|
25
25
|
export declare function handleOwnerDecisionInboxRoute(params: OwnerDecisionRouteParams): Promise<void>;
|
|
26
|
-
/** GET /api/
|
|
26
|
+
/** GET /api/principles/owner-decision-library — compact titles/states for the Library list (§11.2). */
|
|
27
27
|
export declare function handleOwnerDecisionLibraryRoute(params: OwnerDecisionRouteParams): Promise<void>;
|
|
28
28
|
/**
|
|
29
29
|
* Parses `/:id/owner-decision-view` sub paths. Returns the decoded principle
|
|
@@ -32,7 +32,7 @@ export declare function handleOwnerDecisionLibraryRoute(params: OwnerDecisionRou
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function parseOwnerDecisionViewSubPath(subPath: string): string | null | 'invalid';
|
|
34
34
|
/**
|
|
35
|
-
* GET /api/
|
|
35
|
+
* GET /api/principles/:id/owner-decision-view.
|
|
36
36
|
* Returns false when the sub path does not match (caller continues routing).
|
|
37
37
|
*/
|
|
38
38
|
export declare function handleOwnerDecisionViewRoute(params: OwnerDecisionRouteParams & {
|
|
@@ -4,7 +4,7 @@ import { sendSuccess, sendError, errorMessage } from '../utils/response.js';
|
|
|
4
4
|
function featureDisabled(res) {
|
|
5
5
|
sendError(res, 403, 'feature_disabled', 'Owner decision projection is disabled.', { reason: 'feature_disabled', nextAction: 'Enable features.principle_governance_projection_v2 in .pd/config.yaml.' });
|
|
6
6
|
}
|
|
7
|
-
/** GET /api/
|
|
7
|
+
/** GET /api/principles/owner-decision-inbox */
|
|
8
8
|
export async function handleOwnerDecisionInboxRoute(params) {
|
|
9
9
|
const { res, workspaceDir, featureFlags, now } = params;
|
|
10
10
|
if (featureFlags?.principle_governance_projection_v2?.enabled !== true) {
|
|
@@ -19,7 +19,7 @@ export async function handleOwnerDecisionInboxRoute(params) {
|
|
|
19
19
|
sendError(res, 500, 'owner_decision_inbox_error', errorMessage(error), { nextAction: 'inspect_runtime_state' });
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
/** GET /api/
|
|
22
|
+
/** GET /api/principles/owner-decision-library — compact titles/states for the Library list (§11.2). */
|
|
23
23
|
export async function handleOwnerDecisionLibraryRoute(params) {
|
|
24
24
|
const { res, workspaceDir, featureFlags, now } = params;
|
|
25
25
|
if (featureFlags?.principle_governance_projection_v2?.enabled !== true) {
|
|
@@ -53,7 +53,7 @@ export function parseOwnerDecisionViewSubPath(subPath) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* GET /api/
|
|
56
|
+
* GET /api/principles/:id/owner-decision-view.
|
|
57
57
|
* Returns false when the sub path does not match (caller continues routing).
|
|
58
58
|
*/
|
|
59
59
|
export async function handleOwnerDecisionViewRoute(params) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PRI-629 — /api/
|
|
2
|
+
* PRI-629 — /api/governance/owner-decisions 路由。
|
|
3
3
|
*
|
|
4
|
-
* GET /api/
|
|
5
|
-
* POST /api/
|
|
4
|
+
* GET /api/governance/owner-decisions — 统一 Owner Inbox 投影
|
|
5
|
+
* POST /api/governance/owner-decisions/:taskId/resolve — Owner 裁决
|
|
6
6
|
*
|
|
7
7
|
* 安全模型(SPEC §28/§29):
|
|
8
8
|
* - 全局 console token 认证由 server/index.ts 统一强制;
|
|
@@ -156,7 +156,7 @@ function sendOutcome(res, outcome) {
|
|
|
156
156
|
export async function handleOwnerDecisionsRoute(req, res, ctx) {
|
|
157
157
|
const { workspaceDir, subPath, ownerIdentity } = ctx;
|
|
158
158
|
const method = req.method ?? 'GET';
|
|
159
|
-
// GET /api/
|
|
159
|
+
// GET /api/governance/owner-decisions — list
|
|
160
160
|
if (subPath === '' || subPath === '/') {
|
|
161
161
|
if (method !== 'GET') {
|
|
162
162
|
sendMethodNotAllowed(res);
|
|
@@ -174,7 +174,7 @@ export async function handleOwnerDecisionsRoute(req, res, ctx) {
|
|
|
174
174
|
}
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
// POST /api/
|
|
177
|
+
// POST /api/governance/owner-decisions/:taskId/resolve
|
|
178
178
|
const resolveMatch = /^\/([^/]+)\/resolve$/.exec(subPath);
|
|
179
179
|
if (resolveMatch) {
|
|
180
180
|
if (method !== 'POST') {
|
|
@@ -220,5 +220,5 @@ export async function handleOwnerDecisionsRoute(req, res, ctx) {
|
|
|
220
220
|
}
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
sendError(res, 404, 'not_found', `Route /api/
|
|
223
|
+
sendError(res, 404, 'not_found', `Route /api/governance/owner-decisions${subPath} not found`);
|
|
224
224
|
}
|
|
@@ -17,7 +17,7 @@ async function readJson(req) {
|
|
|
17
17
|
/* eslint-disable @typescript-eslint/max-params */
|
|
18
18
|
export async function handleOwnerIdentityRoute(req, res, homeDir, subPath, authConfig) {
|
|
19
19
|
if (subPath !== '' && subPath !== '/') {
|
|
20
|
-
sendError(res, 404, 'not_found', 'Unknown owner identity endpoint.', { nextAction: 'Use GET / POST / DELETE /api/
|
|
20
|
+
sendError(res, 404, 'not_found', 'Unknown owner identity endpoint.', { nextAction: 'Use GET / POST / DELETE /api/owner-identity.' });
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
const method = req.method ?? 'GET';
|
|
@@ -3,9 +3,10 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
3
3
|
* GET /api/principles/core — read-only PD Core Principles reference (PRI-641).
|
|
4
4
|
*
|
|
5
5
|
* Served directly from the canonical `CORE_PRINCIPLES` registry (no ledger /
|
|
6
|
-
* DB read). Dispatched in server/index.ts BEFORE the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* DB read). Dispatched in server/index.ts as an exact-match BEFORE the merged
|
|
7
|
+
* `/api/principles` mount so `core` is never parsed as `/:id` — under the
|
|
8
|
+
* PRI-1139 canonical dispatch this endpoint answers on both the canonical
|
|
9
|
+
* path and the deprecated `/api/v1` alias.
|
|
9
10
|
*
|
|
10
11
|
* Owner Decision Experience v1: the canonical Owner decision read endpoints
|
|
11
12
|
* live in routes/owner-decision.ts and dispatch from handlePrinciplesRoute.
|
|
@@ -20,9 +20,10 @@ function getModel(workspaceDir) {
|
|
|
20
20
|
* GET /api/principles/core — read-only PD Core Principles reference (PRI-641).
|
|
21
21
|
*
|
|
22
22
|
* Served directly from the canonical `CORE_PRINCIPLES` registry (no ledger /
|
|
23
|
-
* DB read). Dispatched in server/index.ts BEFORE the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* DB read). Dispatched in server/index.ts as an exact-match BEFORE the merged
|
|
24
|
+
* `/api/principles` mount so `core` is never parsed as `/:id` — under the
|
|
25
|
+
* PRI-1139 canonical dispatch this endpoint answers on both the canonical
|
|
26
|
+
* path and the deprecated `/api/v1` alias.
|
|
26
27
|
*
|
|
27
28
|
* Owner Decision Experience v1: the canonical Owner decision read endpoints
|
|
28
29
|
* live in routes/owner-decision.ts and dispatch from handlePrinciplesRoute.
|
|
@@ -174,7 +175,7 @@ async function getDeactivatedPrincipleIds(workspaceDir) {
|
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
177
|
export async function handlePrinciplesRoute({ req, res, workspaceDir, subPath, featureFlags, now = () => new Date().toISOString(), }) {
|
|
177
|
-
// GET /api/
|
|
178
|
+
// GET /api/principles/:id/governance. Gate before constructing any
|
|
178
179
|
// Console model or projection reader so flag-off is a true no-read path.
|
|
179
180
|
const governanceMatch = /^\/([^/]+)\/governance$/.exec(subPath);
|
|
180
181
|
if (req.method === 'GET' && governanceMatch) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Receipts API routes — PRI-533.
|
|
3
|
-
* GET /api/
|
|
4
|
-
* GET /api/
|
|
3
|
+
* GET /api/receipts/counts → per-principle receipt counts
|
|
4
|
+
* GET /api/receipts/principles/:principleId → per-principle receipt history
|
|
5
5
|
*/
|
|
6
6
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
7
|
export declare function handleReceiptsRoute(req: IncomingMessage, res: ServerResponse, workspaceDir: string, subPath: string): Promise<void>;
|
|
@@ -12,7 +12,7 @@ function getModel(workspaceDir) {
|
|
|
12
12
|
/* eslint-disable @typescript-eslint/max-params */
|
|
13
13
|
export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
|
|
14
14
|
if (req.method !== 'GET') {
|
|
15
|
-
sendError(res, 405, 'method_not_allowed', 'Only GET is supported on /api/
|
|
15
|
+
sendError(res, 405, 'method_not_allowed', 'Only GET is supported on /api/receipts');
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
if (subPath === '/counts' || subPath === '/counts/') {
|
|
@@ -32,7 +32,7 @@ export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
|
|
|
32
32
|
if (subPath.startsWith('/principles/')) {
|
|
33
33
|
const rawId = subPath.slice('/principles/'.length);
|
|
34
34
|
if (rawId.length === 0 || rawId.includes('/')) {
|
|
35
|
-
sendNotFound(res, `Route /api/
|
|
35
|
+
sendNotFound(res, `Route /api/receipts${subPath} not found`);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
let principleId;
|
|
@@ -55,7 +55,7 @@ export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
|
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
// PD v2 Phase 1 (SPEC §13.8): the four audit queries.
|
|
58
|
-
// GET /api/
|
|
58
|
+
// GET /api/receipts/evidence-audit?type=principle|activation|episode|effect&id=<selector>
|
|
59
59
|
if (subPath === '/evidence-audit' || subPath === '/evidence-audit/') {
|
|
60
60
|
const url = new URL(req.url ?? '/', 'http://localhost');
|
|
61
61
|
const type = url.searchParams.get('type');
|
|
@@ -110,7 +110,7 @@ export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
|
|
|
110
110
|
}
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
sendNotFound(res, `Route /api/
|
|
113
|
+
sendNotFound(res, `Route /api/receipts${subPath} not found`);
|
|
114
114
|
}
|
|
115
115
|
export function disposeReceiptsModels() {
|
|
116
116
|
// Models hold no persistent resources (request-scoped readonly connections
|
package/console/dist/server.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { main } from './server/index.js';
|
|
2
|
+
export { main };
|
package/console/dist/server.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { main } from './server/index.js';
|
|
2
|
+
export { main };
|
|
3
|
+
// Production entry (installed as <pd-runtime>/console/dist/server.js).
|
|
4
|
+
// server/index.ts only self-starts when executed directly, so the packaged
|
|
5
|
+
// entry must start the console explicitly.
|
|
6
|
+
main().catch((err) => {
|
|
7
|
+
console.error('[pd-console] Fatal startup error:', err);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared wire-shape contract for the prompt-injection budget forecast on
|
|
3
|
-
* `/api/
|
|
3
|
+
* `/api/approvals/grouped` (PRI-908).
|
|
4
4
|
*
|
|
5
5
|
* Single source of truth for the field shape within pd-console: the server
|
|
6
6
|
* model (server/models/ApprovalsGroupedConsoleModel.ts) emits it and the UI
|