orchestrator-client 5.7.10 → 5.8.3
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.cjs +29 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +29 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -656,6 +656,7 @@ declare class OrchestratorAsync {
|
|
|
656
656
|
createVSATask(params: {
|
|
657
657
|
userId: string;
|
|
658
658
|
goalPrompt: string;
|
|
659
|
+
variant?: "portal_user" | "operator";
|
|
659
660
|
title?: string;
|
|
660
661
|
agentModelId?: string;
|
|
661
662
|
orchestratorModelId?: string;
|
|
@@ -1012,6 +1013,7 @@ declare class RealtimeClient {
|
|
|
1012
1013
|
private _socket;
|
|
1013
1014
|
private _handlers;
|
|
1014
1015
|
private _connected;
|
|
1016
|
+
private _rooms;
|
|
1015
1017
|
private _subscriptions;
|
|
1016
1018
|
private _currentRooms;
|
|
1017
1019
|
private _subIdCounter;
|
package/dist/index.d.ts
CHANGED
|
@@ -656,6 +656,7 @@ declare class OrchestratorAsync {
|
|
|
656
656
|
createVSATask(params: {
|
|
657
657
|
userId: string;
|
|
658
658
|
goalPrompt: string;
|
|
659
|
+
variant?: "portal_user" | "operator";
|
|
659
660
|
title?: string;
|
|
660
661
|
agentModelId?: string;
|
|
661
662
|
orchestratorModelId?: string;
|
|
@@ -1012,6 +1013,7 @@ declare class RealtimeClient {
|
|
|
1012
1013
|
private _socket;
|
|
1013
1014
|
private _handlers;
|
|
1014
1015
|
private _connected;
|
|
1016
|
+
private _rooms;
|
|
1015
1017
|
private _subscriptions;
|
|
1016
1018
|
private _currentRooms;
|
|
1017
1019
|
private _subIdCounter;
|
package/dist/index.js
CHANGED
|
@@ -691,6 +691,7 @@ var OrchestratorAsync = class {
|
|
|
691
691
|
const body = {
|
|
692
692
|
user_id: params.userId,
|
|
693
693
|
goal_prompt: params.goalPrompt,
|
|
694
|
+
variant: params.variant ?? "portal_user",
|
|
694
695
|
title: params.title,
|
|
695
696
|
agent_model_id: params.agentModelId,
|
|
696
697
|
orchestrator_model_id: params.orchestratorModelId,
|
|
@@ -1780,6 +1781,11 @@ var RealtimeClient = class {
|
|
|
1780
1781
|
this._socket = null;
|
|
1781
1782
|
this._handlers = /* @__PURE__ */ new Map();
|
|
1782
1783
|
this._connected = false;
|
|
1784
|
+
// Every room joined through any API (subscribeTask, joinRooms, subscribe(),
|
|
1785
|
+
// subscribeEvents, etc.) is tracked here so it can be replayed on reconnect.
|
|
1786
|
+
// Server-side room membership is tied to the socket connection and is lost
|
|
1787
|
+
// on disconnect — the full set must be re-emitted on every reconnect.
|
|
1788
|
+
this._rooms = /* @__PURE__ */ new Set();
|
|
1783
1789
|
// Multi-subscriber room-diffing state (mirrors WebSocketProvider)
|
|
1784
1790
|
this._subscriptions = /* @__PURE__ */ new Map();
|
|
1785
1791
|
this._currentRooms = /* @__PURE__ */ new Set();
|
|
@@ -1816,6 +1822,10 @@ var RealtimeClient = class {
|
|
|
1816
1822
|
this._socket.on("connect", () => {
|
|
1817
1823
|
this._connected = true;
|
|
1818
1824
|
this._currentRooms = /* @__PURE__ */ new Set();
|
|
1825
|
+
if (this._rooms.size > 0) {
|
|
1826
|
+
this._socket?.emit("join", { rooms: [...this._rooms] });
|
|
1827
|
+
this._currentRooms = new Set(this._rooms);
|
|
1828
|
+
}
|
|
1819
1829
|
this._syncRooms();
|
|
1820
1830
|
});
|
|
1821
1831
|
this._socket.on("disconnect", () => {
|
|
@@ -1873,7 +1883,9 @@ var RealtimeClient = class {
|
|
|
1873
1883
|
*/
|
|
1874
1884
|
subscribeTask(taskId) {
|
|
1875
1885
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1876
|
-
|
|
1886
|
+
const room = `task:${taskId}`;
|
|
1887
|
+
this._socket.emit("join", { rooms: [room] });
|
|
1888
|
+
this._rooms.add(room);
|
|
1877
1889
|
}
|
|
1878
1890
|
/**
|
|
1879
1891
|
* Unsubscribe from realtime events for a specific task.
|
|
@@ -1881,7 +1893,9 @@ var RealtimeClient = class {
|
|
|
1881
1893
|
*/
|
|
1882
1894
|
unsubscribeTask(taskId) {
|
|
1883
1895
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1884
|
-
|
|
1896
|
+
const room = `task:${taskId}`;
|
|
1897
|
+
this._socket.emit("leave", { rooms: [room] });
|
|
1898
|
+
this._rooms.delete(room);
|
|
1885
1899
|
}
|
|
1886
1900
|
/**
|
|
1887
1901
|
* Subscribe to event-type-scoped rooms.
|
|
@@ -1891,6 +1905,7 @@ var RealtimeClient = class {
|
|
|
1891
1905
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1892
1906
|
const rooms = eventTypes.map((t) => `event:${t}`);
|
|
1893
1907
|
this._socket.emit("join", { rooms });
|
|
1908
|
+
for (const r of rooms) this._rooms.add(r);
|
|
1894
1909
|
}
|
|
1895
1910
|
/**
|
|
1896
1911
|
* Unsubscribe from event-type-scoped rooms.
|
|
@@ -1899,6 +1914,7 @@ var RealtimeClient = class {
|
|
|
1899
1914
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1900
1915
|
const rooms = eventTypes.map((t) => `event:${t}`);
|
|
1901
1916
|
this._socket.emit("leave", { rooms });
|
|
1917
|
+
for (const r of rooms) this._rooms.delete(r);
|
|
1902
1918
|
}
|
|
1903
1919
|
/**
|
|
1904
1920
|
* Subscribe to the `all` broadcast room (receives all events).
|
|
@@ -1906,20 +1922,25 @@ var RealtimeClient = class {
|
|
|
1906
1922
|
subscribeAll() {
|
|
1907
1923
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1908
1924
|
this._socket.emit("join", { rooms: ["all"] });
|
|
1925
|
+
this._rooms.add("all");
|
|
1909
1926
|
}
|
|
1910
1927
|
/**
|
|
1911
1928
|
* Subscribe to a locale-specific room.
|
|
1912
1929
|
*/
|
|
1913
1930
|
subscribeLocale(locale) {
|
|
1914
1931
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1915
|
-
|
|
1932
|
+
const room = `locale:${locale}`;
|
|
1933
|
+
this._socket.emit("join", { rooms: [room] });
|
|
1934
|
+
this._rooms.add(room);
|
|
1916
1935
|
}
|
|
1917
1936
|
/**
|
|
1918
1937
|
* Unsubscribe from a locale-specific room.
|
|
1919
1938
|
*/
|
|
1920
1939
|
unsubscribeLocale(locale) {
|
|
1921
1940
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1922
|
-
|
|
1941
|
+
const room = `locale:${locale}`;
|
|
1942
|
+
this._socket.emit("leave", { rooms: [room] });
|
|
1943
|
+
this._rooms.delete(room);
|
|
1923
1944
|
}
|
|
1924
1945
|
/**
|
|
1925
1946
|
* Join arbitrary rooms by name.
|
|
@@ -1927,6 +1948,7 @@ var RealtimeClient = class {
|
|
|
1927
1948
|
joinRooms(rooms) {
|
|
1928
1949
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1929
1950
|
this._socket.emit("join", { rooms });
|
|
1951
|
+
for (const r of rooms) this._rooms.add(r);
|
|
1930
1952
|
}
|
|
1931
1953
|
/**
|
|
1932
1954
|
* Leave arbitrary rooms by name.
|
|
@@ -1934,6 +1956,7 @@ var RealtimeClient = class {
|
|
|
1934
1956
|
leaveRooms(rooms) {
|
|
1935
1957
|
if (!this._socket) throw new Error("RealtimeClient not connected");
|
|
1936
1958
|
this._socket.emit("leave", { rooms });
|
|
1959
|
+
for (const r of rooms) this._rooms.delete(r);
|
|
1937
1960
|
}
|
|
1938
1961
|
// ------------------------------------------------------------------
|
|
1939
1962
|
// Multi-subscriber API (mirrors WebSocketProvider room-diffing)
|
|
@@ -1991,6 +2014,8 @@ var RealtimeClient = class {
|
|
|
1991
2014
|
const toLeave = [...this._currentRooms].filter((r) => !needed.has(r));
|
|
1992
2015
|
if (toJoin.length) socket.emit("join", { rooms: toJoin });
|
|
1993
2016
|
if (toLeave.length) socket.emit("leave", { rooms: toLeave });
|
|
2017
|
+
for (const r of toJoin) this._rooms.add(r);
|
|
2018
|
+
for (const r of toLeave) this._rooms.delete(r);
|
|
1994
2019
|
this._currentRooms = needed;
|
|
1995
2020
|
}
|
|
1996
2021
|
/**
|