@contractspec/lib.surface-runtime 0.5.5 → 0.5.7
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/README.md +66 -152
- package/dist/adapters/dnd-kit-adapter.d.ts +0 -4
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/index.js +1 -1
- package/dist/browser/adapters/index.js +1 -1
- package/dist/browser/evals/golden-harness.js +1 -1
- package/dist/browser/i18n/catalogs/index.js +1 -1
- package/dist/browser/i18n/index.js +4 -4
- package/dist/browser/i18n/messages.js +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/browser/react/BundleRenderer.js +3 -3
- package/dist/browser/react/index.js +4 -4
- package/dist/browser/runtime/index.js +42 -42
- package/dist/browser/runtime/resolve-bundle.js +2 -2
- package/dist/browser/spec/index.js +5 -5
- package/dist/browser/telemetry/index.js +3 -3
- package/dist/evals/golden-harness.d.ts +1 -2
- package/dist/evals/golden-harness.js +1 -1
- package/dist/i18n/catalogs/index.d.ts +1 -1
- package/dist/i18n/catalogs/index.js +1 -1
- package/dist/i18n/index.d.ts +4 -4
- package/dist/i18n/index.js +4 -4
- package/dist/i18n/messages.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/node/adapters/index.js +1 -1
- package/dist/node/evals/golden-harness.js +1 -1
- package/dist/node/i18n/catalogs/index.js +1 -1
- package/dist/node/i18n/index.js +4 -4
- package/dist/node/i18n/messages.js +1 -1
- package/dist/node/index.js +3 -3
- package/dist/node/react/BundleRenderer.js +3 -3
- package/dist/node/react/index.js +4 -4
- package/dist/node/runtime/index.js +42 -42
- package/dist/node/runtime/resolve-bundle.js +2 -2
- package/dist/node/spec/index.js +5 -5
- package/dist/node/telemetry/index.js +3 -3
- package/dist/react/BundleRenderer.js +3 -3
- package/dist/react/RegionRenderer.d.ts +1 -1
- package/dist/react/SlotRenderer.d.ts +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +4 -4
- package/dist/runtime/apply-surface-patch.d.ts +1 -1
- package/dist/runtime/build-context.d.ts +1 -1
- package/dist/runtime/extension-registry.d.ts +2 -3
- package/dist/runtime/index.d.ts +13 -13
- package/dist/runtime/index.js +42 -42
- package/dist/runtime/overlay-alignment.d.ts +2 -2
- package/dist/runtime/planner-prompt.d.ts +1 -2
- package/dist/runtime/policy-eval.d.ts +2 -2
- package/dist/runtime/resolve-bundle.d.ts +1 -1
- package/dist/runtime/resolve-bundle.js +2 -2
- package/dist/runtime/rollback.d.ts +1 -1
- package/dist/spec/index.d.ts +3 -3
- package/dist/spec/index.js +5 -5
- package/dist/spec/validate-surface-patch.d.ts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +3 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,164 +1,78 @@
|
|
|
1
1
|
# @contractspec/lib.surface-runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Surface runtime for AI-native ContractSpec experiences, including bundle specs, planners, overlays, patching, and React rendering support.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## What It Provides
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- **defaultPreferenceAdapter** — Stub `BundlePreferenceAdapter` (resolve + savePreferencePatch)
|
|
14
|
-
- **applySurfacePatch** — Applies patch operations to a plan
|
|
15
|
-
- **BundleProvider** / **BundleRenderer** — React components for rendering resolved plans
|
|
16
|
-
- **RegionRenderer** / **SlotRenderer** — Layout tree and slot content rendering
|
|
17
|
-
- **Adapters** — BlockNote, dnd-kit, Floating UI, Motion, resizable-panels, AI SDK (stubs)
|
|
9
|
+
- Provides the runtime layer behind AI-planned surfaces, widget registries, overrides, and bundle resolution.
|
|
10
|
+
- Supports React rendering, adapter boundaries, telemetry, evaluation harnesses, and planner tooling.
|
|
11
|
+
- Recently expanded to better align with AI chat, i18n, workflow tools, and bundle export needs.
|
|
12
|
+
- `src/adapters/` contains runtime, provider, or environment-specific adapters.
|
|
18
13
|
|
|
19
|
-
##
|
|
14
|
+
## Installation
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
- **Bundle** (architectural): A domain package in `packages/bundles/` (e.g. bundle.workspace). Contains business logic.
|
|
16
|
+
`npm install @contractspec/lib.surface-runtime`
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
or
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|---------|---------|---------|
|
|
28
|
-
| **Preference** | Stable user intent (e.g. `density=dense`, `guidance=hints`). Orthogonal 7-dimension model. | User/workspace/surface scope via `BundlePreferenceAdapter`. |
|
|
29
|
-
| **Layout snapshot** | Concrete arrangement (panel sizes, tab order, collapsed state). | Distinct from preferences; use `persistKey` + overlay-engine for durable layout. |
|
|
30
|
-
| **View** | Data-shaping projection (filters, sort, visible columns). | Often session-scoped or view-state. |
|
|
31
|
-
| **Overlay** | Durable mutation to the rendered contract (patches, field visibility). | `lib.overlay-engine` (OverlaySpec, merger). |
|
|
32
|
-
|
|
33
|
-
Do not merge these into one blob. Preferences drive adaptation; layout snapshots persist geometry; overlays persist structural patches.
|
|
34
|
-
|
|
35
|
-
### Preference scope resolution order
|
|
36
|
-
|
|
37
|
-
Preferences are merged in this order (later overrides earlier):
|
|
38
|
-
|
|
39
|
-
1. **user** — Global user defaults
|
|
40
|
-
2. **workspace-user** — Workspace-specific user defaults
|
|
41
|
-
3. **bundle** — Bundle-level defaults
|
|
42
|
-
4. **surface** — Surface-specific overrides
|
|
43
|
-
5. **entity** — Entity-context overrides
|
|
44
|
-
6. **session** — Session overrides (highest priority)
|
|
45
|
-
|
|
46
|
-
### Dimension → runtime behavior (summary)
|
|
47
|
-
|
|
48
|
-
| Dimension | Runtime effect |
|
|
49
|
-
|-----------|----------------|
|
|
50
|
-
| **guidance** | Hints, onboarding, progressive disclosure, assistant prompting style |
|
|
51
|
-
| **density** | Spacing, panel expansion, table vs card layout, side rails |
|
|
52
|
-
| **dataDepth** | Query shape, pagination size, inline expansion, raw payload access |
|
|
53
|
-
| **control** | Visible toggles, advanced inspectors, batch ops, policy editor |
|
|
54
|
-
| **media** | Text vs visual vs voice surfaces, charts vs prose, TTS |
|
|
55
|
-
| **pace** | Animation duration, confirmation depth, skeleton persistence; respects `prefers-reduced-motion` |
|
|
56
|
-
| **narrative** | Order of summary vs evidence, top-down vs bottom-up presentation |
|
|
57
|
-
|
|
58
|
-
Every surface must declare `verification.dimensions` describing how it responds to each dimension. See [docs/verification-matrix.md](./docs/verification-matrix.md) for the verification matrix, review questions, and snapshot coverage.
|
|
59
|
-
|
|
60
|
-
## Package Strategy
|
|
61
|
-
|
|
62
|
-
### Hard dependencies
|
|
63
|
-
|
|
64
|
-
- `@contractspec/lib.contracts-spec` — operations, capabilities, policies, presentations
|
|
65
|
-
- `@contractspec/lib.overlay-engine` — typed, auditable overrides
|
|
66
|
-
- `@contractspec/lib.observability` — tracing, metrics, lifecycle instrumentation
|
|
67
|
-
- `zod` — schema validation
|
|
68
|
-
|
|
69
|
-
### Interoperability (consumes or composes with)
|
|
70
|
-
|
|
71
|
-
- `@contractspec/lib.contracts-runtime-client-react` — feature/form rendering
|
|
72
|
-
- `@contractspec/lib.presentation-runtime-react` — workflow, list state
|
|
73
|
-
- `@contractspec/lib.ai-agent` — agent orchestration (when assistant integration is added)
|
|
74
|
-
- `@contractspec/lib.ai-providers` — planner model selection
|
|
75
|
-
- `@contractspec/lib.metering` — when AI/chat features are used
|
|
76
|
-
- `@contractspec/lib.personalization` — preference dimensions (or surface-runtime-owned until adopted)
|
|
77
|
-
|
|
78
|
-
### Peer dependencies
|
|
79
|
-
|
|
80
|
-
- `react`, `react-dom` — optional; required only for React renderer
|
|
81
|
-
- UI libs (BlockNote, dnd-kit, Floating UI, Motion, resizable-panels) — optional; added as peers when adapters are implemented
|
|
20
|
+
`bun add @contractspec/lib.surface-runtime`
|
|
82
21
|
|
|
83
22
|
## Usage
|
|
84
23
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Implement `BundleAuditEmitter` and pass to `resolveBundle` and patch approval flow. Events: `surface.resolved`, `patch.proposed`, `patch.approved`, `patch.rejected`, `overlay.saved`, `overlay.applied`, `overlay.failed`, `policy.denied`, `policy.redacted`. Use `emitPatchProposed`, `emitPatchApproved`, etc. from `./runtime`.
|
|
141
|
-
|
|
142
|
-
### Rollback
|
|
143
|
-
|
|
144
|
-
`applySurfacePatch` returns `inverseOps` for reversible ops (insert/remove, replace, set-layout, reveal/hide-field). Store `OverlayApprovalMeta` (forwardOps, inverseOps, actorId, approvedAt) with each approved overlay. Use `rollbackSurfacePatches(plan, approvalStack, count)` to revert last N patches.
|
|
145
|
-
|
|
146
|
-
**Rollback limits**: move-node, resize-panel, set-focus, promote-action require previous state for full inverse; currently return null inverse. Document when storing approval metadata.
|
|
147
|
-
|
|
148
|
-
## Rollout Status
|
|
149
|
-
|
|
150
|
-
See [ROLLOUT.md](./ROLLOUT.md) for the phased rollout plan, performance budgets, risks, and pilot route (`/operate/pm/issues/:issueId`).
|
|
151
|
-
|
|
152
|
-
**Current:** Phase 0–2 complete (scaffold, resolver, renderer). Phase 3–7 pending.
|
|
153
|
-
|
|
154
|
-
## Adapter Rule (Lint)
|
|
155
|
-
|
|
156
|
-
**Rule**: No direct third-party UI imports outside `src/adapters/`. BlockNote, dnd-kit, Floating UI, Motion, resizable-panels, AI SDK UI—all must be behind adapter boundaries.
|
|
157
|
-
|
|
158
|
-
**Enforcement**: Run `bun run lint:adapters` to detect violations. Integrate into CI if desired.
|
|
159
|
-
|
|
160
|
-
## Phase 2 Status
|
|
161
|
-
|
|
162
|
-
Types, defineModuleBundle, resolveBundle, applySurfacePatch, BundleProvider, BundleRenderer, RegionRenderer, SlotRenderer, and adapter stubs are implemented. ResolvedSurfacePlan includes layoutRoot for rendering. Motion tokens map pace to duration/entrance. Panel persistence (persistKey) via localStorage. Full BlockNote/dnd-kit/Floating UI integrations deferred to later phases. Planner prompt compiler, propose-patch tool schema, and patch proposal validator added for AI chat integration.
|
|
163
|
-
|
|
164
|
-
**Observability (09):** Tracing (`traceAsync`), metrics (`resolution_duration_ms`, patch acceptance/rejection, policy denial, surface fallback, missing renderer), structured logging. Golden-context harness for resolver evals with snapshot tests. Performance budget: resolver p95 <100ms (server). See [docs/evals-runbook.md](./docs/evals-runbook.md) and `./telemetry`.
|
|
24
|
+
Import the root entrypoint from `@contractspec/lib.surface-runtime`, or choose a documented subpath when you only need one part of the package surface.
|
|
25
|
+
|
|
26
|
+
## Architecture
|
|
27
|
+
|
|
28
|
+
- `src/spec/` defines module-bundle and surface-patch validation surfaces.
|
|
29
|
+
- `src/runtime/` contains planners, registries, patch application, policy evaluation, and bundle resolution.
|
|
30
|
+
- `src/react/` exports the React integration layer for bundle rendering and override handling.
|
|
31
|
+
- `src/adapters/`, `src.telemetry/`, `src.evals/`, and `src.examples/` support integration and verification flows.
|
|
32
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
33
|
+
|
|
34
|
+
## Public Entry Points
|
|
35
|
+
|
|
36
|
+
- Exports runtime, spec, React integration, adapters, telemetry, eval, and example subpaths for AI-native surface composition.
|
|
37
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
38
|
+
- Export `./adapters` resolves through `./src/adapters/index.ts`.
|
|
39
|
+
- Export `./adapters/ai-sdk-stub` resolves through `./src/adapters/ai-sdk-stub.ts`.
|
|
40
|
+
- Export `./adapters/blocknote-stub` resolves through `./src/adapters/blocknote-stub.tsx`.
|
|
41
|
+
- Export `./adapters/dnd-kit-adapter` resolves through `./src/adapters/dnd-kit-adapter.tsx`.
|
|
42
|
+
- Export `./adapters/dnd-kit-stub` resolves through `./src/adapters/dnd-kit-stub.ts`.
|
|
43
|
+
- Export `./adapters/floating-ui-stub` resolves through `./src/adapters/floating-ui-stub.tsx`.
|
|
44
|
+
- Export `./adapters/interfaces` resolves through `./src/adapters/interfaces.ts`.
|
|
45
|
+
- Export `./adapters/motion-stub` resolves through `./src/adapters/motion-stub.ts`.
|
|
46
|
+
- Export `./adapters/resizable-panels-stub` resolves through `./src/adapters/resizable-panels-stub.tsx`.
|
|
47
|
+
- The package publishes 53 total export subpaths; keep docs aligned with `package.json`.
|
|
48
|
+
|
|
49
|
+
## Local Commands
|
|
50
|
+
|
|
51
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
52
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
53
|
+
- `bun run test` — bun test --pass-with-no-tests
|
|
54
|
+
- `bun run lint` — bun lint:fix
|
|
55
|
+
- `bun run lint:check` — biome check .
|
|
56
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
57
|
+
- `bun run typecheck` — tsc --noEmit
|
|
58
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
59
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
60
|
+
- `bun run clean` — rimraf dist .turbo
|
|
61
|
+
- `bun run build:bundle` — contractspec-bun-build transpile && node scripts/fix-use-client-directive.mjs
|
|
62
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
63
|
+
- `bun run lint:adapters` — node scripts/lint-adapters.mjs
|
|
64
|
+
- `bun run test:evals` — bun test src/evals/
|
|
65
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
66
|
+
|
|
67
|
+
## Recent Updates
|
|
68
|
+
|
|
69
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
70
|
+
- Export, sidebar, workflow tools, slotContent.
|
|
71
|
+
- Vercel AI SDK parity + surface-runtime i18n and bundle alignment.
|
|
72
|
+
- Bundle spec alignment, i18n support, PM workbench pilot.
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
|
|
76
|
+
- No direct third-party UI imports outside `src/adapters/` (when adapters are added).
|
|
77
|
+
- Every surface must have verification.dimensions for all 7 preference dimensions.
|
|
78
|
+
- Adapter rule: BlockNote, dnd-kit, etc. behind adapter boundaries only.
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dnd-kit adapter for customization mode. Wraps content in DndContext.
|
|
3
|
-
* Requires @dnd-kit/core (optional peer). Falls back to stub when not installed.
|
|
4
|
-
*/
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import type { SurfacePatchOp } from '../spec/types';
|
|
7
3
|
import type { DragDropBundleAdapter } from './interfaces';
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* UI library adapters. No direct third-party imports outside this directory.
|
|
3
3
|
*/
|
|
4
|
-
export type { AiSdkBundleAdapter, BlockNoteBundleAdapter, DragDropBundleAdapter, FieldRendererRegistry, FloatingBundleAdapter, MotionBundleAdapter, MotionTokens, PanelLayoutAdapter, RenderContext, RenderRegionFn, } from './interfaces';
|
|
5
4
|
export { aiSdkAdapterStub } from './ai-sdk-stub';
|
|
6
5
|
export { blocknoteAdapterStub } from './blocknote-stub';
|
|
7
|
-
export { dndKitAdapterStub } from './dnd-kit-stub';
|
|
8
6
|
export { dndKitAdapter } from './dnd-kit-adapter';
|
|
7
|
+
export { dndKitAdapterStub } from './dnd-kit-stub';
|
|
9
8
|
export { floatingUiAdapterStub } from './floating-ui-stub';
|
|
9
|
+
export type { AiSdkBundleAdapter, BlockNoteBundleAdapter, DragDropBundleAdapter, FieldRendererRegistry, FloatingBundleAdapter, MotionBundleAdapter, MotionTokens, PanelLayoutAdapter, RenderContext, RenderRegionFn, } from './interfaces';
|
|
10
10
|
export { motionAdapterStub } from './motion-stub';
|
|
11
11
|
export { resizablePanelsAdapterStub } from './resizable-panels-stub';
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { aiSdkAdapterStub } from "./ai-sdk-stub";
|
|
2
2
|
export { blocknoteAdapterStub } from "./blocknote-stub";
|
|
3
|
-
export { dndKitAdapterStub } from "./dnd-kit-stub";
|
|
4
3
|
export { dndKitAdapter } from "./dnd-kit-adapter";
|
|
4
|
+
export { dndKitAdapterStub } from "./dnd-kit-stub";
|
|
5
5
|
export { floatingUiAdapterStub } from "./floating-ui-stub";
|
|
6
6
|
export { motionAdapterStub } from "./motion-stub";
|
|
7
7
|
export { resizablePanelsAdapterStub } from "./resizable-panels-stub";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { aiSdkAdapterStub } from "./ai-sdk-stub";
|
|
2
2
|
export { blocknoteAdapterStub } from "./blocknote-stub";
|
|
3
|
-
export { dndKitAdapterStub } from "./dnd-kit-stub";
|
|
4
3
|
export { dndKitAdapter } from "./dnd-kit-adapter";
|
|
4
|
+
export { dndKitAdapterStub } from "./dnd-kit-stub";
|
|
5
5
|
export { floatingUiAdapterStub } from "./floating-ui-stub";
|
|
6
6
|
export { motionAdapterStub } from "./motion-stub";
|
|
7
7
|
export { resizablePanelsAdapterStub } from "./resizable-panels-stub";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createSurfaceI18n, getDefaultSurfaceI18n } from "./messages";
|
|
2
|
-
export { SURFACE_KEYS } from "./keys";
|
|
3
1
|
export {
|
|
4
|
-
resolveLocale,
|
|
5
|
-
isSupportedLocale,
|
|
6
2
|
DEFAULT_LOCALE,
|
|
3
|
+
isSupportedLocale,
|
|
4
|
+
resolveLocale,
|
|
7
5
|
SUPPORTED_LOCALES
|
|
8
6
|
} from "@contractspec/lib.contracts-spec/translations";
|
|
7
|
+
export { SURFACE_KEYS } from "./keys";
|
|
8
|
+
export { createSurfaceI18n, getDefaultSurfaceI18n } from "./messages";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
createI18nFactory
|
|
3
3
|
} from "@contractspec/lib.contracts-spec/translations";
|
|
4
4
|
import { enMessages } from "./catalogs/en";
|
|
5
|
-
import { frMessages } from "./catalogs/fr";
|
|
6
5
|
import { esMessages } from "./catalogs/es";
|
|
6
|
+
import { frMessages } from "./catalogs/fr";
|
|
7
7
|
const factory = createI18nFactory({
|
|
8
8
|
specKey: "surface-runtime.messages",
|
|
9
9
|
catalogs: [enMessages, frMessages, esMessages]
|
package/dist/browser/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxDEV as jsxDEV_7x81h0kn, Fragment as Fragment_8vg9x3sq } from "react/jsx-dev-runtime";
|
|
3
|
+
import { motionAdapterStub } from "../adapters/motion-stub";
|
|
3
4
|
import { useBundlePlan } from "./BundleProvider";
|
|
5
|
+
import { OverlayConflictResolver } from "./OverlayConflictResolver";
|
|
6
|
+
import { PatchProposalCard } from "./PatchProposalCard";
|
|
4
7
|
import { RegionRenderer } from "./RegionRenderer";
|
|
5
8
|
import { SlotRenderer } from "./SlotRenderer";
|
|
6
|
-
import { PatchProposalCard } from "./PatchProposalCard";
|
|
7
|
-
import { OverlayConflictResolver } from "./OverlayConflictResolver";
|
|
8
|
-
import { motionAdapterStub } from "../adapters/motion-stub";
|
|
9
9
|
export function BundleRenderer({
|
|
10
10
|
assistantSlotId,
|
|
11
11
|
assistantSlotContent,
|
|
@@ -5,12 +5,12 @@ export {
|
|
|
5
5
|
useIsEditing
|
|
6
6
|
} from "./BundleProvider";
|
|
7
7
|
export { BundleRenderer } from "./BundleRenderer";
|
|
8
|
-
export {
|
|
9
|
-
PatchProposalCard
|
|
10
|
-
} from "./PatchProposalCard";
|
|
11
|
-
export { WidgetPalette } from "./WidgetPalette";
|
|
12
8
|
export {
|
|
13
9
|
OverlayConflictResolver
|
|
14
10
|
} from "./OverlayConflictResolver";
|
|
11
|
+
export {
|
|
12
|
+
PatchProposalCard
|
|
13
|
+
} from "./PatchProposalCard";
|
|
15
14
|
export { RegionRenderer } from "./RegionRenderer";
|
|
16
15
|
export { SlotRenderer } from "./SlotRenderer";
|
|
16
|
+
export { WidgetPalette } from "./WidgetPalette";
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
export { buildContext } from "./build-context";
|
|
2
|
-
export { resolvePreferenceProfile } from "./resolve-preferences";
|
|
3
|
-
export { defaultPreferenceAdapter } from "./preference-adapter";
|
|
4
|
-
export {
|
|
5
|
-
resolveBundle
|
|
6
|
-
} from "./resolve-bundle";
|
|
7
1
|
export {
|
|
8
2
|
applySurfacePatch
|
|
9
3
|
} from "./apply-surface-patch";
|
|
10
4
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
emitOverlayApplied,
|
|
6
|
+
emitOverlayFailed,
|
|
7
|
+
emitOverlaySaved,
|
|
8
|
+
emitPatchApproved,
|
|
9
|
+
emitPatchProposed,
|
|
10
|
+
emitPatchRejected,
|
|
11
|
+
emitPolicyDenied,
|
|
12
|
+
emitPolicyRedacted
|
|
13
|
+
} from "./audit-events";
|
|
14
|
+
export { buildContext } from "./build-context";
|
|
13
15
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./
|
|
16
|
+
createActionRegistry,
|
|
17
|
+
createBundleExtensionRegistry,
|
|
18
|
+
createCommandRegistry
|
|
19
|
+
} from "./extension-registry";
|
|
18
20
|
export {
|
|
19
21
|
createFieldRendererRegistry,
|
|
20
22
|
createMutableFieldRendererRegistry,
|
|
21
23
|
FALLBACK_FIELD_KIND
|
|
22
24
|
} from "./field-renderer-registry";
|
|
23
25
|
export {
|
|
24
|
-
|
|
25
|
-
} from "./widget-registry";
|
|
26
|
-
export {
|
|
27
|
-
createActionRegistry,
|
|
28
|
-
createCommandRegistry,
|
|
29
|
-
createBundleExtensionRegistry
|
|
30
|
-
} from "./extension-registry";
|
|
31
|
-
export {
|
|
32
|
-
createInMemoryOverrideStore,
|
|
33
|
-
createOverrideStoreWithApprovalGate,
|
|
34
|
-
buildOverrideTargetKey
|
|
35
|
-
} from "./override-store";
|
|
36
|
-
export {
|
|
37
|
-
toOverlayScopeContext,
|
|
38
|
-
toOverlayTargetRef,
|
|
39
|
-
toOverlayRenderableField,
|
|
26
|
+
applyEntityFieldOverlays,
|
|
40
27
|
fromOverlayRenderableField,
|
|
41
|
-
toOverlayRenderable,
|
|
42
28
|
mergeOverlayResultIntoFields,
|
|
43
|
-
|
|
29
|
+
toOverlayRenderable,
|
|
30
|
+
toOverlayRenderableField,
|
|
31
|
+
toOverlayScopeContext,
|
|
32
|
+
toOverlayTargetRef
|
|
44
33
|
} from "./overlay-alignment";
|
|
45
34
|
export {
|
|
46
35
|
signWorkspaceOverlay,
|
|
47
36
|
verifyWorkspaceOverlay
|
|
48
37
|
} from "./overlay-signer";
|
|
49
38
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
emitPolicyRedacted
|
|
58
|
-
} from "./audit-events";
|
|
59
|
-
export { rollbackSurfacePatches } from "./rollback";
|
|
39
|
+
buildOverrideTargetKey,
|
|
40
|
+
createInMemoryOverrideStore,
|
|
41
|
+
createOverrideStoreWithApprovalGate
|
|
42
|
+
} from "./override-store";
|
|
43
|
+
export {
|
|
44
|
+
compilePlannerPrompt
|
|
45
|
+
} from "./planner-prompt";
|
|
60
46
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
buildSurfacePatchProposal,
|
|
48
|
+
PROPOSE_PATCH_TOOL_SCHEMA,
|
|
49
|
+
proposePatchToolConfig
|
|
50
|
+
} from "./planner-tools";
|
|
51
|
+
export {
|
|
52
|
+
evaluateAndEmitPatchPolicy,
|
|
53
|
+
evaluatePatchProposalPolicy
|
|
63
54
|
} from "./policy-eval";
|
|
55
|
+
export { defaultPreferenceAdapter } from "./preference-adapter";
|
|
56
|
+
export {
|
|
57
|
+
resolveBundle
|
|
58
|
+
} from "./resolve-bundle";
|
|
59
|
+
export { resolvePreferenceProfile } from "./resolve-preferences";
|
|
60
|
+
export { rollbackSurfacePatches } from "./rollback";
|
|
61
|
+
export {
|
|
62
|
+
createWidgetRegistry
|
|
63
|
+
} from "./widget-registry";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { traceAsync } from "@contractspec/lib.observability/tracing";
|
|
2
1
|
import { Logger } from "@contractspec/lib.observability";
|
|
2
|
+
import { traceAsync } from "@contractspec/lib.observability/tracing";
|
|
3
3
|
import { resolutionDurationMs, surfaceFallbackCounter } from "../telemetry";
|
|
4
|
-
import { resolvePreferenceProfile } from "./resolve-preferences";
|
|
5
4
|
import { applySurfacePatch } from "./apply-surface-patch";
|
|
6
5
|
import { buildOverrideTargetKey } from "./override-store";
|
|
6
|
+
import { resolvePreferenceProfile } from "./resolve-preferences";
|
|
7
7
|
const logger = new Logger("@contractspec/lib.surface-runtime");
|
|
8
8
|
function getOpTarget(op) {
|
|
9
9
|
switch (op.op) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
1
|
export { defineModuleBundle } from "./define-module-bundle";
|
|
2
|
+
export * from "./types";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
validateBundleNodeKinds,
|
|
5
|
+
validateLayoutSlots
|
|
6
6
|
} from "./validate-bundle";
|
|
7
7
|
export {
|
|
8
|
+
validatePatchProposal,
|
|
8
9
|
validateSurfacePatch,
|
|
9
|
-
validateSurfacePatchOp
|
|
10
|
-
validatePatchProposal
|
|
10
|
+
validateSurfacePatchOp
|
|
11
11
|
} from "./validate-surface-patch";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
2
|
+
missingRendererCounter,
|
|
3
3
|
patchAcceptanceCounter,
|
|
4
4
|
patchRejectionCounter,
|
|
5
5
|
policyDenialCounter,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
resolutionDurationMs,
|
|
7
|
+
surfaceFallbackCounter
|
|
8
8
|
} from "./surface-metrics";
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* Golden-context harness for resolver evals.
|
|
3
3
|
* Runs resolver with golden contexts and snapshots ResolvedSurfacePlan.
|
|
4
4
|
*/
|
|
5
|
-
import type { ModuleBundleSpec } from '../spec/types';
|
|
6
|
-
import type { BundleContext } from '../spec/types';
|
|
7
5
|
import type { ResolvedSurfacePlan } from '../runtime/resolve-bundle';
|
|
6
|
+
import type { BundleContext, ModuleBundleSpec } from '../spec/types';
|
|
8
7
|
import type { GoldenContext } from './golden-context';
|
|
9
8
|
/** Snapshot-friendly plan (deterministic fields only). */
|
|
10
9
|
export interface SnapshotPlan {
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { SurfaceI18n } from './messages';
|
|
3
|
-
export { SURFACE_KEYS } from './keys';
|
|
1
|
+
export { DEFAULT_LOCALE, isSupportedLocale, resolveLocale, SUPPORTED_LOCALES, } from '@contractspec/lib.contracts-spec/translations';
|
|
4
2
|
export type { SurfaceMessageKey } from './keys';
|
|
5
|
-
export {
|
|
3
|
+
export { SURFACE_KEYS } from './keys';
|
|
4
|
+
export type { SurfaceI18n } from './messages';
|
|
5
|
+
export { createSurfaceI18n, getDefaultSurfaceI18n } from './messages';
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createSurfaceI18n, getDefaultSurfaceI18n } from "./messages";
|
|
2
|
-
export { SURFACE_KEYS } from "./keys";
|
|
3
1
|
export {
|
|
4
|
-
resolveLocale,
|
|
5
|
-
isSupportedLocale,
|
|
6
2
|
DEFAULT_LOCALE,
|
|
3
|
+
isSupportedLocale,
|
|
4
|
+
resolveLocale,
|
|
7
5
|
SUPPORTED_LOCALES
|
|
8
6
|
} from "@contractspec/lib.contracts-spec/translations";
|
|
7
|
+
export { SURFACE_KEYS } from "./keys";
|
|
8
|
+
export { createSurfaceI18n, getDefaultSurfaceI18n } from "./messages";
|
package/dist/i18n/messages.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
createI18nFactory
|
|
3
3
|
} from "@contractspec/lib.contracts-spec/translations";
|
|
4
4
|
import { enMessages } from "./catalogs/en";
|
|
5
|
-
import { frMessages } from "./catalogs/fr";
|
|
6
5
|
import { esMessages } from "./catalogs/es";
|
|
6
|
+
import { frMessages } from "./catalogs/fr";
|
|
7
7
|
const factory = createI18nFactory({
|
|
8
8
|
specKey: "surface-runtime.messages",
|
|
9
9
|
catalogs: [enMessages, frMessages, esMessages]
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { aiSdkAdapterStub } from "./ai-sdk-stub";
|
|
2
2
|
export { blocknoteAdapterStub } from "./blocknote-stub";
|
|
3
|
-
export { dndKitAdapterStub } from "./dnd-kit-stub";
|
|
4
3
|
export { dndKitAdapter } from "./dnd-kit-adapter";
|
|
4
|
+
export { dndKitAdapterStub } from "./dnd-kit-stub";
|
|
5
5
|
export { floatingUiAdapterStub } from "./floating-ui-stub";
|
|
6
6
|
export { motionAdapterStub } from "./motion-stub";
|
|
7
7
|
export { resizablePanelsAdapterStub } from "./resizable-panels-stub";
|
package/dist/node/i18n/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createSurfaceI18n, getDefaultSurfaceI18n } from "./messages";
|
|
2
|
-
export { SURFACE_KEYS } from "./keys";
|
|
3
1
|
export {
|
|
4
|
-
resolveLocale,
|
|
5
|
-
isSupportedLocale,
|
|
6
2
|
DEFAULT_LOCALE,
|
|
3
|
+
isSupportedLocale,
|
|
4
|
+
resolveLocale,
|
|
7
5
|
SUPPORTED_LOCALES
|
|
8
6
|
} from "@contractspec/lib.contracts-spec/translations";
|
|
7
|
+
export { SURFACE_KEYS } from "./keys";
|
|
8
|
+
export { createSurfaceI18n, getDefaultSurfaceI18n } from "./messages";
|