Dax Raad 9 months ago
parent
commit
f5e2c596d4
2 changed files with 6 additions and 2 deletions
  1. 6 1
      js/src/index.ts
  2. 0 1
      js/src/session/session.ts

+ 6 - 1
js/src/index.ts

@@ -41,12 +41,17 @@ cli
         ? await Session.get(options.session)
         : await Session.create();
       console.log("Session:", session.id);
-      console.log(`Share: ${Share.URL.replace("api.", "")}/s?id=${session.id}`);
 
       Bus.subscribe(Message.Event.Updated, async (message) => {
         console.log("Thinking...");
       });
 
+      const unsub = Bus.subscribe(Session.Event.Updated, async (message) => {
+        if (message.properties.info.share?.url)
+          console.log("Share:", message.properties.info.share.url);
+        unsub();
+      });
+
       const providers = await LLM.providers();
       const providerID = Object.keys(providers)[0];
       const modelID = Object.keys(providers[providerID].info.models!)[0];

+ 0 - 1
js/src/session/session.ts

@@ -103,7 +103,6 @@ export namespace Session {
     const session = await get(id);
     if (session.share) return session.share;
     const share = await Share.create(id);
-    console.log("share", share);
     await update(id, (draft) => {
       draft.share = share;
     });