blink 1.0.6 → 1.0.8
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/{auth-CpUNsA0k.js → auth-DeHFQhPJ.js} +1 -1
- package/dist/cli/{chat-01Fdrhd_.js → chat-Jjsxhu91.js} +1 -1
- package/dist/cli/{dev-DQh5Ph18.js → dev-BPKpFAM3.js} +99 -420
- package/dist/cli/index.js +3 -3
- package/dist/cli/init-C45jjEXu.js +416 -0
- package/dist/cli/init-DAff8BFO.js +1 -0
- package/dist/cli/login-OOGg9_8j.js +1 -0
- package/dist/cli/{run-Dy4EpNVD.js → run-_bDe0KqM.js} +1 -1
- package/dist/cli/{util-CkrO2lHF.js → util-dGFzG4wT.js} +1 -1
- package/dist/node/agent/index.node.cjs +1 -1
- package/dist/node/agent/index.node.js +1 -1
- package/dist/node/build/index.cjs +1 -1
- package/dist/node/build/index.js +1 -1
- package/dist/node/{build-D_L0gFGa.js → build-M5Q2ZTGh.js} +5 -5
- package/dist/node/{build-BzoNpizh.cjs → build-lx6plR19.cjs} +4 -4
- package/dist/node/{getMachineId-bsd-B84ixt26.cjs → getMachineId-bsd-CUUgtcEk.cjs} +1 -1
- package/dist/node/{getMachineId-bsd-BxqlJcyA.js → getMachineId-bsd-CpiyZ31n.js} +1 -1
- package/dist/node/{getMachineId-bsd-C10eVJgT.js → getMachineId-bsd-DKc3Wh2z.js} +1 -1
- package/dist/node/{getMachineId-bsd-BudRe7J9.cjs → getMachineId-bsd-YA-Qh955.cjs} +1 -1
- package/dist/node/{getMachineId-darwin-Bf4P0U5b.js → getMachineId-darwin-BBDIi9K5.js} +1 -1
- package/dist/node/{getMachineId-darwin-JB29MQsG.js → getMachineId-darwin-CQ9-5u-a.js} +1 -1
- package/dist/node/{getMachineId-darwin-ZVi3EKE3.cjs → getMachineId-darwin-CcM48gLI.cjs} +1 -1
- package/dist/node/{getMachineId-darwin-Cyng5kFG.cjs → getMachineId-darwin-IcDjLpqm.cjs} +1 -1
- package/dist/node/{getMachineId-linux-B-CtXK0L.cjs → getMachineId-linux-BzwdWZoB.cjs} +1 -1
- package/dist/node/{getMachineId-linux-BPnkHJah.js → getMachineId-linux-Cc8c4coA.js} +1 -1
- package/dist/node/{getMachineId-linux-CJXPQ8U5.cjs → getMachineId-linux-DMvLmvRp.cjs} +1 -1
- package/dist/node/{getMachineId-linux-CmMSYp7C.js → getMachineId-linux-TNXyQsBB.js} +1 -1
- package/dist/node/{getMachineId-unsupported--0R36RP6.cjs → getMachineId-unsupported-ApoW5rxx.cjs} +1 -1
- package/dist/node/{getMachineId-unsupported-C_4fnT4Z.js → getMachineId-unsupported-CRrpolgF.js} +1 -1
- package/dist/node/{getMachineId-unsupported-Dtt3HTNZ.js → getMachineId-unsupported-DGhOj3l0.js} +1 -1
- package/dist/node/{getMachineId-unsupported-DM7fz1pP.cjs → getMachineId-unsupported-DYGwqELh.cjs} +1 -1
- package/dist/node/{getMachineId-win-CjJkZMZe.cjs → getMachineId-win-B-bRjIv0.cjs} +1 -1
- package/dist/node/{getMachineId-win-D1szVnqR.js → getMachineId-win-CSKzOPIT.js} +1 -1
- package/dist/node/{getMachineId-win-DDz2FyEp.cjs → getMachineId-win-CoAu5xDr.cjs} +1 -1
- package/dist/node/{getMachineId-win-C4G-fkEF.js → getMachineId-win-Dfq5UG8G.js} +1 -1
- package/dist/node/{index.node-C6sId3jT.cjs → index.node-DN4zHlM1.cjs} +4 -4
- package/dist/node/{index.node-BdbWMIX0.js → index.node-wsvVRWwb.js} +4 -4
- package/dist/node/react/index.node.cjs +455 -94
- package/dist/node/react/index.node.js +141 -121
- package/dist/node/{token-DOfE6QlD.js → token-B0ivJQut.js} +1 -1
- package/dist/node/{token-BBGr-czK.cjs → token-C10csUbV.cjs} +1 -1
- package/dist/node/{token-util-_pz5CtFI.js → token-util-1r_uDcp7.js} +1 -1
- package/dist/node/{token-util-BOoyY0PX.cjs → token-util-BwRq8n40.cjs} +1 -1
- package/dist/node/token-util-CSWJ2yfA.js +1 -0
- package/dist/node/token-util-beB2LRJ9.cjs +1 -0
- package/package.json +1 -1
- package/dist/cli/init-DFXOMY0k.js +0 -83
- package/dist/cli/login-yMSEGrjU.js +0 -1
- package/dist/node/token-util-C_uzN2q9.js +0 -1
- package/dist/node/token-util-D9kCwzE6.cjs +0 -1
- /package/dist/cli/{dist-wyfWuz5A.js → dist-BNbSDxaw.js} +0 -0
- /package/dist/cli/{open-S_jcQ0nw.js → open-DCYivxgo.js} +0 -0
- /package/dist/node/{esm-0UNjvroT.cjs → esm-C-vSI1Ww.cjs} +0 -0
- /package/dist/node/{esm-CbZfjZBn.js → esm-D1GEQyaY.js} +0 -0
- /package/dist/node/{token-error-BoNG8ooW.cjs → token-error-l6zIbPbZ.cjs} +0 -0
- /package/dist/node/{token-error-488npYdU.js → token-error-wsvzy87W.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__commonJSMin as e}from"./chunk-D9KrCrVq.js";import{require_token_error as t}from"./token-error-
|
|
1
|
+
import{__commonJSMin as e}from"./chunk-D9KrCrVq.js";import{require_token_error as t}from"./token-error-wsvzy87W.js";import{require_token_util as n}from"./token-util-1r_uDcp7.js";var r=e(((e,r)=>{var i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of o(t))!s.call(e,c)&&c!==n&&i(e,c,{get:()=>t[c],enumerable:!(r=a(t,c))||r.enumerable});return e},u=e=>l(i({},`__esModule`,{value:!0}),e),d={};c(d,{refreshToken:()=>m}),r.exports=u(d);var f=t(),p=n();async function m(){let{projectId:e,teamId:t}=(0,p.findProjectInfo)(),n=(0,p.loadToken)(e);if(!n||(0,p.isExpired)((0,p.getTokenPayload)(n.token))){let r=(0,p.getVercelCliToken)();if(!r)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: login to vercel cli`);if(!e)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: project id not found`);if(n=await(0,p.getVercelOidcToken)(r,e,t),!n)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`);(0,p.saveToken)(n,e)}process.env.VERCEL_OIDC_TOKEN=n.token}}));export default r();export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-iXuH7AlR.cjs`),t=require(`./token-error-
|
|
1
|
+
const e=require(`./chunk-iXuH7AlR.cjs`),t=require(`./token-error-l6zIbPbZ.cjs`),n=require(`./token-util-BwRq8n40.cjs`);var r=e.__commonJSMin(((e,r)=>{var i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of o(t))!s.call(e,c)&&c!==n&&i(e,c,{get:()=>t[c],enumerable:!(r=a(t,c))||r.enumerable});return e},u=e=>l(i({},`__esModule`,{value:!0}),e),d={};c(d,{refreshToken:()=>m}),r.exports=u(d);var f=t.require_token_error(),p=n.require_token_util();async function m(){let{projectId:e,teamId:t}=(0,p.findProjectInfo)(),n=(0,p.loadToken)(e);if(!n||(0,p.isExpired)((0,p.getTokenPayload)(n.token))){let r=(0,p.getVercelCliToken)();if(!r)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: login to vercel cli`);if(!e)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: project id not found`);if(n=await(0,p.getVercelOidcToken)(r,e,t),!n)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`);(0,p.saveToken)(n,e)}process.env.VERCEL_OIDC_TOKEN=n.token}}));Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return r()}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__commonJSMin as e,__require as t}from"./chunk-D9KrCrVq.js";import{require_token_error as n}from"./token-error-
|
|
1
|
+
import{__commonJSMin as e,__require as t}from"./chunk-D9KrCrVq.js";import{require_token_error as n}from"./token-error-wsvzy87W.js";var r=e(((e,r)=>{var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(a({},`__esModule`,{value:!0}),e),m={};u(m,{findRootDir:()=>y,getUserDataDir:()=>b}),r.exports=p(m);var h=f(t(`path`)),g=f(t(`fs`)),_=f(t(`os`)),v=n();function y(){try{let e=process.cwd();for(;e!==h.default.dirname(e);){let t=h.default.join(e,`.vercel`);if(g.default.existsSync(t))return e;e=h.default.dirname(e)}}catch{throw new v.VercelOidcTokenError(`Token refresh only supported in node server environments`)}throw new v.VercelOidcTokenError(`Unable to find root directory`)}function b(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(_.default.platform()){case`darwin`:return h.default.join(_.default.homedir(),`Library/Application Support`);case`linux`:return h.default.join(_.default.homedir(),`.local/share`);case`win32`:return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}})),i=e(((e,i)=>{var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of c(t))!u.call(e,i)&&i!==n&&o(e,i,{get:()=>t[i],enumerable:!(r=s(t,i))||r.enumerable});return e},p=(e,t,n)=>(n=e==null?{}:a(l(e)),f(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e)),m=e=>f(o({},`__esModule`,{value:!0}),e),h={};d(h,{assertVercelOidcTokenResponse:()=>C,findProjectInfo:()=>w,getTokenPayload:()=>D,getVercelCliToken:()=>x,getVercelDataDir:()=>b,getVercelOidcToken:()=>S,isExpired:()=>O,loadToken:()=>E,saveToken:()=>T}),i.exports=m(h);var g=p(t(`path`)),_=p(t(`fs`)),v=n(),y=r();function b(){let e=(0,y.getUserDataDir)();return e?g.join(e,`com.vercel.cli`):null}function x(){let e=b();if(!e)return null;let t=g.join(e,`auth.json`);if(!_.existsSync(t))return null;let n=_.readFileSync(t,`utf8`);return n?JSON.parse(n).token:null}async function S(e,t,n){try{let r=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:``}`,i=await fetch(r,{method:`POST`,headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw new v.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`);let a=await i.json();return C(a),a}catch(e){throw new v.VercelOidcTokenError(`Failed to refresh OIDC token`,e)}}function C(e){if(!e||typeof e!=`object`)throw TypeError(`Expected an object`);if(!(`token`in e)||typeof e.token!=`string`)throw TypeError(`Expected a string-valued token property`)}function w(){let e=(0,y.findRootDir)();if(!e)throw new v.VercelOidcTokenError(`Unable to find root directory`);try{let t=g.join(e,`.vercel`,`project.json`);if(!_.existsSync(t))throw new v.VercelOidcTokenError(`project.json not found`);let n=JSON.parse(_.readFileSync(t,`utf8`));if(typeof n.projectId!=`string`&&typeof n.orgId!=`string`)throw TypeError(`Expected a string-valued projectId property`);return{projectId:n.projectId,teamId:n.orgId}}catch(e){throw new v.VercelOidcTokenError(`Unable to find project ID`,e)}}function T(e,t){try{let n=(0,y.getUserDataDir)();if(!n)throw new v.VercelOidcTokenError(`Unable to find user data directory`);let r=g.join(n,`com.vercel.token`,`${t}.json`),i=JSON.stringify(e);_.mkdirSync(g.dirname(r),{mode:432,recursive:!0}),_.writeFileSync(r,i),_.chmodSync(r,432);return}catch(e){throw new v.VercelOidcTokenError(`Failed to save token`,e)}}function E(e){try{let t=(0,y.getUserDataDir)();if(!t)return null;let n=g.join(t,`com.vercel.token`,`${e}.json`);if(!_.existsSync(n))return null;let r=JSON.parse(_.readFileSync(n,`utf8`));return C(r),r}catch(e){throw new v.VercelOidcTokenError(`Failed to load token`,e)}}function D(e){let t=e.split(`.`);if(t.length!==3)throw new v.VercelOidcTokenError(`Invalid token`);let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(n.length+(4-n.length%4)%4,`=`);return JSON.parse(Buffer.from(r,`base64`).toString(`utf8`))}function O(e){return e.exp*1e3<Date.now()+9e5}}));export{i as require_token_util};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-iXuH7AlR.cjs`),t=require(`./token-error-
|
|
1
|
+
const e=require(`./chunk-iXuH7AlR.cjs`),t=require(`./token-error-l6zIbPbZ.cjs`);var n=e.__commonJSMin(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{findRootDir:()=>v,getUserDataDir:()=>y}),n.exports=f(p);var m=d(require(`path`)),h=d(require(`fs`)),g=d(require(`os`)),_=t.require_token_error();function v(){try{let e=process.cwd();for(;e!==m.default.dirname(e);){let t=m.default.join(e,`.vercel`);if(h.default.existsSync(t))return e;e=m.default.dirname(e)}}catch{throw new _.VercelOidcTokenError(`Token refresh only supported in node server environments`)}throw new _.VercelOidcTokenError(`Unable to find root directory`)}function y(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(g.default.platform()){case`darwin`:return m.default.join(g.default.homedir(),`Library/Application Support`);case`linux`:return m.default.join(g.default.homedir(),`.local/share`);case`win32`:return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}})),r=e.__commonJSMin(((e,r)=>{var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(a({},`__esModule`,{value:!0}),e),m={};u(m,{assertVercelOidcTokenResponse:()=>S,findProjectInfo:()=>C,getTokenPayload:()=>E,getVercelCliToken:()=>b,getVercelDataDir:()=>y,getVercelOidcToken:()=>x,isExpired:()=>D,loadToken:()=>T,saveToken:()=>w}),r.exports=p(m);var h=f(require(`path`)),g=f(require(`fs`)),_=t.require_token_error(),v=n();function y(){let e=(0,v.getUserDataDir)();return e?h.join(e,`com.vercel.cli`):null}function b(){let e=y();if(!e)return null;let t=h.join(e,`auth.json`);if(!g.existsSync(t))return null;let n=g.readFileSync(t,`utf8`);return n?JSON.parse(n).token:null}async function x(e,t,n){try{let r=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:``}`,i=await fetch(r,{method:`POST`,headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw new _.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`);let a=await i.json();return S(a),a}catch(e){throw new _.VercelOidcTokenError(`Failed to refresh OIDC token`,e)}}function S(e){if(!e||typeof e!=`object`)throw TypeError(`Expected an object`);if(!(`token`in e)||typeof e.token!=`string`)throw TypeError(`Expected a string-valued token property`)}function C(){let e=(0,v.findRootDir)();if(!e)throw new _.VercelOidcTokenError(`Unable to find root directory`);try{let t=h.join(e,`.vercel`,`project.json`);if(!g.existsSync(t))throw new _.VercelOidcTokenError(`project.json not found`);let n=JSON.parse(g.readFileSync(t,`utf8`));if(typeof n.projectId!=`string`&&typeof n.orgId!=`string`)throw TypeError(`Expected a string-valued projectId property`);return{projectId:n.projectId,teamId:n.orgId}}catch(e){throw new _.VercelOidcTokenError(`Unable to find project ID`,e)}}function w(e,t){try{let n=(0,v.getUserDataDir)();if(!n)throw new _.VercelOidcTokenError(`Unable to find user data directory`);let r=h.join(n,`com.vercel.token`,`${t}.json`),i=JSON.stringify(e);g.mkdirSync(h.dirname(r),{mode:432,recursive:!0}),g.writeFileSync(r,i),g.chmodSync(r,432);return}catch(e){throw new _.VercelOidcTokenError(`Failed to save token`,e)}}function T(e){try{let t=(0,v.getUserDataDir)();if(!t)return null;let n=h.join(t,`com.vercel.token`,`${e}.json`);if(!g.existsSync(n))return null;let r=JSON.parse(g.readFileSync(n,`utf8`));return S(r),r}catch(e){throw new _.VercelOidcTokenError(`Failed to load token`,e)}}function E(e){let t=e.split(`.`);if(t.length!==3)throw new _.VercelOidcTokenError(`Invalid token`);let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(n.length+(4-n.length%4)%4,`=`);return JSON.parse(Buffer.from(r,`base64`).toString(`utf8`))}function D(e){return e.exp*1e3<Date.now()+9e5}}));Object.defineProperty(exports,`require_token_util`,{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./token-error-wsvzy87W.js";import{require_token_util as e}from"./token-util-1r_uDcp7.js";export default e();export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./token-error-l6zIbPbZ.cjs`);const e=require(`./token-util-BwRq8n40.cjs`);Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return e.require_token_util()}});
|
package/package.json
CHANGED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import{Ie as e,M as t,Se as n,pD as r,ve as i,xe as a,ye as o}from"./dist-wyfWuz5A.js";import{basename as s,join as c}from"path";import{mkdir as l,readdir as u,writeFile as d}from"fs/promises";import{spawn as f}from"child_process";async function p(p){if(p||=process.cwd(),e(`Initializing a new Blink Agent`),(await u(p)).length>0){let e=await o({message:`Directory is not empty. Create agent in ".blink" instead? Blink looks for the nearest ".blink" directory for agents.`});if(r(e)&&(a(`Initialization cancelled.`),process.exit(1)),e)p=c(p,`.blink`),await l(p,{recursive:!0}),t.info(`Creating project in ${p}`);else{let e=await o({message:`Initialize in non-empty directory anyway?`});(e===!1||r(e))&&(a(`Initialization cancelled.`),process.exit(1))}}let m=s(p).replace(/[^a-zA-Z0-9]/g,`-`),h;if(process.env.npm_config_user_agent?.includes(`bun/`)?h=`bun`:process.env.npm_config_user_agent?.includes(`pnpm/`)?h=`pnpm`:process.env.npm_config_user_agent?.includes(`yarn/`)?h=`yarn`:process.env.npm_config_user_agent?.includes(`npm/`)&&(h=`npm`),!h){let e=await i({options:[{label:`Bun`,value:`bun`},{label:`NPM`,value:`npm`},{label:`PNPM`,value:`pnpm`},{label:`Yarn`,value:`yarn`}],message:`What package manager do you want to use?`});r(e)&&process.exit(0),h=e}t.info(`Using ${h} as the package manager.`);let g={"package.json":JSON.stringify({name:m,main:`agent.ts`,type:`module`,private:!0,scripts:{dev:`blink dev`,deploy:`blink deploy`}}),"agent.ts":`import { convertToModelMessages, streamText, tool } from "ai";
|
|
2
|
-
import * as blink from "blink";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
const agent = blink.agent();
|
|
6
|
-
|
|
7
|
-
agent.on("chat", async ({ messages }) => {
|
|
8
|
-
return streamText({
|
|
9
|
-
model: blink.model("anthropic/claude-sonnet-4.5"),
|
|
10
|
-
system: \`You are a basic agent the user will customize.
|
|
11
|
-
|
|
12
|
-
Suggest the user enters edit mode with Ctrl+E or /edit to customize the agent.
|
|
13
|
-
Demonstrate your capabilities with the IP tool.\`,
|
|
14
|
-
messages: convertToModelMessages(messages),
|
|
15
|
-
tools: {
|
|
16
|
-
get_ip_info: tool({
|
|
17
|
-
description: "Get IP address information of the computer.",
|
|
18
|
-
inputSchema: z.object({}),
|
|
19
|
-
execute: async () => {
|
|
20
|
-
const response = await fetch("https://ipinfo.io/json");
|
|
21
|
-
return response.json();
|
|
22
|
-
},
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
agent.serve();
|
|
29
|
-
`,".gitignore":`# dependencies
|
|
30
|
-
node_modules
|
|
31
|
-
|
|
32
|
-
# config and build
|
|
33
|
-
data
|
|
34
|
-
|
|
35
|
-
# dotenv environment variables file
|
|
36
|
-
.env
|
|
37
|
-
.env.*
|
|
38
|
-
|
|
39
|
-
# Finder (MacOS) folder config
|
|
40
|
-
.DS_Store
|
|
41
|
-
`,".env.local":`
|
|
42
|
-
# Store local environment variables here.
|
|
43
|
-
# They will be used by blink dev for development.
|
|
44
|
-
# EXTERNAL_SERVICE_API_KEY=
|
|
45
|
-
`,".env.production":`
|
|
46
|
-
# Store production environment variables here.
|
|
47
|
-
# They will be upserted as secrets on blink deploy.
|
|
48
|
-
# EXTERNAL_SERVICE_API_KEY=
|
|
49
|
-
`,"AGENTS.md":`Assist the user in developing an agent.
|
|
50
|
-
|
|
51
|
-
- Use AI SDK v5 for tool-call syntax (inputSchema instead of parameters).
|
|
52
|
-
- Store local environment secrets in .env.local.
|
|
53
|
-
- Store production environment secrets in .env.production.
|
|
54
|
-
- Run "blink deploy" to deploy an agent to the cloud.
|
|
55
|
-
- Run "blink deploy --prod" to deploy to production.
|
|
56
|
-
- The user can run "blink dev" to start a development server.
|
|
57
|
-
`,"tsconfig.json":`{
|
|
58
|
-
"compilerOptions": {
|
|
59
|
-
"lib": ["ESNext"],
|
|
60
|
-
"target": "ESNext",
|
|
61
|
-
"module": "Preserve",
|
|
62
|
-
"moduleDetection": "force",
|
|
63
|
-
|
|
64
|
-
"moduleResolution": "bundler",
|
|
65
|
-
"allowImportingTsExtensions": true,
|
|
66
|
-
"verbatimModuleSyntax": true,
|
|
67
|
-
"resolveJsonModule": true,
|
|
68
|
-
"noEmit": true,
|
|
69
|
-
|
|
70
|
-
"strict": true,
|
|
71
|
-
"skipLibCheck": true,
|
|
72
|
-
"noFallthroughCasesInSwitch": true,
|
|
73
|
-
"noUncheckedIndexedAccess": true,
|
|
74
|
-
"noImplicitOverride": true,
|
|
75
|
-
|
|
76
|
-
"noUnusedLocals": false,
|
|
77
|
-
"noUnusedParameters": false,
|
|
78
|
-
|
|
79
|
-
"types": ["node"]
|
|
80
|
-
}
|
|
81
|
-
}`};await Promise.all(Object.entries(g).map(async([e,t])=>{await d(c(p,e),t)})),console.log(``);let _=f(h,[h===`yarn`?`add`:`install`,`--save-dev`,`zod`,`ai`,`blink`,`esbuild`,`@types/node`,`typescript`],{stdio:`inherit`,cwd:p});await new Promise((e,t)=>{_.on(`close`,t=>{t===0&&e(void 0)}),_.on(`error`,e=>{t(e)})}),console.log(``);let v={bun:`bun run dev`,npm:`npm run dev`,pnpm:`pnpm run dev`,yarn:`yarn dev`}[h];t.success(`To get started, run:
|
|
82
|
-
|
|
83
|
-
${v??`blink dev`}`),n(`Edit agent.ts to hot-reload your agent.`)}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{login as e}from"./auth-CpUNsA0k.js";import"./dist-wyfWuz5A.js";import"./open-S_jcQ0nw.js";async function t(){await e()}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./token-error-488npYdU.js";import{require_token_util as e}from"./token-util-_pz5CtFI.js";export default e();export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./token-error-BoNG8ooW.cjs`);const e=require(`./token-util-BOoyY0PX.cjs`);Object.defineProperty(exports,`default`,{enumerable:!0,get:function(){return e.require_token_util()}});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|