@belonguniverseai/react-sdk 0.1.2 → 0.1.4-beta
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/api/client.d.ts +382 -9
- package/dist/api/mutations.d.ts +5 -0
- package/dist/api/query-keys.d.ts +9 -0
- package/dist/api/workspace-files.d.ts +1 -1
- package/dist/app/providers.d.ts +1 -1
- package/dist/component/BelongWidget.d.ts +7 -1
- package/dist/component/{arc-DPDIJagU.js → arc-BxS7Httb.js} +2 -2
- package/dist/component/{architectureDiagram-3BPJPVTR-WmTdGYxp.js → architectureDiagram-3BPJPVTR-C9p6wCFY.js} +3 -3
- package/dist/component/{blockDiagram-GPEHLZMM-myKtXzN1.js → blockDiagram-GPEHLZMM-B_4sjrFH.js} +4 -4
- package/dist/component/{c4Diagram-AAUBKEIU-BbN6n9Vc.js → c4Diagram-AAUBKEIU-BAZBnWkR.js} +3 -3
- package/dist/component/{channel-B0H_QP_-.js → channel-D_9jCQmy.js} +2 -2
- package/dist/component/{chunk-2J33WTMH-iwZo17vf.js → chunk-2J33WTMH-BAqJCIVt.js} +2 -2
- package/dist/component/{chunk-4BX2VUAB-CKT6dptL.js → chunk-4BX2VUAB-CTC8q-Ea.js} +2 -2
- package/dist/component/{chunk-55IACEB6-CLJ9pgvn.js → chunk-55IACEB6-CcASKowe.js} +2 -2
- package/dist/component/{chunk-727SXJPM-BngOIcz0.js → chunk-727SXJPM-DUSkaQ6e.js} +6 -6
- package/dist/component/{chunk-AQP2D5EJ-iLdnjZec.js → chunk-AQP2D5EJ-B_-4XjtP.js} +4 -4
- package/dist/component/{chunk-FMBD7UC4-6uJqTx36.js → chunk-FMBD7UC4-D4VtGmb1.js} +2 -2
- package/dist/component/{chunk-ND2GUHAM-BUngsBoq.js → chunk-ND2GUHAM-_nr7rOab.js} +2 -2
- package/dist/component/{chunk-QZHKN3VN-CFfcj0kF.js → chunk-QZHKN3VN-BCKH-gFC.js} +2 -2
- package/dist/component/{classDiagram-4FO5ZUOK-4Unpku5g.js → classDiagram-4FO5ZUOK-Dnq69pDR.js} +3 -3
- package/dist/component/{classDiagram-v2-Q7XG4LA2-4Unpku5g.js → classDiagram-v2-Q7XG4LA2-Dnq69pDR.js} +3 -3
- package/dist/component/{cose-bilkent-S5V4N54A-CxgXF1ox.js → cose-bilkent-S5V4N54A-Ci3256Cw.js} +2 -2
- package/dist/component/{dagre-BM42HDAG-CvJZZLBU.js → dagre-BM42HDAG-D1H7ndes.js} +2 -2
- package/dist/component/{diagram-2AECGRRQ-BM26zrSB.js → diagram-2AECGRRQ-DA0oXo6P.js} +3 -3
- package/dist/component/{diagram-5GNKFQAL-E7W8UahE.js → diagram-5GNKFQAL-DwMOYjf9.js} +4 -4
- package/dist/component/{diagram-KO2AKTUF-Cx9n9K8j.js → diagram-KO2AKTUF-BAVad1Vy.js} +3 -3
- package/dist/component/{diagram-LMA3HP47-DD5MMO35.js → diagram-LMA3HP47-BWNN256P.js} +3 -3
- package/dist/component/{diagram-OG6HWLK6-DaiZ4TvN.js → diagram-OG6HWLK6-CTsISqXy.js} +4 -4
- package/dist/component/{erDiagram-TEJ5UH35-ChBEEVA8.js → erDiagram-TEJ5UH35-BLKTD8lF.js} +5 -5
- package/dist/component/{flowDiagram-I6XJVG4X-DAsWdPx4.js → flowDiagram-I6XJVG4X-DNmugITh.js} +7 -7
- package/dist/component/{ganttDiagram-6RSMTGT7-qtGq5aA8.js → ganttDiagram-6RSMTGT7-C834AkNu.js} +3 -3
- package/dist/component/{gitGraphDiagram-PVQCEYII-B-KRbsvH.js → gitGraphDiagram-PVQCEYII-KpnFC5UI.js} +4 -4
- package/dist/component/{highlighted-body-OFNGDK62-etsPYV7E.js → highlighted-body-OFNGDK62-CNK-tfA_.js} +2 -2
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-5YYISTIA-BzJ6egpv.js → infoDiagram-5YYISTIA-D7-Yqlci.js} +2 -2
- package/dist/component/{ishikawaDiagram-YF4QCWOH-DnPu1odF.js → ishikawaDiagram-YF4QCWOH-Dkl6wTqA.js} +2 -2
- package/dist/component/{journeyDiagram-JHISSGLW-BDbOAXFA.js → journeyDiagram-JHISSGLW-CcN28ByV.js} +5 -5
- package/dist/component/{kanban-definition-UN3LZRKU-BjvUIgNN.js → kanban-definition-UN3LZRKU-hS_UMH7H.js} +3 -3
- package/dist/component/{linear-COVcd8bM.js → linear-BdhJkh0B.js} +2 -2
- package/dist/component/{mermaid-GHXKKRXX-Bk5cDfRV.js → mermaid-GHXKKRXX-CUwFO8-B.js} +31423 -28144
- package/dist/component/{mindmap-definition-RKZ34NQL-C0g8QURW.js → mindmap-definition-RKZ34NQL-DB-r9g1c.js} +4 -4
- package/dist/component/{pieDiagram-4H26LBE5-Mbexiv4J.js → pieDiagram-4H26LBE5-CMqPVjRg.js} +4 -4
- package/dist/component/{quadrantDiagram-W4KKPZXB-BPRDLHzc.js → quadrantDiagram-W4KKPZXB-DWWi29dP.js} +3 -3
- package/dist/component/{requirementDiagram-4Y6WPE33-XjOXpLfB.js → requirementDiagram-4Y6WPE33-D1nFFrnS.js} +4 -4
- package/dist/component/{sankeyDiagram-5OEKKPKP-Boo0vXVH.js → sankeyDiagram-5OEKKPKP-BnfzKSOs.js} +2 -2
- package/dist/component/{sequenceDiagram-3UESZ5HK-CmZk5hb2.js → sequenceDiagram-3UESZ5HK-D3r-W-Vw.js} +4 -4
- package/dist/component/{stateDiagram-AJRCARHV-zKdC8ZqU.js → stateDiagram-AJRCARHV-Ba3bMrr0.js} +3 -3
- package/dist/component/{stateDiagram-v2-BHNVJYJU-C3TFxstc.js → stateDiagram-v2-BHNVJYJU-YCAvqrHf.js} +3 -3
- package/dist/component/{timeline-definition-PNZ67QCA-DV17S1NP.js → timeline-definition-PNZ67QCA-DlxU8RFH.js} +3 -3
- package/dist/component/{vennDiagram-CIIHVFJN-DtHYS_yc.js → vennDiagram-CIIHVFJN-teVIHl4-.js} +2 -2
- package/dist/component/{wardleyDiagram-YWT4CUSO-BxPk1XTc.js → wardleyDiagram-YWT4CUSO-B31MFPtu.js} +3 -3
- package/dist/component/{xychartDiagram-2RQKCTM6-C3o6FXYC.js → xychartDiagram-2RQKCTM6-csegzRq-.js} +3 -3
- package/dist/components/embed/AgentGrantCard.d.ts +6 -4
- package/dist/components/embed/ComposerMenu.d.ts +9 -1
- package/dist/components/embed/EmbedRail.d.ts +18 -1
- package/dist/components/embed/EmbedSessions.d.ts +6 -4
- package/dist/components/embed/MentionInput.d.ts +10 -0
- package/dist/components/embed/SlashCommandMenu.d.ts +10 -6
- package/dist/components/feedback/feedback-metadata.d.ts +4 -30
- package/dist/dev-modal-repro.d.ts +0 -0
- package/dist/embed/approval-bus.d.ts +14 -0
- package/dist/embed/approval-decision.d.ts +10 -0
- package/dist/embed/auto-embed.d.ts +1 -1
- package/dist/embed/closed-surface-voice-bus.d.ts +25 -0
- package/dist/embed/copy.d.ts +3 -0
- package/dist/embed/dock-layout.d.ts +32 -0
- package/dist/embed/global.d.ts +4 -3
- package/dist/embed/locale.d.ts +24 -5
- package/dist/embed/plan-decision.d.ts +3 -1
- package/dist/embed/use-workspace-file-download.d.ts +2 -0
- package/dist/embed/voice-decision.d.ts +27 -0
- package/dist/embed/voice-phrase-match.d.ts +5 -0
- package/dist/embed/voice-prefs.d.ts +4 -0
- package/dist/embed/voice-send-intent.d.ts +12 -0
- package/dist/embed/workspace-scope.d.ts +44 -0
- package/dist/i18n/i18n.d.ts +6 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/messages/en.d.ts +350 -0
- package/dist/i18n/messages/es.d.ts +3 -0
- package/dist/i18n/messages/surfaces/agentGrant.d.ts +39 -0
- package/dist/i18n/messages/surfaces/aiElements.d.ts +101 -0
- package/dist/i18n/messages/surfaces/app.d.ts +31 -0
- package/dist/i18n/messages/surfaces/embedMisc.d.ts +100 -0
- package/dist/i18n/messages/surfaces/feedback.d.ts +19 -0
- package/dist/i18n/messages/surfaces/files.d.ts +75 -0
- package/dist/i18n/messages/surfaces/header.d.ts +31 -0
- package/dist/i18n/messages/surfaces/login.d.ts +17 -0
- package/dist/i18n/messages/surfaces/plan.d.ts +35 -0
- package/dist/i18n/messages/surfaces/sessions.d.ts +43 -0
- package/dist/i18n/messages/surfaces/stream.d.ts +144 -0
- package/dist/i18n/messages/surfaces/usage.d.ts +21 -0
- package/dist/i18n/messages/types.d.ts +10 -0
- package/dist/routes/chat.d.ts +1 -0
- package/dist/stream/ai-sdk-part-renderers.d.ts +10 -2
- package/dist/stream/belong-chat-transport.d.ts +54 -1
- package/dist/stream/belong-data-parts.d.ts +6 -4
- package/dist/stream/message-metadata.d.ts +45 -0
- package/dist/stream/stream-state-store.d.ts +4 -4
- package/dist/types/public.d.ts +20 -4
- package/package.json +2 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const belongMessageMetadataSchema: z.ZodObject<{
|
|
3
|
+
/** Producing task of an assistant turn — the reload-stable feedback key. */
|
|
4
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
/** The user's current 👍/👎 on that turn; `.nullish()` because the live
|
|
6
|
+
* `start` chunk stamps no vote yet while history returns `null` for
|
|
7
|
+
* "no vote" (requiring it would hide the thumbs on a fresh turn). */
|
|
8
|
+
feedback: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
9
|
+
sentiment: z.ZodEnum<["up", "down"]>;
|
|
10
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
reason: string | null;
|
|
13
|
+
sentiment: "up" | "down";
|
|
14
|
+
}, {
|
|
15
|
+
reason: string | null;
|
|
16
|
+
sentiment: "up" | "down";
|
|
17
|
+
}>>>;
|
|
18
|
+
/** Server row creation time (ISO) — per-bubble clock, history only (§41). */
|
|
19
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/** Skill picked for this user message — renders the bubble's skill chip. */
|
|
21
|
+
skill: z.ZodOptional<z.ZodString>;
|
|
22
|
+
/** Set by `loadSessionHistory` on every restored message. Gates the
|
|
23
|
+
* dispatch renderers' auto-fire: absent (live/replayed turn) → fire once;
|
|
24
|
+
* true (restored history) → render settled, never re-dispatch. */
|
|
25
|
+
fromHistory: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
createdAt?: string | undefined;
|
|
28
|
+
taskId?: string | undefined;
|
|
29
|
+
skill?: string | undefined;
|
|
30
|
+
feedback?: {
|
|
31
|
+
reason: string | null;
|
|
32
|
+
sentiment: "up" | "down";
|
|
33
|
+
} | null | undefined;
|
|
34
|
+
fromHistory?: boolean | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
createdAt?: string | undefined;
|
|
37
|
+
taskId?: string | undefined;
|
|
38
|
+
skill?: string | undefined;
|
|
39
|
+
feedback?: {
|
|
40
|
+
reason: string | null;
|
|
41
|
+
sentiment: "up" | "down";
|
|
42
|
+
} | null | undefined;
|
|
43
|
+
fromHistory?: boolean | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export type BelongMessageMetadata = z.infer<typeof belongMessageMetadataSchema>;
|
|
@@ -30,9 +30,9 @@ declare const streamStateSchema: z.ZodObject<{
|
|
|
30
30
|
lastEventId: string | null;
|
|
31
31
|
}>;
|
|
32
32
|
export type PersistedStreamState = z.infer<typeof streamStateSchema>;
|
|
33
|
-
export declare const readStreamState: () => PersistedStreamState | null;
|
|
34
|
-
export declare const writeStreamState: (state: Omit<PersistedStreamState, "updatedAt"
|
|
35
|
-
export declare const clearStreamState: () => void;
|
|
33
|
+
export declare const readStreamState: (workspaceId?: string | null) => PersistedStreamState | null;
|
|
34
|
+
export declare const writeStreamState: (state: Omit<PersistedStreamState, "updatedAt">, workspaceId?: string | null) => void;
|
|
35
|
+
export declare const clearStreamState: (workspaceId?: string | null) => void;
|
|
36
36
|
/**
|
|
37
37
|
* Like {@link readStreamState}, but only returns state fresh enough that its
|
|
38
38
|
* run is worth reconnecting to. Returns null for stale state WITHOUT clearing
|
|
@@ -40,7 +40,7 @@ export declare const clearStreamState: () => void;
|
|
|
40
40
|
* and history restore on reload — only the *run* is too old to resume. A new
|
|
41
41
|
* message overwrites the cursor via {@link writeStreamState}.
|
|
42
42
|
*/
|
|
43
|
-
export declare const readResumableStreamState: () => PersistedStreamState | null;
|
|
43
|
+
export declare const readResumableStreamState: (workspaceId?: string | null) => PersistedStreamState | null;
|
|
44
44
|
/**
|
|
45
45
|
* Persist the chosen session as the active stream session (sessions menu
|
|
46
46
|
* switch / new). Passing a session id points the next ChatRoute mount at that
|
package/dist/types/public.d.ts
CHANGED
|
@@ -82,15 +82,18 @@ export type PartialBelongTheme = {
|
|
|
82
82
|
};
|
|
83
83
|
/** Built-in theme presets selectable via `belong.applyPreset(name)`. */
|
|
84
84
|
export type PresetName = "belong" | "simetrik" | "custom";
|
|
85
|
-
/**
|
|
85
|
+
/** UI languages the dock ships. `setLocale` / `init({ locale })` accept these. */
|
|
86
86
|
export type BelongLocale = "en" | "es";
|
|
87
87
|
export type BelongInitInput = {
|
|
88
88
|
/** Belong cloud base URL, e.g. `https://api.belong.host` or `http://localhost:8787`. */
|
|
89
89
|
readonly apiBaseUrl: string;
|
|
90
90
|
/**
|
|
91
|
-
* Dock UI language
|
|
92
|
-
*
|
|
93
|
-
*
|
|
91
|
+
* Dock UI language. When omitted the dock auto-detects: a stored user choice
|
|
92
|
+
* ▸ the browser language ▸ English. Set it to default the deployment's
|
|
93
|
+
* language (a Spanish-first tenant passes `"es"`); the end user can still
|
|
94
|
+
* switch with the in-dock toggle. Re-`init` (or `belong.setLocale`) with a
|
|
95
|
+
* DIFFERENT value relabels the dock live — the host's language switch wins
|
|
96
|
+
* over a stale in-dock choice (BEL-140).
|
|
94
97
|
*/
|
|
95
98
|
readonly locale?: BelongLocale;
|
|
96
99
|
/** Where to mount the dock. Defaults to `document.body`. */
|
|
@@ -172,6 +175,19 @@ export type UiActionHandler<I = unknown, O = unknown> = (input: I) => Promise<Ui
|
|
|
172
175
|
export type BelongGlobal = {
|
|
173
176
|
readonly init: (input: BelongInitInput) => Promise<void>;
|
|
174
177
|
readonly setToken: (jwt: string) => void;
|
|
178
|
+
/** Switch the dock UI language at runtime (persisted; relabels live). */
|
|
179
|
+
readonly setLocale: (locale: BelongLocale) => void;
|
|
180
|
+
/**
|
|
181
|
+
* Switch the dock's workspace at runtime (workspace isolation). Re-scopes
|
|
182
|
+
* the whole dock synchronously — session list, Files tab, chat, and the
|
|
183
|
+
* agent's Simetrik CLI credential all follow the given workspace id (the
|
|
184
|
+
* same value `agentGrant.scopeExternalId` / the `scopeUrlParam` URL param
|
|
185
|
+
* carry). Wins over URL tracking until cleared with `null` (which falls
|
|
186
|
+
* back to the URL/static resolution). Invalid ids are ignored with a
|
|
187
|
+
* console warning. Hosts can use this standalone (no `scopeUrlParam`) or
|
|
188
|
+
* alongside URL tracking for instant switches.
|
|
189
|
+
*/
|
|
190
|
+
readonly setWorkspace: (id: string | null) => void;
|
|
175
191
|
readonly setTheme: (theme: PartialBelongTheme) => void;
|
|
176
192
|
readonly applyPreset: (name: PresetName) => void;
|
|
177
193
|
readonly open: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@belonguniverseai/react-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-beta",
|
|
4
4
|
"description": "Belong — embeddable React AI assistant dock. Mount <BelongWidget> in your app tree with getToken dependency-injection auth.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"homepage": "https://github.com/Belong-Universe/agent-as-a-service/tree/main/packages/belong-sdk",
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public",
|
|
43
|
-
"provenance":
|
|
43
|
+
"provenance": false
|
|
44
44
|
}
|
|
45
45
|
}
|