blink 0.1.54 → 0.1.55

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 (48) hide show
  1. package/dist/api/index.cjs +16 -9
  2. package/dist/api/index.d.cts +2 -265
  3. package/dist/api/index.d.ts +2 -265
  4. package/dist/api/index.js +15 -8
  5. package/dist/build/index.cjs +7 -0
  6. package/dist/build/index.d.cts +107 -0
  7. package/dist/build/index.d.ts +107 -0
  8. package/dist/build/index.js +7 -0
  9. package/dist/chunk-___ucjiX.js +1 -0
  10. package/dist/chunk-hhQzssFb.cjs +1 -0
  11. package/dist/cli/auth-Dw-wJ1IM.js +30 -0
  12. package/dist/cli/{chat-VT2y0Ejx.js → chat-CvTLq5E0.js} +1 -1
  13. package/dist/cli/connect-BHyGYU8L.js +1 -0
  14. package/dist/cli/connect-Cxa-uIEb.js +26 -0
  15. package/dist/cli/{dev-DWe1-Qrm.js → dev-Kje8z9kN.js} +415 -340
  16. package/dist/cli/devtools-BS9tk1Y9.js +14 -14
  17. package/dist/cli/dist-CN69Y-yA.js +1 -1
  18. package/dist/cli/esm-CeJfCMPI.js +1 -1
  19. package/dist/cli/index.js +10 -10
  20. package/dist/cli/{init-CyILyaVn.js → init-x07jlFqm.js} +2 -2
  21. package/dist/cli/login-KHDcJ0iZ.js +1 -0
  22. package/dist/cli/undici-BG07ys6c.js +6 -6
  23. package/dist/cli/util-cVEGIV3r.js +9 -0
  24. package/dist/cli/wrapper-B4vDwpOq.js +2 -2
  25. package/dist/http/index.cjs +1 -0
  26. package/dist/http/index.d.cts +3 -0
  27. package/dist/http/index.d.ts +3 -0
  28. package/dist/http/index.js +1 -0
  29. package/dist/http-BAfeJhFm.js +53 -0
  30. package/dist/http-DS8vmbQx.cjs +53 -0
  31. package/dist/index-BgJpZoBy.d.cts +102 -0
  32. package/dist/index-IWju3eNc.d.cts +286 -0
  33. package/dist/index-auvvMWNH.d.ts +102 -0
  34. package/dist/index-tvf1rglX.d.ts +286 -0
  35. package/dist/test.cjs +1 -4
  36. package/dist/test.d.cts +4 -1
  37. package/dist/test.d.ts +4 -1
  38. package/dist/test.js +1 -4
  39. package/package.json +12 -8
  40. package/dist/cli/auth-BP6XsB4o.js +0 -30
  41. package/dist/cli/connect-CUOPse6P.js +0 -1
  42. package/dist/cli/connect-CswVxp7Y.js +0 -26
  43. package/dist/cli/login-JR8bA13P.js +0 -1
  44. package/dist/cli/main-DqOlaYW2.js +0 -6
  45. package/dist/cli/serve-CEeYlO7w.js +0 -60
  46. package/dist/cli/serve-DY71nMqp.js +0 -1
  47. package/dist/cookie-CB9k3Awr.js +0 -11
  48. package/dist/cookie-Dx2Kx4Zh.cjs +0 -11
@@ -1 +0,0 @@
1
- import{login as e}from"./auth-BP6XsB4o.js";import"./dist-CN69Y-yA.js";import"./open-Cr8lEmcs.js";async function t(){await e()}export{t as default};
@@ -1,6 +0,0 @@
1
- import{__commonJSMin as e,__require as t}from"./chunk-ByIbJXPc.js";import{mkdir as n,readFile as r,stat as i,writeFile as a}from"fs/promises";import{dirname as o,join as s,relative as c}from"path";import{builtinModules as l}from"module";async function u(e,{outdir:t}={}){t||=await p(e);let n=s(t,`agent.js`),r=g(),i=await r.build({...h,entryPoints:[e],outfile:n,write:!1});if(i.errors.length>0)throw Error(`Failed to build agent!`);let o=i.outputFiles[0];return await a(n,Buffer.from(o.contents),`utf-8`),{outfile:n}}async function d(e,{onErrors:t,onBuildStart:n,onBuildEnd:r,outdir:i}){let o=g();i||=await p(e);let c=s(i,`agent.js`),l=await o.context({...h,entryPoints:[e],logLevel:`silent`,outfile:c,plugins:[...h.plugins??[],{name:`blink-dev-server`,setup(e){e.onStart(()=>{n?.()}),e.onEnd(async e=>{if(e.errors.length>0){t?.(e.errors);return}let n=e.outputFiles[0];await a(c,Buffer.from(n.contents),`utf-8`),r?.({outfile:c})})}}],write:!1});return await l.watch(),{dispose:()=>{l.dispose()}}}async function f(e){let t=await m(e,`package.json`);if(!t)throw Error(`No package.json found in ${e}`);let n=JSON.parse(await r(t,`utf-8`)),a=n.main;if(!a)throw Error(`"main" is not set in ${c(process.cwd(),t)}. It should be set to the entrypoint of your agent.`);let l=s(o(t),a),u=await i(l);if(!u.isFile())throw Error(`${l} is not a file.`);return l}async function p(e){let t=await m(e,`node_modules`);if(!t){let t=await i(e);return t.isDirectory()?s(e,`.blink`):s(o(e),`.blink`)}let r=s(t,`.blink`);return await n(r,{recursive:!0}),r}async function m(e,t){let n=e;for(;n!==o(n);){let e=s(n,t);try{return await i(e),e}catch{}n=o(n)}}const h={bundle:!0,format:`esm`,platform:`node`,target:`node22`,mainFields:[`module`,`main`],conditions:[`import`,`module`],plugins:[{name:`blink-esm-require-to-import`,setup(e){e.onEnd(t=>{e.initialOptions.format!==`esm`||e.initialOptions.platform!==`node`||t.outputFiles?.forEach(e=>{if(e.path.endsWith(`.js`)||e.path.endsWith(`.mjs`)){let t=Buffer.from(e.contents).toString(`utf-8`),n=new Map,r=RegExp(`\\b__require\\("(${l.join(`|`)})"\\)`,`gm`);if(t=t.replace(r,(e,t)=>{let r=`__import_${t.toUpperCase().replace(/-/g,`_`)}`;return n.set(t,r),r}),n.size>0){let e=Array.from(n.entries()).map(([e,t])=>`import ${t} from "${e}";`).join(`
2
- `);t=e+`
3
-
4
- `+t}e.contents=Buffer.from(t,`utf-8`)}})})}}]},g=()=>{try{return t(`esbuild`)}catch{throw Error("esbuild is not installed. Please install it with `bun add esbuild`.")}};var _=e(((exports,t)=>{t.exports={name:`dotenv`,version:`16.4.7`,description:`Loads environment variables from .env file`,main:`lib/main.js`,types:`lib/main.d.ts`,exports:{".":{types:`./lib/main.d.ts`,require:`./lib/main.js`,default:`./lib/main.js`},"./config":`./config.js`,"./config.js":`./config.js`,"./lib/env-options":`./lib/env-options.js`,"./lib/env-options.js":`./lib/env-options.js`,"./lib/cli-options":`./lib/cli-options.js`,"./lib/cli-options.js":`./lib/cli-options.js`,"./package.json":`./package.json`},scripts:{"dts-check":`tsc --project tests/types/tsconfig.json`,lint:`standard`,pretest:`npm run lint && npm run dts-check`,test:`tap run --allow-empty-coverage --disable-coverage --timeout=60000`,"test:coverage":`tap run --show-full-coverage --timeout=60000 --coverage-report=lcov`,prerelease:`npm test`,release:`standard-version`},repository:{type:`git`,url:`git://github.com/motdotla/dotenv.git`},funding:`https://dotenvx.com`,keywords:[`dotenv`,`env`,`.env`,`environment`,`variables`,`config`,`settings`],readmeFilename:`README.md`,license:`BSD-2-Clause`,devDependencies:{"@types/node":`^18.11.3`,decache:`^4.6.2`,sinon:`^14.0.1`,standard:`^17.0.0`,"standard-version":`^9.5.0`,tap:`^19.2.0`,typescript:`^4.8.4`},engines:{node:`>=12`},browser:{fs:!1}}})),v=e(((exports,n)=>{let r=t(`fs`),i=t(`path`),a=t(`os`),o=t(`crypto`),s=_(),c=s.version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function u(e){let t={},n=e.toString();n=n.replace(/\r\n?/gm,`
5
- `);let r;for(;(r=l.exec(n))!=null;){let e=r[1],n=r[2]||``;n=n.trim();let i=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/gm,`$2`),i===`"`&&(n=n.replace(/\\n/g,`
6
- `),n=n.replace(/\\r/g,`\r`)),t[e]=n}return t}function d(e){let t=v(e),n=T.configDotenv({path:t});if(!n.parsed){let e=Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw e.code=`MISSING_DATA`,e}let r=h(e).split(`,`),i=r.length,a;for(let e=0;e<i;e++)try{let t=r[e].trim(),i=g(n,t);a=T.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return T.parse(a)}function f(e){console.log(`[dotenv@${c}][INFO] ${e}`)}function p(e){console.log(`[dotenv@${c}][WARN] ${e}`)}function m(e){console.log(`[dotenv@${c}][DEBUG] ${e}`)}function h(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:``}function g(e,t){let n;try{n=new URL(t)}catch(e){if(e.code===`ERR_INVALID_URL`){let e=Error(`INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development`);throw e.code=`INVALID_DOTENV_KEY`,e}throw e}let r=n.password;if(!r){let e=Error(`INVALID_DOTENV_KEY: Missing key part`);throw e.code=`INVALID_DOTENV_KEY`,e}let i=n.searchParams.get(`environment`);if(!i){let e=Error(`INVALID_DOTENV_KEY: Missing environment part`);throw e.code=`INVALID_DOTENV_KEY`,e}let a=`DOTENV_VAULT_${i.toUpperCase()}`,o=e.parsed[a];if(!o){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${a} in your .env.vault file.`);throw e.code=`NOT_FOUND_DOTENV_ENVIRONMENT`,e}return{ciphertext:o,key:r}}function v(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let n of e.path)r.existsSync(n)&&(t=n.endsWith(`.vault`)?n:`${n}.vault`);else t=e.path.endsWith(`.vault`)?e.path:`${e.path}.vault`;else t=i.resolve(process.cwd(),`.env.vault`);return r.existsSync(t)?t:null}function y(e){return e[0]===`~`?i.join(a.homedir(),e.slice(1)):e}function b(e){f(`Loading env from encrypted .env.vault`);let t=T._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),T.populate(n,t,e),{parsed:t}}function x(e){let t=i.resolve(process.cwd(),`.env`),n=`utf8`,a=!!(e&&e.debug);e&&e.encoding?n=e.encoding:a&&m(`No encoding is specified. UTF-8 is used by default`);let o=[t];if(e&&e.path)if(!Array.isArray(e.path))o=[y(e.path)];else{o=[];for(let t of e.path)o.push(y(t))}let s,c={};for(let t of o)try{let i=T.parse(r.readFileSync(t,{encoding:n}));T.populate(c,i,e)}catch(e){a&&m(`Failed to load ${t} ${e.message}`),s=e}let l=process.env;return e&&e.processEnv!=null&&(l=e.processEnv),T.populate(l,c,e),s?{parsed:c,error:s}:{parsed:c}}function S(e){if(h(e).length===0)return T.configDotenv(e);let t=v(e);return t?T._configVault(e):(p(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),T.configDotenv(e))}function C(e,t){let n=Buffer.from(t.slice(-64),`hex`),r=Buffer.from(e,`base64`),i=r.subarray(0,12),a=r.subarray(-16);r=r.subarray(12,-16);try{let e=o.createDecipheriv(`aes-256-gcm`,n,i);return e.setAuthTag(a),`${e.update(r)}${e.final()}`}catch(e){let t=e instanceof RangeError,n=e.message===`Invalid key length`,r=e.message===`Unsupported state or unable to authenticate data`;if(t||n){let e=Error(`INVALID_DOTENV_KEY: It must be 64 characters long (or more)`);throw e.code=`INVALID_DOTENV_KEY`,e}else if(r){let e=Error(`DECRYPTION_FAILED: Please check your DOTENV_KEY`);throw e.code=`DECRYPTION_FAILED`,e}else throw e}}function w(e,t,n={}){let r=!!(n&&n.debug),i=!!(n&&n.override);if(typeof t!=`object`){let e=Error(`OBJECT_REQUIRED: Please check the processEnv argument being passed to populate`);throw e.code=`OBJECT_REQUIRED`,e}for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e,n)?(i===!0&&(e[n]=t[n]),r&&m(i===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}let T={configDotenv:x,_configVault:b,_parseVault:d,config:S,decrypt:C,parse:u,populate:w};n.exports.configDotenv=T.configDotenv,n.exports._configVault=T._configVault,n.exports._parseVault=T._parseVault,n.exports.config=T.config,n.exports.decrypt=T.decrypt,n.exports.parse=T.parse,n.exports.populate=T.populate,n.exports=T}));export{u as build,m as findNearestEntry,v as require_main,f as resolveEntrypoint,d as watch};