@turingfocus/chat-kit 0.8.2 → 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.
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from "react";
2
+ import { type ManagerChatController, type ManagerChatControllerOptions, type ManagerChatSnapshot } from "./manager.js";
3
+ /** Subscribes to a host-owned controller; hiding a view does not log out. */
4
+ export declare const useManagerChat: <Robot>(controller: ManagerChatController<Robot>) => ManagerChatSnapshot;
5
+ export interface ManagerChatProviderProps<Robot> {
6
+ /** Stable factory. Resources are created in effects, including StrictMode replay. */
7
+ readonly create: () => ManagerChatControllerOptions<Robot>;
8
+ readonly robot?: Robot | undefined;
9
+ readonly children?: ReactNode;
10
+ readonly fallback?: ((snapshot: ManagerChatSnapshot) => ReactNode) | undefined;
11
+ readonly onDisposeError?: ((error: unknown) => void) | undefined;
12
+ }
13
+ export declare function ManagerChatProvider<Robot>({ create, robot, children, fallback, onDisposeError, }: ManagerChatProviderProps<Robot>): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").FunctionComponentElement<Omit<ManagerChatProviderProps<Robot>, "create"> & {
14
+ readonly controller: ManagerChatController<Robot>;
15
+ }> | null;
16
+ //# sourceMappingURL=manager-react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-react.d.ts","sourceRoot":"","sources":["../src/manager-react.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB,6EAA6E;AAC7E,eAAO,MAAM,cAAc,GAAI,KAAK,EAClC,YAAY,qBAAqB,CAAC,KAAK,CAAC,KACvC,mBAKA,CAAC;AACJ,MAAM,WAAW,wBAAwB,CAAC,KAAK;IAC7C,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAChB,CAAC,CAAC,QAAQ,EAAE,mBAAmB,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;IAC7D,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAClE;AACD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,EACzC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,cAAc,GACf,EAAE,wBAAwB,CAAC,KAAK,CAAC;;UAgBjC"}
@@ -0,0 +1,36 @@
1
+ import { createElement, useEffect, useState, useSyncExternalStore, } from "react";
2
+ import { ChatProvider } from "@turingfocus/chat-react";
3
+ import { createManagerChatController, } from "./manager.js";
4
+ /** Subscribes to a host-owned controller; hiding a view does not log out. */
5
+ export const useManagerChat = (controller) => useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
6
+ export function ManagerChatProvider({ create, robot, children, fallback, onDisposeError, }) {
7
+ const [controller, setController] = useState();
8
+ useEffect(() => {
9
+ const owned = createManagerChatController(create());
10
+ setController(owned);
11
+ return () => {
12
+ void owned.dispose().catch((error) => onDisposeError?.(error));
13
+ };
14
+ }, [create, onDisposeError]);
15
+ if (!controller)
16
+ return fallback?.({ status: "idle" }) ?? null;
17
+ return createElement((ManagerChatBinding), {
18
+ controller,
19
+ robot,
20
+ children,
21
+ fallback,
22
+ });
23
+ }
24
+ function ManagerChatBinding({ controller, robot, children, fallback, }) {
25
+ const snapshot = useManagerChat(controller);
26
+ useEffect(() => {
27
+ void controller.select(robot);
28
+ return () => {
29
+ void controller.select(undefined);
30
+ };
31
+ }, [controller, robot]);
32
+ return snapshot.status === "ready" && snapshot.client
33
+ ? createElement(ChatProvider, { client: snapshot.client }, children)
34
+ : (fallback?.(snapshot) ?? null);
35
+ }
36
+ //# sourceMappingURL=manager-react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-react.js","sourceRoot":"","sources":["../src/manager-react.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,QAAQ,EACR,oBAAoB,GAErB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,2BAA2B,GAI5B,MAAM,cAAc,CAAC;AAEtB,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,UAAwC,EACnB,EAAE,CACvB,oBAAoB,CAClB,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,WAAW,EACtB,UAAU,CAAC,WAAW,CACvB,CAAC;AAUJ,MAAM,UAAU,mBAAmB,CAAQ,EACzC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,cAAc,GACkB;IAChC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,EAAgC,CAAC;IAC7E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,2BAA2B,CAAC,MAAM,EAAE,CAAC,CAAC;QACpD,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,GAAG,EAAE;YACV,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,UAAU;QAAE,OAAO,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC;IAC/D,OAAO,aAAa,CAAC,CAAA,kBAAyB,CAAA,EAAE;QAC9C,UAAU;QACV,KAAK;QACL,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AACD,SAAS,kBAAkB,CAAQ,EACjC,UAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,GAGT;IACC,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC5C,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE;YACV,KAAK,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;IACxB,OAAO,QAAQ,CAAC,MAAM,KAAK,OAAO,IAAI,QAAQ,CAAC,MAAM;QACnD,CAAC,CAAC,aAAa,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC;QACpE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { type TFRobotChatClientOptions } from "./tfrobot-client.js";
2
+ import type { ChatClient } from "@turingfocus/chat-runtime";
3
+ import type { TFRobotSession } from "@turingfocus/chat-gateway-tfrobot";
4
+ import { type ChatError, type SessionProvider } from "@turingfocus/chat-protocol";
5
+ /** Structural port: optional Manager integration never installs or imports chat-auth. */
6
+ export interface ManagerChatConnection {
7
+ readonly target: {
8
+ readonly baseUrl: string;
9
+ readonly socketNamespaceUrl: string;
10
+ readonly socketPath: string;
11
+ };
12
+ readonly sessionProvider: SessionProvider<TFRobotSession>;
13
+ dispose(): void;
14
+ }
15
+ export interface ManagerChatSource<Robot> {
16
+ connect(robot: Robot, options?: {
17
+ readonly signal?: AbortSignal;
18
+ }): Promise<ManagerChatConnection>;
19
+ getSnapshot?(): {
20
+ readonly status: string;
21
+ readonly identityRevision?: number | undefined;
22
+ };
23
+ subscribe(listener: (snapshot: {
24
+ readonly status: string;
25
+ readonly identityRevision?: number | undefined;
26
+ }) => void): () => void;
27
+ }
28
+ export interface ManagerChatSnapshot {
29
+ readonly status: "idle" | "connecting" | "ready" | "error" | "disposed";
30
+ readonly client?: ChatClient | undefined;
31
+ readonly error?: {
32
+ readonly code: string;
33
+ readonly message: string;
34
+ } | undefined;
35
+ }
36
+ export interface ManagerChatControllerOptions<Robot> {
37
+ readonly manager: ManagerChatSource<Robot>;
38
+ readonly chat: Omit<TFRobotChatClientOptions, "baseUrl" | "sessionProvider" | "socketPath" | "socketNamespaceUrl">;
39
+ /** A lifecycle deadline, not a polling interval. */
40
+ readonly disposeTimeoutMs?: number | undefined;
41
+ readonly onDisposeError?: ((error: unknown) => void) | undefined;
42
+ }
43
+ export declare class ManagerChatController<Robot> {
44
+ #private;
45
+ constructor(options: ManagerChatControllerOptions<Robot>);
46
+ getSnapshot: () => ManagerChatSnapshot;
47
+ subscribe: (listener: () => void) => (() => void);
48
+ select(robot: Robot | undefined): Promise<void>;
49
+ dispose(): Promise<void>;
50
+ }
51
+ export declare const createManagerChatController: <Robot>(options: ManagerChatControllerOptions<Robot>) => ManagerChatController<Robot>;
52
+ /** Bridges optional Manager diagnostics to the existing safe ChatClient diagnostic model. */
53
+ export declare function managerDiagnosticToChatError(input: {
54
+ readonly operation: "directory" | "connection-info" | "resolve" | "exchange";
55
+ readonly code: string;
56
+ readonly status?: number | undefined;
57
+ readonly path?: string | undefined;
58
+ readonly requestId?: string | undefined;
59
+ }): ChatError;
60
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KA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IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC,GAAG,SAAS,CA2CZ"}
@@ -0,0 +1,181 @@
1
+ import { createTFRobotChatClient, } from "./tfrobot-client.js";
2
+ import { safeDiagnosticError, } from "@turingfocus/chat-protocol";
3
+ export class ManagerChatController {
4
+ #options;
5
+ #unsubscribe;
6
+ #listeners = new Set();
7
+ #cleanup = new Set();
8
+ #snapshot = Object.freeze({ status: "idle" });
9
+ #connection;
10
+ #abort;
11
+ #generation = 0;
12
+ #disposed = false;
13
+ constructor(options) {
14
+ if (options.disposeTimeoutMs !== undefined &&
15
+ (!Number.isFinite(options.disposeTimeoutMs) ||
16
+ options.disposeTimeoutMs <= 0 ||
17
+ options.disposeTimeoutMs > 60_000))
18
+ throw new TypeError("Invalid disposal deadline");
19
+ this.#options = options;
20
+ let identityRevision = options.manager.getSnapshot?.().identityRevision ?? 0;
21
+ this.#unsubscribe = options.manager.subscribe((snapshot) => {
22
+ const changed = snapshot.identityRevision !== undefined &&
23
+ snapshot.identityRevision !== identityRevision;
24
+ identityRevision = snapshot.identityRevision ?? identityRevision;
25
+ if (changed ||
26
+ snapshot.status === "auth_required" ||
27
+ snapshot.status === "disposed")
28
+ void this.select(undefined);
29
+ });
30
+ }
31
+ getSnapshot = () => this.#snapshot;
32
+ subscribe = (listener) => {
33
+ if (this.#disposed)
34
+ return () => { };
35
+ this.#listeners.add(listener);
36
+ return () => {
37
+ this.#listeners.delete(listener);
38
+ };
39
+ };
40
+ #update(snapshot) {
41
+ if (this.#disposed)
42
+ return;
43
+ this.#snapshot = Object.freeze(snapshot);
44
+ for (const listener of this.#listeners) {
45
+ try {
46
+ listener();
47
+ }
48
+ catch {
49
+ /* Isolate observers. */
50
+ }
51
+ }
52
+ }
53
+ #release() {
54
+ this.#abort?.abort();
55
+ this.#abort = undefined;
56
+ this.#connection?.dispose();
57
+ this.#connection = undefined;
58
+ const client = this.#snapshot.client;
59
+ if (client !== undefined) {
60
+ let timer;
61
+ const timeout = new Promise((_, reject) => {
62
+ timer = setTimeout(() => reject(new Error("Chat disposal deadline exceeded")), this.#options.disposeTimeoutMs ?? 10_000);
63
+ });
64
+ const work = Promise.race([
65
+ client.dispose({
66
+ deadlineAt: Date.now() + (this.#options.disposeTimeoutMs ?? 10_000),
67
+ }),
68
+ timeout,
69
+ ])
70
+ .catch((error) => {
71
+ try {
72
+ this.#options.onDisposeError?.(error);
73
+ }
74
+ catch {
75
+ /* Isolate observers. */
76
+ }
77
+ })
78
+ .finally(() => {
79
+ clearTimeout(timer);
80
+ this.#cleanup.delete(work);
81
+ });
82
+ this.#cleanup.add(work);
83
+ }
84
+ }
85
+ async select(robot) {
86
+ if (this.#disposed)
87
+ return;
88
+ const generation = ++this.#generation;
89
+ this.#release();
90
+ this.#update({ status: robot === undefined ? "idle" : "connecting" });
91
+ if (robot === undefined)
92
+ return;
93
+ const controller = new AbortController();
94
+ this.#abort = controller;
95
+ let connection;
96
+ try {
97
+ connection = await this.#options.manager.connect(robot, {
98
+ signal: controller.signal,
99
+ });
100
+ if (this.#disposed || generation !== this.#generation) {
101
+ connection.dispose();
102
+ return;
103
+ }
104
+ const client = createTFRobotChatClient({
105
+ ...this.#options.chat,
106
+ ...connection.target,
107
+ sessionProvider: connection.sessionProvider,
108
+ });
109
+ this.#connection = connection;
110
+ this.#update({ status: "ready", client });
111
+ }
112
+ catch {
113
+ connection?.dispose();
114
+ if (!this.#disposed && generation === this.#generation)
115
+ this.#update({
116
+ status: "error",
117
+ error: Object.freeze({
118
+ code: "connection_failed",
119
+ message: "Robot connection failed. Inspect Manager diagnostics and retry.",
120
+ }),
121
+ });
122
+ }
123
+ }
124
+ async dispose() {
125
+ if (this.#disposed) {
126
+ await Promise.all([...this.#cleanup]);
127
+ return;
128
+ }
129
+ this.#generation++;
130
+ this.#unsubscribe();
131
+ this.#release();
132
+ this.#update({ status: "disposed" });
133
+ this.#disposed = true;
134
+ this.#listeners.clear();
135
+ await Promise.all([...this.#cleanup]);
136
+ }
137
+ }
138
+ export const createManagerChatController = (options) => new ManagerChatController(options);
139
+ /** Bridges optional Manager diagnostics to the existing safe ChatClient diagnostic model. */
140
+ export function managerDiagnosticToChatError(input) {
141
+ const codes = new Map([
142
+ ["authentication", "authentication"],
143
+ ["authorization", "authorization"],
144
+ ["conflict", "conflict"],
145
+ ["network", "network"],
146
+ ["not_found", "not-found"],
147
+ ["server", "server"],
148
+ ["timeout", "timeout"],
149
+ ["unsupported_contract", "unsupported"],
150
+ ["invalid_response", "validation"],
151
+ ["rate_limited", "network"],
152
+ ["payment_required", "authorization"],
153
+ ["cancelled", "conflict"],
154
+ ["disposed", "conflict"],
155
+ ]);
156
+ const known = codes.has(input.code);
157
+ const code = codes.get(input.code) ?? "unknown";
158
+ const paths = [
159
+ "/api/v1/digital-employees",
160
+ "/api/v1/digital-employees/:employeeId/connection-info",
161
+ "/api/v1/oauth/token",
162
+ ];
163
+ const requestId = input.requestId &&
164
+ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(input.requestId)
165
+ ? input.requestId
166
+ : undefined;
167
+ return safeDiagnosticError({
168
+ code,
169
+ message: "Manager operation failed",
170
+ retryable: ["network", "server", "timeout"].includes(code),
171
+ diagnostic: {
172
+ operation: `manager.${input.operation}`,
173
+ phase: `manager.${input.operation}`,
174
+ reasonCode: known ? input.code : "unknown",
175
+ ...(input.status === undefined ? {} : { httpStatus: input.status }),
176
+ ...(input.path && paths.includes(input.path) ? { path: input.path } : {}),
177
+ ...(requestId === undefined ? {} : { requestId }),
178
+ },
179
+ });
180
+ }
181
+ //# sourceMappingURL=manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAExB,MAAM,qBAAqB,CAAC;AAG7B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AK,CAAC,SAAS,CAChB;QACC,CAAC,CAAC,KAAK,CAAC,SAAS;QACjB,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO,mBAAmB,CAAC;QACzB,IAAI;QACJ,OAAO,EAAE,0BAA0B;QACnC,SAAS,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC1D,UAAU,EAAE;YACV,SAAS,EAAE,WAAW,KAAK,CAAC,SAAS,EAAE;YACvC,KAAK,EAAE,WAAW,KAAK,CAAC,SAAS,EAAE;YACnC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAC1C,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;YACnE,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;SAClD;KACF,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turingfocus/chat-kit",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "description": "Unified headless, React, and Ant Design chat integration facade",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,14 +40,24 @@
40
40
  "types": "./dist/antd.d.ts",
41
41
  "import": "./dist/antd.js",
42
42
  "default": "./dist/antd.js"
43
+ },
44
+ "./manager": {
45
+ "types": "./dist/manager.d.ts",
46
+ "import": "./dist/manager.js",
47
+ "default": "./dist/manager.js"
48
+ },
49
+ "./manager-react": {
50
+ "types": "./dist/manager-react.d.ts",
51
+ "import": "./dist/manager-react.js",
52
+ "default": "./dist/manager-react.js"
43
53
  }
44
54
  },
45
55
  "dependencies": {
46
- "@turingfocus/chat-gateway-tfrobot": "^0.8.2",
47
- "@turingfocus/chat-protocol": "^0.8.2",
48
- "@turingfocus/chat-react": "^0.8.2",
49
- "@turingfocus/chat-runtime": "^0.8.2",
50
- "@turingfocus/chat-ui-antd": "^0.8.2"
56
+ "@turingfocus/chat-gateway-tfrobot": "^0.9.0",
57
+ "@turingfocus/chat-protocol": "^0.9.0",
58
+ "@turingfocus/chat-react": "^0.9.0",
59
+ "@turingfocus/chat-runtime": "^0.9.0",
60
+ "@turingfocus/chat-ui-antd": "^0.9.0"
51
61
  },
52
62
  "peerDependencies": {
53
63
  "antd": ">=5.23.4 <6.0.0",