@guuey/agent-layout 0.16.0 → 0.16.1
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 +4 -1
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.1",
|
|
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
|
@@ -40,7 +40,10 @@
|
|
|
40
40
|
color: var(--guuey-layout-tone-upper-on);
|
|
41
41
|
}
|
|
42
42
|
.guuey-layout-panel-agent {
|
|
43
|
-
|
|
43
|
+
/* Host-overridable default (guuey#427): a host that wants a fixed-height
|
|
44
|
+
* rail sets `--guuey-layout-agent-panel-flex` (e.g. `0 0 auto` + its own
|
|
45
|
+
* height) — a custom-property seam, never a specificity fight. */
|
|
46
|
+
flex: var(--guuey-layout-agent-panel-flex, 1);
|
|
44
47
|
display: flex;
|
|
45
48
|
flex-direction: column;
|
|
46
49
|
background: var(--guuey-layout-tone-lower);
|