@contractspec/lib.surface-runtime 0.2.3 → 0.3.0
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/browser/index.js +4 -0
- package/dist/browser/react/BundleRenderer.js +4 -0
- package/dist/browser/react/index.js +4 -0
- package/dist/index.js +4 -0
- package/dist/node/index.js +4 -0
- package/dist/node/react/BundleRenderer.js +4 -0
- package/dist/node/react/index.js +4 -0
- package/dist/react/BundleRenderer.d.ts +3 -1
- package/dist/react/BundleRenderer.js +4 -0
- package/dist/react/index.js +4 -0
- package/package.json +6 -6
package/dist/browser/index.js
CHANGED
|
@@ -2275,6 +2275,7 @@ import { jsxDEV as jsxDEV10, Fragment } from "react/jsx-dev-runtime";
|
|
|
2275
2275
|
function BundleRenderer({
|
|
2276
2276
|
assistantSlotId,
|
|
2277
2277
|
assistantSlotContent,
|
|
2278
|
+
slotContent,
|
|
2278
2279
|
onPatchAccept,
|
|
2279
2280
|
onPatchReject,
|
|
2280
2281
|
onOverlayConflictResolve
|
|
@@ -2289,6 +2290,9 @@ function BundleRenderer({
|
|
|
2289
2290
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
2290
2291
|
const locale = plan.locale;
|
|
2291
2292
|
const renderSlot = (slotId, slotCtx) => {
|
|
2293
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
2294
|
+
return slotContent[slotId];
|
|
2295
|
+
}
|
|
2292
2296
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
2293
2297
|
return /* @__PURE__ */ jsxDEV10(Fragment, {
|
|
2294
2298
|
children: [
|
|
@@ -653,6 +653,7 @@ import { jsxDEV as jsxDEV8, Fragment } from "react/jsx-dev-runtime";
|
|
|
653
653
|
function BundleRenderer({
|
|
654
654
|
assistantSlotId,
|
|
655
655
|
assistantSlotContent,
|
|
656
|
+
slotContent,
|
|
656
657
|
onPatchAccept,
|
|
657
658
|
onPatchReject,
|
|
658
659
|
onOverlayConflictResolve
|
|
@@ -667,6 +668,9 @@ function BundleRenderer({
|
|
|
667
668
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
668
669
|
const locale = plan.locale;
|
|
669
670
|
const renderSlot = (slotId, slotCtx) => {
|
|
671
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
672
|
+
return slotContent[slotId];
|
|
673
|
+
}
|
|
670
674
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
671
675
|
return /* @__PURE__ */ jsxDEV8(Fragment, {
|
|
672
676
|
children: [
|
|
@@ -653,6 +653,7 @@ import { jsxDEV as jsxDEV8, Fragment } from "react/jsx-dev-runtime";
|
|
|
653
653
|
function BundleRenderer({
|
|
654
654
|
assistantSlotId,
|
|
655
655
|
assistantSlotContent,
|
|
656
|
+
slotContent,
|
|
656
657
|
onPatchAccept,
|
|
657
658
|
onPatchReject,
|
|
658
659
|
onOverlayConflictResolve
|
|
@@ -667,6 +668,9 @@ function BundleRenderer({
|
|
|
667
668
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
668
669
|
const locale = plan.locale;
|
|
669
670
|
const renderSlot = (slotId, slotCtx) => {
|
|
671
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
672
|
+
return slotContent[slotId];
|
|
673
|
+
}
|
|
670
674
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
671
675
|
return /* @__PURE__ */ jsxDEV8(Fragment, {
|
|
672
676
|
children: [
|
package/dist/index.js
CHANGED
|
@@ -2276,6 +2276,7 @@ import { jsxDEV as jsxDEV10, Fragment } from "react/jsx-dev-runtime";
|
|
|
2276
2276
|
function BundleRenderer({
|
|
2277
2277
|
assistantSlotId,
|
|
2278
2278
|
assistantSlotContent,
|
|
2279
|
+
slotContent,
|
|
2279
2280
|
onPatchAccept,
|
|
2280
2281
|
onPatchReject,
|
|
2281
2282
|
onOverlayConflictResolve
|
|
@@ -2290,6 +2291,9 @@ function BundleRenderer({
|
|
|
2290
2291
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
2291
2292
|
const locale = plan.locale;
|
|
2292
2293
|
const renderSlot = (slotId, slotCtx) => {
|
|
2294
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
2295
|
+
return slotContent[slotId];
|
|
2296
|
+
}
|
|
2293
2297
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
2294
2298
|
return /* @__PURE__ */ jsxDEV10(Fragment, {
|
|
2295
2299
|
children: [
|
package/dist/node/index.js
CHANGED
|
@@ -2275,6 +2275,7 @@ import { jsxDEV as jsxDEV10, Fragment } from "react/jsx-dev-runtime";
|
|
|
2275
2275
|
function BundleRenderer({
|
|
2276
2276
|
assistantSlotId,
|
|
2277
2277
|
assistantSlotContent,
|
|
2278
|
+
slotContent,
|
|
2278
2279
|
onPatchAccept,
|
|
2279
2280
|
onPatchReject,
|
|
2280
2281
|
onOverlayConflictResolve
|
|
@@ -2289,6 +2290,9 @@ function BundleRenderer({
|
|
|
2289
2290
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
2290
2291
|
const locale = plan.locale;
|
|
2291
2292
|
const renderSlot = (slotId, slotCtx) => {
|
|
2293
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
2294
|
+
return slotContent[slotId];
|
|
2295
|
+
}
|
|
2292
2296
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
2293
2297
|
return /* @__PURE__ */ jsxDEV10(Fragment, {
|
|
2294
2298
|
children: [
|
|
@@ -653,6 +653,7 @@ import { jsxDEV as jsxDEV8, Fragment } from "react/jsx-dev-runtime";
|
|
|
653
653
|
function BundleRenderer({
|
|
654
654
|
assistantSlotId,
|
|
655
655
|
assistantSlotContent,
|
|
656
|
+
slotContent,
|
|
656
657
|
onPatchAccept,
|
|
657
658
|
onPatchReject,
|
|
658
659
|
onOverlayConflictResolve
|
|
@@ -667,6 +668,9 @@ function BundleRenderer({
|
|
|
667
668
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
668
669
|
const locale = plan.locale;
|
|
669
670
|
const renderSlot = (slotId, slotCtx) => {
|
|
671
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
672
|
+
return slotContent[slotId];
|
|
673
|
+
}
|
|
670
674
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
671
675
|
return /* @__PURE__ */ jsxDEV8(Fragment, {
|
|
672
676
|
children: [
|
package/dist/node/react/index.js
CHANGED
|
@@ -653,6 +653,7 @@ import { jsxDEV as jsxDEV8, Fragment } from "react/jsx-dev-runtime";
|
|
|
653
653
|
function BundleRenderer({
|
|
654
654
|
assistantSlotId,
|
|
655
655
|
assistantSlotContent,
|
|
656
|
+
slotContent,
|
|
656
657
|
onPatchAccept,
|
|
657
658
|
onPatchReject,
|
|
658
659
|
onOverlayConflictResolve
|
|
@@ -667,6 +668,9 @@ function BundleRenderer({
|
|
|
667
668
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
668
669
|
const locale = plan.locale;
|
|
669
670
|
const renderSlot = (slotId, slotCtx) => {
|
|
671
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
672
|
+
return slotContent[slotId];
|
|
673
|
+
}
|
|
670
674
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
671
675
|
return /* @__PURE__ */ jsxDEV8(Fragment, {
|
|
672
676
|
children: [
|
|
@@ -4,6 +4,8 @@ export interface BundleRendererProps {
|
|
|
4
4
|
assistantSlotId?: string;
|
|
5
5
|
/** Content for the assistant slot (e.g. ChatContainer with useChat). */
|
|
6
6
|
assistantSlotContent?: React.ReactNode;
|
|
7
|
+
/** Override content for any slot. When provided, renders this instead of SlotRenderer for the given slotId. */
|
|
8
|
+
slotContent?: Partial<Record<string, React.ReactNode>>;
|
|
7
9
|
/** Called when user accepts a patch proposal. Caller should apply patch and update plan. */
|
|
8
10
|
onPatchAccept?: (proposalId: string) => void;
|
|
9
11
|
/** Called when user rejects a patch proposal. Caller should remove from proposals and emit audit. */
|
|
@@ -19,4 +21,4 @@ export interface BundleRendererProps {
|
|
|
19
21
|
* Composes RegionRenderer (layout tree), SlotRenderer, and motion tokens from pace.
|
|
20
22
|
* When assistantSlotId is set and matches a slot, renders assistantSlotContent instead.
|
|
21
23
|
*/
|
|
22
|
-
export declare function BundleRenderer({ assistantSlotId, assistantSlotContent, onPatchAccept, onPatchReject, onOverlayConflictResolve, }?: BundleRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function BundleRenderer({ assistantSlotId, assistantSlotContent, slotContent, onPatchAccept, onPatchReject, onOverlayConflictResolve, }?: BundleRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -654,6 +654,7 @@ import { jsxDEV as jsxDEV8, Fragment } from "react/jsx-dev-runtime";
|
|
|
654
654
|
function BundleRenderer({
|
|
655
655
|
assistantSlotId,
|
|
656
656
|
assistantSlotContent,
|
|
657
|
+
slotContent,
|
|
657
658
|
onPatchAccept,
|
|
658
659
|
onPatchReject,
|
|
659
660
|
onOverlayConflictResolve
|
|
@@ -668,6 +669,9 @@ function BundleRenderer({
|
|
|
668
669
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
669
670
|
const locale = plan.locale;
|
|
670
671
|
const renderSlot = (slotId, slotCtx) => {
|
|
672
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
673
|
+
return slotContent[slotId];
|
|
674
|
+
}
|
|
671
675
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
672
676
|
return /* @__PURE__ */ jsxDEV8(Fragment, {
|
|
673
677
|
children: [
|
package/dist/react/index.js
CHANGED
|
@@ -654,6 +654,7 @@ import { jsxDEV as jsxDEV8, Fragment } from "react/jsx-dev-runtime";
|
|
|
654
654
|
function BundleRenderer({
|
|
655
655
|
assistantSlotId,
|
|
656
656
|
assistantSlotContent,
|
|
657
|
+
slotContent,
|
|
657
658
|
onPatchAccept,
|
|
658
659
|
onPatchReject,
|
|
659
660
|
onOverlayConflictResolve
|
|
@@ -668,6 +669,9 @@ function BundleRenderer({
|
|
|
668
669
|
const proposals = plan.ai?.proposals?.filter((p) => p.approvalState === "proposed");
|
|
669
670
|
const locale = plan.locale;
|
|
670
671
|
const renderSlot = (slotId, slotCtx) => {
|
|
672
|
+
if (slotContent && slotId in slotContent && slotContent[slotId] != null) {
|
|
673
|
+
return slotContent[slotId];
|
|
674
|
+
}
|
|
671
675
|
if (assistantSlotId && slotId === assistantSlotId) {
|
|
672
676
|
return /* @__PURE__ */ jsxDEV8(Fragment, {
|
|
673
677
|
children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.surface-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "AI-native surface specs and web runtime for adaptive ContractSpec surfaces",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"typecheck": "tsc --noEmit"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@contractspec/lib.contracts-spec": "3.
|
|
39
|
-
"@contractspec/lib.overlay-engine": "3.
|
|
40
|
-
"@contractspec/lib.observability": "3.
|
|
38
|
+
"@contractspec/lib.contracts-spec": "3.5.0",
|
|
39
|
+
"@contractspec/lib.overlay-engine": "3.5.0",
|
|
40
|
+
"@contractspec/lib.observability": "3.5.0",
|
|
41
41
|
"zod": "^4.3.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@contractspec/tool.typescript": "3.
|
|
60
|
+
"@contractspec/tool.typescript": "3.5.0",
|
|
61
61
|
"@dnd-kit/core": "^6.3.1",
|
|
62
62
|
"typescript": "^5.9.3",
|
|
63
|
-
"@contractspec/tool.bun": "3.
|
|
63
|
+
"@contractspec/tool.bun": "3.5.0"
|
|
64
64
|
},
|
|
65
65
|
"exports": {
|
|
66
66
|
".": {
|