@uibot/application 0.0.0-stage → 0.2.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/dist/collection-application.d.ts +3 -0
- package/dist/collection-application.js +25 -0
- package/dist/compose-system-prompt.d.ts +104 -0
- package/dist/composition.d.ts +24 -0
- package/dist/context-service.d.ts +42 -0
- package/dist/creation-annotations.d.ts +5 -0
- package/dist/creation-assets.d.ts +15 -0
- package/dist/creation-brand-http.d.ts +9 -0
- package/dist/creation-brand.d.ts +25 -0
- package/dist/creation-copy.d.ts +11 -0
- package/dist/creation-domains.d.ts +25 -0
- package/dist/creation-facts.d.ts +8 -0
- package/dist/creation-http-helpers.d.ts +35 -0
- package/dist/creation-http.d.ts +99 -0
- package/dist/creation-layout.d.ts +4 -0
- package/dist/creation-legacy-flat-spec.d.ts +42 -0
- package/dist/creation-prompt.d.ts +33 -0
- package/dist/creation-requirements.d.ts +6 -0
- package/dist/creation-routes.d.ts +26 -0
- package/dist/creation-runner.d.ts +20 -0
- package/dist/creation-schema-ids.d.ts +6 -0
- package/dist/creation-spec-prompt.d.ts +3 -0
- package/dist/creation-store.d.ts +121 -0
- package/dist/creation-theme-http.d.ts +13 -0
- package/dist/creation-theme.d.ts +16 -0
- package/dist/creation-web-data-prompt.d.ts +15 -0
- package/dist/discovery-protocol.d.ts +25 -0
- package/dist/gap-orchestrator.d.ts +19 -0
- package/dist/grounded-brief.d.ts +37 -0
- package/dist/html-preview/config.d.ts +14 -0
- package/dist/html-preview/index.d.ts +11 -0
- package/dist/html-preview/link-interceptor.d.ts +10 -0
- package/dist/html-preview/proxy.d.ts +57 -0
- package/dist/html-preview/render.d.ts +39 -0
- package/dist/html-preview/routes.d.ts +27 -0
- package/dist/html-preview/session-store.d.ts +44 -0
- package/dist/hub-client.d.ts +25 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +819 -0
- package/dist/live-runtime-adapter.d.ts +11 -0
- package/dist/playground-session-http.d.ts +24 -0
- package/dist/prompt.d.ts +17 -0
- package/dist/resource-apply.d.ts +18 -0
- package/dist/runtime.d.ts +37 -0
- package/dist/studio-artifact-export-http.d.ts +52 -0
- package/dist/studio-compose-context.d.ts +47 -0
- package/dist/studio-compose-http.d.ts +31 -0
- package/dist/studio-design-http.d.ts +164 -0
- package/dist/studio-design-md-export-http.d.ts +11 -0
- package/dist/studio-http-shared.d.ts +34 -0
- package/dist/studio-http.d.ts +359 -0
- package/dist/studio-logo.d.ts +24 -0
- package/dist/studio-pages/agents-page.d.ts +48 -0
- package/dist/studio-pages/catalog-page.d.ts +22 -0
- package/dist/studio-pages/design-md-page.d.ts +55 -0
- package/dist/studio-pages/evolution-page.d.ts +111 -0
- package/dist/studio-pages/governance-page.d.ts +65 -0
- package/dist/studio-pages/index.d.ts +82 -0
- package/dist/studio-pages/models-page.d.ts +76 -0
- package/dist/studio-pages/operations-page.d.ts +61 -0
- package/dist/studio-pages/overview-page.d.ts +90 -0
- package/dist/studio-pages/plugins-page.d.ts +36 -0
- package/dist/studio-pages/shared.d.ts +25 -0
- package/dist/studio-pages/skills-page.d.ts +59 -0
- package/dist/studio-pages/spec-page.d.ts +33 -0
- package/dist/studio-project-design-http.d.ts +41 -0
- package/dist/studio-project-specs.d.ts +11 -0
- package/dist/studio-resource-index-http.d.ts +17 -0
- package/dist/studio-spec-recover-http.d.ts +45 -0
- package/dist/studio-spec-sync-http.d.ts +43 -0
- package/dist/studio.d.ts +64 -0
- package/dist/ui-craft-baseline.d.ts +14 -0
- package/package.json +49 -4
- package/README.md +0 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
export type StudioGovernanceRiskLevel = "low" | "medium" | "high" | "critical";
|
|
3
|
+
export interface StudioGovernancePolicyInput {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
outcome: "pass" | "warn" | "fail";
|
|
7
|
+
detail: string;
|
|
8
|
+
}
|
|
9
|
+
export interface StudioGovernanceDecisionInput {
|
|
10
|
+
id: string;
|
|
11
|
+
scope: "plugin" | "permission" | "provider" | "runtime";
|
|
12
|
+
subject: string;
|
|
13
|
+
status: "approved" | "review-required" | "rejected";
|
|
14
|
+
riskLevel: StudioGovernanceRiskLevel;
|
|
15
|
+
summary: string;
|
|
16
|
+
rationale: string;
|
|
17
|
+
}
|
|
18
|
+
/** A single permission-audit row, mirrored from `runtime.governance.permissionAudit`. */
|
|
19
|
+
export interface StudioGovernanceAuditInput {
|
|
20
|
+
resource: string;
|
|
21
|
+
decision: "granted" | "review-required" | "blocked";
|
|
22
|
+
riskLevel: "low" | "medium" | "high";
|
|
23
|
+
rationale: string;
|
|
24
|
+
requiredBy?: string[];
|
|
25
|
+
optionalBy?: string[];
|
|
26
|
+
deniedPlugins?: string[];
|
|
27
|
+
}
|
|
28
|
+
/** The `/governance` page data slice. Combines the governance summary with the
|
|
29
|
+
* runtime permission-audit + granted-permissions detail. */
|
|
30
|
+
export interface StudioGovernanceInput {
|
|
31
|
+
status: "governed" | "review-required" | "blocked";
|
|
32
|
+
riskLevel: StudioGovernanceRiskLevel;
|
|
33
|
+
summary: string;
|
|
34
|
+
totals: {
|
|
35
|
+
grantedPermissions: number;
|
|
36
|
+
deniedPermissions: number;
|
|
37
|
+
rejectedPlugins: number;
|
|
38
|
+
reviewRequired: number;
|
|
39
|
+
};
|
|
40
|
+
policies: StudioGovernancePolicyInput[];
|
|
41
|
+
decisions: StudioGovernanceDecisionInput[];
|
|
42
|
+
/** From runtime.governance.permissionAudit. */
|
|
43
|
+
permissionAudit?: StudioGovernanceAuditInput[];
|
|
44
|
+
/** From runtime.governance.grantedPermissions. */
|
|
45
|
+
grantedPermissions?: string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the `/governance` dogfood page.
|
|
49
|
+
*
|
|
50
|
+
* Blocks used:
|
|
51
|
+
* - `StatGrid` — the four governance totals (granted / denied / rejected /
|
|
52
|
+
* review-required) as KPI cards.
|
|
53
|
+
* - `BadgeGroup` — overall status + risk-level summary badges (risk → tone).
|
|
54
|
+
* - `Matrix` — decision risk heatmap (scope × riskLevel density).
|
|
55
|
+
* - `SearchableTable` — governance decisions, `_contains` search across
|
|
56
|
+
* subject/scope/status.
|
|
57
|
+
* - `SplitMasterDetail` — permission audit drill-down (resource list → decision /
|
|
58
|
+
* risk / required-by / denied-plugins / rationale), `_contains` search.
|
|
59
|
+
* - `BadgeGroup` — granted permissions chips.
|
|
60
|
+
*
|
|
61
|
+
* The decision-matrix counts, the searchable-table rows, and the master/detail
|
|
62
|
+
* selection are all pre-seeded into `__computed` server-side so the SSR first
|
|
63
|
+
* paint matches the client mount recompute (no flash).
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildGovernancePage(input: StudioGovernanceInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
import { type StudioSpecInput } from "./spec-page.js";
|
|
3
|
+
import { type StudioCatalogInput } from "./catalog-page.js";
|
|
4
|
+
import { type StudioPluginsInput } from "./plugins-page.js";
|
|
5
|
+
import { type StudioGovernanceInput } from "./governance-page.js";
|
|
6
|
+
import { type StudioOperationsInput } from "./operations-page.js";
|
|
7
|
+
import { type StudioOverviewInput } from "./overview-page.js";
|
|
8
|
+
import { type StudioModelsInput } from "./models-page.js";
|
|
9
|
+
import { type StudioAgentsInput } from "./agents-page.js";
|
|
10
|
+
import { type StudioSkillsInput } from "./skills-page.js";
|
|
11
|
+
import { type StudioDesignMdInput } from "./design-md-page.js";
|
|
12
|
+
import { type StudioEvolutionInput } from "./evolution-page.js";
|
|
13
|
+
export { buildSpecPage } from "./spec-page.js";
|
|
14
|
+
export { buildCatalogPage } from "./catalog-page.js";
|
|
15
|
+
export { buildPluginsPage } from "./plugins-page.js";
|
|
16
|
+
export { buildGovernancePage } from "./governance-page.js";
|
|
17
|
+
export { buildOperationsPage } from "./operations-page.js";
|
|
18
|
+
export { buildOverviewPage } from "./overview-page.js";
|
|
19
|
+
export { buildModelsPage } from "./models-page.js";
|
|
20
|
+
export { buildAgentsPage } from "./agents-page.js";
|
|
21
|
+
export { buildSkillsPage } from "./skills-page.js";
|
|
22
|
+
export { buildDesignMdPage } from "./design-md-page.js";
|
|
23
|
+
export { buildEvolutionPage, toProposalRow } from "./evolution-page.js";
|
|
24
|
+
export { StudioPageBuilder } from "./shared.js";
|
|
25
|
+
export type { StudioSpecInput, StudioSpecElementInput } from "./spec-page.js";
|
|
26
|
+
export type { StudioCatalogInput, StudioCatalogComponentInput } from "./catalog-page.js";
|
|
27
|
+
export type { StudioPluginsInput, StudioPluginInput, StudioPluginCapabilityInput, StudioPluginPermissionInput, } from "./plugins-page.js";
|
|
28
|
+
export type { StudioGovernanceInput, StudioGovernancePolicyInput, StudioGovernanceDecisionInput, StudioGovernanceAuditInput, StudioGovernanceRiskLevel, } from "./governance-page.js";
|
|
29
|
+
export type { StudioOperationsInput, StudioWorkflowInput, StudioOpsTaskInput, } from "./operations-page.js";
|
|
30
|
+
export type { StudioOverviewInput, StudioOverviewCheckInput, StudioOverviewDiagnosticsInput, StudioOverviewTimelineEventInput, StudioOverviewOperationsInput, } from "./overview-page.js";
|
|
31
|
+
export type { StudioModelsInput, StudioModelProviderInput, StudioModelRecordInput, } from "./models-page.js";
|
|
32
|
+
export type { StudioAgentsInput, StudioAgentInput } from "./agents-page.js";
|
|
33
|
+
export type { StudioSkillsInput, StudioSkillInput } from "./skills-page.js";
|
|
34
|
+
export type { StudioDesignMdInput, StudioDesignMdEntryInput } from "./design-md-page.js";
|
|
35
|
+
export type { StudioEvolutionInput, StudioEvolutionProposalInput, StudioEvolutionProposalRow, StudioEvolutionProposalStatus, } from "./evolution-page.js";
|
|
36
|
+
/** Route key → compiled dogfood page spec. Mirrors `UIBotStudioPagesMap`. */
|
|
37
|
+
export type StudioPagesMap = Record<string, CompiledUIBotSpec>;
|
|
38
|
+
/**
|
|
39
|
+
* Input to {@link buildStudioPages}: the snapshot slices each page builder needs.
|
|
40
|
+
* Slices are intentionally structural (not example-specific types) so any
|
|
41
|
+
* runtime snapshot whose shape matches can feed the dogfood page builders.
|
|
42
|
+
*/
|
|
43
|
+
export interface BuildStudioPagesInput {
|
|
44
|
+
/** runtime.spec — compiled element table. */
|
|
45
|
+
spec: StudioSpecInput;
|
|
46
|
+
/** runtime.catalog — component catalog rows. */
|
|
47
|
+
catalog: StudioCatalogInput;
|
|
48
|
+
/** runtime.plugins — installed plugin rows. */
|
|
49
|
+
plugins: StudioPluginsInput;
|
|
50
|
+
/** governance summary + runtime permission-audit slice. */
|
|
51
|
+
governance?: StudioGovernanceInput;
|
|
52
|
+
/** operations summary (workflows + hub tasks). */
|
|
53
|
+
operations?: StudioOperationsInput;
|
|
54
|
+
/** `/` overview aggregate (diagnostics + timeline + runtime counts). */
|
|
55
|
+
overview?: StudioOverviewInput;
|
|
56
|
+
/** `/models` provider + model inventory (snapshot.models). */
|
|
57
|
+
models?: StudioModelsInput;
|
|
58
|
+
/** `/agents` roster (snapshot.agents). */
|
|
59
|
+
agents?: StudioAgentsInput;
|
|
60
|
+
/** `/skills` catalog + scores (snapshot.skills). */
|
|
61
|
+
skills?: StudioSkillsInput;
|
|
62
|
+
/** `/design-md` token entries (snapshot.designMds). */
|
|
63
|
+
designMds?: StudioDesignMdInput;
|
|
64
|
+
/** `/evolution` proposal pre-seed (live data fetched via onMount). */
|
|
65
|
+
evolution?: StudioEvolutionInput;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Build the per-route compiled dogfood page specs for the studio snapshot (v5).
|
|
69
|
+
*
|
|
70
|
+
* Each builder produces a {@link CompiledUIBotSpec} directly (no runtime
|
|
71
|
+
* `compileSpec` pass) and injects its snapshot slice into `page.state`, so the
|
|
72
|
+
* frontend renders the page entirely from snapshot data without re-fetching.
|
|
73
|
+
* The `*.page.yaml` files under `./specs` are the source-of-truth and are
|
|
74
|
+
* compiled in tests to assert the builder output stays in sync.
|
|
75
|
+
*
|
|
76
|
+
* The five data pages whose slices are always present (`/admin/spec`, `/admin/catalog`,
|
|
77
|
+
* `/admin/plugins`) or conditionally present (`/admin/governance`, `/admin/operations`) are joined
|
|
78
|
+
* here; the remaining six pages (`/admin`, `/admin/models`, `/admin/agents`, `/admin/skills`,
|
|
79
|
+
* `/admin/design-md`, `/admin/evolution`) are emitted whenever their optional slice is
|
|
80
|
+
* supplied, so a v4-shaped service that omits them stays backward compatible.
|
|
81
|
+
*/
|
|
82
|
+
export declare function buildStudioPages(input: BuildStudioPagesInput): StudioPagesMap;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
/**
|
|
3
|
+
* A provider row in the `/models` snapshot slice. Mirrors the studio-side
|
|
4
|
+
* `ModelSnapshotProvider` shape (apps/studio/src/features/models/model-config.ts)
|
|
5
|
+
* but is redeclared here so the application layer never imports studio code.
|
|
6
|
+
*/
|
|
7
|
+
export interface StudioModelProviderInput {
|
|
8
|
+
provider: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
apiStyle: string;
|
|
11
|
+
baseUrl?: string | null;
|
|
12
|
+
defaultModel: string | null;
|
|
13
|
+
modelCount?: number;
|
|
14
|
+
env?: string[];
|
|
15
|
+
npm?: string | null;
|
|
16
|
+
doc?: string | null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A model row in the `/models` snapshot slice. Mirrors the studio-side
|
|
20
|
+
* `ModelSnapshotRecord` shape.
|
|
21
|
+
*/
|
|
22
|
+
export interface StudioModelRecordInput {
|
|
23
|
+
id: string;
|
|
24
|
+
provider: string;
|
|
25
|
+
label?: string | null;
|
|
26
|
+
family?: string | null;
|
|
27
|
+
contextWindow?: number | null;
|
|
28
|
+
maxOutputTokens?: number | null;
|
|
29
|
+
apiStyle?: string | null;
|
|
30
|
+
reasoning?: boolean;
|
|
31
|
+
toolCall?: boolean;
|
|
32
|
+
structuredOutput?: boolean;
|
|
33
|
+
inputModalities?: string[];
|
|
34
|
+
outputModalities?: string[];
|
|
35
|
+
inputCost?: number | null;
|
|
36
|
+
outputCost?: number | null;
|
|
37
|
+
status?: string | null;
|
|
38
|
+
releaseDate?: string | null;
|
|
39
|
+
lastUpdated?: string | null;
|
|
40
|
+
}
|
|
41
|
+
/** The `/models` page data slice (snapshot.models). */
|
|
42
|
+
export interface StudioModelsInput {
|
|
43
|
+
providers: StudioModelProviderInput[];
|
|
44
|
+
models: StudioModelRecordInput[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Build the `/models` dogfood page.
|
|
48
|
+
*
|
|
49
|
+
* Blocks used:
|
|
50
|
+
* - `StatGrid` — KPI cards: total providers, total models, providers with a
|
|
51
|
+
* default model, models flagged reasoning-capable.
|
|
52
|
+
* - `SearchableTable` — model inventory with `_contains` search across
|
|
53
|
+
* provider/model id/family (multi-field `_or`). Drives the master/detail
|
|
54
|
+
* selection via the same row id (`provider:model`).
|
|
55
|
+
* - `SplitMasterDetail` — model drill-down: master list of `provider:model`,
|
|
56
|
+
* detail `KeyValueGrid` (provider / family / context / output / api style /
|
|
57
|
+
* capabilities / status) plus a capability `BadgeGroup`.
|
|
58
|
+
*
|
|
59
|
+
* The filtered table rows and the master/detail selection are pre-seeded into
|
|
60
|
+
* `__computed` server-side so the SSR first paint matches the client mount
|
|
61
|
+
* recompute (empty search ⇒ all rows; `selectedModel` ⇒ first row).
|
|
62
|
+
*
|
|
63
|
+
* EXPRESSIVENESS GAP / NOT MIGRATED (kept in the legacy ModelManagementPanel):
|
|
64
|
+
* - All **write** operations — add/edit/delete provider & model (ProviderDialog,
|
|
65
|
+
* ModelDialog), enable/disable toggles (Checkbox → saveModelConfig), set/unset
|
|
66
|
+
* default model (Star), import models.dev catalog, reset local config. These
|
|
67
|
+
* round-trip to `/api/...` model-config endpoints with optimistic local state
|
|
68
|
+
* and `window.confirm` dialogs — not expressible as declarative computed/events.
|
|
69
|
+
* - The provider env-readiness badges (configured / missing secret env) sourced
|
|
70
|
+
* from a separate `fetchModelConfig().envStatus` call, and the catalog/gateway
|
|
71
|
+
* option cards. These rely on snapshot-external async config state.
|
|
72
|
+
* This page migrates the **display** surface (inventory + per-model detail +
|
|
73
|
+
* KPI stats) only; the legacy panel remains reachable as the fallback for the
|
|
74
|
+
* full editing workflow.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildModelsPage(input: StudioModelsInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
export interface StudioWorkflowInput {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
status: "ready" | "active" | "attention";
|
|
6
|
+
protocols: string[];
|
|
7
|
+
taskCount: number;
|
|
8
|
+
activeTasks: number;
|
|
9
|
+
completedTasks: number;
|
|
10
|
+
failedTasks: number;
|
|
11
|
+
summary: string;
|
|
12
|
+
}
|
|
13
|
+
export interface StudioOpsTaskInput {
|
|
14
|
+
taskId: string;
|
|
15
|
+
workflowId: string;
|
|
16
|
+
requestedComponent: string;
|
|
17
|
+
requestedBy: string | null;
|
|
18
|
+
priority: "low" | "normal" | "high" | null;
|
|
19
|
+
status: "pending" | "running" | "ready" | "failed";
|
|
20
|
+
progress: number | null;
|
|
21
|
+
artifactName: string | null;
|
|
22
|
+
error: string | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}
|
|
26
|
+
/** The `/operations` page data slice (snapshot.operations). */
|
|
27
|
+
export interface StudioOperationsInput {
|
|
28
|
+
status: "ready" | "active" | "attention";
|
|
29
|
+
summary: string;
|
|
30
|
+
totals: {
|
|
31
|
+
workflows: number;
|
|
32
|
+
tasks: number;
|
|
33
|
+
running: number;
|
|
34
|
+
failed: number;
|
|
35
|
+
ready: number;
|
|
36
|
+
};
|
|
37
|
+
workflows: StudioWorkflowInput[];
|
|
38
|
+
tasks: StudioOpsTaskInput[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Build the `/operations` dogfood page.
|
|
42
|
+
*
|
|
43
|
+
* Blocks used:
|
|
44
|
+
* - `BadgeGroup` — overall ops status badge.
|
|
45
|
+
* - `StatGrid` — running / failed / ready counts as compact KPI cards.
|
|
46
|
+
* - `KanbanBoard` — workflows grouped into Ready / Active / Attention columns;
|
|
47
|
+
* each workflow becomes a card (title = label, subtitle = summary, badge =
|
|
48
|
+
* task count).
|
|
49
|
+
* - `DiagnosticsList` — failed tasks before the catalog; no fabricated retry.
|
|
50
|
+
* - `SearchableTable` — hub tasks, `_contains` search across
|
|
51
|
+
* requestedComponent / workflowId / status.
|
|
52
|
+
* - `SplitMasterDetail` — task drill-down (status / priority / progress /
|
|
53
|
+
* requested-by / artifact / error) replacing the legacy click-drawer.
|
|
54
|
+
* - `TimelineList` — recent task activity timeline (by updatedAt), status dot
|
|
55
|
+
* per task.
|
|
56
|
+
*
|
|
57
|
+
* The kanban cards, the searchable-table rows, and the task master/detail
|
|
58
|
+
* selection are pre-seeded into `__computed` server-side so the SSR first paint
|
|
59
|
+
* matches the client mount recompute.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildOperationsPage(input: StudioOperationsInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
/** A single diagnostics check, mirrored from `diagnostics.checks`. */
|
|
3
|
+
export interface StudioOverviewCheckInput {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
status: "pass" | "warn" | "fail";
|
|
7
|
+
detail: string;
|
|
8
|
+
metric?: string;
|
|
9
|
+
}
|
|
10
|
+
/** The diagnostics slice (snapshot.diagnostics), used for the health header,
|
|
11
|
+
* the diagnostics checks list, and the artifact/model counts. */
|
|
12
|
+
export interface StudioOverviewDiagnosticsInput {
|
|
13
|
+
status: "healthy" | "attention" | "blocked";
|
|
14
|
+
score: number;
|
|
15
|
+
summary: string;
|
|
16
|
+
totals: {
|
|
17
|
+
pluginsReady: number;
|
|
18
|
+
pluginCount: number;
|
|
19
|
+
warnings: number;
|
|
20
|
+
gaps: number;
|
|
21
|
+
artifacts: number;
|
|
22
|
+
models: number;
|
|
23
|
+
};
|
|
24
|
+
checks: StudioOverviewCheckInput[];
|
|
25
|
+
}
|
|
26
|
+
/** A single timeline event (snapshot.timeline), newest-first after sorting. */
|
|
27
|
+
export interface StudioOverviewTimelineEventInput {
|
|
28
|
+
id: string;
|
|
29
|
+
lane: "plugin" | "compile" | "artifact" | "render" | "model" | "service";
|
|
30
|
+
title: string;
|
|
31
|
+
detail: string;
|
|
32
|
+
status: "completed" | "active" | "attention";
|
|
33
|
+
at: string;
|
|
34
|
+
}
|
|
35
|
+
/** The operations summary slice (snapshot.operations) — surfaced as a compact
|
|
36
|
+
* totals strip on the overview. May be null when no hub is wired. */
|
|
37
|
+
export interface StudioOverviewOperationsInput {
|
|
38
|
+
status: "ready" | "active" | "attention";
|
|
39
|
+
summary: string;
|
|
40
|
+
totals: {
|
|
41
|
+
workflows: number;
|
|
42
|
+
tasks: number;
|
|
43
|
+
running: number;
|
|
44
|
+
failed: number;
|
|
45
|
+
ready: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The `/` (overview) page data slice. Aggregates the diagnostics health header,
|
|
50
|
+
* the four architecture stat cards (plugins / capability groups / catalog
|
|
51
|
+
* components / installed artifacts), the diagnostics checks list, the operations
|
|
52
|
+
* totals strip, and the most-recent timeline events.
|
|
53
|
+
*
|
|
54
|
+
* `pluginCount` and `artifactCount` come from `diagnostics.totals`; the catalog
|
|
55
|
+
* and capability-group counts are runtime architecture counts the integration
|
|
56
|
+
* step sources from `snapshot.runtime`.
|
|
57
|
+
*/
|
|
58
|
+
export interface StudioOverviewInput {
|
|
59
|
+
diagnostics: StudioOverviewDiagnosticsInput | null;
|
|
60
|
+
timeline: StudioOverviewTimelineEventInput[];
|
|
61
|
+
operations: StudioOverviewOperationsInput | null;
|
|
62
|
+
/** Runtime architecture counts (from snapshot.runtime). */
|
|
63
|
+
counts: {
|
|
64
|
+
plugins: number;
|
|
65
|
+
capabilityGroups: number;
|
|
66
|
+
catalogComponents: number;
|
|
67
|
+
installedArtifacts: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Build the `/` (overview) dogfood page.
|
|
72
|
+
*
|
|
73
|
+
* Blocks used:
|
|
74
|
+
* - `BadgeGroup` — overall health status badge (status → tone) next to the score.
|
|
75
|
+
* - `StatGrid` — four architecture KPI cards (plugins / capability groups /
|
|
76
|
+
* catalog components / installed artifacts).
|
|
77
|
+
* - `DiagnosticsList` — the diagnostics checks rendered as a levelled list
|
|
78
|
+
* (pass→info / warn→warn / fail→error); the per-check `metric` is folded into
|
|
79
|
+
* the detail line.
|
|
80
|
+
* - `StatGrid` (compact) — the five operations totals (workflows / tasks /
|
|
81
|
+
* running / failed / ready) as a secondary KPI strip, when operations present.
|
|
82
|
+
* - `TimelineList` — the most-recent timeline events (newest-first, ≤8),
|
|
83
|
+
* status dot per event.
|
|
84
|
+
*
|
|
85
|
+
* The page is purely snapshot-derived; everything is pre-computed in the builder
|
|
86
|
+
* and seeded into `state` so the SSR first paint matches the client mount. There
|
|
87
|
+
* are no query-aware `computed` filters and no `__computed` pre-seed needed — the
|
|
88
|
+
* overview has no client-side search/selection interactions.
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildOverviewPage(input: StudioOverviewInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
export interface StudioPluginCapabilityInput {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface StudioPluginPermissionInput {
|
|
8
|
+
resource: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** A single plugin row, as exposed by the runtime snapshot. */
|
|
13
|
+
export interface StudioPluginInput {
|
|
14
|
+
pluginId: string;
|
|
15
|
+
displayName?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
status?: string;
|
|
19
|
+
reasons?: string[];
|
|
20
|
+
declaredCapabilities?: StudioPluginCapabilityInput[];
|
|
21
|
+
registeredCapabilities?: StudioPluginCapabilityInput[];
|
|
22
|
+
permissions?: StudioPluginPermissionInput[];
|
|
23
|
+
}
|
|
24
|
+
/** The `/plugins` page data slice (runtime.plugins). */
|
|
25
|
+
export type StudioPluginsInput = StudioPluginInput[];
|
|
26
|
+
/**
|
|
27
|
+
* Build the `/plugins` dogfood page: a searchable plugin table on top and a
|
|
28
|
+
* master/detail split (plugin list → status, capability diff matrix, and
|
|
29
|
+
* permission rows) below.
|
|
30
|
+
*
|
|
31
|
+
* `computed.filtered` is a query-aware `_filter` over the plugins; `selected`
|
|
32
|
+
* is a `_find` by pluginId. The capability/permission rows are pre-joined at
|
|
33
|
+
* build time and carried on each plugin record so the detail tables can read
|
|
34
|
+
* them via `__computed.selected.capabilityRows` / `.permissionRows`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildPluginsPage(plugins: StudioPluginsInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CompiledBlock, CompiledUIBotSpec, CompiledPage } from "@uibot/contracts";
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight builder for a single-page {@link CompiledUIBotSpec}.
|
|
4
|
+
*
|
|
5
|
+
* `buildStudioPages` produces compiled specs directly (no runtime `compileSpec`
|
|
6
|
+
* pass) so the snapshot hot path stays cheap and the application layer never
|
|
7
|
+
* depends on the block catalog packages. The corresponding `*.page.yaml` files
|
|
8
|
+
* are the human-readable source-of-truth and are compiled in tests to assert
|
|
9
|
+
* the builder output stays in sync.
|
|
10
|
+
*/
|
|
11
|
+
export declare class StudioPageBuilder {
|
|
12
|
+
private readonly pageId;
|
|
13
|
+
private readonly path;
|
|
14
|
+
private readonly options;
|
|
15
|
+
private readonly blocks;
|
|
16
|
+
constructor(pageId: string, path: string, options?: {
|
|
17
|
+
title?: string;
|
|
18
|
+
state?: Record<string, unknown>;
|
|
19
|
+
computed?: CompiledPage["computed"];
|
|
20
|
+
lifecycle?: CompiledPage["lifecycle"];
|
|
21
|
+
});
|
|
22
|
+
/** Register a block by id. Returns the id for convenient nesting. */
|
|
23
|
+
block(id: string, block: Omit<CompiledBlock, "id" | "pageId">): string;
|
|
24
|
+
build(rootBlockIds: string[]): CompiledUIBotSpec;
|
|
25
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
/**
|
|
3
|
+
* A single skill row, mirrored from `snapshot.skills.skills[]`
|
|
4
|
+
* ({@link UIBotStudioSkillEntry} in `studio.ts`). Kept structural (not a type
|
|
5
|
+
* import) so this page stays decoupled from the snapshot module and the
|
|
6
|
+
* integration step can wire it without a circular dependency.
|
|
7
|
+
*/
|
|
8
|
+
export interface StudioSkillInput {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
version: string;
|
|
12
|
+
triggers: string[];
|
|
13
|
+
tags: string[];
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
lastInvocation?: string;
|
|
16
|
+
/** Bayesian-smoothed score (0–1) when available. */
|
|
17
|
+
avgScore?: number;
|
|
18
|
+
/** Last ≤30 invocation scores (1 = success, 0 = failure), oldest first. */
|
|
19
|
+
recentSignals?: number[];
|
|
20
|
+
}
|
|
21
|
+
/** The `/skills` page data slice — the `snapshot.skills` summary. */
|
|
22
|
+
export interface StudioSkillsInput {
|
|
23
|
+
totals: {
|
|
24
|
+
total: number;
|
|
25
|
+
enabled: number;
|
|
26
|
+
};
|
|
27
|
+
skills: StudioSkillInput[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build the `/skills` dogfood page.
|
|
31
|
+
*
|
|
32
|
+
* Blocks used:
|
|
33
|
+
* - `StatGrid` — Total / Enabled / Scored / Avg-score KPI cards.
|
|
34
|
+
* - `BadgeGroup` — enabled-vs-disabled summary chips (tone from status).
|
|
35
|
+
* - `TrendChart` — avg-score histogram across five score bands (the legacy
|
|
36
|
+
* `SkillScoreBreakdown` distribution, expressed as a single series).
|
|
37
|
+
* - `SearchableTable` — skill catalog, `_contains` search across
|
|
38
|
+
* title / id / triggers / tags (all flattened to strings server-side).
|
|
39
|
+
* - `SplitMasterDetail` — selected-skill drill-down (id / version / status /
|
|
40
|
+
* triggers / tags / avg-score / last-invocation), `_contains` search.
|
|
41
|
+
* - `BadgeGroup` — selected skill's trigger + tag chips.
|
|
42
|
+
* - `KeyValueGrid` — selected skill's metadata.
|
|
43
|
+
*
|
|
44
|
+
* The searchable-table rows, the master/detail selection, and the score
|
|
45
|
+
* histogram are all pre-seeded into `__computed`/state server-side so the SSR
|
|
46
|
+
* first paint matches the client mount recompute (no flash). Empty search ⇒
|
|
47
|
+
* `_contains` passes everything; `selected` is the first row (matches `_find`).
|
|
48
|
+
*
|
|
49
|
+
* EXPRESSIVENESS GAP (kept as legacy, NOT spec-ified here):
|
|
50
|
+
* the legacy page lazily fetches per-skill `detail` / `reflections` /
|
|
51
|
+
* `regressions` from `/api/studio/skills/{id}/{reflections|regressions}` on row
|
|
52
|
+
* selection. Those are snapshot-external HTTP reads that need a `connection:driver`
|
|
53
|
+
* wired into the runtime; a `lifecycle.onMount`/`Request` action here would need a
|
|
54
|
+
* registered connectionId + a way to thread the *selected* id into the request,
|
|
55
|
+
* neither of which exists in the spec-driven shell yet. So the histogram +
|
|
56
|
+
* snapshot-resident `recentSignals` sparkline data are surfaced, but the
|
|
57
|
+
* on-demand reflections/regressions drawer stays in the legacy fallback.
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildSkillsPage(input: StudioSkillsInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CompiledUIBotSpec } from "@uibot/contracts";
|
|
2
|
+
/** A single compiled-spec element row, as exposed by the runtime snapshot. */
|
|
3
|
+
export interface StudioSpecElementInput {
|
|
4
|
+
id: string;
|
|
5
|
+
type: string;
|
|
6
|
+
childIds?: string[];
|
|
7
|
+
propKeys?: string[];
|
|
8
|
+
props?: Array<{
|
|
9
|
+
name: string;
|
|
10
|
+
preview: string;
|
|
11
|
+
}>;
|
|
12
|
+
eventNames?: string[];
|
|
13
|
+
visible?: string | null;
|
|
14
|
+
template?: string | null;
|
|
15
|
+
variant?: string | null;
|
|
16
|
+
}
|
|
17
|
+
/** The `/spec` page data slice (runtime.spec). */
|
|
18
|
+
export interface StudioSpecInput {
|
|
19
|
+
version?: string;
|
|
20
|
+
root?: string;
|
|
21
|
+
stateKeys?: string[];
|
|
22
|
+
elements: StudioSpecElementInput[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build the `/spec` dogfood page: a searchable element table on top and a
|
|
26
|
+
* master/detail split (element list → props + events) below.
|
|
27
|
+
*
|
|
28
|
+
* Search/select are driven by reactive page state: `search` (the SearchableTable
|
|
29
|
+
* query) and `selectedId` (the SplitMasterDetail selection). The page-level
|
|
30
|
+
* `computed.filtered` is a real `_filter` expression (query-aware) and
|
|
31
|
+
* `computed.selected` is a `_find` over the elements by id.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildSpecPage(spec: StudioSpecInput): CompiledUIBotSpec;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DesignMd } from "@uibot/contracts";
|
|
2
|
+
export declare const STUDIO_PROJECT_SCHEMA: "uibot.studio.project.v1";
|
|
3
|
+
export declare const STUDIO_PROJECT_DEFAULT_PATH = "/api/studio/project-design";
|
|
4
|
+
export declare const STUDIO_PROJECT_STORE_REL: string;
|
|
5
|
+
export interface StudioProjectSpecSummary {
|
|
6
|
+
rel: string;
|
|
7
|
+
pageId: string;
|
|
8
|
+
path: string;
|
|
9
|
+
title: string;
|
|
10
|
+
}
|
|
11
|
+
export interface StudioProjectDesignStatus {
|
|
12
|
+
schema: typeof STUDIO_PROJECT_SCHEMA;
|
|
13
|
+
projectRoot: string | null;
|
|
14
|
+
designMdPath: string | null;
|
|
15
|
+
consumed: boolean;
|
|
16
|
+
specs: StudioProjectSpecSummary[];
|
|
17
|
+
}
|
|
18
|
+
export interface StudioProjectDesignStore {
|
|
19
|
+
schema: typeof STUDIO_PROJECT_SCHEMA;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CreateUIBotStudioProjectDesignHandlerOptions {
|
|
23
|
+
cwd: string;
|
|
24
|
+
apply: (projectRoot: string | null) => {
|
|
25
|
+
designMdPath: string | null;
|
|
26
|
+
};
|
|
27
|
+
path?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function studioProjectStorePath(cwd: string): string;
|
|
30
|
+
export declare function readStudioProjectRoot(cwd: string): string | undefined;
|
|
31
|
+
export declare function writeStudioProjectRoot(cwd: string, projectRoot: string): string;
|
|
32
|
+
export declare function assertProjectDesignRoot(raw: string): string;
|
|
33
|
+
export declare function createUIBotStudioProjectDesignHandler(options: CreateUIBotStudioProjectDesignHandlerOptions): (request: Request) => Promise<Response>;
|
|
34
|
+
export declare function applyProjectDesignToRegistry(registry: {
|
|
35
|
+
add: (entry: DesignMd, options?: {
|
|
36
|
+
layer?: "user";
|
|
37
|
+
}) => void;
|
|
38
|
+
remove?: (id: string) => boolean;
|
|
39
|
+
}, projectRoot: string | null): {
|
|
40
|
+
designMdPath: string | null;
|
|
41
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ProjectSpecPage {
|
|
2
|
+
rel: string;
|
|
3
|
+
pageId: string;
|
|
4
|
+
path: string;
|
|
5
|
+
title: string;
|
|
6
|
+
yaml: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function listProjectUibotSpecs(projectRoot: string): ProjectSpecPage[];
|
|
9
|
+
export declare function formatConsumerSpecsPrompt(specs: Array<Omit<ProjectSpecPage, "yaml"> & {
|
|
10
|
+
yaml?: string;
|
|
11
|
+
}>): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ResourceQueryService } from "@uibot/registry";
|
|
2
|
+
export declare const RESOURCE_HTTP_ERROR_CODES: readonly ["resource-http-invalid-argument", "resource-http-route-not-found", "resource-query-failed", "resource-apply-gaps", "resource-apply-no-template", "resource-apply-ambiguous-template", "resource-apply-missing-yaml", "resource-apply-invalid-spec"];
|
|
3
|
+
export interface CreateUIBotStudioResourceIndexHttpHandlerOptions {
|
|
4
|
+
resourceQuery: ResourceQueryService;
|
|
5
|
+
/** Base path. Defaults to `/api/studio/resources`. */
|
|
6
|
+
basePath?: string;
|
|
7
|
+
/** Optional space-separated CORS allowlist for a separately hosted Studio. */
|
|
8
|
+
studioOrigin?: string;
|
|
9
|
+
/** YAML for `template:<name>` ids. Required for POST /apply. */
|
|
10
|
+
templateYamlById?: Readonly<Record<string, string>>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Canonical HTTP adapter over ResourceQueryService. It only validates transport
|
|
14
|
+
* arguments and maps results; ranking, aliases, dependency planning and query
|
|
15
|
+
* error codes remain owned by @uibot/registry.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createUIBotStudioResourceIndexHttpHandler(options: CreateUIBotStudioResourceIndexHttpHandlerOptions): (request: Request) => Promise<Response | null>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Catalog, ComponentArtifact, CompileResult, GapReport, UIBotSpec } from "@uibot/contracts";
|
|
2
|
+
import type { ResourceQueryService } from "@uibot/registry";
|
|
3
|
+
import { type GapResolutionInstallResult } from "./gap-orchestrator.js";
|
|
4
|
+
import { type UIBotHubClient } from "./hub-client.js";
|
|
5
|
+
export declare const SPEC_RECOVER_MODES: readonly ["diagnose", "suggest", "hub-install"];
|
|
6
|
+
export type SpecRecoverMode = (typeof SPEC_RECOVER_MODES)[number];
|
|
7
|
+
export interface SpecGapCandidate {
|
|
8
|
+
id: string;
|
|
9
|
+
kind: string;
|
|
10
|
+
title: string;
|
|
11
|
+
score: number;
|
|
12
|
+
reasons: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface SpecRecoverResult {
|
|
15
|
+
mode: SpecRecoverMode;
|
|
16
|
+
gaps: GapReport[];
|
|
17
|
+
remainingGaps: GapReport[];
|
|
18
|
+
warnings: CompileResult["warnings"];
|
|
19
|
+
candidatesByMissingType: Record<string, SpecGapCandidate[]>;
|
|
20
|
+
installedArtifacts: GapResolutionInstallResult["artifactLock"][];
|
|
21
|
+
unresolvedGaps: Array<GapReport & {
|
|
22
|
+
error: string;
|
|
23
|
+
}>;
|
|
24
|
+
ok: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateUIBotStudioSpecRecoverHandlerOptions {
|
|
27
|
+
catalog: Catalog;
|
|
28
|
+
compile: (spec: UIBotSpec, catalog: Catalog) => Promise<CompileResult> | CompileResult;
|
|
29
|
+
resourceQuery?: ResourceQueryService;
|
|
30
|
+
hubClient?: UIBotHubClient;
|
|
31
|
+
installArtifact?: (artifact: ComponentArtifact) => Promise<GapResolutionInstallResult>;
|
|
32
|
+
path?: string;
|
|
33
|
+
/** Max ResourceQuery hits per missing type (default 5). */
|
|
34
|
+
suggestLimit?: number;
|
|
35
|
+
maxRecoveryIterations?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Studio HTTP adapter for compile-gap diagnose / resource suggest / hub-install recover.
|
|
39
|
+
*
|
|
40
|
+
* Modes:
|
|
41
|
+
* - `diagnose` — compile only; never writes disk
|
|
42
|
+
* - `suggest` — diagnose + ResourceQuery candidates per missing type
|
|
43
|
+
* - `hub-install` — `compileWithGapRecovery` via Hub + installer (requires DI)
|
|
44
|
+
*/
|
|
45
|
+
export declare function createUIBotStudioSpecRecoverHandler(options: CreateUIBotStudioSpecRecoverHandlerOptions): (request: Request) => Promise<Response>;
|