@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.
Files changed (93) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +80 -31
  3. package/dist/chief/ChiefDrawer.d.ts +34 -2
  4. package/dist/chief/ChiefDrawer.d.ts.map +1 -1
  5. package/dist/chief/ChiefDrawer.js +43 -30
  6. package/dist/chief/ChiefDrawer.js.map +1 -1
  7. package/dist/chief/ChiefHeaderBar.d.ts +19 -0
  8. package/dist/chief/ChiefHeaderBar.d.ts.map +1 -0
  9. package/dist/chief/ChiefHeaderBar.js +7 -0
  10. package/dist/chief/ChiefHeaderBar.js.map +1 -0
  11. package/dist/chief/ChiefMarkdown.d.ts +12 -0
  12. package/dist/chief/ChiefMarkdown.d.ts.map +1 -0
  13. package/dist/chief/ChiefMarkdown.js +95 -0
  14. package/dist/chief/ChiefMarkdown.js.map +1 -0
  15. package/dist/chief/ChiefPanel.d.ts +44 -1
  16. package/dist/chief/ChiefPanel.d.ts.map +1 -1
  17. package/dist/chief/ChiefPanel.js +79 -29
  18. package/dist/chief/ChiefPanel.js.map +1 -1
  19. package/dist/chief/ChiefRegion.d.ts +44 -1
  20. package/dist/chief/ChiefRegion.d.ts.map +1 -1
  21. package/dist/chief/ChiefRegion.js +63 -27
  22. package/dist/chief/ChiefRegion.js.map +1 -1
  23. package/dist/chief/ChiefSession.d.ts +46 -10
  24. package/dist/chief/ChiefSession.d.ts.map +1 -1
  25. package/dist/chief/ChiefSession.js +252 -6
  26. package/dist/chief/ChiefSession.js.map +1 -1
  27. package/dist/chief/ChiefTrigger.d.ts +26 -0
  28. package/dist/chief/ChiefTrigger.d.ts.map +1 -0
  29. package/dist/chief/ChiefTrigger.js +21 -0
  30. package/dist/chief/ChiefTrigger.js.map +1 -0
  31. package/dist/chief/conversation-adapter.d.ts +70 -0
  32. package/dist/chief/conversation-adapter.d.ts.map +1 -0
  33. package/dist/chief/conversation-adapter.js +26 -0
  34. package/dist/chief/conversation-adapter.js.map +1 -0
  35. package/dist/chief/conversation-identity.d.ts +48 -0
  36. package/dist/chief/conversation-identity.d.ts.map +1 -0
  37. package/dist/chief/conversation-identity.js +100 -0
  38. package/dist/chief/conversation-identity.js.map +1 -0
  39. package/dist/chief/personality-display.d.ts +56 -0
  40. package/dist/chief/personality-display.d.ts.map +1 -0
  41. package/dist/chief/personality-display.js +52 -0
  42. package/dist/chief/personality-display.js.map +1 -0
  43. package/dist/chief/turn-adapter.d.ts +45 -0
  44. package/dist/chief/turn-adapter.d.ts.map +1 -1
  45. package/dist/chief/use-chief-turn.d.ts +127 -14
  46. package/dist/chief/use-chief-turn.d.ts.map +1 -1
  47. package/dist/chief/use-chief-turn.js +284 -28
  48. package/dist/chief/use-chief-turn.js.map +1 -1
  49. package/dist/chief/use-controlled-open.d.ts +2 -0
  50. package/dist/chief/use-controlled-open.d.ts.map +1 -0
  51. package/dist/chief/use-controlled-open.js +27 -0
  52. package/dist/chief/use-controlled-open.js.map +1 -0
  53. package/dist/chief/use-smooth-stream.d.ts +8 -0
  54. package/dist/chief/use-smooth-stream.d.ts.map +1 -0
  55. package/dist/chief/use-smooth-stream.js +128 -0
  56. package/dist/chief/use-smooth-stream.js.map +1 -0
  57. package/dist/flavor/types.d.ts +36 -21
  58. package/dist/flavor/types.d.ts.map +1 -1
  59. package/dist/frame/ComposedWorkspace.d.ts +39 -0
  60. package/dist/frame/ComposedWorkspace.d.ts.map +1 -0
  61. package/dist/frame/ComposedWorkspace.js +94 -0
  62. package/dist/frame/ComposedWorkspace.js.map +1 -0
  63. package/dist/frame/OperatorShell.d.ts +115 -13
  64. package/dist/frame/OperatorShell.d.ts.map +1 -1
  65. package/dist/frame/OperatorShell.js +200 -12
  66. package/dist/frame/OperatorShell.js.map +1 -1
  67. package/dist/guard/permissions.d.ts +2 -2
  68. package/dist/guard/permissions.js +2 -2
  69. package/dist/header/OperatorHeader.d.ts +15 -2
  70. package/dist/header/OperatorHeader.d.ts.map +1 -1
  71. package/dist/header/OperatorHeader.js +3 -3
  72. package/dist/header/OperatorHeader.js.map +1 -1
  73. package/dist/icons/registry.d.ts +7 -1
  74. package/dist/icons/registry.d.ts.map +1 -1
  75. package/dist/icons/registry.js +31 -2
  76. package/dist/icons/registry.js.map +1 -1
  77. package/dist/index.d.ts +24 -11
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +43 -17
  80. package/dist/index.js.map +1 -1
  81. package/dist/sidebar/OperatorSidebar.d.ts +16 -1
  82. package/dist/sidebar/OperatorSidebar.d.ts.map +1 -1
  83. package/dist/sidebar/OperatorSidebar.js +13 -10
  84. package/dist/sidebar/OperatorSidebar.js.map +1 -1
  85. package/dist/workspace/FormWorkspace.d.ts +2 -3
  86. package/dist/workspace/FormWorkspace.d.ts.map +1 -1
  87. package/dist/workspace/FormWorkspace.js.map +1 -1
  88. package/dist/workspace/session-adapter.d.ts +95 -0
  89. package/dist/workspace/session-adapter.d.ts.map +1 -0
  90. package/dist/workspace/session-adapter.js +29 -0
  91. package/dist/workspace/session-adapter.js.map +1 -0
  92. package/package.json +10 -5
  93. 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":"AA4BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,gFAAgF;IAChF,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,2CAqCzE"}
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"}
@@ -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 RAIL placement: an always-open inflow
5
- * assistant rail mounted through @consciousclouds/assistant-surface's
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
- * Two shapes off one turn:
11
- * - a deterministic command moves the surface via a `routed` event — ZERO
12
- * model tokens (only honored when the destination is part of this
13
- * console, DERIVED from the Flavor's nav; off-console targets are
14
- * reported, not navigated to);
15
- * - any other question is a router miss the model reasons over the
16
- * granted knowledge envelope and streams the answer here.
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
- * The chat is just the access point; the operator intelligence is the
19
- * knowledge underneath. Transport is the injected TurnAdapter's the shell
20
- * never owns the wire (P1-1).
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
- export function ChiefPanel({ flavor, adapter, className }) {
30
- const session = useChiefTurn({ flavor, adapter });
31
- // Headless assistant-surface mount (inflow: always open, non-modal,
32
- // non-dismissible). The drawer placement is the same content behind the
33
- // sheet primitive see ChiefRegion for the placement switch.
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: true,
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
- // The shell-owned Chief keybinding (⌘J / Ctrl+J use-chief-shortcut.ts).
41
- // The rail is always open, so invocation here means: focus the composer.
42
- const composerRef = React.useRef(null);
43
- useChiefShortcut(() => composerRef.current?.focus());
44
- return (_jsxs("aside", { ref: surface.surfaceRef, ...surface.surfaceProps, className: cn("hidden w-[340px] shrink-0 flex-col border-l border-border bg-background xl:flex", className), children: [_jsxs("div", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-4", children: [_jsx("div", { className: "flex size-6 items-center justify-center rounded-md bg-primary/10 text-primary", children: _jsx(Sparkles, { className: "size-3.5" }) }), _jsx("div", { className: "text-sm font-medium", children: session.title })] }), _jsx(ChiefSession, { session: session, composerRef: composerRef })] }));
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;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO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C,EAC3C,MAAM;oBACJ,CAAC,CAAC,2DAA2D;wBAC3D,+CAA+C;wBAC/C;4BACE,wDAAwD;4BACxD,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,wBAAwB;yBAC7D;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":"AA2BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAkBrD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,iFAAiF;IACjF,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,gBAAgB,2CAYhE"}
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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AAK,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,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
- * `flavor.chief.placement` to a presentation. Placement is Flavor decoration
6
- * (P1-1): it moves the panel, never the behavior — every placement runs the
7
- * same useChiefTurn flow over the same injected TurnAdapter, the same
8
- * conductor event vocabulary, and the same routed-directive guard.
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
- * - `rail` (default): the always-open inflow right rail (ChiefPanel).
11
- * Below the xl breakpoint where the rail's `hidden xl:flex` chrome
12
- * disappears the region falls back to the DRAWER so Chief stays
13
- * reachable on narrow viewports instead of silently vanishing (the rail
14
- * was CSS-hidden there before; now the same seam that makes placement
15
- * configurable also closes that gap).
16
- * - `drawer`: the same content behind the sheet primitive + a floating
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). The
21
- * breakpoint check is undefined until the client knows the viewport; the
22
- * region then renders the rail, whose CSS already hides it below xl, so
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 placement = flavor.chief?.placement ?? "rail";
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
- if (placement === "drawer")
46
- return _jsx(ChiefDrawer, { flavor: flavor, adapter: adapter });
47
- // Rail placement: the inflow rail at xl and up; the drawer below it
48
- // (where the rail is CSS-hidden). While the viewport is unknown
49
- // (SSR/first client render) the rail mounts — its own CSS keeps it
50
- // invisible below xl, so there is no flash either way.
51
- if (isXl === false)
52
- return _jsx(ChiefDrawer, { flavor: flavor, adapter: adapter });
53
- return _jsx(ChiefPanel, { flavor: flavor, adapter: adapter });
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;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,2EAA2E;AAC3E,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AAEvC,gEAAgE;AAChE,SAAS,OAAO;IACd,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAsB,SAAS,CAAC,CAAC;IACvE,KAAK,CAAC,SAAS,CAAC,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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: idle hint, thread (question ·
3
- * streamed answer · status line), and the composer form, rendered from a
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, drawer) mounts this same column inside its own chrome, so moving
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
- * `composerRef` exposes the composer input to the mounting placement — the
9
- * rail points the shell's ⌘J invocation at it (focus); presentation only,
10
- * no behavior lives here.
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 type * as React from "react";
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 the rail). */
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;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,kFAAkF;IAClF,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAyFlF"}
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,CAA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