blink 0.1.86 → 0.1.88

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.
@@ -62,11 +62,9 @@ declare const api: hono_hono_base0.HonoBase<{
62
62
  key: string;
63
63
  };
64
64
  };
65
- output: {
66
- error: string;
67
- };
68
- outputFormat: "json";
69
- status: 400;
65
+ output: null;
66
+ outputFormat: "body";
67
+ status: 204;
70
68
  } | {
71
69
  input: {
72
70
  json: {
@@ -77,9 +75,11 @@ declare const api: hono_hono_base0.HonoBase<{
77
75
  key: string;
78
76
  };
79
77
  };
80
- output: null;
81
- outputFormat: "body";
82
- status: 204;
78
+ output: {
79
+ error: string;
80
+ };
81
+ outputFormat: "json";
82
+ status: 400;
83
83
  };
84
84
  };
85
85
  } & {
@@ -161,11 +161,9 @@ declare const api: hono_hono_base0.HonoBase<{
161
161
  key: string;
162
162
  };
163
163
  };
164
- output: {
165
- error: string;
166
- };
167
- outputFormat: "json";
168
- status: 400;
164
+ output: null;
165
+ outputFormat: "body";
166
+ status: 204;
169
167
  } | {
170
168
  input: {
171
169
  json: {
@@ -177,9 +175,11 @@ declare const api: hono_hono_base0.HonoBase<{
177
175
  key: string;
178
176
  };
179
177
  };
180
- output: null;
181
- outputFormat: "body";
182
- status: 204;
178
+ output: {
179
+ error: string;
180
+ };
181
+ outputFormat: "json";
182
+ status: 400;
183
183
  };
184
184
  };
185
185
  }, "/chat"> | hono_types0.MergeSchemaPath<{
@@ -62,11 +62,9 @@ declare const api: hono_hono_base0.HonoBase<{
62
62
  key: string;
63
63
  };
64
64
  };
65
- output: {
66
- error: string;
67
- };
68
- outputFormat: "json";
69
- status: 400;
65
+ output: null;
66
+ outputFormat: "body";
67
+ status: 204;
70
68
  } | {
71
69
  input: {
72
70
  json: {
@@ -77,9 +75,11 @@ declare const api: hono_hono_base0.HonoBase<{
77
75
  key: string;
78
76
  };
79
77
  };
80
- output: null;
81
- outputFormat: "body";
82
- status: 204;
78
+ output: {
79
+ error: string;
80
+ };
81
+ outputFormat: "json";
82
+ status: 400;
83
83
  };
84
84
  };
85
85
  } & {
@@ -161,11 +161,9 @@ declare const api: hono_hono_base0.HonoBase<{
161
161
  key: string;
162
162
  };
163
163
  };
164
- output: {
165
- error: string;
166
- };
167
- outputFormat: "json";
168
- status: 400;
164
+ output: null;
165
+ outputFormat: "body";
166
+ status: 204;
169
167
  } | {
170
168
  input: {
171
169
  json: {
@@ -177,9 +175,11 @@ declare const api: hono_hono_base0.HonoBase<{
177
175
  key: string;
178
176
  };
179
177
  };
180
- output: null;
181
- outputFormat: "body";
182
- status: 204;
178
+ output: {
179
+ error: string;
180
+ };
181
+ outputFormat: "json";
182
+ status: 400;
183
183
  };
184
184
  };
185
185
  }, "/chat"> | hono_types0.MergeSchemaPath<{
@@ -1,4 +1,4 @@
1
- import{__commonJSMin as e,__export as t,__reExport as n,__require as r,__toESM as i}from"./chunk-ByIbJXPc.js";import{open_default as a}from"./open-DfjrUP4O.js";import{createRequire as o}from"node:module";import s,{stdin as c,stdout as l}from"node:process";import{dirname as u,join as d}from"path";import{existsSync as f,mkdirSync as p,readFileSync as m,writeFileSync as h}from"fs";import g,{z as _}from"zod";import"zod/v4";import"zod/v3";import v from"node:os";import y from"node:tty";import{stripVTControlCharacters as b}from"node:util";import*as x from"node:readline";import S from"node:readline";import{Writable as C}from"node:stream";var w=Object.getOwnPropertyNames,T=(e,t)=>function(){return t||(0,e[w(e)[0]])((t={exports:{}}).exports,t),t.exports},E=o(import.meta.url);_.object({email:_.string().email(),password:_.string().min(8)}),_.object({email:_.string().email(),code:_.string()}),_.object({email:_.string().email(),password:_.string().min(8)});var D=class{constructor(e,t){this.client=e,this.baseURL=t}async token(e,t={timeout:12e4}){return new Promise((n,r)=>{let i=crypto.randomUUID(),a=this.client.websocket(`/api/auth/token?id=${i}`),o=new URL(`/auth?id=${i}`,this.baseURL),s=setTimeout(()=>{r(Error(`Timeout waiting for the user to authenticate`))},t.timeout);a.onerror=e=>{clearTimeout(s),console.log(`error`,e),r(Error(`Failed to connect to server`))},a.onopen=()=>{e(o.toString(),i)},a.onmessage=e=>{typeof e.data==`string`&&(clearTimeout(s),n(e.data))}})}},O=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function k(e){}function A(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=k,onError:n=k,onRetry:r=k,onComment:i}=e,a=``,o=!0,s,c=``,l=``;function u(e){let t=o?e.replace(/^\xEF\xBB\xBF/,``):e,[n,r]=j(`${a}${t}`);for(let e of n)d(e);a=r,o=!1}function d(e){if(e===``){p();return}if(e.startsWith(`:`)){i&&i(e.slice(e.startsWith(`: `)?2:1));return}let t=e.indexOf(`:`);if(t!==-1){let n=e.slice(0,t),r=e[t+1]===` `?2:1,i=e.slice(t+r);f(n,i,e);return}f(e,``,e)}function f(e,t,i){switch(e){case`event`:l=t;break;case`data`:c=`${c}${t}
1
+ import{__commonJSMin as e,__export as t,__reExport as n,__require as r,__toESM as i}from"./chunk-ByIbJXPc.js";import{open_default as a}from"./open-FpexaS6S.js";import{createRequire as o}from"node:module";import s,{stdin as c,stdout as l}from"node:process";import{dirname as u,join as d}from"path";import{existsSync as f,mkdirSync as p,readFileSync as m,writeFileSync as h}from"fs";import g,{z as _}from"zod";import"zod/v4";import"zod/v3";import v from"node:os";import y from"node:tty";import{stripVTControlCharacters as b}from"node:util";import*as x from"node:readline";import S from"node:readline";import{Writable as C}from"node:stream";var w=Object.getOwnPropertyNames,T=(e,t)=>function(){return t||(0,e[w(e)[0]])((t={exports:{}}).exports,t),t.exports},E=o(import.meta.url);_.object({email:_.string().email(),password:_.string().min(8)}),_.object({email:_.string().email(),code:_.string()}),_.object({email:_.string().email(),password:_.string().min(8)});var D=class{constructor(e,t){this.client=e,this.baseURL=t}async token(e,t={timeout:12e4}){return new Promise((n,r)=>{let i=crypto.randomUUID(),a=this.client.websocket(`/api/auth/token?id=${i}`),o=new URL(`/auth?id=${i}`,this.baseURL),s=setTimeout(()=>{r(Error(`Timeout waiting for the user to authenticate`))},t.timeout);a.onerror=e=>{clearTimeout(s),console.log(`error`,e),r(Error(`Failed to connect to server`))},a.onopen=()=>{e(o.toString(),i)},a.onmessage=e=>{typeof e.data==`string`&&(clearTimeout(s),n(e.data))}})}},O=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function k(e){}function A(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=k,onError:n=k,onRetry:r=k,onComment:i}=e,a=``,o=!0,s,c=``,l=``;function u(e){let t=o?e.replace(/^\xEF\xBB\xBF/,``):e,[n,r]=j(`${a}${t}`);for(let e of n)d(e);a=r,o=!1}function d(e){if(e===``){p();return}if(e.startsWith(`:`)){i&&i(e.slice(e.startsWith(`: `)?2:1));return}let t=e.indexOf(`:`);if(t!==-1){let n=e.slice(0,t),r=e[t+1]===` `?2:1,i=e.slice(t+r);f(n,i,e);return}f(e,``,e)}function f(e,t,i){switch(e){case`event`:l=t;break;case`data`:c=`${c}${t}
2
2
  `;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new O(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new O(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function p(){c.length>0&&t({id:s,event:l||void 0,data:c.endsWith(`
3
3
  `)?c.slice(0,-1):c}),s=void 0,c=``,l=``}function m(e={}){a&&e.consume&&d(a),o=!0,s=void 0,c=``,l=``,a=``}return{feed:u,reset:m}}function j(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e.indexOf(`\r`,r),a=e.indexOf(`
4
4
  `,r),o=-1;if(i!==-1&&a!==-1?o=Math.min(i,a):i===-1?a!==-1&&(o=a):o=i===e.length-1?-1:i,o===-1){n=e.slice(r);break}else{let n=e.slice(r,o);t.push(n),r=o+1,e[r-1]===`\r`&&e[r]===`
@@ -1 +1 @@
1
- import{import_websocket as e}from"./wrapper-B4vDwpOq.js";import{open_default as t}from"./open-DfjrUP4O.js";import"./events-NgMztwfM.js";import{WorkspaceConnect as n}from"./connect-Bfao1GJr.js";async function r(){let r=crypto.randomUUID(),i=new e.default(`wss://blink.so/legacy-auth?id=${r}`),a=new Promise((e,t)=>{i.onopen=()=>{e()},i.onerror=e=>{t(e)}});await a;let o=new Promise((e,t)=>{i.onmessage=t=>{e(t.data.toString())}}),s=`https://blink.so/legacy-auth?id=${r}&type=workspace`;console.log(`Opening the following URL in your browser: ${s}`),await t(s);let c=await o,l=new n({url:`wss://blink.so/api/connect`,token:c});l.onConnect(()=>{console.log(`Connected to Blink`)}),l.onDisconnect(()=>{console.log(`Disconnected from Blink`)})}export{r as default};
1
+ import{import_websocket as e}from"./wrapper-B4vDwpOq.js";import{open_default as t}from"./open-FpexaS6S.js";import"./events-NgMztwfM.js";import{WorkspaceConnect as n}from"./connect-Bfao1GJr.js";async function r(){let r=crypto.randomUUID(),i=new e.default(`wss://blink.so/legacy-auth?id=${r}`),a=new Promise((e,t)=>{i.onopen=()=>{e()},i.onerror=e=>{t(e)}});await a;let o=new Promise((e,t)=>{i.onmessage=t=>{e(t.data.toString())}}),s=`https://blink.so/legacy-auth?id=${r}&type=workspace`;console.log(`Opening the following URL in your browser: ${s}`),await t(s);let c=await o,l=new n({url:`wss://blink.so/api/connect`,token:c});l.onConnect(()=>{console.log(`Connected to Blink`)}),l.onDisconnect(()=>{console.log(`Disconnected from Blink`)})}export{r as default};