feat(web): W4-A wire console to real endpoints
- Agent page uses contracts (AgentRun/AgentRunDetail/AgentGoalReport) instead of a local mirror; ?mock=1 stays as an explicit demo switch; run snapshot refreshes on agent.run_status; stream auto-follow only while the user stays near the bottom (abort stays reachable) - settings: Pi provider select incl. fake, new Agent runtime card (budgets, fakeScript) - download trace uses /tasks?subjectId= and /organization-records?downloadTaskId= instead of time-window engine run matching and path matching; new business-task tab with cancel/retry - workbench download dialog posts /acquisition-plans and shows per-slot rejection reasons - preference tag revision history; subscription search by title/kind; identity/alias/subscription lists show entity titles; slot cards show current asset summary; policy preview sample titles - DecisionSummary / IdentityRevisionList / ReleaseIdentityResult / TaskAccepted / PolicyPreviewSummary / OrganizePlanArtifactContent taken from contracts - docs: SSE for console (cookie) vs GET /events?after=&limit= JSON replay for API keys Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
34e8751b45
commit
1023642ef9
30 files changed
+703
-271
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import {
|
||||
cursorPage,
|
||||
PolicyPreviewSummary,
|
||||
PolicyRevision,
|
||||
type PolicyRevisionCreate,
|
||||
type PolicyRevisionUpdate,
|
||||
type PolicyStatus,
|
||||
} from "@umt/contracts";
|
||||
import { z } from "zod";
|
||||
import { api } from "~/lib/api.ts";
|
||||
import { getParsed, parseOrThrow } from "./library.ts";
|
||||
|
||||
@@ -28,17 +28,9 @@ export function usePolicyRevisions(filters: PolicyFilters = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 预览结果(服务端 previewPolicy 的形状;contracts 里是 JsonObject) */
|
||||
export const PolicyPreview = z.object({
|
||||
evaluatedAt: z.string(),
|
||||
sampleSize: z.number(),
|
||||
templates: z.number(),
|
||||
matched: z.number(),
|
||||
excluded: z.number(),
|
||||
samples: z.array(z.object({ sourceReleaseId: z.string(), template: z.string(), decision: z.string() })),
|
||||
valid: z.boolean(),
|
||||
});
|
||||
export type PolicyPreview = z.infer<typeof PolicyPreview>;
|
||||
/** 预览结果(合同 PolicyPreviewSummary;存在 policy_revision.preview) */
|
||||
export const PolicyPreview = PolicyPreviewSummary;
|
||||
export type PolicyPreview = PolicyPreviewSummary;
|
||||
|
||||
const parse = (d: unknown) => parseOrThrow(PolicyRevision, d, "/policy-revisions");
|
||||
|
||||
|
||||
Reference in new issue
Block a user