@supernova-studio/client 1.39.0 → 1.40.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.mjs CHANGED
@@ -474,8 +474,7 @@ var ForgeChatMessage = z14.object({
474
474
  updatedAt: z14.coerce.date(),
475
475
  opikTraceId: z14.string().optional(),
476
476
  sender: ForgeChatMessageSender,
477
- userScore: ForgeChatMessageUserScore.optional(),
478
- replyToMessageId: z14.string().optional()
477
+ userScore: ForgeChatMessageUserScore.optional()
479
478
  });
480
479
  var ForgeChatThread = z15.object({
481
480
  id: z15.string(),
@@ -9915,8 +9914,7 @@ var DTOForgeChatThreadListResponse = z328.object({
9915
9914
  var DTOForgeChatMessageCreateInput = z328.object({
9916
9915
  payload: z328.string(),
9917
9916
  sender: DTOForgeChatMessageSender.optional(),
9918
- opikTraceId: z328.string().optional(),
9919
- replyToMessageId: z328.string().optional()
9917
+ opikTraceId: z328.string().optional()
9920
9918
  });
9921
9919
  var DTOForgeChatMessageCreateResponse = z328.object({
9922
9920
  message: DTOForgeChatMessage
@@ -17788,6 +17786,101 @@ var BackendForgeProjectRoomYDoc = class {
17788
17786
  }
17789
17787
  };
17790
17788
 
17789
+ // src/yjs/thread-room/base.ts
17790
+ var ThreadRoomBaseYDoc = class {
17791
+ constructor(yDoc) {
17792
+ __publicField(this, "yDoc");
17793
+ this.yDoc = yDoc;
17794
+ }
17795
+ getState() {
17796
+ const agentResponseTrackers = this.getAgentResponseTrackers();
17797
+ const isLoaded = true;
17798
+ return {
17799
+ isLoaded,
17800
+ agentResponseTrackers
17801
+ };
17802
+ }
17803
+ //
17804
+ // Agent Response Trackers
17805
+ //
17806
+ getAgentResponseTrackers() {
17807
+ return this.getObjects(this.agentResponseTrackersYMap, DTOFeatureAgentResponseTracker);
17808
+ }
17809
+ updateAgentResponseTrackers(trackers) {
17810
+ this.setObjects(this.agentResponseTrackersYMap, trackers);
17811
+ }
17812
+ deleteAgentResponseTrackers(ids) {
17813
+ this.deleteObjects(this.agentResponseTrackersYMap, ids);
17814
+ }
17815
+ get agentResponseTrackersYMap() {
17816
+ return this.yDoc.getMap("forgeFeatureAgentResponseTrackers");
17817
+ }
17818
+ //
17819
+ // Utility methods
17820
+ //
17821
+ getObjects(map, schema) {
17822
+ const objects = [];
17823
+ map.forEach((value) => objects.push(schema.parse(value)));
17824
+ return objects;
17825
+ }
17826
+ setObjects(map, objects) {
17827
+ objects.forEach((o) => map.set(o.id, JSON.parse(JSON.stringify(o))));
17828
+ }
17829
+ deleteObjects(map, ids) {
17830
+ ids.forEach((id) => map.delete(id));
17831
+ }
17832
+ };
17833
+
17834
+ // src/yjs/thread-room/backend.ts
17835
+ var BackendThreadRoomYDoc = class {
17836
+ constructor(yDoc) {
17837
+ __publicField(this, "yDoc");
17838
+ this.yDoc = yDoc;
17839
+ }
17840
+ updateState(transaction) {
17841
+ this.yDoc.transact((trx) => {
17842
+ const yDoc = new ThreadRoomBaseYDoc(trx.doc);
17843
+ transaction.agentResponseTrackerIdsToDelete && yDoc.deleteAgentResponseTrackers(transaction.agentResponseTrackerIdsToDelete);
17844
+ transaction.agentResponseTrackers && yDoc.updateAgentResponseTrackers(transaction.agentResponseTrackers);
17845
+ });
17846
+ }
17847
+ getState() {
17848
+ const featureRoomDoc = new ThreadRoomBaseYDoc(this.yDoc);
17849
+ return featureRoomDoc.getState();
17850
+ }
17851
+ };
17852
+
17853
+ // src/yjs/thread-room/frontend.ts
17854
+ var FrontendThreadRoomYDoc = class {
17855
+ constructor(yDoc, debug = false) {
17856
+ this.debug = debug;
17857
+ __publicField(this, "yDoc");
17858
+ this.yDoc = yDoc;
17859
+ }
17860
+ //
17861
+ // State Access
17862
+ //
17863
+ getState() {
17864
+ const doc = new ThreadRoomBaseYDoc(this.yDoc);
17865
+ return doc.getState();
17866
+ }
17867
+ //
17868
+ // Agent Response Trackers
17869
+ //
17870
+ getAgentResponseTrackers() {
17871
+ const doc = new ThreadRoomBaseYDoc(this.yDoc);
17872
+ return doc.getAgentResponseTrackers();
17873
+ }
17874
+ updateAgentResponseTracker(tracker) {
17875
+ const doc = new ThreadRoomBaseYDoc(this.yDoc);
17876
+ return doc.updateAgentResponseTrackers([tracker]);
17877
+ }
17878
+ deleteAgentResponseTrackers(id) {
17879
+ const doc = new ThreadRoomBaseYDoc(this.yDoc);
17880
+ return doc.deleteAgentResponseTrackers([id]);
17881
+ }
17882
+ };
17883
+
17791
17884
  // src/yjs/version-room/backend.ts
17792
17885
  var BackendVersionRoomYDoc = class {
17793
17886
  constructor(yDoc) {
@@ -18447,6 +18540,7 @@ var TransactionQueue2 = class {
18447
18540
  export {
18448
18541
  BackendFeatureRoomYDoc,
18449
18542
  BackendForgeProjectRoomYDoc,
18543
+ BackendThreadRoomYDoc,
18450
18544
  BackendVersionRoomYDoc,
18451
18545
  BlockDefinitionUtils,
18452
18546
  BlockParsingUtils,
@@ -19147,6 +19241,7 @@ export {
19147
19241
  ForgeProjectsEndpoint,
19148
19242
  FormattedCollections,
19149
19243
  FrontendFeatureRoomYDoc,
19244
+ FrontendThreadRoomYDoc,
19150
19245
  FrontendVersionRoomYDoc,
19151
19246
  GitDestinationOptions,
19152
19247
  ImportJobsEndpoint,
@@ -19171,6 +19266,7 @@ export {
19171
19266
  StringVariableScopeType,
19172
19267
  SupernovaApiClient,
19173
19268
  ThemesEndpoint,
19269
+ ThreadRoomBaseYDoc,
19174
19270
  TokenCollectionsEndpoint,
19175
19271
  TokenGroupsEndpoint,
19176
19272
  TokensEndpoint,