blink 1.1.16 → 1.1.19

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.
Files changed (88) hide show
  1. package/dist/browser/agent/client/index.cjs +8 -8
  2. package/dist/browser/agent/client/index.js +8 -8
  3. package/dist/cli/auth-CoJASYGP.js +2 -0
  4. package/dist/cli/chat-BDAEIrJW.js +1 -0
  5. package/dist/cli/{chat-manager-BtRfjylv.js → chat-manager-BRchJngj.js} +8 -8
  6. package/dist/cli/connect-CQUVd44y.js +1 -0
  7. package/dist/cli/connect-WyCmuQHj.js +1 -0
  8. package/dist/cli/{dev-Bz1veOUF.js → dev-BShY-dVP.js} +182 -200
  9. package/dist/cli/{dist-AXHevRdg.js → dist-Ceoe3h7v.js} +51 -56
  10. package/dist/cli/index.js +7 -7
  11. package/dist/cli/init-DoMgv4kU.js +25 -0
  12. package/dist/cli/{init-templates-C_keoZ45.js → init-templates-MqyReSD9.js} +132 -117
  13. package/dist/cli/login-DZFx5155.js +1 -0
  14. package/dist/cli/{run-DT3wRuFc.js → run-DFYLWiOa.js} +1 -1
  15. package/dist/cli/setup-slack-app-DQ3iSM5s.js +1 -0
  16. package/dist/cli/{token-CrWhcy44.js → token-DNRiDJM-.js} +1 -1
  17. package/dist/cli/token-util-C6Xu44iO.js +1 -0
  18. package/dist/cli/{token-util-1KocPoKS.js → token-util-IqDtKhK6.js} +1 -1
  19. package/dist/cli/undici-L5V8WBce.js +1 -0
  20. package/dist/cli/{util-DBfnc6lD.js → util-BQ3TH_Sv.js} +1 -1
  21. package/dist/cli/util-BgbIWOFE.js +6 -0
  22. package/dist/node/agent/index.node.cjs +1 -1
  23. package/dist/node/agent/index.node.d.ts +1 -1
  24. package/dist/node/agent/index.node.js +1 -1
  25. package/dist/node/build/index.d.ts +1 -1
  26. package/dist/node/index.node-D7Cvmag9.cjs +55 -0
  27. package/dist/node/index.node-TFdiI8lm.js +55 -0
  28. package/dist/node/react/index.node.cjs +252 -270
  29. package/dist/node/react/index.node.d.cts +3 -1
  30. package/dist/node/react/index.node.d.ts +5 -3
  31. package/dist/node/react/index.node.js +182 -200
  32. package/dist/node/{token-Bcs36BIo.cjs → token-BBGr-czK.cjs} +1 -1
  33. package/dist/node/{token-DY8sflMu.js → token-DOfE6QlD.js} +1 -1
  34. package/dist/node/{token-util-BIiR16HV.js → token-util-C_uzN2q9.js} +1 -1
  35. package/dist/node/token-util-D9kCwzE6.cjs +1 -0
  36. package/package.json +8 -4
  37. package/README.md +0 -3
  38. package/dist/cli/auth-DCUw-BJE.js +0 -2
  39. package/dist/cli/chat-ebiRKqit.js +0 -1
  40. package/dist/cli/connect-C3y3nGPW.js +0 -1
  41. package/dist/cli/connect-C__b725p.js +0 -1
  42. package/dist/cli/execAsync-BeUIz9nV.js +0 -1
  43. package/dist/cli/execAsync-Byz_iObc.js +0 -1
  44. package/dist/cli/execAsync-CQurQFgT.js +0 -1
  45. package/dist/cli/getMachineId-bsd-2l7jEJ9H.js +0 -1
  46. package/dist/cli/getMachineId-bsd-Cn9OZifa.js +0 -1
  47. package/dist/cli/getMachineId-bsd-DP_S0ZSE.js +0 -1
  48. package/dist/cli/getMachineId-darwin-C-kdKVWl.js +0 -2
  49. package/dist/cli/getMachineId-darwin-D6Y_ttQ1.js +0 -2
  50. package/dist/cli/getMachineId-darwin-D9mTsu57.js +0 -2
  51. package/dist/cli/getMachineId-linux-CI6sk5r7.js +0 -1
  52. package/dist/cli/getMachineId-linux-DA2UB-e3.js +0 -1
  53. package/dist/cli/getMachineId-linux-DGORKISs.js +0 -1
  54. package/dist/cli/getMachineId-unsupported-B4t2intc.js +0 -1
  55. package/dist/cli/getMachineId-unsupported-B6Ips7oB.js +0 -1
  56. package/dist/cli/getMachineId-unsupported-Cxfw7WwT.js +0 -1
  57. package/dist/cli/getMachineId-win-B6FQ_uBq.js +0 -1
  58. package/dist/cli/getMachineId-win-Dr2KTzTp.js +0 -1
  59. package/dist/cli/getMachineId-win-QxOtxJWo.js +0 -1
  60. package/dist/cli/init-DYcep43s.js +0 -3
  61. package/dist/cli/login-P-KIKeEv.js +0 -1
  62. package/dist/cli/open-DCYivxgo.js +0 -1
  63. package/dist/cli/server-C8plsU0X-b-FVGGZ1.js +0 -16
  64. package/dist/cli/setup-slack-app-Bo1yEsSq.js +0 -1
  65. package/dist/cli/token-util-CRJP9Uji.js +0 -1
  66. package/dist/cli/undici-CeDxbuSU.js +0 -1
  67. package/dist/node/execAsync-DDSV4gfK.cjs +0 -1
  68. package/dist/node/execAsync-DQysi_u6.js +0 -1
  69. package/dist/node/getMachineId-bsd-D2W6fhXU.js +0 -1
  70. package/dist/node/getMachineId-bsd-DM9BAly2.cjs +0 -1
  71. package/dist/node/getMachineId-darwin-BsTWxMfp.cjs +0 -2
  72. package/dist/node/getMachineId-darwin-Dk0tjVME.js +0 -2
  73. package/dist/node/getMachineId-linux-DZ7RMAHq.js +0 -1
  74. package/dist/node/getMachineId-linux-DmWhhrp6.cjs +0 -1
  75. package/dist/node/getMachineId-unsupported-CiZad6mc.js +0 -1
  76. package/dist/node/getMachineId-unsupported-y6X1AHF8.cjs +0 -1
  77. package/dist/node/getMachineId-win-_P_0Nv15.js +0 -1
  78. package/dist/node/getMachineId-win-e1UzWB2B.cjs +0 -1
  79. package/dist/node/index.node-CERnwYbK.js +0 -55
  80. package/dist/node/index.node-sb6fILn2.cjs +0 -55
  81. package/dist/node/token-util-BrE-Vihm.cjs +0 -1
  82. /package/dist/cli/{devtools-CcsObSm8.js → devtools-DvNholmW.js} +0 -0
  83. /package/dist/cli/{token-error-CoDMyqH1.js → token-error-DVSfBVaT.js} +0 -0
  84. /package/dist/cli/{undici-DS7K19Do.js → undici-BUZTy5qm.js} +0 -0
  85. /package/dist/node/{index-Q90WjL1a.d.ts → index-C28Wm0bG.d.ts} +0 -0
  86. /package/dist/node/{index.node-BgliWLNt.d.ts → index.node-qJt_7e9E.d.ts} +0 -0
  87. /package/dist/node/{token-util-B9ankBb5.cjs → token-util-BOoyY0PX.cjs} +0 -0
  88. /package/dist/node/{token-util-Czyk5fmW.js → token-util-_pz5CtFI.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import{__commonJSMin as e,__reExport as t,__require as n,__toESM as r}from"./chunk-D9KrCrVq.js";import{Client as i,Y as a}from"./dist-Ceoe3h7v.js";import{openUrl as o,require_source as s}from"./util-BgbIWOFE.js";import{dirname as c,join as l}from"node:path";import{existsSync as u,mkdirSync as d,readFileSync as f,unlinkSync as p,writeFileSync as m}from"node:fs";var h=e((e=>{e.__esModule=!0;function t(e){return i(e)===`boolean`}function n(e){return i(e)===`object`}function r(e){return i(e)===`string`}function i(e){return typeof e}function a(e){var i=e.meta,a=e.path,o=e.xdg;return{XDGAppPaths:new(function(){function e(s){s===void 0&&(s={});function c(t){return t===void 0&&(t={}),new e(t)}var l=n(s)?s:{name:s},u=l.suffix??``,d=l.isolated??!0,f=[l.name,i.pkgMainFilename(),i.mainFilename()],p=a.parse((f.find(function(e){return r(e)})??`$eval`)+u).name;c.$name=function(){return p},c.$isolated=function(){return d};function m(e){return e??={isolated:d},t(e)?e:e.isolated??d}function h(e){return m(e)?p:``}return c.cache=function(e){return a.join(o.cache(),h(e))},c.config=function(e){return a.join(o.config(),h(e))},c.data=function(e){return a.join(o.data(),h(e))},c.runtime=function(e){return o.runtime()?a.join(o.runtime(),h(e)):void 0},c.state=function(e){return a.join(o.state(),h(e))},c.configDirs=function(e){return o.configDirs().map(function(t){return a.join(t,h(e))})},c.dataDirs=function(e){return o.dataDirs().map(function(t){return a.join(t,h(e))})},c}return e}())}}e.Adapt=a})),g=e((e=>{var t=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};e.__esModule=!0;function n(e){var n=e.env,r=e.osPaths,i=e.path,a=/^darwin$/i.test(e.process.platform),o=/^win/i.test(e.process.platform);function s(){return r.home()||r.temp()}function c(e,t){return e||i.join.apply(i,t)}var l=function(){return{cache:function(){return c(n.get(`XDG_CACHE_HOME`),[s(),`.cache`])},config:function(){return c(n.get(`XDG_CONFIG_HOME`),[s(),`.config`])},data:function(){return c(n.get(`XDG_DATA_HOME`),[s(),`.local`,`share`])},runtime:function(){return n.get(`XDG_RUNTIME_DIR`)||void 0},state:function(){return c(n.get(`XDG_STATE_HOME`),[s(),`.local`,`state`])}}},u=function(){return{cache:function(){return c(n.get(`XDG_CACHE_HOME`),[s(),`Library`,`Caches`])},config:function(){return c(n.get(`XDG_CONFIG_HOME`),[s(),`Library`,`Preferences`])},data:function(){return c(n.get(`XDG_DATA_HOME`),[s(),`Library`,`Application Support`])},runtime:function(){return n.get(`XDG_RUNTIME_DIR`)||void 0},state:function(){return c(n.get(`XDG_STATE_HOME`),[s(),`Library`,`State`])}}},d=function(){function e(){return c(n.get(`APPDATA`),[s(),`AppData`,`Roaming`])}function t(){return c(n.get(`LOCALAPPDATA`),[s(),`AppData`,`Local`])}return{cache:function(){return c(n.get(`XDG_CACHE_HOME`),[t(),`xdg.cache`])},config:function(){return c(n.get(`XDG_CONFIG_HOME`),[e(),`xdg.config`])},data:function(){return c(n.get(`XDG_DATA_HOME`),[e(),`xdg.data`])},runtime:function(){return n.get(`XDG_RUNTIME_DIR`)||void 0},state:function(){return c(n.get(`XDG_STATE_HOME`),[t(),`xdg.state`])}}};return{XDG:new(function(){function e(){function r(){return new e}var s=a?u():o?d():l();return r.cache=s.cache,r.config=s.config,r.data=s.data,r.runtime=s.runtime,r.state=s.state,r.configDirs=function(){var e=n.get(`XDG_CONFIG_DIRS`);return t([s.config()],e?e.split(i.delimiter):[])},r.dataDirs=function(){var e=n.get(`XDG_DATA_DIRS`);return t([s.data()],e?e.split(i.delimiter):[])},r}return e}())}}e.Adapt=n})),_=e((e=>{var t=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};e.__esModule=!0;function n(e){return!e}function r(e){var r=e.env,i=e.os,a=e.path,o=/^win/i.test(e.process.platform);function s(t){return t?e.path.normalize(e.path.join(t,`.`)):void 0}function c(){return o?function(){var e=[typeof i.homedir==`function`?i.homedir():void 0,r.get(`USERPROFILE`),r.get(`HOME`),r.get(`HOMEDRIVE`)||r.get(`HOMEPATH`)?a.join(r.get(`HOMEDRIVE`)||``,r.get(`HOMEPATH`)||``):void 0];return s(e.find(function(e){return!n(e)}))}():function(){return s((typeof i.homedir==`function`?i.homedir():void 0)||r.get(`HOME`))}()}function l(){function e(e,n){return e?a.join.apply(a,t([e],n)):void 0}function l(){var e=`/tmp`,t=[typeof i.tmpdir==`function`?i.tmpdir():void 0,r.get(`TMPDIR`),r.get(`TEMP`),r.get(`TMP`)];return s(t.find(function(e){return!n(e)}))||e}function u(){var t=`C:\\Temp`,a=[typeof i.tmpdir==`function`?i.tmpdir:function(){},function(){return r.get(`TEMP`)},function(){return r.get(`TMP`)},function(){return e(r.get(`LOCALAPPDATA`),[`Temp`])},function(){return e(c(),[`AppData`,`Local`,`Temp`])},function(){return e(r.get(`ALLUSERSPROFILE`),[`Temp`])},function(){return e(r.get(`SystemRoot`),[`Temp`])},function(){return e(r.get(`windir`),[`Temp`])},function(){return e(r.get(`SystemDrive`),[`\\`,`Temp`])}].find(function(e){return e&&!n(e())});return a&&s(a())||t}return o?u():l()}return{OSPaths:new(function(){function e(){function t(){return new e}return t.home=c,t.temp=l,t}return e}())}}e.Adapt=r})),v=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};e.__esModule=!0;var a=i(n(`os`)),o=i(n(`path`));e.adapter={atImportPermissions:{env:!0},env:{get:function(e){return process.env[e]}},os:a,path:o,process}})),y=e(((e,t)=>{var n=_(),r=v();t.exports=n.Adapt(r.adapter).OSPaths})),b=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};e.__esModule=!0;var o=i(n(`path`));e.adapter={atImportPermissions:{env:!0},env:{get:function(e){return process.env[e]}},osPaths:a(y()).default,path:o,process}})),x=e(((e,t)=>{var n=g(),r=b();t.exports=n.Adapt(r.adapter).XDG})),S=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};e.__esModule=!0;var o=i(n(`path`)),s=a(x());e.adapter={atImportPermissions:{env:!0,read:!0},meta:{mainFilename:function(){var e=(n!=null&&n.main?n.main:{filename:void 0}).filename;return(e===process.execArgv[0]?void 0:e)||(process._eval===void 0?process.argv[1]:void 0)},pkgMainFilename:function(){return process.pkg?process.execPath:void 0}},path:o,process,xdg:s.default}})),C=r(e(((e,t)=>{var n=h(),r=S();t.exports=n.Adapt(r.adapter).XDGAppPaths}))(),1).default,w=r(s(),1);function T(e){let t=e||O();if(u(t)){let e=f(t,`utf8`);return JSON.parse(e).token}}function E(e,t){let n=t||O();u(c(n))||d(c(n),{recursive:!0}),m(n,JSON.stringify({_:`This is your Blink credentials file. DO NOT SHARE THIS FILE WITH ANYONE!`,token:e}))}function D(e){let t=e||O();u(t)&&p(t)}function O(){let e=C(`blink`).dataDirs();if(e.length===0)throw Error(`No suitable data directory for Blink storage found!`);return l(e[0],`auth.json`)}async function k(){let e=new i,t=T();if(t){e.authToken=t;try{await e.users.me()}catch{t=await j()}}else t=await j();return t}function A(e){let t=!1,n=t=>{(t.toString()===`\r`||t.toString()===`
2
+ `)&&e(),t.toString()===``&&(r(),process.exit(1))},r=()=>{if(!t){t=!0;try{process.stdin.removeListener(`data`,n),process.stdin.setRawMode(!1),process.stdin.pause()}catch{}}};return process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on(`data`,n),{cleanup:r}}async function j(){let e=new i,t,n=!1,r,s=new Promise(e=>{r=e}),c=e.auth.token((e,n)=>{t=e,console.log(`Visit`,w.default.bold(e),`to authenticate with Blink.`),console.log(w.default.dim(`Press [ENTER] to open the browser`)),r()}),l=A(async()=>{n||(n=!0,await s,await o(t))});await s;let u=a();u.start(`Waiting for authentication...`);try{let t=await c;l.cleanup(),e.authToken=t;let n=await e.users.me();return u.stop(`Congratulations, you are now signed in as ${n.email}!`),console.log(``),E(t),t}catch(e){l.cleanup(),u.stop(`Authentication failed: ${e}`),process.exit(1)}}export{D as deleteAuthToken,T as getAuthToken,j as login,k as loginIfNeeded,E as setAuthToken};
@@ -0,0 +1 @@
1
+ import{import_websocket as e}from"./wrapper-B0SBsJWP.js";import{openUrl as t}from"./util-BgbIWOFE.js";import{WorkspaceConnect as n}from"./connect-CQUVd44y.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};