broods 0.6.2 → 0.8.1
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/account.d.ts +7 -1
- package/dist/chunk-61hkdhg4.js +1 -0
- package/dist/chunk-7krsz9m4.js +2 -0
- package/dist/{chunk-g5vj2wtg.js → chunk-7pcjqsbk.js} +1 -1
- package/dist/{chunk-qjfqqhve.js → chunk-phmt1gk7.js} +5 -5
- package/dist/cli/index.js +89 -90
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-7qwyvgaq.js +0 -1
- package/dist/chunk-d865sg8r.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare const ACCOUNT_MODEL_PROVIDERS: {
|
|
|
9
9
|
readonly openai: true;
|
|
10
10
|
readonly anthropic: true;
|
|
11
11
|
readonly bedrock: true;
|
|
12
|
-
readonly
|
|
12
|
+
readonly vercel: true;
|
|
13
13
|
readonly minimax: true;
|
|
14
14
|
readonly custom: true;
|
|
15
15
|
};
|
|
@@ -262,6 +262,7 @@ interface AgentTelegramChannelConfig {
|
|
|
262
262
|
webhookSecret?: string;
|
|
263
263
|
allowedChatIds?: number[];
|
|
264
264
|
reactionEmoji?: string;
|
|
265
|
+
trace?: "enabled" | "disabled";
|
|
265
266
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
266
267
|
[key: string]: unknown;
|
|
267
268
|
}
|
|
@@ -280,6 +281,7 @@ interface AgentGitHubChannelConfig {
|
|
|
280
281
|
triggerOnIssueOpen?: boolean;
|
|
281
282
|
/** When false, the bot does not auto-trigger on new PRs (opened/edited/reopened). Defaults to true. The bot still triggers when assigned to a PR. */
|
|
282
283
|
triggerOnPROpen?: boolean;
|
|
284
|
+
trace?: "enabled" | "disabled";
|
|
283
285
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
284
286
|
[key: string]: unknown;
|
|
285
287
|
}
|
|
@@ -290,6 +292,7 @@ interface AgentSlackChannelConfig {
|
|
|
290
292
|
signingSecret?: string;
|
|
291
293
|
allowedChannelIds?: string[];
|
|
292
294
|
reactionEmoji?: string;
|
|
295
|
+
trace?: "enabled" | "disabled";
|
|
293
296
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
294
297
|
[key: string]: unknown;
|
|
295
298
|
}
|
|
@@ -303,6 +306,7 @@ interface AgentDiscordChannelConfig {
|
|
|
303
306
|
botUserId?: string;
|
|
304
307
|
/** Role ids that count as mentioning the agent, e.g. an on-call role. */
|
|
305
308
|
mentionRoleIds?: string[];
|
|
309
|
+
trace?: "enabled" | "disabled";
|
|
306
310
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
307
311
|
[key: string]: unknown;
|
|
308
312
|
}
|
|
@@ -312,6 +316,7 @@ interface AgentPancakeChannelConfig {
|
|
|
312
316
|
pageAccessToken?: string;
|
|
313
317
|
webhookSecret?: string;
|
|
314
318
|
senderId?: string;
|
|
319
|
+
trace?: "enabled" | "disabled";
|
|
315
320
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
316
321
|
[key: string]: unknown;
|
|
317
322
|
}
|
|
@@ -320,6 +325,7 @@ interface AgentZaloChannelConfig {
|
|
|
320
325
|
botToken?: string;
|
|
321
326
|
webhookSecret?: string;
|
|
322
327
|
allowedUserIds?: string[];
|
|
328
|
+
trace?: "enabled" | "disabled";
|
|
323
329
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
324
330
|
[key: string]: unknown;
|
|
325
331
|
}
|
|
@@ -1690,6 +1696,7 @@ interface ChannelDefinition<Type extends ChannelType, Config> {
|
|
|
1690
1696
|
type RequiredChannelKeys<Config, Keys extends keyof Config> = Required<Pick<Config, Keys>> & Omit<Config, Keys>;
|
|
1691
1697
|
type ChannelSecret = string | EnvRef | undefined;
|
|
1692
1698
|
type ChannelIdentityInput = {
|
|
1699
|
+
trace?: "enabled" | "disabled";
|
|
1693
1700
|
workspaceScope?: AgentChannelWorkspaceScope;
|
|
1694
1701
|
};
|
|
1695
1702
|
type TelegramChannelInput = EnvRefString<RequiredChannelKeys<Pick<AgentTelegramChannelConfig, "apiUrl" | "botToken" | "webhookSecret" | "allowedChatIds" | "reactionEmoji">, "botToken" | "webhookSecret" | "allowedChatIds">> & ChannelIdentityInput;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M,b as h,c as O}from"./chunk-wvs39trg.js";import{A as _,B as P,C as H,D as U,E as B,F as K,G as j,H as F,I as G,J as z,K as Z,L as V,M as X,d as x,e as I,n as v,o as k,p as S,q as A,r as R,s as W,t as L,u as w,v as E,w as D,x as T,y as q,z as N}from"./chunk-
|
|
1
|
+
import{a as M,b as h,c as O}from"./chunk-wvs39trg.js";import{A as _,B as P,C as H,D as U,E as B,F as K,G as j,H as F,I as G,J as z,K as Z,L as V,M as X,d as x,e as I,n as v,o as k,p as S,q as A,r as R,s as W,t as L,u as w,v as E,w as D,x as T,y as q,z as N}from"./chunk-phmt1gk7.js";import"./chunk-51a2zca3.js";var o=500;function a(s){if(typeof s!=="object"||s===null)return!1;let e=s;if(e.type==="subscribe"){let t=e.stream;if(t!=="logs"&&t!=="traces")return!1;let r=e.backfill;if(r!==void 0&&(typeof r!=="number"||!Number.isSafeInteger(r)||r<0||r>500))return!1;if(e.liveOnly!==void 0&&typeof e.liveOnly!=="boolean")return!1;let n=e.minLevel;if(n!==void 0&&n!=="INFO"&&n!=="WARN"&&n!=="ERROR")return!1;return!0}if(e.type==="unsubscribe"){let t=e.stream;return t==="logs"||t==="traces"}return!1}export{h as BroodsAccountApiError,O as BroodsAccountClient,S as BroodsClient,R as BroodsWebSocketClient,v as DEFAULT_CORE_BASE_URL,k as IngressAcceptedError,o as MAX_OBSERVABILITY_BACKFILL,R as WebSocketClient,R as WebsocketClient,P as defineAgent,_ as defineBroods,G as defineChannelRecord,z as defineCron,T as defineDiscordChannel,E as defineGitHubChannel,H as defineHarness,q as definePancakeChannel,F as definePolicy,B as defineSandbox,K as defineSkill,D as defineSlackChannel,w as defineTelegramChannel,j as defineTool,U as defineWorkspace,N as defineZaloChannel,L as env,M as envPlaceholder,X as isBroodsConfig,V as isChannelDefinition,a as isObservabilityClientMessage,Z as isResource,A as normalizeHttpServiceUrl,I as readSseStream,x as resolveRunEvents,W as toWebSocketBaseUrl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "broods",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "CLI + TypeScript SDK for the broods agent platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"node": ">=22"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"esbuild": "^0.28.
|
|
53
|
+
"esbuild": "^0.28.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"ai": "^7.0.
|
|
56
|
+
"ai": "^7.0.58"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@ai-sdk/tui": "^1.0.
|
|
60
|
-
"ai": "^7.0.
|
|
59
|
+
"@ai-sdk/tui": "^1.0.59",
|
|
60
|
+
"ai": "^7.0.58",
|
|
61
61
|
"@chat-adapter/discord": "^4.35.0",
|
|
62
62
|
"@chat-adapter/github": "^4.35.0",
|
|
63
63
|
"@chat-adapter/slack": "^4.35.0",
|
package/dist/chunk-7qwyvgaq.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as a}from"./chunk-d865sg8r.js";import"./chunk-51a2zca3.js";export default a();
|
package/dist/chunk-d865sg8r.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{P as c,R as s}from"./chunk-51a2zca3.js";var g=c(function(ur,A){var{defineProperty:w,getOwnPropertyDescriptor:oe,getOwnPropertyNames:ne}=Object,se=Object.prototype.hasOwnProperty,ie=(e,r)=>{for(var t in r)w(e,t,{get:r[t],enumerable:!0})},ae=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of ne(r))if(!se.call(e,o)&&o!==t)w(e,o,{get:()=>r[o],enumerable:!(n=oe(r,o))||n.enumerable})}return e},ce=(e)=>ae(w({},"__esModule",{value:!0}),e),D={};ie(D,{VercelOidcTokenError:()=>x});A.exports=ce(D);class x extends Error{constructor(e,r){super(e);this.name="VercelOidcTokenError",this.cause=r}toString(){if(this.cause)return`${this.name}: ${this.message}: ${this.cause}`;return`${this.name}: ${this.message}`}}});var R=c(function(pr,C){var{create:ue,defineProperty:h,getOwnPropertyDescriptor:pe,getOwnPropertyNames:le,getPrototypeOf:fe}=Object,_e=Object.prototype.hasOwnProperty,de=(e,r)=>{for(var t in r)h(e,t,{get:r[t],enumerable:!0})},S=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of le(r))if(!_e.call(e,o)&&o!==t)h(e,o,{get:()=>r[o],enumerable:!(n=pe(r,o))||n.enumerable})}return e},P=(e,r,t)=>(t=e!=null?ue(fe(e)):{},S(r||!e||!e.__esModule?h(t,"default",{value:e,enumerable:!0}):t,e)),he=(e)=>S(h({},"__esModule",{value:!0}),e),V={};de(V,{findRootDir:()=>ye,getUserDataDir:()=>we});C.exports=he(V);var f=P(s("path")),ve=P(s("fs")),O=P(s("os")),ke=g();function ye(){try{let e=process.cwd();while(e!==f.default.dirname(e)){let r=f.default.join(e,".vercel");if(ve.default.existsSync(r))return e;e=f.default.dirname(e)}}catch(e){throw new ke.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function we(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(O.default.platform()){case"darwin":return f.default.join(O.default.homedir(),"Library/Application Support");case"linux":return f.default.join(O.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}});var U=c(function(lr,$){var{create:ge,defineProperty:v,getOwnPropertyDescriptor:Oe,getOwnPropertyNames:Pe,getPrototypeOf:be}=Object,je=Object.prototype.hasOwnProperty,Te=(e,r)=>{for(var t in r)v(e,t,{get:r[t],enumerable:!0})},M=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Pe(r))if(!je.call(e,o)&&o!==t)v(e,o,{get:()=>r[o],enumerable:!(n=Oe(r,o))||n.enumerable})}return e},I=(e,r,t)=>(t=e!=null?ge(be(e)):{},M(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)),Ee=(e)=>M(v({},"__esModule",{value:!0}),e),N={};Te(N,{isValidAccessToken:()=>Ae,readAuthConfig:()=>De,writeAuthConfig:()=>xe});$.exports=Ee(N);var _=I(s("fs")),q=I(s("path")),me=J();function F(){let e=(0,me.getVercelDataDir)();if(!e)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return q.join(e,"auth.json")}function De(){try{let e=F();if(!_.existsSync(e))return null;let r=_.readFileSync(e,"utf8");if(!r)return null;return JSON.parse(r)}catch(e){return null}}function xe(e){let r=F(),t=q.dirname(r);if(!_.existsSync(t))_.mkdirSync(t,{mode:504,recursive:!0});_.writeFileSync(r,JSON.stringify(e,null,2),{mode:384})}function Ae(e,r=0){if(!e.token)return!1;if(typeof e.expiresAt!=="number")return!0;let t=Math.floor(Date.now()/1000),n=r/1000;return e.expiresAt>=t+n}});var z=c(function(fr,H){var{defineProperty:T,getOwnPropertyDescriptor:Se,getOwnPropertyNames:Ve}=Object,Ce=Object.prototype.hasOwnProperty,Re=(e,r)=>{for(var t in r)T(e,t,{get:r[t],enumerable:!0})},Me=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Ve(r))if(!Ce.call(e,o)&&o!==t)T(e,o,{get:()=>r[o],enumerable:!(n=Se(r,o))||n.enumerable})}return e},Ie=(e)=>Me(T({},"__esModule",{value:!0}),e),L={};Re(L,{processTokenResponse:()=>Ue,refreshTokenRequest:()=>$e});H.exports=Ie(L);var b=s("os"),Ne="https://vercel.com",qe="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",B=`@vercel/oidc node-${process.version} ${(0,b.platform)()} (${(0,b.arch)()}) ${(0,b.hostname)()}`,j=null;async function Fe(){if(j)return j;let e=`${Ne}/.well-known/openid-configuration`,r=await fetch(e,{headers:{"user-agent":B}});if(!r.ok)throw Error("Failed to discover OAuth endpoints");let t=await r.json();if(!t||typeof t.token_endpoint!=="string")throw Error("Invalid OAuth discovery response");let n=t.token_endpoint;return j=n,n}async function $e(e){let r=await Fe();return await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":B},body:new URLSearchParams({client_id:qe,grant_type:"refresh_token",...e})})}async function Ue(e){let r=await e.json();if(!e.ok){let t=typeof r==="object"&&r&&"error"in r?String(r.error):"Token refresh failed";return[Error(t)]}if(typeof r!=="object"||r===null)return[Error("Invalid token response")];if(typeof r.access_token!=="string")return[Error("Missing access_token in response")];if(r.token_type!=="Bearer")return[Error("Invalid token_type in response")];if(typeof r.expires_in!=="number")return[Error("Missing expires_in in response")];return[null,r]}});var Z=c(function(_r,Q){var{defineProperty:E,getOwnPropertyDescriptor:Je,getOwnPropertyNames:Le}=Object,Be=Object.prototype.hasOwnProperty,He=(e,r)=>{for(var t in r)E(e,t,{get:r[t],enumerable:!0})},ze=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Le(r))if(!Be.call(e,o)&&o!==t)E(e,o,{get:()=>r[o],enumerable:!(n=Je(r,o))||n.enumerable})}return e},Ge=(e)=>ze(E({},"__esModule",{value:!0}),e),G={};He(G,{AccessTokenMissingError:()=>X,RefreshAccessTokenFailedError:()=>Y});Q.exports=Ge(G);class X extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login).");this.name="AccessTokenMissingError"}}class Y extends Error{constructor(e){super("Failed to refresh authentication token.",{cause:e});this.name="RefreshAccessTokenFailedError"}}});var J=c(function(dr,te){var{create:Xe,defineProperty:k,getOwnPropertyDescriptor:Ye,getOwnPropertyNames:Qe,getPrototypeOf:Ze}=Object,Ke=Object.prototype.hasOwnProperty,We=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},W=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Qe(r))if(!Ke.call(e,o)&&o!==t)k(e,o,{get:()=>r[o],enumerable:!(n=Ye(r,o))||n.enumerable})}return e},ee=(e,r,t)=>(t=e!=null?Xe(Ze(e)):{},W(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),er=(e)=>W(k({},"__esModule",{value:!0}),e),re={};We(re,{assertVercelOidcTokenResponse:()=>m,findProjectInfo:()=>nr,getTokenPayload:()=>ar,getVercelDataDir:()=>rr,getVercelOidcToken:()=>or,getVercelToken:()=>tr,isExpired:()=>cr,loadToken:()=>ir,saveToken:()=>sr});te.exports=er(re);var d=ee(s("path")),i=ee(s("fs")),l=g(),y=R(),u=U(),K=z(),p=Z();function rr(){let r=(0,y.getUserDataDir)();if(!r)return null;return d.join(r,"com.vercel.cli")}async function tr(e){let r=(0,u.readAuthConfig)();if(!r?.token)throw new p.AccessTokenMissingError;if((0,u.isValidAccessToken)(r,e?.expirationBufferMs))return r.token;if(!r.refreshToken)throw(0,u.writeAuthConfig)({}),new p.RefreshAccessTokenFailedError("No refresh token available");try{let t=await(0,K.refreshTokenRequest)({refresh_token:r.refreshToken}),[n,o]=await(0,K.processTokenResponse)(t);if(n||!o)throw(0,u.writeAuthConfig)({}),new p.RefreshAccessTokenFailedError(n);let a={token:o.access_token,expiresAt:Math.floor(Date.now()/1000)+o.expires_in};if(o.refresh_token)a.refreshToken=o.refresh_token;return(0,u.writeAuthConfig)(a),a.token}catch(t){if((0,u.writeAuthConfig)({}),t instanceof p.AccessTokenMissingError||t instanceof p.RefreshAccessTokenFailedError)throw t;throw new p.RefreshAccessTokenFailedError(t)}}async function or(e,r,t){let n=`https://api.vercel.com/v1/projects/${r}/token?source=vercel-oidc-refresh${t?`&teamId=${t}`:""}`,o=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!o.ok)throw new l.VercelOidcTokenError(`Failed to refresh OIDC token: ${o.statusText}`);let a=await o.json();return m(a),a}function m(e){if(!e||typeof e!=="object")throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in e)||typeof e.token!=="string")throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function nr(){let e=(0,y.findRootDir)();if(!e)throw new l.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let r=d.join(e,".vercel","project.json");if(!i.existsSync(r))throw new l.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let t=JSON.parse(i.readFileSync(r,"utf8"));if(typeof t.projectId!=="string"&&typeof t.orgId!=="string")throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:t.projectId,teamId:t.orgId}}function sr(e,r){let t=(0,y.getUserDataDir)();if(!t)throw new l.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let n=d.join(t,"com.vercel.token",`${r}.json`),o=JSON.stringify(e);i.mkdirSync(d.dirname(n),{mode:504,recursive:!0}),i.writeFileSync(n,o),i.chmodSync(n,432);return}function ir(e){let r=(0,y.getUserDataDir)();if(!r)throw new l.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let t=d.join(r,"com.vercel.token",`${e}.json`);if(!i.existsSync(t))return null;let n=JSON.parse(i.readFileSync(t,"utf8"));return m(n),n}function ar(e){let r=e.split(".");if(r.length!==3)throw new l.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let t=r[1].replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"=");return JSON.parse(Buffer.from(n,"base64").toString("utf8"))}function cr(e,r=0){return e.exp*1000<Date.now()+r}});
|
|
2
|
-
export{g as N,J as O};
|