@guuey/chat 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/native/components.d.ts.map +1 -1
- package/dist/native/components.js +4 -2
- package/dist/oauth.d.ts +87 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +121 -0
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +2 -0
- package/dist/react/components.d.ts.map +1 -1
- package/dist/react/components.js +6 -2
- package/dist/react/guuey-chat.d.ts +14 -0
- package/dist/react/guuey-chat.d.ts.map +1 -1
- package/dist/react/guuey-chat.js +21 -3
- package/dist/react/oauth-return.d.ts +61 -0
- package/dist/react/oauth-return.d.ts.map +1 -0
- package/dist/react/oauth-return.js +103 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -0
- package/dist/strings.d.ts +10 -0
- package/dist/strings.d.ts.map +1 -1
- package/dist/strings.js +4 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/corpus/README.md +7 -1
- package/src/corpus/__snapshots__/corpus.test.ts.snap +84 -0
- package/src/corpus/fixtures.ts +77 -0
- package/src/index.ts +11 -0
- package/src/native/components.tsx +14 -4
- package/src/oauth.ts +157 -0
- package/src/plan.ts +2 -0
- package/src/react/components.tsx +16 -4
- package/src/react/guuey-chat.tsx +49 -1
- package/src/react/oauth-return.ts +129 -0
- package/src/react.tsx +9 -0
- package/src/strings.ts +14 -0
- package/src/types.ts +8 -0
- package/styles.css +26 -0
package/dist/react.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { Transcript, type TranscriptProps, type TranscriptWindowing, } from "./r
|
|
|
16
16
|
export { defaultTranscriptComponents, renderItem, DefaultUserMessage, DefaultText, DefaultReasoning, DefaultTool, DefaultToolGroup, DefaultDataResult, DefaultView, DefaultViewRef, DefaultMedia, DefaultCode, DefaultCitations, DefaultPrompt, DefaultError, DefaultHistoryBoundary, DefaultCompaction, DefaultUnknown, DefaultStatus, type TranscriptComponents, type TranscriptItemContext, type ViewSlotProps, } from "./react/components.js";
|
|
17
17
|
export { useTranscript, useTranscriptInputs, type UseTranscriptArgs, type UseTranscriptResult, type UseTranscriptInputsResult, } from "./react/use-transcript.js";
|
|
18
18
|
export { GuueyChat, type GuueyChatProps, type GuueyChatHandle } from "./react/guuey-chat.js";
|
|
19
|
+
export { oauthPromptAction, oauthReturnToHere, openOAuthAuthorize, useOAuthReturn, type OAuthPromptActionArgs, type OAuthWindow, type UseOAuthReturnResult, } from "./react/oauth-return.js";
|
|
19
20
|
export { Markdown } from "./react/markdown.js";
|
|
20
21
|
export { themeCssVars, type ThemeMode } from "./react/theme-css.js";
|
|
21
22
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KA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AS,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -16,5 +16,6 @@ export { Transcript, } from "./react/transcript.js";
|
|
|
16
16
|
export { defaultTranscriptComponents, renderItem, DefaultUserMessage, DefaultText, DefaultReasoning, DefaultTool, DefaultToolGroup, DefaultDataResult, DefaultView, DefaultViewRef, DefaultMedia, DefaultCode, DefaultCitations, DefaultPrompt, DefaultError, DefaultHistoryBoundary, DefaultCompaction, DefaultUnknown, DefaultStatus, } from "./react/components.js";
|
|
17
17
|
export { useTranscript, useTranscriptInputs, } from "./react/use-transcript.js";
|
|
18
18
|
export { GuueyChat } from "./react/guuey-chat.js";
|
|
19
|
+
export { oauthPromptAction, oauthReturnToHere, openOAuthAuthorize, useOAuthReturn, } from "./react/oauth-return.js";
|
|
19
20
|
export { Markdown } from "./react/markdown.js";
|
|
20
21
|
export { themeCssVars } from "./react/theme-css.js";
|
package/dist/strings.d.ts
CHANGED
|
@@ -83,6 +83,16 @@ export interface ChatStrings {
|
|
|
83
83
|
/** The answered record line, e.g. `Allowed — Always`. */
|
|
84
84
|
promptAnsweredWith: (modeLabel: string) => string;
|
|
85
85
|
promptDeclinedRecord: string;
|
|
86
|
+
/**
|
|
87
|
+
* The OAuth arm (guuey#178): the dismiss action ("Not now" — nothing is
|
|
88
|
+
* written, the ask re-emits next turn), the answered record (the user was
|
|
89
|
+
* sent to the provider), and the return notices the surface shows after
|
|
90
|
+
* the broker 302s back with `?connected=<serverName>` / `?error=<reason>`.
|
|
91
|
+
*/
|
|
92
|
+
promptNotNow: string;
|
|
93
|
+
promptOAuthSent: (modeLabel: string) => string;
|
|
94
|
+
oauthConnected: (serverName: string) => string;
|
|
95
|
+
oauthFailed: (reason: string) => string;
|
|
86
96
|
/** R16 — the notice row's label (provenance shows only under debug). */
|
|
87
97
|
noticeLabel: string;
|
|
88
98
|
/** The 3c composer (`<GuueyChat>`). */
|
package/dist/strings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|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9B,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAErC,kBAAkB;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,kEAAkE;IAClE,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IAEf,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAExC,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IAEpB,uCAAuC;IACvC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,kBAAkB,EAAE,WAsEhC,CAAC"}
|
package/dist/strings.js
CHANGED
|
@@ -45,6 +45,10 @@ export const defaultChatStrings = {
|
|
|
45
45
|
promptDismissed: "Dismissed",
|
|
46
46
|
promptAnsweredWith: (modeLabel) => `Allowed — ${modeLabel}`,
|
|
47
47
|
promptDeclinedRecord: "Not allowed",
|
|
48
|
+
promptNotNow: "Not now",
|
|
49
|
+
promptOAuthSent: (modeLabel) => `Connecting — ${modeLabel}`,
|
|
50
|
+
oauthConnected: (serverName) => `Connected ${serverName}. The agent can use it from your next message.`,
|
|
51
|
+
oauthFailed: (reason) => `Couldn't connect: ${reason}`,
|
|
48
52
|
noticeLabel: "Note",
|
|
49
53
|
composerPlaceholder: "Message the agent…",
|
|
50
54
|
composerUnavailable: "Chat is unavailable.",
|
package/dist/types.d.ts
CHANGED
|
@@ -328,6 +328,17 @@ export interface HitlPromptItem extends BaseItem {
|
|
|
328
328
|
askKind: AgPausedAsk["kind"];
|
|
329
329
|
/** Declared accept variants; empty = a plain accept/decline ask. */
|
|
330
330
|
grantModes: readonly AgGrantMode[];
|
|
331
|
+
/**
|
|
332
|
+
* The OAuth arm (guuey#178): set when the ask is `kind:"auth"` with
|
|
333
|
+
* `authConfig.scheme:"oauth2"` + an `authorizationUrl`. There is no
|
|
334
|
+
* answer door for this ask — a mode pick OPENS `authorizationUrl` with
|
|
335
|
+
* `&mode=` + `&returnTo=` appended (`oauthAuthorizeHref`); "Not now" is a
|
|
336
|
+
* plain dismissal. `null` for every other ask.
|
|
337
|
+
*/
|
|
338
|
+
oauth: {
|
|
339
|
+
authorizationUrl: string;
|
|
340
|
+
scopes: readonly string[];
|
|
341
|
+
} | null;
|
|
331
342
|
state: "pending" | "resolved" | "declined" | "cancelled";
|
|
332
343
|
/** Echo of the chosen mode id (identity, never displayed as meaning). */
|
|
333
344
|
chosenModeId: string | null;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACR,SAAS,EACV,MAAM,sBAAsB,CA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AC,EAAE,gBAAgB,CAAC;CAC9B,GACD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,kEAAkE;IAClE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guuey/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The default end-user transcript UI for guuey agents — the headless view-model (planTranscript), calm/debug presets, the GuueyChatTheme token schema, the ChatStrings i18n seam, and (at ./react) the component kit that renders it: per-category components, <Transcript>, the live + history input assemblers, and stick-to-bottom/windowed/accessible transcript behavior; at ./native, the React Native renderer over the same view-model.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@silverprotocol/core": "0.5.0",
|
|
40
40
|
"@silverprotocol/richtext": "0.5.0",
|
|
41
41
|
"zod": "^4.3.6",
|
|
42
|
-
"@guuey/agent-client": "0.
|
|
43
|
-
"@guuey/mcp-apps-host": "0.
|
|
42
|
+
"@guuey/agent-client": "0.9.0",
|
|
43
|
+
"@guuey/mcp-apps-host": "0.9.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=18",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@testing-library/react": "^16.3.2",
|
|
60
60
|
"@types/node": "^24.0.0",
|
|
61
61
|
"@types/react": "^19.0.0",
|
|
62
|
+
"@types/react-dom": "^19.0.0",
|
|
62
63
|
"jsdom": "^25.0.1",
|
|
63
64
|
"react": "^19.0.0",
|
|
64
65
|
"react-dom": "^19.0.0",
|
package/src/corpus/README.md
CHANGED
|
@@ -56,7 +56,13 @@ witness.
|
|
|
56
56
|
C2-shaped read shell (`gguiReadShell`) to the `"ggui"` channel — the
|
|
57
57
|
whole converged path in plain Node; 24c pins that a bootstrap-carrying
|
|
58
58
|
result (fixture 7's shape) rides the same arm to the same outcome, and
|
|
59
|
-
family 18's production capture asserts the same)
|
|
59
|
+
family 18's production capture asserts the same), and family 25
|
|
60
|
+
(`oauth-auth-ask` — guuey#178: the MCP OAuth broker's "authorize this
|
|
61
|
+
server" card, `hitl.ask kind:"auth"` + `authConfig:{scheme:"oauth2",
|
|
62
|
+
authorizationUrl}` + grant modes; the SAME hitl card with an `oauth` arm,
|
|
63
|
+
where a mode pick is a LINK (`oauthAuthorizeHref` — `&mode=` +
|
|
64
|
+
`&returnTo=` appended by the client) and "Not now" is a dismissal —
|
|
65
|
+
there is no answer door, the answer is the redirect).
|
|
60
66
|
- `capture.ts` / `captures/` — family 18: production-capture replay
|
|
61
67
|
through the real `invokeTurn` (provenance in the module header).
|
|
62
68
|
- `corpus.test.ts` — the runner: per-fixture assertions + snapshots, plain
|
|
@@ -1056,6 +1056,7 @@ exports[`corpus > 4. consent-gate — pending grant-mode card → answered one-l
|
|
|
1056
1056
|
"key": "p.profile-consent:app-1:thread-corpus",
|
|
1057
1057
|
"kind": "prompt",
|
|
1058
1058
|
"message": "Trip Planner wants to read your guuey profile — the notes agents keep about you across apps.",
|
|
1059
|
+
"oauth": null,
|
|
1059
1060
|
"promptId": "profile-consent:app-1:thread-corpus",
|
|
1060
1061
|
"promptKind": "hitl",
|
|
1061
1062
|
"raw": null,
|
|
@@ -1797,6 +1798,7 @@ exports[`corpus > 20. hitl-grant-modes — the persisted declaration renders; an
|
|
|
1797
1798
|
"key": "p.ask-remember-1",
|
|
1798
1799
|
"kind": "prompt",
|
|
1799
1800
|
"message": "Remember your seating preference?",
|
|
1801
|
+
"oauth": null,
|
|
1800
1802
|
"promptId": "ask-remember-1",
|
|
1801
1803
|
"promptKind": "hitl",
|
|
1802
1804
|
"raw": null,
|
|
@@ -2016,3 +2018,85 @@ exports[`corpus > 24. prod-wire-ggui-render — ggui's production posture: no _m
|
|
|
2016
2018
|
"status": null,
|
|
2017
2019
|
}
|
|
2018
2020
|
`;
|
|
2021
|
+
|
|
2022
|
+
exports[`corpus > 25. oauth-auth-ask — kind:auth + authConfig oauth2 plans as the SAME hitl card with an oauth arm; a mode pick is a link, not an answer (guuey#178) 1`] = `
|
|
2023
|
+
{
|
|
2024
|
+
"items": [
|
|
2025
|
+
{
|
|
2026
|
+
"expanded": true,
|
|
2027
|
+
"key": "u0",
|
|
2028
|
+
"kind": "user",
|
|
2029
|
+
"retry": false,
|
|
2030
|
+
"state": "sent",
|
|
2031
|
+
"text": "what's on my Linear board?",
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
"expanded": true,
|
|
2035
|
+
"key": "a0.t0",
|
|
2036
|
+
"kind": "text",
|
|
2037
|
+
"markdown": true,
|
|
2038
|
+
"stopped": false,
|
|
2039
|
+
"streaming": false,
|
|
2040
|
+
"text": "I can't reach Linear yet.",
|
|
2041
|
+
},
|
|
2042
|
+
{
|
|
2043
|
+
"ask": {
|
|
2044
|
+
"askId": "mcp-oauth:app_1:linear:thread-oauth",
|
|
2045
|
+
"authConfig": {
|
|
2046
|
+
"authorizationUrl": "https://mcp.dev.sandbox.guuey.com/oauth/start?state=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
2047
|
+
"scheme": "oauth2",
|
|
2048
|
+
},
|
|
2049
|
+
"expiresAt": "2026-08-17T10:10:00.000Z",
|
|
2050
|
+
"grantModes": [
|
|
2051
|
+
{
|
|
2052
|
+
"description": "Every conversation with this agent",
|
|
2053
|
+
"id": "always",
|
|
2054
|
+
"label": "Always allow",
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
"description": "Only this conversation",
|
|
2058
|
+
"id": "once",
|
|
2059
|
+
"label": "Allow this chat",
|
|
2060
|
+
},
|
|
2061
|
+
],
|
|
2062
|
+
"kind": "auth",
|
|
2063
|
+
"message": "Trip Planner wants to use your Linear account",
|
|
2064
|
+
"metadata": {
|
|
2065
|
+
"appId": "app_1",
|
|
2066
|
+
"expiresAt": "2026-08-17T10:10:00.000Z",
|
|
2067
|
+
"serverName": "linear",
|
|
2068
|
+
},
|
|
2069
|
+
},
|
|
2070
|
+
"askKind": "auth",
|
|
2071
|
+
"chosenModeId": null,
|
|
2072
|
+
"chosenModeLabel": null,
|
|
2073
|
+
"expanded": true,
|
|
2074
|
+
"grantModes": [
|
|
2075
|
+
{
|
|
2076
|
+
"description": "Every conversation with this agent",
|
|
2077
|
+
"id": "always",
|
|
2078
|
+
"label": "Always allow",
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
"description": "Only this conversation",
|
|
2082
|
+
"id": "once",
|
|
2083
|
+
"label": "Allow this chat",
|
|
2084
|
+
},
|
|
2085
|
+
],
|
|
2086
|
+
"key": "p.mcp-oauth:app_1:linear:thread-oauth",
|
|
2087
|
+
"kind": "prompt",
|
|
2088
|
+
"message": "Trip Planner wants to use your Linear account",
|
|
2089
|
+
"oauth": {
|
|
2090
|
+
"authorizationUrl": "https://mcp.dev.sandbox.guuey.com/oauth/start?state=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
2091
|
+
"scopes": [],
|
|
2092
|
+
},
|
|
2093
|
+
"promptId": "mcp-oauth:app_1:linear:thread-oauth",
|
|
2094
|
+
"promptKind": "hitl",
|
|
2095
|
+
"raw": null,
|
|
2096
|
+
"state": "pending",
|
|
2097
|
+
},
|
|
2098
|
+
],
|
|
2099
|
+
"recovery": null,
|
|
2100
|
+
"status": null,
|
|
2101
|
+
}
|
|
2102
|
+
`;
|
package/src/corpus/fixtures.ts
CHANGED
|
@@ -641,6 +641,83 @@ export function prodWireGguiRender(): TranscriptInputs {
|
|
|
641
641
|
return driveTurn(events, { userText: "show me the board" });
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
+
/**
|
|
645
|
+
* 25. oauth-auth-ask (guuey#178 Slice 4) — the MCP OAuth broker's "authorize
|
|
646
|
+
* this server" card: a paused turn whose PERSISTED ask is `kind:"auth"` with
|
|
647
|
+
* `authConfig:{ scheme:"oauth2", authorizationUrl }` + the two grant modes
|
|
648
|
+
* (the exact wire `nocode-runtime/src/mcp-oauth-consent.ts` emits — askId
|
|
649
|
+
* `mcp-oauth:<appId>:<serverName>:<threadId>`, `metadata:{appId, serverName,
|
|
650
|
+
* expiresAt}`, top-level `expiresAt`). Unlike family 20 there is NO answer
|
|
651
|
+
* door: a mode pick opens `authorizationUrl&mode=<id>&returnTo=<here>`; the
|
|
652
|
+
* decline is a dismissal ("Not now"). Driven through the real Reducer.
|
|
653
|
+
*/
|
|
654
|
+
export const OAUTH_ASK_AUTHORIZE_URL = "https://mcp.dev.sandbox.guuey.com/oauth/start?state=" + "a".repeat(64);
|
|
655
|
+
export function oauthAuthAsk(): TranscriptInputs {
|
|
656
|
+
const reducer = new Reducer();
|
|
657
|
+
let seq = 0;
|
|
658
|
+
const s = (): number => seq++;
|
|
659
|
+
const askId = "mcp-oauth:app_1:linear:thread-oauth";
|
|
660
|
+
const events: AgEvent[] = [
|
|
661
|
+
{ type: "turn.start", threadId: "thread-oauth", turnId: "turn-o", seq: s() },
|
|
662
|
+
{ type: "message.start", id: "msg-o", role: "assistant", turnId: "turn-o", threadId: "thread-oauth", seq: s() },
|
|
663
|
+
{ type: "text.start", id: "to", seq: s() },
|
|
664
|
+
{ type: "text.delta", id: "to", delta: "I can't reach Linear yet.", seq: s() },
|
|
665
|
+
{ type: "text.end", id: "to", seq: s() },
|
|
666
|
+
{ type: "turn.done", turnId: "turn-o", outcome: { type: "success" }, seq: s() },
|
|
667
|
+
{ type: "turn.start", threadId: "thread-oauth", turnId: `${askId}#turn`, seq: s() },
|
|
668
|
+
{
|
|
669
|
+
type: "hitl.ask",
|
|
670
|
+
turnId: `${askId}#turn`,
|
|
671
|
+
askId,
|
|
672
|
+
kind: "auth",
|
|
673
|
+
message: "Trip Planner wants to use your Linear account",
|
|
674
|
+
authConfig: { scheme: "oauth2", authorizationUrl: OAUTH_ASK_AUTHORIZE_URL },
|
|
675
|
+
grantModes: [
|
|
676
|
+
{ id: "always", label: "Always allow", description: "Every conversation with this agent" },
|
|
677
|
+
{ id: "once", label: "Allow this chat", description: "Only this conversation" },
|
|
678
|
+
],
|
|
679
|
+
metadata: { appId: "app_1", serverName: "linear", expiresAt: "2026-08-17T10:10:00.000Z" },
|
|
680
|
+
expiresAt: "2026-08-17T10:10:00.000Z",
|
|
681
|
+
continuation: "turn",
|
|
682
|
+
seq: s(),
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
type: "turn.done",
|
|
686
|
+
turnId: `${askId}#turn`,
|
|
687
|
+
finishReason: "paused",
|
|
688
|
+
outcome: {
|
|
689
|
+
type: "paused",
|
|
690
|
+
asks: [
|
|
691
|
+
{
|
|
692
|
+
askId,
|
|
693
|
+
kind: "auth",
|
|
694
|
+
message: "Trip Planner wants to use your Linear account",
|
|
695
|
+
authConfig: { scheme: "oauth2", authorizationUrl: OAUTH_ASK_AUTHORIZE_URL },
|
|
696
|
+
grantModes: [
|
|
697
|
+
{ id: "always", label: "Always allow", description: "Every conversation with this agent" },
|
|
698
|
+
{ id: "once", label: "Allow this chat", description: "Only this conversation" },
|
|
699
|
+
],
|
|
700
|
+
metadata: { appId: "app_1", serverName: "linear", expiresAt: "2026-08-17T10:10:00.000Z" },
|
|
701
|
+
expiresAt: "2026-08-17T10:10:00.000Z",
|
|
702
|
+
},
|
|
703
|
+
],
|
|
704
|
+
},
|
|
705
|
+
seq: s(),
|
|
706
|
+
},
|
|
707
|
+
];
|
|
708
|
+
for (const ev of events) reducer.push(ev);
|
|
709
|
+
return {
|
|
710
|
+
result: reducer.result(),
|
|
711
|
+
assistantText: "",
|
|
712
|
+
status: "ready",
|
|
713
|
+
statusElapsedMs: 0,
|
|
714
|
+
activeTool: null,
|
|
715
|
+
error: null,
|
|
716
|
+
prompts: [], // the test composes these via hitlPromptsFromFold + the answer ledger
|
|
717
|
+
messages: [{ role: "user", text: "what's on my Linear board?" }],
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
|
|
644
721
|
/**
|
|
645
722
|
* What ggui's `resources/read` answers for a render locator (guuey#209 C2):
|
|
646
723
|
* the shell that boots ggui's runtime with the live-channel material
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,17 @@ export {
|
|
|
32
32
|
type HitlAnswerRecord,
|
|
33
33
|
type HitlPromptAction,
|
|
34
34
|
} from "./hitl.js";
|
|
35
|
+
export {
|
|
36
|
+
OAUTH_LINK_PARAMS,
|
|
37
|
+
OAUTH_RETURN_PARAMS,
|
|
38
|
+
OAUTH_SCHEME,
|
|
39
|
+
oauthAuthorizeAsk,
|
|
40
|
+
oauthAuthorizeHref,
|
|
41
|
+
parseOAuthReturn,
|
|
42
|
+
stripOAuthReturn,
|
|
43
|
+
type OAuthAuthorizeAsk,
|
|
44
|
+
type OAuthReturn,
|
|
45
|
+
} from "./oauth.js";
|
|
35
46
|
export {
|
|
36
47
|
DEFAULT_CHAT_THEME,
|
|
37
48
|
GUUEY_CHAT_THEME,
|
|
@@ -492,7 +492,9 @@ export function NativePrompt({ item, ctx }: ItemProps<PromptItem>): ReactNode {
|
|
|
492
492
|
<MutedText ctx={ctx}>
|
|
493
493
|
{item.state === "resolved"
|
|
494
494
|
? item.chosenModeLabel !== null
|
|
495
|
-
?
|
|
495
|
+
? item.oauth !== null
|
|
496
|
+
? s.promptOAuthSent(item.chosenModeLabel)
|
|
497
|
+
: s.promptAnsweredWith(item.chosenModeLabel)
|
|
496
498
|
: s.promptAccept
|
|
497
499
|
: s.promptDeclinedRecord}
|
|
498
500
|
</MutedText>
|
|
@@ -540,9 +542,17 @@ export function NativePrompt({ item, ctx }: ItemProps<PromptItem>): ReactNode {
|
|
|
540
542
|
</Pressable>
|
|
541
543
|
))
|
|
542
544
|
)}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
545
|
+
{/* The OAuth arm has no durable deny — "Not now" dismisses
|
|
546
|
+
(nothing written; the ask re-emits next turn). */}
|
|
547
|
+
{item.oauth !== null ? (
|
|
548
|
+
<Pressable accessibilityRole="button" onPress={() => ctx.onPromptAction?.(item, "dismiss")}>
|
|
549
|
+
<Text style={{ color: tokens.palette.inkMuted, fontSize: tokens.fontSize }}>{s.promptNotNow}</Text>
|
|
550
|
+
</Pressable>
|
|
551
|
+
) : (
|
|
552
|
+
<Pressable accessibilityRole="button" onPress={() => ctx.onPromptAction?.(item, "decline")}>
|
|
553
|
+
<Text style={{ color: tokens.palette.inkMuted, fontSize: tokens.fontSize }}>{s.promptDecline}</Text>
|
|
554
|
+
</Pressable>
|
|
555
|
+
)}
|
|
546
556
|
</View>
|
|
547
557
|
</>
|
|
548
558
|
)}
|
package/src/oauth.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "authorize this server" arm of R10 (guuey#178 Slice 4) — the pure
|
|
3
|
+
* helpers every surface (web kit, widget, studio, portal native) uses for a
|
|
4
|
+
* `hitl.ask kind:"auth"` whose `authConfig.scheme` is `oauth2`.
|
|
5
|
+
*
|
|
6
|
+
* The producer is the guuey runtime's MCP OAuth broker: the pod appends a
|
|
7
|
+
* paused turn (`turn.done outcome:"paused"`) whose ask declares
|
|
8
|
+
* `authConfig:{ scheme:"oauth2", authorizationUrl }` + `grantModes:
|
|
9
|
+
* [always, once?]`. Unlike the profile-consent ask there is **no answer
|
|
10
|
+
* door**: the answer IS the redirect. Picking a mode opens
|
|
11
|
+
* `authorizationUrl` with two query params appended by THIS client —
|
|
12
|
+
*
|
|
13
|
+
* - `mode=<grantModeId>` — the pre-chosen grant (recorded by the broker's
|
|
14
|
+
* callback; the mode is fixed BEFORE the identity-provider hop), and
|
|
15
|
+
* - `returnTo=<the surface's own location>` — where the broker 302s back
|
|
16
|
+
* to when the dance ends (`?connected=<serverName>` on success,
|
|
17
|
+
* `?error=<reason>` on failure). The broker allowlists it; the client
|
|
18
|
+
* just says where it lives.
|
|
19
|
+
*
|
|
20
|
+
* On return the surface strips the two params, shows a one-line notice, and
|
|
21
|
+
* does nothing else: the NEXT turn's pre-turn preflight on the pod resolves
|
|
22
|
+
* `connected` (or asks again). No client-side state survives the redirect
|
|
23
|
+
* on purpose. "Not now" is a plain dismissal (`cancelled` — still pending,
|
|
24
|
+
* re-askable); nothing is written anywhere and the ask re-emits next turn.
|
|
25
|
+
*
|
|
26
|
+
* Everything here is string-level (no `URL`/`URLSearchParams`) so it runs
|
|
27
|
+
* identically on React Native, whose URL polyfill is partial.
|
|
28
|
+
*/
|
|
29
|
+
import type { AgPausedAsk } from "@silverprotocol/core";
|
|
30
|
+
|
|
31
|
+
/** The `authConfig.scheme` this arm recognises (the spec's OAuth 2 vocabulary). */
|
|
32
|
+
export const OAUTH_SCHEME = "oauth2";
|
|
33
|
+
|
|
34
|
+
/** The query params THIS client appends to the authorize link. */
|
|
35
|
+
export const OAUTH_LINK_PARAMS = { mode: "mode", returnTo: "returnTo" } as const;
|
|
36
|
+
|
|
37
|
+
/** The query params the broker's callback appends to `returnTo`. */
|
|
38
|
+
export const OAUTH_RETURN_PARAMS = { connected: "connected", error: "error" } as const;
|
|
39
|
+
|
|
40
|
+
/** What an auth ask declares once narrowed to the OAuth arm. */
|
|
41
|
+
export interface OAuthAuthorizeAsk {
|
|
42
|
+
authorizationUrl: string;
|
|
43
|
+
scopes: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Narrow an ask to the OAuth arm: `kind:"auth"` + `authConfig.scheme ===
|
|
48
|
+
* "oauth2"` + an `authorizationUrl` to open. Anything else (a plain
|
|
49
|
+
* approval, an auth ask with another scheme, a URL-less declaration) is
|
|
50
|
+
* `null` and renders as an ordinary hitl card.
|
|
51
|
+
*/
|
|
52
|
+
export function oauthAuthorizeAsk(ask: AgPausedAsk): OAuthAuthorizeAsk | null {
|
|
53
|
+
if (ask.kind !== "auth" || ask.authConfig === undefined) return null;
|
|
54
|
+
const { scheme, authorizationUrl, scopes } = ask.authConfig;
|
|
55
|
+
if (scheme !== OAUTH_SCHEME || authorizationUrl === undefined || authorizationUrl === "") return null;
|
|
56
|
+
return { authorizationUrl, scopes: scopes ?? [] };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The link to open for a mode pick: `authorizationUrl` + `&mode=<grantModeId>`
|
|
61
|
+
* + `&returnTo=<returnTo>` (each value URI-encoded; `?` vs `&` chosen from
|
|
62
|
+
* the URL as declared). `grantModeId` is required iff the ask declares
|
|
63
|
+
* modes (`null` = a plain accept on a mode-less auth ask — no `mode` param).
|
|
64
|
+
* Throws on a mode the ask did not declare — the inputs came from the
|
|
65
|
+
* declaration itself, so a mismatch is a construction bug, never a user
|
|
66
|
+
* state.
|
|
67
|
+
*/
|
|
68
|
+
export function oauthAuthorizeHref(ask: AgPausedAsk, grantModeId: string | null, returnTo: string): string {
|
|
69
|
+
const oauth = oauthAuthorizeAsk(ask);
|
|
70
|
+
if (oauth === null) throw new Error("oauthAuthorizeHref: the ask is not an oauth2 auth ask");
|
|
71
|
+
const declared = ask.grantModes ?? [];
|
|
72
|
+
if (grantModeId === null && declared.length > 0) {
|
|
73
|
+
throw new Error(`oauthAuthorizeHref: ${ask.askId} declares grant modes — a mode is required`);
|
|
74
|
+
}
|
|
75
|
+
if (grantModeId !== null && !declared.some((m) => m.id === grantModeId)) {
|
|
76
|
+
throw new Error(`oauthAuthorizeHref: grant mode "${grantModeId}" is not declared on ${ask.askId}`);
|
|
77
|
+
}
|
|
78
|
+
if (returnTo === "") throw new Error("oauthAuthorizeHref: returnTo is required");
|
|
79
|
+
const sep = oauth.authorizationUrl.includes("?") ? "&" : "?";
|
|
80
|
+
const mode = grantModeId === null ? "" : `${OAUTH_LINK_PARAMS.mode}=${encodeURIComponent(grantModeId)}&`;
|
|
81
|
+
return `${oauth.authorizationUrl}${sep}${mode}${OAUTH_LINK_PARAMS.returnTo}=${encodeURIComponent(returnTo)}`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The broker's answer, lifted off the return location. */
|
|
85
|
+
export type OAuthReturn =
|
|
86
|
+
| { kind: "connected"; serverName: string }
|
|
87
|
+
| { kind: "error"; reason: string };
|
|
88
|
+
|
|
89
|
+
/** `decodeURIComponent` that yields the raw text for a malformed escape (a foreign param is not ours to fail on). */
|
|
90
|
+
function safeDecode(s: string): string {
|
|
91
|
+
try {
|
|
92
|
+
return decodeURIComponent(s.replace(/\+/g, " "));
|
|
93
|
+
} catch {
|
|
94
|
+
return s;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Split a URL (or bare query) into its query pairs — RN-safe, no `URLSearchParams`. */
|
|
99
|
+
function queryPairs(urlOrQuery: string): Array<[string, string]> {
|
|
100
|
+
const q = urlOrQuery.indexOf("?");
|
|
101
|
+
let query = q === -1 ? (urlOrQuery.startsWith("&") || !urlOrQuery.includes("=") ? "" : urlOrQuery) : urlOrQuery.slice(q + 1);
|
|
102
|
+
const hash = query.indexOf("#");
|
|
103
|
+
if (hash !== -1) query = query.slice(0, hash);
|
|
104
|
+
const pairs: Array<[string, string]> = [];
|
|
105
|
+
for (const part of query.split("&")) {
|
|
106
|
+
if (part === "") continue;
|
|
107
|
+
const eq = part.indexOf("=");
|
|
108
|
+
const k = eq === -1 ? part : part.slice(0, eq);
|
|
109
|
+
const v = eq === -1 ? "" : part.slice(eq + 1);
|
|
110
|
+
pairs.push([safeDecode(k), safeDecode(v)]);
|
|
111
|
+
}
|
|
112
|
+
return pairs;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Read the broker's return params off a location (a full URL, a deep link
|
|
117
|
+
* like `guuey://oauth/done?connected=linear`, or a bare `?connected=…`
|
|
118
|
+
* query). `null` when neither param is present. `connected` wins when both
|
|
119
|
+
* appear (the broker never sends both).
|
|
120
|
+
*/
|
|
121
|
+
export function parseOAuthReturn(urlOrQuery: string): OAuthReturn | null {
|
|
122
|
+
let connected: string | undefined;
|
|
123
|
+
let error: string | undefined;
|
|
124
|
+
for (const [k, v] of queryPairs(urlOrQuery)) {
|
|
125
|
+
if (k === OAUTH_RETURN_PARAMS.connected && v !== "") connected ??= v;
|
|
126
|
+
else if (k === OAUTH_RETURN_PARAMS.error && v !== "") error ??= v;
|
|
127
|
+
}
|
|
128
|
+
if (connected !== undefined) return { kind: "connected", serverName: connected };
|
|
129
|
+
if (error !== undefined) return { kind: "error", reason: error };
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The same location with the broker's return params removed (every other
|
|
135
|
+
* param, and the hash, preserved). Idempotent; a URL without them is
|
|
136
|
+
* returned unchanged. This is what a surface writes back into its address
|
|
137
|
+
* bar (`history.replaceState`) so a reload never re-shows the notice — and
|
|
138
|
+
* what it passes as `returnTo` for the next dance.
|
|
139
|
+
*/
|
|
140
|
+
export function stripOAuthReturn(url: string): string {
|
|
141
|
+
const q = url.indexOf("?");
|
|
142
|
+
if (q === -1) return url;
|
|
143
|
+
const hashAt = url.indexOf("#", q);
|
|
144
|
+
const base = url.slice(0, q);
|
|
145
|
+
const hash = hashAt === -1 ? "" : url.slice(hashAt);
|
|
146
|
+
const query = hashAt === -1 ? url.slice(q + 1) : url.slice(q + 1, hashAt);
|
|
147
|
+
const kept = query
|
|
148
|
+
.split("&")
|
|
149
|
+
.filter((part) => {
|
|
150
|
+
if (part === "") return false;
|
|
151
|
+
const eq = part.indexOf("=");
|
|
152
|
+
const key = safeDecode(eq === -1 ? part : part.slice(0, eq));
|
|
153
|
+
return key !== OAUTH_RETURN_PARAMS.connected && key !== OAUTH_RETURN_PARAMS.error;
|
|
154
|
+
})
|
|
155
|
+
.join("&");
|
|
156
|
+
return kept === "" ? `${base}${hash}` : `${base}?${kept}${hash}`;
|
|
157
|
+
}
|
package/src/plan.ts
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
} from "@guuey/mcp-apps-host";
|
|
42
42
|
import type { TranscriptPolicy } from "./policy.js";
|
|
43
43
|
import { grantModeDisplay } from "./hitl.js";
|
|
44
|
+
import { oauthAuthorizeAsk } from "./oauth.js";
|
|
44
45
|
import type {
|
|
45
46
|
CitationsItem,
|
|
46
47
|
DataResultItem,
|
|
@@ -859,6 +860,7 @@ export function planTranscript(
|
|
|
859
860
|
message: prompt.ask.message ?? null,
|
|
860
861
|
askKind: prompt.ask.kind,
|
|
861
862
|
grantModes: prompt.ask.grantModes ?? [],
|
|
863
|
+
oauth: oauthAuthorizeAsk(prompt.ask),
|
|
862
864
|
state: prompt.state,
|
|
863
865
|
chosenModeId: prompt.grantModeId ?? null,
|
|
864
866
|
chosenModeLabel: chosen !== undefined ? grantModeDisplay(chosen) : null,
|
package/src/react/components.tsx
CHANGED
|
@@ -520,11 +520,15 @@ export function DefaultPrompt({ item, ctx }: ItemProps<PromptItem>): ReactNode {
|
|
|
520
520
|
// the durable deny. `cancelled` is guuey's re-askable dismissal: it
|
|
521
521
|
// collapses to a record but stays answerable when expanded.
|
|
522
522
|
if (item.state === "resolved" || item.state === "declined") {
|
|
523
|
+
// The OAuth arm's resolved record: the pick SENT the user to the
|
|
524
|
+
// provider (no answer door) — the grant lands on the next turn.
|
|
523
525
|
return (
|
|
524
526
|
<p className={`guuey-chat-prompt-record guuey-chat-prompt-${item.state}`}>
|
|
525
527
|
{item.state === "resolved"
|
|
526
528
|
? item.chosenModeLabel !== null
|
|
527
|
-
?
|
|
529
|
+
? item.oauth !== null
|
|
530
|
+
? s.promptOAuthSent(item.chosenModeLabel)
|
|
531
|
+
: s.promptAnsweredWith(item.chosenModeLabel)
|
|
528
532
|
: s.promptAccept
|
|
529
533
|
: s.promptDeclinedRecord}
|
|
530
534
|
</p>
|
|
@@ -570,9 +574,17 @@ export function DefaultPrompt({ item, ctx }: ItemProps<PromptItem>): ReactNode {
|
|
|
570
574
|
</button>
|
|
571
575
|
))
|
|
572
576
|
)}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
577
|
+
{/* The OAuth arm has no durable deny — "Not now" dismisses
|
|
578
|
+
(nothing written; the ask re-emits next turn). */}
|
|
579
|
+
{item.oauth !== null ? (
|
|
580
|
+
<button type="button" onClick={() => ctx.onPromptAction?.(item, "dismiss")}>
|
|
581
|
+
{s.promptNotNow}
|
|
582
|
+
</button>
|
|
583
|
+
) : (
|
|
584
|
+
<button type="button" onClick={() => ctx.onPromptAction?.(item, "decline")}>
|
|
585
|
+
{s.promptDecline}
|
|
586
|
+
</button>
|
|
587
|
+
)}
|
|
576
588
|
</div>
|
|
577
589
|
</>
|
|
578
590
|
)}
|