@consciousclouds/operator-shell 0.1.0 → 0.2.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/CHANGELOG.md +66 -0
- package/README.md +80 -31
- package/dist/chief/ChiefDrawer.d.ts +34 -2
- package/dist/chief/ChiefDrawer.d.ts.map +1 -1
- package/dist/chief/ChiefDrawer.js +43 -30
- package/dist/chief/ChiefDrawer.js.map +1 -1
- package/dist/chief/ChiefHeaderBar.d.ts +19 -0
- package/dist/chief/ChiefHeaderBar.d.ts.map +1 -0
- package/dist/chief/ChiefHeaderBar.js +7 -0
- package/dist/chief/ChiefHeaderBar.js.map +1 -0
- package/dist/chief/ChiefMarkdown.d.ts +12 -0
- package/dist/chief/ChiefMarkdown.d.ts.map +1 -0
- package/dist/chief/ChiefMarkdown.js +95 -0
- package/dist/chief/ChiefMarkdown.js.map +1 -0
- package/dist/chief/ChiefPanel.d.ts +44 -1
- package/dist/chief/ChiefPanel.d.ts.map +1 -1
- package/dist/chief/ChiefPanel.js +79 -29
- package/dist/chief/ChiefPanel.js.map +1 -1
- package/dist/chief/ChiefRegion.d.ts +44 -1
- package/dist/chief/ChiefRegion.d.ts.map +1 -1
- package/dist/chief/ChiefRegion.js +63 -27
- package/dist/chief/ChiefRegion.js.map +1 -1
- package/dist/chief/ChiefSession.d.ts +46 -10
- package/dist/chief/ChiefSession.d.ts.map +1 -1
- package/dist/chief/ChiefSession.js +252 -6
- package/dist/chief/ChiefSession.js.map +1 -1
- package/dist/chief/ChiefTrigger.d.ts +26 -0
- package/dist/chief/ChiefTrigger.d.ts.map +1 -0
- package/dist/chief/ChiefTrigger.js +21 -0
- package/dist/chief/ChiefTrigger.js.map +1 -0
- package/dist/chief/conversation-adapter.d.ts +70 -0
- package/dist/chief/conversation-adapter.d.ts.map +1 -0
- package/dist/chief/conversation-adapter.js +26 -0
- package/dist/chief/conversation-adapter.js.map +1 -0
- package/dist/chief/conversation-identity.d.ts +48 -0
- package/dist/chief/conversation-identity.d.ts.map +1 -0
- package/dist/chief/conversation-identity.js +100 -0
- package/dist/chief/conversation-identity.js.map +1 -0
- package/dist/chief/personality-display.d.ts +56 -0
- package/dist/chief/personality-display.d.ts.map +1 -0
- package/dist/chief/personality-display.js +52 -0
- package/dist/chief/personality-display.js.map +1 -0
- package/dist/chief/turn-adapter.d.ts +45 -0
- package/dist/chief/turn-adapter.d.ts.map +1 -1
- package/dist/chief/use-chief-turn.d.ts +127 -14
- package/dist/chief/use-chief-turn.d.ts.map +1 -1
- package/dist/chief/use-chief-turn.js +284 -28
- package/dist/chief/use-chief-turn.js.map +1 -1
- package/dist/chief/use-controlled-open.d.ts +2 -0
- package/dist/chief/use-controlled-open.d.ts.map +1 -0
- package/dist/chief/use-controlled-open.js +27 -0
- package/dist/chief/use-controlled-open.js.map +1 -0
- package/dist/chief/use-smooth-stream.d.ts +8 -0
- package/dist/chief/use-smooth-stream.d.ts.map +1 -0
- package/dist/chief/use-smooth-stream.js +128 -0
- package/dist/chief/use-smooth-stream.js.map +1 -0
- package/dist/flavor/types.d.ts +36 -21
- package/dist/flavor/types.d.ts.map +1 -1
- package/dist/frame/ComposedWorkspace.d.ts +39 -0
- package/dist/frame/ComposedWorkspace.d.ts.map +1 -0
- package/dist/frame/ComposedWorkspace.js +94 -0
- package/dist/frame/ComposedWorkspace.js.map +1 -0
- package/dist/frame/OperatorShell.d.ts +115 -13
- package/dist/frame/OperatorShell.d.ts.map +1 -1
- package/dist/frame/OperatorShell.js +200 -12
- package/dist/frame/OperatorShell.js.map +1 -1
- package/dist/guard/permissions.d.ts +2 -2
- package/dist/guard/permissions.js +2 -2
- package/dist/header/OperatorHeader.d.ts +15 -2
- package/dist/header/OperatorHeader.d.ts.map +1 -1
- package/dist/header/OperatorHeader.js +3 -3
- package/dist/header/OperatorHeader.js.map +1 -1
- package/dist/icons/registry.d.ts +7 -1
- package/dist/icons/registry.d.ts.map +1 -1
- package/dist/icons/registry.js +31 -2
- package/dist/icons/registry.js.map +1 -1
- package/dist/index.d.ts +24 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -17
- package/dist/index.js.map +1 -1
- package/dist/sidebar/OperatorSidebar.d.ts +16 -1
- package/dist/sidebar/OperatorSidebar.d.ts.map +1 -1
- package/dist/sidebar/OperatorSidebar.js +13 -10
- package/dist/sidebar/OperatorSidebar.js.map +1 -1
- package/dist/workspace/FormWorkspace.d.ts +2 -3
- package/dist/workspace/FormWorkspace.d.ts.map +1 -1
- package/dist/workspace/FormWorkspace.js.map +1 -1
- package/dist/workspace/session-adapter.d.ts +95 -0
- package/dist/workspace/session-adapter.d.ts.map +1 -0
- package/dist/workspace/session-adapter.js +29 -0
- package/dist/workspace/session-adapter.js.map +1 -0
- package/package.json +10 -5
- package/styles/source.css +9 -0
|
@@ -1,10 +1,53 @@
|
|
|
1
|
+
import type { CanvasDefinition } from "@consciousclouds/canvas-sdk";
|
|
1
2
|
import type { OperatorFlavor } from "../flavor/types.js";
|
|
3
|
+
import type { IconRegistry } from "../icons/registry.js";
|
|
4
|
+
import { type ChiefWorkspacesRegion } from "./ChiefSession.js";
|
|
5
|
+
import type { ConversationAdapter } from "./conversation-adapter.js";
|
|
6
|
+
import { type PersonalityDisplay } from "./personality-display.js";
|
|
2
7
|
import type { TurnAdapter } from "./turn-adapter.js";
|
|
8
|
+
import { type ComposedMeta } from "./use-chief-turn.js";
|
|
3
9
|
export interface ChiefPanelProps {
|
|
4
10
|
flavor: OperatorFlavor;
|
|
5
11
|
/** The product's transport (P1-1). The shell owns the panel, never the wire. */
|
|
6
12
|
adapter: TurnAdapter;
|
|
13
|
+
/**
|
|
14
|
+
* `push` (default): closed-by-default responsive hybrid — overlay below
|
|
15
|
+
* lg, in-flow push at lg+. `rail`: the always-open inflow rail at xl+
|
|
16
|
+
* (the always-visible mode; the region mounts the overlay below xl).
|
|
17
|
+
*/
|
|
18
|
+
mode?: "push" | "rail";
|
|
19
|
+
/** Panel width in px at the inflow breakpoint (default 420). */
|
|
20
|
+
width?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Desktop chrome: `card` (default) floats as a rounded sibling card —
|
|
23
|
+
* the framed-workspace look; `flat` squares off with a left border for
|
|
24
|
+
* edge-to-edge workspaces. Cosmetic only.
|
|
25
|
+
*/
|
|
26
|
+
variant?: "card" | "flat";
|
|
27
|
+
/** Controlled open state (push mode). Omit for uncontrolled (closed). */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/** Open-state observer/setter — fires for every open/close, however caused. */
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
/**
|
|
32
|
+
* External trigger (e.g. the shell header's ChiefTrigger): excluded from
|
|
33
|
+
* outside-click dismissal; receives focus back on close.
|
|
34
|
+
*/
|
|
35
|
+
getTriggerElement?: () => HTMLElement | null;
|
|
36
|
+
/** Display identity from the Factory personality record (D-Q2 seam). */
|
|
37
|
+
personalityDisplay?: PersonalityDisplay;
|
|
38
|
+
/** Icon-registry extensions for `personalityDisplay.iconRef` resolution. */
|
|
39
|
+
icons?: IconRegistry;
|
|
40
|
+
/** Brand icon family (read-and-defaulted by the registry). */
|
|
41
|
+
iconFamily?: string;
|
|
42
|
+
/** The compose→center seam — forwarded verbatim to useChiefTurn (see ChiefRegion). */
|
|
43
|
+
onComposed?: (canvas: CanvasDefinition, meta: ComposedMeta) => void;
|
|
44
|
+
/** Composition activity (real tool events) — forwarded verbatim to useChiefTurn. */
|
|
45
|
+
onComposeActivity?: (phase: "composing" | "idle") => void;
|
|
46
|
+
/** The transcript transport — forwarded verbatim to useChiefTurn (fail-closed slot). */
|
|
47
|
+
conversationAdapter?: ConversationAdapter;
|
|
48
|
+
/** Kept workspaces for the drawer's Workspaces tab (fail-closed slot). */
|
|
49
|
+
workspaces?: ChiefWorkspacesRegion;
|
|
7
50
|
className?: string;
|
|
8
51
|
}
|
|
9
|
-
export declare function ChiefPanel({ flavor, adapter, className }: ChiefPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function ChiefPanel({ flavor, adapter, mode, width, variant, open: openProp, onOpenChange, getTriggerElement, personalityDisplay, icons, iconFamily, onComposed, onComposeActivity, conversationAdapter, workspaces, className, }: ChiefPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
10
53
|
//# sourceMappingURL=ChiefPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChiefPanel.d.ts","sourceRoot":"","sources":["../../src/chief/ChiefPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChiefPanel.d.ts","sourceRoot":"","sources":["../../src/chief/ChiefPanel.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAgB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGtE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,gFAAgF;IAChF,OAAO,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAC7C,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACpE,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,KAAK,IAAI,CAAC;IAC1D,wFAAwF;IACxF,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,0EAA0E;IAC1E,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,OAAO,EACP,IAAa,EACb,KAAW,EACX,OAAgB,EAChB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,SAAS,GACV,EAAE,eAAe,2CA+FjB"}
|
package/dist/chief/ChiefPanel.js
CHANGED
|
@@ -1,46 +1,96 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* ChiefPanel — the AI Region's
|
|
5
|
-
*
|
|
6
|
-
* headless hook (open, non-modal, non-dismissible). The turn flow lives in
|
|
7
|
-
* useChiefTurn and the body in ChiefSession — shared verbatim with the
|
|
8
|
-
* drawer placement (ChiefDrawer); this file is only the right-rail chrome.
|
|
4
|
+
* ChiefPanel — the AI Region's INFLOW placements, one CSS-responsive
|
|
5
|
+
* component (ported from the reference operator surface's proven panel):
|
|
9
6
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
7
|
+
* - `mode="push"` (default): the responsive hybrid. Below `lg` the panel
|
|
8
|
+
* is a fixed overlay drawer sliding from the right over a clickable
|
|
9
|
+
* scrim; at `lg+` it is an in-flow peer panel animating `w-0 →
|
|
10
|
+
* w-(--chief-width)` (300ms) so the workspace visibly reflows beside
|
|
11
|
+
* it. Closed by default; a dismissible, non-modal peer surface (Esc +
|
|
12
|
+
* outside-click close, composer focused on open, focus returned to the
|
|
13
|
+
* trigger on close) — the full assistant-surface option set.
|
|
14
|
+
* - `mode="rail"`: the always-visible mode — an always-open inflow rail
|
|
15
|
+
* at `xl+` (never dismissible; ⌘J focuses the composer). Below xl the
|
|
16
|
+
* region mounts the overlay instead (ChiefRegion owns that fallback).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Because BOTH responsive layouts of `push` are one mounted component, the
|
|
19
|
+
* turn thread survives viewport changes, and open/close keeps the thread —
|
|
20
|
+
* turn state lives here, outside the animated chrome.
|
|
21
|
+
*
|
|
22
|
+
* Layout is chrome; behavior never forks: every mode runs the identical
|
|
23
|
+
* useChiefTurn flow over the injected TurnAdapter (P1-1 — the shell owns
|
|
24
|
+
* the panel, never the wire).
|
|
21
25
|
*/
|
|
22
26
|
import * as React from "react";
|
|
23
|
-
import { Sparkles } from "lucide-react";
|
|
24
27
|
import { useAssistantSurface } from "@consciousclouds/assistant-surface";
|
|
25
28
|
import { cn } from "@consciousclouds/ui";
|
|
29
|
+
import { ChiefHeaderBar } from "./ChiefHeaderBar.js";
|
|
26
30
|
import { ChiefSession } from "./ChiefSession.js";
|
|
31
|
+
import { resolvePersonalityAccent, resolvePersonalityIcon, } from "./personality-display.js";
|
|
27
32
|
import { useChiefShortcut } from "./use-chief-shortcut.js";
|
|
28
33
|
import { useChiefTurn } from "./use-chief-turn.js";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
import { useControlledOpen } from "./use-controlled-open.js";
|
|
35
|
+
export function ChiefPanel({ flavor, adapter, mode = "push", width = 420, variant = "card", open: openProp, onOpenChange, getTriggerElement, personalityDisplay, icons, iconFamily, onComposed, onComposeActivity, conversationAdapter, workspaces, className, }) {
|
|
36
|
+
const isRail = mode === "rail";
|
|
37
|
+
const [openState, setOpen] = useControlledOpen(openProp, onOpenChange);
|
|
38
|
+
const open = isRail ? true : openState;
|
|
39
|
+
const session = useChiefTurn({ flavor, adapter, personalityDisplay, onComposed, onComposeActivity, conversationAdapter });
|
|
40
|
+
const composerRef = React.useRef(null);
|
|
41
|
+
const Icon = resolvePersonalityIcon(personalityDisplay, icons, iconFamily);
|
|
42
|
+
const accentColor = resolvePersonalityAccent(personalityDisplay?.accentRef);
|
|
43
|
+
// The shell-owned Chief keybinding (⌘J / Ctrl+J — use-chief-shortcut.ts).
|
|
44
|
+
// Rail (always open): focus the composer. Push: summon/dismiss — the SAME
|
|
45
|
+
// setOpen the trigger, Esc, and outside-click drive; one open state,
|
|
46
|
+
// whoever moves it.
|
|
47
|
+
useChiefShortcut(() => {
|
|
48
|
+
if (isRail)
|
|
49
|
+
composerRef.current?.focus();
|
|
50
|
+
else
|
|
51
|
+
setOpen(!open);
|
|
52
|
+
});
|
|
53
|
+
// Assistant-surface lifecycle (same surface id in every placement — one AI
|
|
54
|
+
// Region per application). Push is the full dismissible peer-panel option
|
|
55
|
+
// set: non-modal (no trap, no scroll lock), Esc + outside-click close,
|
|
56
|
+
// composer focus on open, focus back to the external trigger on close.
|
|
57
|
+
// Rail stays non-modal AND non-dismissible — always-visible means it.
|
|
34
58
|
const surface = useAssistantSurface({
|
|
35
|
-
open
|
|
36
|
-
onOpenChange: () => { },
|
|
59
|
+
open,
|
|
60
|
+
onOpenChange: isRail ? () => { } : setOpen,
|
|
37
61
|
surfaceId: "operator-shell-chief",
|
|
38
62
|
"aria-label": session.title,
|
|
63
|
+
modal: false,
|
|
64
|
+
dismissible: !isRail,
|
|
65
|
+
// EXPLICIT-CLOSE (owner): Chief is a working PEER, not a popover — clicking into the
|
|
66
|
+
// workspace to act on what Chief said must never dismiss the conversation. Only the
|
|
67
|
+
// header ✕, the trigger toggle, and Esc (a deliberate keyboard gesture) close it.
|
|
68
|
+
closeOnOutsideClick: false,
|
|
69
|
+
focusOnOpen: isRail ? "none" : () => composerRef.current,
|
|
70
|
+
getTriggerElement,
|
|
39
71
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
return (_jsxs(_Fragment, { children: [!isRail && (_jsx("div", { "aria-hidden": true,
|
|
73
|
+
// No click-to-close: explicit-close only (✕ / trigger / Esc).
|
|
74
|
+
className: cn("fixed inset-0 z-40 bg-black/30 transition-opacity duration-(--motion-duration-base) lg:hidden", open ? "opacity-100" : "pointer-events-none opacity-0") })), _jsxs("aside", { ref: surface.surfaceRef, ...surface.surfaceProps, role: isRail ? undefined : "dialog", style: { "--chief-width": `${width}px` }, className: cn("flex flex-col overflow-hidden bg-muted/50", isRail
|
|
75
|
+
? // Always-visible inflow rail at xl+ (the region mounts the
|
|
76
|
+
// overlay below xl, where this is CSS-hidden).
|
|
77
|
+
[
|
|
78
|
+
"hidden w-(--chief-width) shrink-0 shadow-panel xl:flex",
|
|
79
|
+
variant === "card" ? "rounded-xl" : "border-l border-border",
|
|
80
|
+
]
|
|
81
|
+
: [
|
|
82
|
+
"transition-all duration-(--motion-duration-base) ease-(--motion-ease-standard)",
|
|
83
|
+
// Below lg: fixed overlay drawer from the right (floating →
|
|
84
|
+
// the heavier overlay shadow gives it separation from content).
|
|
85
|
+
"fixed inset-y-4 right-4 z-50 w-[min(var(--chief-width),calc(100vw-2rem))] rounded-xl shadow-2xl backdrop-blur-xl",
|
|
86
|
+
// lg+: in-flow peer panel; the workspace reflows beside it. At
|
|
87
|
+
// rest it carries the subtle harvested container elevation
|
|
88
|
+
// (shadow-panel), not the floating overlay shadow.
|
|
89
|
+
"lg:relative lg:inset-auto lg:right-auto lg:z-auto lg:shrink-0 lg:shadow-panel lg:backdrop-blur-none",
|
|
90
|
+
variant === "flat" && "lg:rounded-none lg:border-l lg:border-border",
|
|
91
|
+
open
|
|
92
|
+
? "translate-x-0 opacity-100 lg:w-(--chief-width)"
|
|
93
|
+
: "pointer-events-none invisible translate-x-[calc(100%+1.5rem)] opacity-0 lg:w-0 lg:translate-x-0",
|
|
94
|
+
], className), children: [_jsx(ChiefHeaderBar, { title: session.title, icon: Icon, accentColor: accentColor, onClose: isRail ? undefined : () => setOpen(false) }), _jsx(ChiefSession, { session: session, composerRef: composerRef, accentColor: accentColor, workspaces: workspaces })] })] }));
|
|
45
95
|
}
|
|
46
96
|
//# sourceMappingURL=ChiefPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChiefPanel.js","sourceRoot":"","sources":["../../src/chief/ChiefPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb
|
|
1
|
+
{"version":3,"file":"ChiefPanel.js","sourceRoot":"","sources":["../../src/chief/ChiefPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAIzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAA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7D;oBACH,CAAC,CAAC;wBACE,gFAAgF;wBAChF,4DAA4D;wBAC5D,gEAAgE;wBAChE,kHAAkH;wBAClH,+DAA+D;wBAC/D,2DAA2D;wBAC3D,mDAAmD;wBACnD,qGAAqG;wBACrG,OAAO,KAAK,MAAM,IAAI,8CAA8C;wBACpE,IAAI;4BACF,CAAC,CAAC,gDAAgD;4BAClD,CAAC,CAAC,iGAAiG;qBACtG,EACL,SAAS,CACV,aAED,KAAC,cAAc,IACb,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAClD,EACF,KAAC,YAAY,IAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAI,IACxG,IACP,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
import type { OperatorFlavor } from "../flavor/types.js";
|
|
2
|
+
import type { CanvasDefinition } from "@consciousclouds/canvas-sdk";
|
|
3
|
+
import type { IconRegistry } from "../icons/registry.js";
|
|
4
|
+
import type { PersonalityDisplay } from "./personality-display.js";
|
|
2
5
|
import type { TurnAdapter } from "./turn-adapter.js";
|
|
6
|
+
import type { ChiefWorkspacesRegion } from "./ChiefSession.js";
|
|
7
|
+
import type { ConversationAdapter } from "./conversation-adapter.js";
|
|
8
|
+
import type { ComposedMeta } from "./use-chief-turn.js";
|
|
9
|
+
/** The AI Region's layout behaviors (chrome, never turn flow). */
|
|
10
|
+
export type ChiefBehavior = "push" | "overlay" | "rail";
|
|
11
|
+
/**
|
|
12
|
+
* The one behavior-resolution rule, pure and provable: the chrome config
|
|
13
|
+
* wins; a legacy `flavor.chief.placement` is honored as a hint (`rail` →
|
|
14
|
+
* `rail`, `drawer` → `overlay`); the default is the responsive hybrid.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveChiefBehavior(behavior?: ChiefBehavior, legacyPlacement?: "rail" | "drawer"): ChiefBehavior;
|
|
3
17
|
export interface ChiefRegionProps {
|
|
4
18
|
flavor: OperatorFlavor;
|
|
5
19
|
/** The product's transport (P1-1). The shell owns the region, never the wire. */
|
|
6
20
|
adapter: TurnAdapter;
|
|
21
|
+
/** Layout behavior (chrome config). Absent ⇒ legacy placement hint ⇒ `push`. */
|
|
22
|
+
behavior?: ChiefBehavior;
|
|
23
|
+
/** Panel width in px (default 420). */
|
|
24
|
+
width?: number;
|
|
25
|
+
/** Desktop chrome for the inflow modes: `card` (framed) | `flat` (edge-to-edge). */
|
|
26
|
+
variant?: "card" | "flat";
|
|
27
|
+
/** Controlled open state (push/overlay; rail is always open at xl+). */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
/** External trigger element (outside-click exclusion + focus return). */
|
|
31
|
+
getTriggerElement?: () => HTMLElement | null;
|
|
32
|
+
/** Display identity from the Factory personality record (D-Q2 seam). */
|
|
33
|
+
personalityDisplay?: PersonalityDisplay;
|
|
34
|
+
/** Icon-registry extensions for `personalityDisplay.iconRef` resolution. */
|
|
35
|
+
icons?: IconRegistry;
|
|
36
|
+
/** Brand icon family (read-and-defaulted by the registry). */
|
|
37
|
+
iconFamily?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The compose→center seam: a turn produced a transient CanvasDefinition.
|
|
40
|
+
* Threaded down to useChiefTurn (identical in every presentation); OperatorShell
|
|
41
|
+
* consumes it to drive the CENTER workspace. Panel stays presentation-only.
|
|
42
|
+
*/
|
|
43
|
+
onComposed?: (canvas: CanvasDefinition, meta: ComposedMeta) => void;
|
|
44
|
+
/** Composition activity (real tool events) — forwarded verbatim to useChiefTurn. */
|
|
45
|
+
onComposeActivity?: (phase: "composing" | "idle") => void;
|
|
46
|
+
/** The transcript transport (fail-closed slot) — identical in every presentation. */
|
|
47
|
+
conversationAdapter?: ConversationAdapter;
|
|
48
|
+
/** Kept workspaces for the drawer's Workspaces tab (fail-closed slot). */
|
|
49
|
+
workspaces?: ChiefWorkspacesRegion;
|
|
7
50
|
}
|
|
8
|
-
export declare function ChiefRegion({ flavor, adapter }: ChiefRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function ChiefRegion({ flavor, adapter, behavior, width, variant, open, onOpenChange, getTriggerElement, personalityDisplay, icons, iconFamily, onComposed, onComposeActivity, conversationAdapter, workspaces, }: ChiefRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
9
52
|
//# sourceMappingURL=ChiefRegion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChiefRegion.d.ts","sourceRoot":"","sources":["../../src/chief/ChiefRegion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChiefRegion.d.ts","sourceRoot":"","sources":["../../src/chief/ChiefRegion.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,kEAAkE;AAClE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,oBAAoB,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AU,GACX,EAAE,gBAAgB,2CAiClB"}
|
|
@@ -2,29 +2,46 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
4
|
* ChiefRegion — the shell's AI REGION: the one place Chief mounts, resolving
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* a BEHAVIOR to a presentation. Behavior is a COMPOSITION concern (the
|
|
6
|
+
* chrome config on OperatorShell — defaults-and-overrides: the SDK ships
|
|
7
|
+
* sensible defaults, the consuming app overrides at its composition root,
|
|
8
|
+
* never by forking); it moves the panel, never the turn flow — every
|
|
9
|
+
* behavior runs the same useChiefTurn over the same injected TurnAdapter,
|
|
10
|
+
* the same conductor event vocabulary, and the same routed-directive guard.
|
|
9
11
|
*
|
|
10
|
-
* - `
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* trigger, with assistant-surface's open/close lifecycle (ChiefDrawer).
|
|
12
|
+
* - `push` (default): the responsive hybrid, one component — overlay
|
|
13
|
+
* drawer below lg, in-flow push panel (w-0 → w-(--chief-width)) at lg+.
|
|
14
|
+
* Closed by default; summoned by the header trigger or ⌘J.
|
|
15
|
+
* - `overlay`: the floating drawer at every width.
|
|
16
|
+
* - `rail`: the always-visible mode — the always-open inflow rail at xl+,
|
|
17
|
+
* the overlay below it (where the rail is CSS-hidden) so Chief stays
|
|
18
|
+
* reachable on narrow viewports.
|
|
18
19
|
*
|
|
19
20
|
* Exactly ONE presentation mounts at a time (they share the
|
|
20
|
-
* `operator-shell-chief` surface id — the single-surface rule holds).
|
|
21
|
-
* breakpoint check is undefined until the client knows the
|
|
22
|
-
* region then renders the rail, whose CSS already hides it
|
|
23
|
-
* SSR/hydration stay consistent and nothing flashes.
|
|
21
|
+
* `operator-shell-chief` surface id — the single-surface rule holds). For
|
|
22
|
+
* `rail`, the breakpoint check is undefined until the client knows the
|
|
23
|
+
* viewport; the region then renders the rail, whose CSS already hides it
|
|
24
|
+
* below xl, so SSR/hydration stay consistent and nothing flashes. `push`
|
|
25
|
+
* and `overlay` need no viewport check at all — their responsiveness is
|
|
26
|
+
* pure CSS on one mounted component (the turn thread survives resizes).
|
|
24
27
|
*/
|
|
25
28
|
import * as React from "react";
|
|
26
29
|
import { ChiefDrawer } from "./ChiefDrawer.js";
|
|
27
30
|
import { ChiefPanel } from "./ChiefPanel.js";
|
|
31
|
+
/**
|
|
32
|
+
* The one behavior-resolution rule, pure and provable: the chrome config
|
|
33
|
+
* wins; a legacy `flavor.chief.placement` is honored as a hint (`rail` →
|
|
34
|
+
* `rail`, `drawer` → `overlay`); the default is the responsive hybrid.
|
|
35
|
+
*/
|
|
36
|
+
export function resolveChiefBehavior(behavior, legacyPlacement) {
|
|
37
|
+
if (behavior !== undefined)
|
|
38
|
+
return behavior;
|
|
39
|
+
if (legacyPlacement === "rail")
|
|
40
|
+
return "rail";
|
|
41
|
+
if (legacyPlacement === "drawer")
|
|
42
|
+
return "overlay";
|
|
43
|
+
return "push";
|
|
44
|
+
}
|
|
28
45
|
/** Tailwind's `xl` — MUST match the rail's `hidden xl:flex` visibility. */
|
|
29
46
|
const XL_QUERY = "(min-width: 1280px)";
|
|
30
47
|
/** undefined until the client can answer (SSR/first render). */
|
|
@@ -39,17 +56,36 @@ function useIsXl() {
|
|
|
39
56
|
}, []);
|
|
40
57
|
return isXl;
|
|
41
58
|
}
|
|
42
|
-
export function ChiefRegion({ flavor, adapter }) {
|
|
43
|
-
const
|
|
59
|
+
export function ChiefRegion({ flavor, adapter, behavior, width, variant, open, onOpenChange, getTriggerElement, personalityDisplay, icons, iconFamily, onComposed, onComposeActivity, conversationAdapter, workspaces, }) {
|
|
60
|
+
const resolved = resolveChiefBehavior(behavior, flavor.chief?.placement);
|
|
44
61
|
const isXl = useIsXl();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
const shared = {
|
|
63
|
+
flavor,
|
|
64
|
+
adapter,
|
|
65
|
+
width,
|
|
66
|
+
open,
|
|
67
|
+
onOpenChange,
|
|
68
|
+
getTriggerElement,
|
|
69
|
+
personalityDisplay,
|
|
70
|
+
icons,
|
|
71
|
+
iconFamily,
|
|
72
|
+
onComposed,
|
|
73
|
+
onComposeActivity,
|
|
74
|
+
conversationAdapter,
|
|
75
|
+
workspaces,
|
|
76
|
+
};
|
|
77
|
+
if (resolved === "overlay")
|
|
78
|
+
return _jsx(ChiefDrawer, { ...shared });
|
|
79
|
+
if (resolved === "rail") {
|
|
80
|
+
// The always-visible mode: the inflow rail at xl and up; the overlay
|
|
81
|
+
// below it (where the rail is CSS-hidden). While the viewport is
|
|
82
|
+
// unknown (SSR/first client render) the rail mounts — its own CSS keeps
|
|
83
|
+
// it invisible below xl, so there is no flash either way.
|
|
84
|
+
if (isXl === false)
|
|
85
|
+
return _jsx(ChiefDrawer, { ...shared });
|
|
86
|
+
return _jsx(ChiefPanel, { ...shared, mode: "rail", variant: variant });
|
|
87
|
+
}
|
|
88
|
+
// The default responsive hybrid — one component, pure-CSS responsive.
|
|
89
|
+
return _jsx(ChiefPanel, { ...shared, mode: "push", variant: variant });
|
|
54
90
|
}
|
|
55
91
|
//# sourceMappingURL=ChiefRegion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChiefRegion.js","sourceRoot":"","sources":["../../src/chief/ChiefRegion.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb
|
|
1
|
+
{"version":3,"file":"ChiefRegion.js","sourceRoot":"","sources":["../../src/chief/ChiefRegion.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,WAA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CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACzE,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,MAAM,GAAG;QACb,MAAM;QACN,OAAO;QACP,KAAK;QACL,IAAI;QACJ,YAAY;QACZ,iBAAiB;QACjB,kBAAkB;QAClB,KAAK;QACL,UAAU;QACV,UAAU;QACV,iBAAiB;QACjB,mBAAmB;QACnB,UAAU;KACX,CAAC;IAEF,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,KAAC,WAAW,OAAK,MAAM,GAAI,CAAC;IAE/D,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,qEAAqE;QACrE,iEAAiE;QACjE,wEAAwE;QACxE,0DAA0D;QAC1D,IAAI,IAAI,KAAK,KAAK;YAAE,OAAO,KAAC,WAAW,OAAK,MAAM,GAAI,CAAC;QACvD,OAAO,KAAC,UAAU,OAAK,MAAM,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,CAAC;IAClE,CAAC;IAED,sEAAsE;IACtE,OAAO,KAAC,UAAU,OAAK,MAAM,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,CAAC;AAClE,CAAC"}
|
|
@@ -1,21 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChiefSession — the AI Region's shared BODY:
|
|
3
|
-
*
|
|
2
|
+
* ChiefSession — the AI Region's shared BODY: the empty state (hint card +
|
|
3
|
+
* suggestion chips), the thread (question · streamed markdown answer ·
|
|
4
|
+
* color-coded metadata bar), and the pill composer, rendered from a
|
|
4
5
|
* ChiefTurnSession. Pure presentation of the one turn flow — every placement
|
|
5
|
-
* (rail,
|
|
6
|
-
* Chief never forks its behavior or its look.
|
|
6
|
+
* (rail, push, overlay) mounts this same column inside its own chrome, so
|
|
7
|
+
* moving Chief never forks its behavior or its look.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Suggestion chips are inert Flavor strings (`flavor.chief.suggestions`);
|
|
10
|
+
* clicking one submits its text through `submitPrompt` — the SAME entry the
|
|
11
|
+
* composer uses, so a chip is a canned question, never a second code path.
|
|
12
|
+
*
|
|
13
|
+
* `composerRef` exposes the composer input to the mounting placement — ⌘J
|
|
14
|
+
* focus on the rail, focus-on-open in the dismissible placements;
|
|
15
|
+
* presentation only, no behavior lives here.
|
|
16
|
+
*
|
|
17
|
+
* MOTION (presentation only — the turn STATE and the adapter are untouched):
|
|
18
|
+
* the conversation is animated with the ConsciousClouds motion vocabulary
|
|
19
|
+
* (`@consciousclouds/tokens`' `motionTokens` — durations/curves/offsets, no
|
|
20
|
+
* inline magic numbers) through `motion/react`. The empty-state hint rises in
|
|
21
|
+
* and the suggestion chips STAGGER in gently; when the first turn starts the
|
|
22
|
+
* thread rises in (empty → active); inside the thread the "thinking…" state
|
|
23
|
+
* and the answer CROSSFADE (the leaving one lifts out as an absolute overlay,
|
|
24
|
+
* so nothing reflows) and the answer SETTLES to full size the instant
|
|
25
|
+
* streaming completes; the status line eases in. The token stream itself is
|
|
26
|
+
* never animated per-character (that fights the stream) — only the CONTAINER
|
|
27
|
+
* and the turn state are. Every gesture respects `prefers-reduced-motion`
|
|
28
|
+
* (`useReducedMotion`): reduced → instant, no transform, no fade.
|
|
11
29
|
*/
|
|
12
|
-
import
|
|
30
|
+
import * as React from "react";
|
|
13
31
|
import type { ChiefTurnSession } from "./use-chief-turn.js";
|
|
32
|
+
/**
|
|
33
|
+
* The AI Region's Workspaces tab data (Session Binder consumption slice —
|
|
34
|
+
* "a conversation owns a workspace", so kept workspaces live WITH the
|
|
35
|
+
* conversation surface, in the drawer, not the side menu). Same shape the
|
|
36
|
+
* sidebar region used; fed by OperatorShell, absent ⇒ no tab.
|
|
37
|
+
*/
|
|
38
|
+
export interface ChiefWorkspacesRegion {
|
|
39
|
+
items: ReadonlyArray<{
|
|
40
|
+
workspaceId: string;
|
|
41
|
+
name: string;
|
|
42
|
+
}>;
|
|
43
|
+
activeId?: string;
|
|
44
|
+
onOpen: (workspaceId: string) => void;
|
|
45
|
+
}
|
|
14
46
|
export interface ChiefSessionProps {
|
|
15
47
|
session: ChiefTurnSession;
|
|
16
|
-
/** The composer input element — the placement's focus target (⌘J on
|
|
48
|
+
/** The composer input element — the placement's focus target (⌘J, focus-on-open). */
|
|
17
49
|
composerRef?: React.Ref<HTMLInputElement>;
|
|
50
|
+
/** Composable CSS color from a token ROLE (resolvePersonalityAccent). */
|
|
51
|
+
accentColor?: string;
|
|
52
|
+
/** Kept workspaces for the Workspaces tab (absent ⇒ the tab doesn't exist). */
|
|
53
|
+
workspaces?: ChiefWorkspacesRegion;
|
|
18
54
|
className?: string;
|
|
19
55
|
}
|
|
20
|
-
export declare function ChiefSession({ session, composerRef, className }: ChiefSessionProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare function ChiefSession({ session, composerRef, accentColor, workspaces, className, }: ChiefSessionProps): import("react/jsx-runtime").JSX.Element;
|
|
21
57
|
//# sourceMappingURL=ChiefSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChiefSession.d.ts","sourceRoot":"","sources":["../../src/chief/ChiefSession.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"ChiefSession.d.ts","sourceRoot":"","sources":["../../src/chief/ChiefSession.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAY5D;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAKD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,qFAAqF;IACrF,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC1C,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8BD,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,GACV,EAAE,iBAAiB,2CAyenB"}
|