blink 0.1.109 → 0.1.110
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/browser/control/index.d.cts +16 -16
- package/dist/browser/control/index.d.ts +16 -16
- package/dist/cli/chat-Jjsxhu91.js +1 -0
- package/dist/cli/connect-BpfPzXxZ.js +1 -0
- package/dist/cli/connect-O43Nkqhm.js +1 -0
- package/dist/cli/{dev-C8e69O1h.js → dev-BvMDj_Q6.js} +10 -10
- package/dist/cli/{getMachineId-bsd-BIOLOPhL.js → getMachineId-bsd-C9_PO8vg.js} +1 -1
- package/dist/cli/{getMachineId-bsd-BsiSHdIY.js → getMachineId-bsd-aGbXimKO.js} +1 -1
- package/dist/cli/{getMachineId-bsd-DOWrEuKQ.js → getMachineId-bsd-f6XFfE6Q.js} +1 -1
- package/dist/cli/{getMachineId-darwin-BcKyqrJz.js → getMachineId-darwin-CbnZZvCa.js} +1 -1
- package/dist/cli/{getMachineId-darwin-Ch2lPibC.js → getMachineId-darwin-D2cTSAMO.js} +1 -1
- package/dist/cli/{getMachineId-darwin-KlnNx6Ci.js → getMachineId-darwin-VXBPWUwo.js} +1 -1
- package/dist/cli/{getMachineId-win-DB0Jdpp7.js → getMachineId-win-B1comJH7.js} +1 -1
- package/dist/cli/{getMachineId-win-DZJS-oII.js → getMachineId-win-DHmeC5Ow.js} +1 -1
- package/dist/cli/{getMachineId-win-4fht1YMv.js → getMachineId-win-Dof2NkV_.js} +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/{run-Be8N9G40.js → run-Bfj_0Gkl.js} +1 -1
- package/dist/cli/{token-DNRiDJM-.js → token-CwpupgJv.js} +1 -1
- package/dist/cli/{token-util-IqDtKhK6.js → token-util-BGsva5RI.js} +1 -1
- package/dist/cli/token-util-DsmDyKzB.js +1 -0
- package/dist/cli/undici-Cyjf_ODA.js +1 -0
- package/dist/node/react/index.node.cjs +3 -3
- package/dist/node/react/index.node.js +3 -3
- package/package.json +1 -1
- package/dist/cli/chat-DX_V608z.js +0 -1
- package/dist/cli/connect-Bw0fihsU.js +0 -1
- package/dist/cli/connect-D8dpOtYY.js +0 -1
- package/dist/cli/node-pty-BfteYoG-.js +0 -13
- package/dist/cli/node-pty-CFpbCPc8.js +0 -1
- package/dist/cli/token-util-C6Xu44iO.js +0 -1
- package/dist/cli/undici-L5V8WBce.js +0 -1
- /package/dist/cli/{chat-manager-BL3XfguD.js → chat-manager-DnV2OvBw.js} +0 -0
- /package/dist/cli/{devtools-DvNholmW.js → devtools-aLFrISVw.js} +0 -0
- /package/dist/cli/{execAsync-Bhq3YKvl.js → execAsync-BTw463vh.js} +0 -0
- /package/dist/cli/{execAsync-Djebuxfm.js → execAsync-DQQzCKCI.js} +0 -0
- /package/dist/cli/{execAsync-_tP2SNTy.js → execAsync-WFKcnjxL.js} +0 -0
- /package/dist/cli/{getMachineId-linux-DOYJzWBc.js → getMachineId-linux-B2Hg9S6u.js} +0 -0
- /package/dist/cli/{getMachineId-linux-HIrcMDqb.js → getMachineId-linux-CGpaESCu.js} +0 -0
- /package/dist/cli/{getMachineId-linux-ulzMB5vC.js → getMachineId-linux-sSblsl0f.js} +0 -0
- /package/dist/cli/{getMachineId-unsupported-B1wECTrM.js → getMachineId-unsupported-B067r1JC.js} +0 -0
- /package/dist/cli/{getMachineId-unsupported-Drd_3o_r.js → getMachineId-unsupported-B_bl21GL.js} +0 -0
- /package/dist/cli/{getMachineId-unsupported-nDPltmL9.js → getMachineId-unsupported-BcNSZ9TD.js} +0 -0
- /package/dist/cli/{init-iySs9KUe.js → init-EfvGBlkJ.js} +0 -0
- /package/dist/cli/{login-DTwQcbaT.js → login-B84QSb5o.js} +0 -0
- /package/dist/cli/{server-C8plsU0X-We1KgV-r.js → server-C8plsU0X-BmosAKXr.js} +0 -0
- /package/dist/cli/{token-error-DVSfBVaT.js → token-error-C6TSmqWz.js} +0 -0
- /package/dist/cli/{undici-BUZTy5qm.js → undici-v5uUkaRO.js} +0 -0
|
@@ -62,11 +62,9 @@ declare const api: hono_hono_base0.HonoBase<{
|
|
|
62
62
|
key: string;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
output:
|
|
66
|
-
|
|
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:
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
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:
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
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:
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
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:
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
output: {
|
|
179
|
+
error: string;
|
|
180
|
+
};
|
|
181
|
+
outputFormat: "json";
|
|
182
|
+
status: 400;
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
}, "/chat"> | hono_types0.MergeSchemaPath<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{import_websocket as e}from"./wrapper-B0SBsJWP.js";import{open_default as t}from"./open-DCYivxgo.js";import"./server-C8plsU0X-BmosAKXr.js";import{WorkspaceConnect as n}from"./connect-BpfPzXxZ.js";async function r(){let r=crypto.randomUUID(),i=new e.default(`wss://blink.so/legacy-auth?id=${r}`);await new Promise((e,t)=>{i.onopen=()=>{e()},i.onerror=e=>{t(e)}});let a=new Promise((e,t)=>{i.onmessage=t=>{e(t.data.toString())}}),o=`https://blink.so/legacy-auth?id=${r}&type=workspace`;console.log(`Opening the following URL in your browser: ${o}`),await t(o);let s=await a,c=new n({url:`wss://blink.so/api/connect`,token:s});c.onConnect(()=>{console.log(`Connected to Blink`)}),c.onDisconnect(()=>{console.log(`Disconnected from Blink`)})}export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__require as e}from"./chunk-D9KrCrVq.js";import{wrapper_default as t}from"./wrapper-B0SBsJWP.js";import{Server as n}from"./server-C8plsU0X-BmosAKXr.js";import r from"node:path";import i from"node:fs";import a from"node:os";var o=class{listeners=[];get event(){return e=>(this.listeners.push(e),{dispose:()=>{this.listeners=this.listeners.filter(t=>t!==e)}})}emit(e){for(let t=this.listeners.length-1;t>=0;t--)this.listeners[t]?.(e)}dispose(){this.listeners=[]}};const s=r.join(a.tmpdir(),`blink-connect-${process.pid}.log`),c=e=>{if(e instanceof Error)return e.stack??e.message;try{return JSON.stringify(e)}catch{return String(e)}},l=async e=>{let t=`${new Date().toISOString()} ${e}\n`;try{await i.promises.appendFile(s,t,`utf8`)}catch{}};async function u(){let e=process.env.BLINK_URL,t=process.env.BLINK_TOKEN;delete process.env.BLINK_TOKEN,process.env.GIT_TERMINAL_PROMPT=`0`,process.env.GIT_PAGER=`cat`,process.env.GIT_AUTHOR_NAME=`blink-so[bot]`,process.env.GIT_AUTHOR_EMAIL=`211532188+blink-so[bot]@users.noreply.github.com`,process.env.GIT_COMMITTER_NAME=`blink-so[bot]`,process.env.GIT_COMMITTER_EMAIL=`211532188+blink-so[bot]@users.noreply.github.com`,process.env.GIT_CONFIG_COUNT=`1`,process.env.GIT_CONFIG_KEY_0=`credential.https://github.com.helper`,process.env.GIT_CONFIG_VALUE_0=`!gh auth git-credential`,process.addListener(`uncaughtException`,e=>{l(`uncaughtException: ${c(e)}`),d(t,e)}),process.addListener(`unhandledRejection`,e=>{l(`unhandledRejection: ${c(e)}`),d(t,e)});let n=new f({url:e??`wss://blink.so/api/connect`,token:t,createDeploymentFromTar:async n=>{let r=new URL(`/api/static-deployment`,e??`https://blink.so`);return(await(await fetch(r,{method:`POST`,body:n,headers:{"Content-Type":`application/tar`,Authorization:`Bearer ${t}`},duplex:`half`})).json()).deployment_id}});n.onConnect(()=>{console.log(`Connected`),l(`Connected`)}),n.onDisconnect(()=>{console.log(`Disconnected`),l(`Disconnected`)})}const d=async(e,t)=>{let n=new URL(`https://blink.so/api/connect-error`);await fetch(n.toString(),{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${e}`},body:JSON.stringify({error:t})})};var f=class{_onConnect=new o;onConnect=this._onConnect.event;_onDisconnect=new o;onDisconnect=this._onDisconnect.event;reconnectTimeout=null;disposed=!1;ws;server;hasReconnectedOnce=!1;constructor(r){this.opts=r;let i;try{i=e(`@lydell/node-pty`)}catch{}typeof Bun<`u`&&(i=void 0),this.server=new n({send:e=>{this.ws.readyState===t.OPEN?this.ws.send(e):console.warn(`Message skipped because connection is closed.`)},createDeploymentFromTar:this.opts.createDeploymentFromTar,nodePty:i}),this.connect()}dispose(){this.disposed||(this.disposed=!0,this.ws.close(),this.reconnectTimeout&&clearTimeout(this.reconnectTimeout))}scheduleReconnect(){if(this.disposed)return;let e=this.opts.immediateReconnectFirst??!0,t=this.opts.reconnectionDelay??2500;!this.hasReconnectedOnce&&e&&(t=0),this.hasReconnectedOnce=!0,this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectTimeout=setTimeout(()=>{this.connect()},t)}connect(){let e=new URL(this.opts.url);e.protocol===`http:`?e.protocol=`ws:`:e.protocol===`https:`&&(e.protocol=`wss:`);let n={};this.opts.token&&(n.Authorization=`Bearer ${this.opts.token}`),this.ws=new t(e.toString(),{headers:n}),this.ws.addEventListener(`open`,()=>{this._onConnect.emit()}),this.ws.addEventListener(`close`,()=>{this._onDisconnect.emit(),!this.disposed&&this.scheduleReconnect()}),this.ws.addEventListener(`error`,e=>{console.error(`Error`,e.message??e)}),this.ws.addEventListener(`message`,e=>{if(typeof e.data==`string`){console.warn(`Message skipped because it is not a buffer.`);return}try{this.server.handleMessage(new Uint8Array(e.data))}catch(e){console.error(`message handler error`,e);try{this.ws.close(1011)}catch{}}})}};export{f as WorkspaceConnect,u as connect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./wrapper-B0SBsJWP.js";import"./server-C8plsU0X-BmosAKXr.js";import{WorkspaceConnect as e,connect as t}from"./connect-BpfPzXxZ.js";export{e as WorkspaceConnect,t as default};
|