@guuey/agent-layout 0.16.0 → 0.16.2
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/machine.d.ts +10 -0
- package/dist/machine.d.ts.map +1 -1
- package/dist/machine.js +3 -0
- package/dist/react.d.ts +7 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +6 -1
- package/package.json +1 -1
- package/src/machine.ts +11 -0
- package/src/react.tsx +12 -2
- package/styles.css +32 -2
package/dist/machine.d.ts
CHANGED
|
@@ -39,6 +39,16 @@ export type AgentModeInput =
|
|
|
39
39
|
| {
|
|
40
40
|
type: "agentSubmit";
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Give the agent panel the room WITHOUT claiming a submit happened
|
|
44
|
+
* (guuey#427, the first consumer's near-miss): a host reopening the
|
|
45
|
+
* agent surface (restoring a view, a deep link) wants the tone flip
|
|
46
|
+
* and NOTHING else — arming the working state here would leave a
|
|
47
|
+
* permanent spinner, since no turn will ever mount a view or settle.
|
|
48
|
+
*/
|
|
49
|
+
| {
|
|
50
|
+
type: "agentPanelActivated";
|
|
51
|
+
}
|
|
42
52
|
/** The turn reached `ready`. NO panel transition (platform-ruled: no bounce-back). */
|
|
43
53
|
| {
|
|
44
54
|
type: "agentSettled";
|
package/dist/machine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../src/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,wBAAwB,EAAE,cAKtC,CAAC;AAE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AAE,KAAK,EAAE,cAAc,GAAG,cAAc,CAqB5F"}
|
package/dist/machine.js
CHANGED
|
@@ -39,6 +39,9 @@ export function agentModeReduce(state, input) {
|
|
|
39
39
|
return { ...state, activePanel: "app", pending: false };
|
|
40
40
|
case "agentSubmit":
|
|
41
41
|
return { activePanel: "agent", streaming: true, pending: true };
|
|
42
|
+
case "agentPanelActivated":
|
|
43
|
+
// The neutral flip: panel only — streaming/pending untouched.
|
|
44
|
+
return { ...state, activePanel: "agent" };
|
|
42
45
|
case "agentSettled":
|
|
43
46
|
// Stream end changes nothing about the panel — the tone tracks the
|
|
44
47
|
// user's locus of action, not the agent's state.
|
package/dist/react.d.ts
CHANGED
|
@@ -54,7 +54,13 @@ export interface UseAgentModeResult {
|
|
|
54
54
|
pending: boolean;
|
|
55
55
|
/** The raw machine door — `bindGuueyChat(dispatch)` wires a kit surface. */
|
|
56
56
|
dispatch: (input: AgentModeInput) => void;
|
|
57
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* The NEUTRAL panel setter (guuey#427): flips which panel has the room
|
|
59
|
+
* and nothing else — `"agent"` never claims a submit happened (no
|
|
60
|
+
* working state, no streaming). Submit intent goes through
|
|
61
|
+
* `dispatch({ type: "agentSubmit" })` / `bindGuueyChat`. Escape hatch,
|
|
62
|
+
* documented as rarely needed.
|
|
63
|
+
*/
|
|
58
64
|
setActivePanel: (panel: ActivePanel) => void;
|
|
59
65
|
/** The <1024px overlay drawer (lib-owned state; Shell renders the toggle). */
|
|
60
66
|
drawerOpen: boolean;
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAUL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;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AG,IAAI,EAAE,EAAE,iBAAiB,GAAG,SAAS,CAcpG;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,GAAG,SAAS,CAwBrG;AAMD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChF,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -57,7 +57,12 @@ export function useAgentMode() {
|
|
|
57
57
|
throw new Error("useAgentMode: no <AgentModeProvider> above this component.");
|
|
58
58
|
}
|
|
59
59
|
const { state, dispatch, drawerOpen, setDrawerOpen } = ctx;
|
|
60
|
-
const setActivePanel = useCallback((panel) =>
|
|
60
|
+
const setActivePanel = useCallback((panel) =>
|
|
61
|
+
// guuey#427: the name promises a neutral setter, so it IS one — the
|
|
62
|
+
// agent arm activates the panel WITHOUT arming the working state
|
|
63
|
+
// (the first consumer nearly shipped a permanent spinner on the
|
|
64
|
+
// agentSubmit sugar this used to be).
|
|
65
|
+
dispatch(panel === "app" ? { type: "menuInteraction" } : { type: "agentPanelActivated" }), [dispatch]);
|
|
61
66
|
return {
|
|
62
67
|
activePanel: state.activePanel,
|
|
63
68
|
streaming: state.streaming,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guuey/agent-layout",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "Agent-mode layout: the two-tone shell where an app and its agent share one surface — the pane follows attention, the transport owns the stream.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/src/machine.ts
CHANGED
|
@@ -44,6 +44,14 @@ export type AgentModeInput =
|
|
|
44
44
|
| { type: "menuInteraction" }
|
|
45
45
|
/** The user sent a message — the agent bridge fired. */
|
|
46
46
|
| { type: "agentSubmit" }
|
|
47
|
+
/**
|
|
48
|
+
* Give the agent panel the room WITHOUT claiming a submit happened
|
|
49
|
+
* (guuey#427, the first consumer's near-miss): a host reopening the
|
|
50
|
+
* agent surface (restoring a view, a deep link) wants the tone flip
|
|
51
|
+
* and NOTHING else — arming the working state here would leave a
|
|
52
|
+
* permanent spinner, since no turn will ever mount a view or settle.
|
|
53
|
+
*/
|
|
54
|
+
| { type: "agentPanelActivated" }
|
|
47
55
|
/** The turn reached `ready`. NO panel transition (platform-ruled: no bounce-back). */
|
|
48
56
|
| { type: "agentSettled" }
|
|
49
57
|
/** A live view mounted — the working state has been replaced by content. */
|
|
@@ -63,6 +71,9 @@ export function agentModeReduce(state: AgentModeState, input: AgentModeInput): A
|
|
|
63
71
|
return { ...state, activePanel: "app", pending: false };
|
|
64
72
|
case "agentSubmit":
|
|
65
73
|
return { activePanel: "agent", streaming: true, pending: true };
|
|
74
|
+
case "agentPanelActivated":
|
|
75
|
+
// The neutral flip: panel only — streaming/pending untouched.
|
|
76
|
+
return { ...state, activePanel: "agent" };
|
|
66
77
|
case "agentSettled":
|
|
67
78
|
// Stream end changes nothing about the panel — the tone tracks the
|
|
68
79
|
// user's locus of action, not the agent's state.
|
package/src/react.tsx
CHANGED
|
@@ -142,7 +142,13 @@ export interface UseAgentModeResult {
|
|
|
142
142
|
pending: boolean;
|
|
143
143
|
/** The raw machine door — `bindGuueyChat(dispatch)` wires a kit surface. */
|
|
144
144
|
dispatch: (input: AgentModeInput) => void;
|
|
145
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* The NEUTRAL panel setter (guuey#427): flips which panel has the room
|
|
147
|
+
* and nothing else — `"agent"` never claims a submit happened (no
|
|
148
|
+
* working state, no streaming). Submit intent goes through
|
|
149
|
+
* `dispatch({ type: "agentSubmit" })` / `bindGuueyChat`. Escape hatch,
|
|
150
|
+
* documented as rarely needed.
|
|
151
|
+
*/
|
|
146
152
|
setActivePanel: (panel: ActivePanel) => void;
|
|
147
153
|
/** The <1024px overlay drawer (lib-owned state; Shell renders the toggle). */
|
|
148
154
|
drawerOpen: boolean;
|
|
@@ -157,7 +163,11 @@ export function useAgentMode(): UseAgentModeResult {
|
|
|
157
163
|
const { state, dispatch, drawerOpen, setDrawerOpen } = ctx;
|
|
158
164
|
const setActivePanel = useCallback(
|
|
159
165
|
(panel: ActivePanel) =>
|
|
160
|
-
|
|
166
|
+
// guuey#427: the name promises a neutral setter, so it IS one — the
|
|
167
|
+
// agent arm activates the panel WITHOUT arming the working state
|
|
168
|
+
// (the first consumer nearly shipped a permanent spinner on the
|
|
169
|
+
// agentSubmit sugar this used to be).
|
|
170
|
+
dispatch(panel === "app" ? { type: "menuInteraction" } : { type: "agentPanelActivated" }),
|
|
161
171
|
[dispatch],
|
|
162
172
|
);
|
|
163
173
|
return {
|
package/styles.css
CHANGED
|
@@ -11,14 +11,37 @@
|
|
|
11
11
|
* set it.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
/* guuey#429 (founder rule, requirement-grade): the shell is VIEWPORT-PINNED
|
|
15
|
+
* by default — "the sidebar's height should be fixed and the lower part
|
|
16
|
+
* should be stick on its bottom". `height: 100%` only pins when every
|
|
17
|
+
* ancestor carries a definite height, which no adopter's tree guarantees —
|
|
18
|
+
* against auto ancestors it computes to auto, tall pane content stretches
|
|
19
|
+
* the PAGE, and the agent rail scrolls below the fold (a scrollable-away
|
|
20
|
+
* agent panel defeats the category). So the ROOT establishes the chain
|
|
21
|
+
* itself: dynamic-viewport height (dvh; vh first as the older-browser
|
|
22
|
+
* fallback), `overflow: hidden` so content can only scroll inside the
|
|
23
|
+
* panels' own scroll contexts (the pane's overflow:auto; the chat's own
|
|
24
|
+
* scroller), never the page. An embedder that genuinely wants an in-flow
|
|
25
|
+
* layout sets `--guuey-layout-height` (e.g. `100%` inside its own pinned
|
|
26
|
+
* region) — a seam, not a fight. */
|
|
14
27
|
.guuey-agent-layout {
|
|
15
|
-
height:
|
|
28
|
+
height: var(--guuey-layout-height, 100vh);
|
|
29
|
+
height: var(--guuey-layout-height, 100dvh);
|
|
16
30
|
min-height: 0;
|
|
31
|
+
overflow: hidden;
|
|
17
32
|
}
|
|
18
33
|
|
|
19
34
|
.guuey-layout-shell {
|
|
20
35
|
display: grid;
|
|
21
36
|
grid-template-columns: minmax(240px, 300px) 1fr;
|
|
37
|
+
/* guuey#429, the completing half (console's adjudication): without an
|
|
38
|
+
* explicit row the grid's IMPLICIT row is `auto` — it sizes to content,
|
|
39
|
+
* growing past any bounded container and rendering every child's
|
|
40
|
+
* min-height:0 + overflow:auto inert (clip-not-scroll). minmax(0, 1fr)
|
|
41
|
+
* makes the row exactly the container's height, so the root's viewport
|
|
42
|
+
* pin actually DISTRIBUTES: sidebar bound, pane scrolling within
|
|
43
|
+
* itself. */
|
|
44
|
+
grid-template-rows: minmax(0, 1fr);
|
|
22
45
|
height: 100%;
|
|
23
46
|
min-height: 0;
|
|
24
47
|
}
|
|
@@ -36,11 +59,18 @@
|
|
|
36
59
|
transition: background-color var(--guuey-layout-tone-transition) ease-out;
|
|
37
60
|
}
|
|
38
61
|
.guuey-layout-panel-app {
|
|
62
|
+
/* The app panel keeps its content height; the agent panel takes the
|
|
63
|
+
* remaining lower space (guuey#429 — stuck on its bottom, never
|
|
64
|
+
* crushed nor scrolled away). */
|
|
65
|
+
flex-shrink: 0;
|
|
39
66
|
background: var(--guuey-layout-tone-upper);
|
|
40
67
|
color: var(--guuey-layout-tone-upper-on);
|
|
41
68
|
}
|
|
42
69
|
.guuey-layout-panel-agent {
|
|
43
|
-
|
|
70
|
+
/* Host-overridable default (guuey#427): a host that wants a fixed-height
|
|
71
|
+
* rail sets `--guuey-layout-agent-panel-flex` (e.g. `0 0 auto` + its own
|
|
72
|
+
* height) — a custom-property seam, never a specificity fight. */
|
|
73
|
+
flex: var(--guuey-layout-agent-panel-flex, 1);
|
|
44
74
|
display: flex;
|
|
45
75
|
flex-direction: column;
|
|
46
76
|
background: var(--guuey-layout-tone-lower);
|