broods 0.53.1 → 0.54.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 +3 -124
- package/dist/account.js +1 -1
- package/dist/{chunk-14wmsrrt.js → chunk-7nrh4nqb.js} +8 -8
- package/dist/{chunk-b0pdqkyk.js → chunk-aqcx0cwa.js} +5 -5
- package/dist/{chunk-bbvew31z.js → chunk-j55y24fb.js} +1 -1
- package/dist/{chunk-8zcgnjs8.js → chunk-pjvyrwbt.js} +14 -14
- package/dist/chunk-wamkxgcg.js +4 -0
- package/dist/{chunk-1fn0c0fe.js → chunk-xv88e799.js} +2 -2
- package/dist/cli/index.js +63 -56
- package/dist/index.d.ts +3 -124
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5ks36kqn.js +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -17,129 +17,8 @@ type AgentHookEventName = (typeof AGENT_HOOK_EVENT_NAMES)[number];
|
|
|
17
17
|
* Image-, speech- and transcription-only providers are deliberately absent:
|
|
18
18
|
* they cannot back `config.model`.
|
|
19
19
|
*/
|
|
20
|
-
declare const
|
|
21
|
-
|
|
22
|
-
readonly label: "Alibaba Qwen";
|
|
23
|
-
readonly modelPlaceholder: "qwen3-max";
|
|
24
|
-
};
|
|
25
|
-
readonly anthropic: {
|
|
26
|
-
readonly label: "Anthropic";
|
|
27
|
-
readonly modelPlaceholder: "claude-sonnet-4-5-20250929";
|
|
28
|
-
};
|
|
29
|
-
readonly azure: {
|
|
30
|
-
readonly label: "Azure OpenAI";
|
|
31
|
-
readonly modelPlaceholder: "gpt-4.1-mini";
|
|
32
|
-
};
|
|
33
|
-
readonly baseten: {
|
|
34
|
-
readonly label: "Baseten";
|
|
35
|
-
readonly modelPlaceholder: "deepseek-ai/DeepSeek-V3";
|
|
36
|
-
};
|
|
37
|
-
readonly bedrock: {
|
|
38
|
-
readonly label: "Amazon Bedrock";
|
|
39
|
-
readonly modelPlaceholder: "anthropic.claude-sonnet-4-5-20250929-v1:0";
|
|
40
|
-
};
|
|
41
|
-
readonly cerebras: {
|
|
42
|
-
readonly label: "Cerebras";
|
|
43
|
-
readonly modelPlaceholder: "llama3.1-8b";
|
|
44
|
-
};
|
|
45
|
-
readonly chatgpt: {
|
|
46
|
-
readonly label: "ChatGPT plan";
|
|
47
|
-
readonly modelPlaceholder: "gpt-5.5";
|
|
48
|
-
};
|
|
49
|
-
readonly cloudflare: {
|
|
50
|
-
readonly label: "Cloudflare";
|
|
51
|
-
readonly modelPlaceholder: "@cf/meta/llama-3.3-70b-instruct-fp8-fast";
|
|
52
|
-
};
|
|
53
|
-
readonly cohere: {
|
|
54
|
-
readonly label: "Cohere";
|
|
55
|
-
readonly modelPlaceholder: "command-a-03-2025";
|
|
56
|
-
};
|
|
57
|
-
readonly custom: {
|
|
58
|
-
readonly label: "Custom OpenAI-compatible";
|
|
59
|
-
readonly modelPlaceholder: "gpt-oss-120b";
|
|
60
|
-
};
|
|
61
|
-
readonly deepinfra: {
|
|
62
|
-
readonly label: "DeepInfra";
|
|
63
|
-
readonly modelPlaceholder: "deepseek-ai/DeepSeek-V3";
|
|
64
|
-
};
|
|
65
|
-
readonly deepseek: {
|
|
66
|
-
readonly label: "DeepSeek";
|
|
67
|
-
readonly modelPlaceholder: "deepseek-chat";
|
|
68
|
-
};
|
|
69
|
-
readonly fireworks: {
|
|
70
|
-
readonly label: "Fireworks";
|
|
71
|
-
readonly modelPlaceholder: "accounts/fireworks/models/deepseek-v3";
|
|
72
|
-
};
|
|
73
|
-
readonly google: {
|
|
74
|
-
readonly label: "Google";
|
|
75
|
-
readonly modelPlaceholder: "gemini-2.5-flash";
|
|
76
|
-
};
|
|
77
|
-
readonly groq: {
|
|
78
|
-
readonly label: "Groq";
|
|
79
|
-
readonly modelPlaceholder: "llama-3.3-70b-versatile";
|
|
80
|
-
};
|
|
81
|
-
readonly huggingface: {
|
|
82
|
-
readonly label: "Hugging Face";
|
|
83
|
-
readonly modelPlaceholder: "meta-llama/Llama-3.3-70B-Instruct";
|
|
84
|
-
};
|
|
85
|
-
readonly llmgateway: {
|
|
86
|
-
readonly label: "LLM Gateway";
|
|
87
|
-
readonly modelPlaceholder: "openai/gpt-4.1-mini";
|
|
88
|
-
};
|
|
89
|
-
readonly minimax: {
|
|
90
|
-
readonly label: "MiniMax";
|
|
91
|
-
readonly modelPlaceholder: "MiniMax-M2.7";
|
|
92
|
-
};
|
|
93
|
-
readonly mistral: {
|
|
94
|
-
readonly label: "Mistral";
|
|
95
|
-
readonly modelPlaceholder: "mistral-large-latest";
|
|
96
|
-
};
|
|
97
|
-
readonly moonshotai: {
|
|
98
|
-
readonly label: "Moonshot AI Kimi";
|
|
99
|
-
readonly modelPlaceholder: "kimi-k2.6";
|
|
100
|
-
};
|
|
101
|
-
readonly ollama: {
|
|
102
|
-
readonly label: "Ollama";
|
|
103
|
-
readonly modelPlaceholder: "gpt-oss:120b";
|
|
104
|
-
};
|
|
105
|
-
readonly openai: {
|
|
106
|
-
readonly label: "OpenAI";
|
|
107
|
-
readonly modelPlaceholder: "gpt-4.1-mini";
|
|
108
|
-
};
|
|
109
|
-
readonly openrouter: {
|
|
110
|
-
readonly label: "OpenRouter";
|
|
111
|
-
readonly modelPlaceholder: "anthropic/claude-sonnet-4.5";
|
|
112
|
-
};
|
|
113
|
-
readonly perplexity: {
|
|
114
|
-
readonly label: "Perplexity";
|
|
115
|
-
readonly modelPlaceholder: "low";
|
|
116
|
-
};
|
|
117
|
-
readonly togetherai: {
|
|
118
|
-
readonly label: "Together.ai";
|
|
119
|
-
readonly modelPlaceholder: "deepseek-ai/DeepSeek-V3";
|
|
120
|
-
};
|
|
121
|
-
readonly v0: {
|
|
122
|
-
readonly label: "Vercel v0";
|
|
123
|
-
readonly modelPlaceholder: "v0-1.0-md";
|
|
124
|
-
};
|
|
125
|
-
readonly vercel: {
|
|
126
|
-
readonly label: "Vercel AI Gateway";
|
|
127
|
-
readonly modelPlaceholder: "openai/gpt-4.1-mini";
|
|
128
|
-
};
|
|
129
|
-
readonly vertex: {
|
|
130
|
-
readonly label: "Google Vertex AI";
|
|
131
|
-
readonly modelPlaceholder: "gemini-2.5-flash";
|
|
132
|
-
};
|
|
133
|
-
readonly xai: {
|
|
134
|
-
readonly label: "xAI Grok";
|
|
135
|
-
readonly modelPlaceholder: "grok-4";
|
|
136
|
-
};
|
|
137
|
-
readonly zai: {
|
|
138
|
-
readonly label: "Z.ai GLM";
|
|
139
|
-
readonly modelPlaceholder: "glm-4.7";
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
type AccountModelProviderName = keyof typeof MODEL_PROVIDERS;
|
|
20
|
+
declare const ACCOUNT_MODEL_PROVIDER_NAMES: readonly ["alibaba", "anthropic", "azure", "baseten", "bedrock", "cerebras", "chatgpt", "cloudflare", "cohere", "custom", "deepinfra", "deepseek", "fireworks", "google", "groq", "huggingface", "llmgateway", "minimax", "mistral", "moonshotai", "ollama", "openai", "openrouter", "perplexity", "togetherai", "v0", "vercel", "vertex", "xai", "zai"];
|
|
21
|
+
type AccountModelProviderName = (typeof ACCOUNT_MODEL_PROVIDER_NAMES)[number];
|
|
143
22
|
|
|
144
23
|
/**
|
|
145
24
|
* Agent config validation, the only copy of it: Convex config HTTP checks a
|
|
@@ -463,7 +342,7 @@ interface AgentTelegramChannelConfig {
|
|
|
463
342
|
webhookSecret?: string;
|
|
464
343
|
allowedChannelIds?: string[];
|
|
465
344
|
allowedUserIds?: string[];
|
|
466
|
-
/** Bot's @username, e.g. `
|
|
345
|
+
/** Bot's @username, e.g. `support_bot`. Set it to answer only when the agent is mentioned. */
|
|
467
346
|
botUsername?: string;
|
|
468
347
|
reactionEmoji?: string;
|
|
469
348
|
trace?: "enabled" | "disabled";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q,
|
|
1
|
+
import{q,ae,L,me,ye,Se,U,F,te,V,g,be,T,ce,N,K,fe,G,E,ve,_e,we,Re,$e,Ce,Ee,ke,Te,Pe,Ie,ze,xe,Ae,Oe,Me,Ne,je,De,qe,Le,Ue,Fe,Be,He,Ze,Ve,Ke,Ge,We,Je,Ye,Xe,Qe,et,tt,nt,rt,ne,v,h}from"./chunk-aqcx0cwa.js";import{p,he,j,_}from"./chunk-xv88e799.js";export{p as BroodsAccountApiError,_ as BroodsAccountClient,N as BroodsClient,fe as BroodsWebSocketClient,T as DEFAULT_CORE_BASE_URL,ce as IngressAcceptedError,L as MAX_OBSERVABILITY_BACKFILL,te as USER_TOKEN_HEADER,V as USER_TOKEN_MAX_TTL_MS,g as USER_TOKEN_SECRET_ENV,fe as WebSocketClient,fe as WebsocketClient,_e as defineAgent,we as defineBroods,Re as defineCron,He as defineDiscordChannel,Ie as defineDiscordConnection,Ze as defineGitHubChannel,ze as defineGitHubConnection,Ve as defineGoogleChatChannel,xe as defineGoogleChatConnection,$e as defineHarness,Ke as defineInstagramChannel,Ae as defineInstagramConnection,Ge as defineLinearChannel,Oe as defineLinearConnection,We as defineMatrixChannel,Me as defineMatrixConnection,Ce as defineMcp,Je as defineMessengerChannel,Ne as defineMessengerConnection,Ye as definePancakeChannel,je as definePancakeConnection,Ee as definePolicy,ke as defineSandbox,Te as defineSkill,Xe as defineSlackChannel,De as defineSlackConnection,Qe as defineTeamsChannel,qe as defineTeamsConnection,et as defineTelegramChannel,Le as defineTelegramConnection,tt as defineTwilioChannel,Ue as defineTwilioConnection,nt as defineWhatsAppChannel,Fe as defineWhatsAppConnection,Pe as defineWorkspace,rt as defineZaloChannel,Be as defineZaloConnection,ve as env,he as envPlaceholder,ne as isBroodsConfig,v as isConnectionDefinition,me as isLogLevel,ye as isObservabilityClientMessage,h as isResource,Se as isRootSpanKind,U as isSandboxLogId,F as isTraceId,K as normalizeHttpServiceUrl,ae as readSseStream,j as resolveEnvCredential,q as resolveRunEvents,be as signUserToken,G as toWebSocketBaseUrl,E as webSocketSubprotocols};
|
package/package.json
CHANGED
package/dist/chunk-5ks36kqn.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{O,E}from"./chunk-b0pdqkyk.js";import{e,o,i,c,n,t,u,w,s,d,r}from"./chunk-8zcgnjs8.js";import{Q,se,x}from"./cli/index.js";import{spawn as ne}from"node:child_process";import{statfsSync as ie}from"node:fs";import{availableParallelism as ae,homedir as ce,hostname as le,totalmem as pe}from"node:os";import{performance as j}from"node:perf_hooks";var P=["cursor_position","double_click","hold_key","key","left_click","left_click_drag","left_mouse_down","left_mouse_up","middle_click","mouse_move","right_click","screenshot","scroll","triple_click","type","wait","zoom"];var T={badFrame:{code:4400,reason:"Malformed frame"},expired:{code:4419,reason:"Credential expired"},occupied:{code:4423,reason:"Already connected from another daemon"},replaced:{code:4409,reason:"Replaced by a newer connection"},unauthorized:{code:4401,reason:"Unauthorized; run broods login"},unknownSandbox:{code:4404,reason:"No machine sandbox with that name in this account"}};var U="/v1/machines/ws",B=t({action:d(P),coordinate:n(o().int()).length(2).optional().describe("[x, y] in screenshot pixels for mouse actions."),start_coordinate:n(o().int()).length(2).optional().describe("[x, y] where a left_click_drag starts."),text:e().optional().describe("Text for type, the key chord for key and hold_key, or modifiers to hold during a click, drag or scroll."),scroll_direction:d(["down","left","right","up"]).optional(),scroll_amount:o().int().min(1).optional().describe("Scroll clicks, default 3."),duration:o().min(0).max(300).optional().describe("Seconds for wait and hold_key."),region:n(o().int()).length(4).optional().describe("[x0, y0, x1, y1] of the screenshot to zoom into."),repeat:o().int().min(1).max(100).optional().describe("How many times to press the key.")}),G=B.extend({type:r("computer"),id:e()}),W=t({type:r("computer-result"),id:e(),text:e().optional(),image:t({data:e(),mediaType:e()}).optional(),app:e().optional(),error:e().optional()}),J=t({type:r("credential"),token:e().min(1)}),K=t({type:r("exec"),id:e(),code:e(),cwd:e().optional(),env:s(e(),e()).optional(),timeoutSeconds:o().positive(),outputLimitBytes:o().positive()}),X=t({type:r("hello"),sandbox:e().min(1),hostname:e().optional(),platform:e().optional(),computer:i().optional(),mcp:n(e()).optional(),instance:e().optional(),force:i().optional(),specs:t({vcpu:o().positive(),memoryMb:o().positive(),storageGb:o().positive().optional()}).optional().catch(void 0)}),Y=t({type:r("mcp-call"),id:e(),server:e(),tool:e(),args:s(e(),c())}),q=t({type:r("mcp-list"),id:e(),server:e()}),Z=t({type:r("mcp-result"),id:e(),result:u({content:n(c())}).optional(),error:e().optional()}),V=t({type:r("mcp-tools"),id:e(),tools:n(u({name:e(),inputSchema:s(e(),c())})).optional(),error:e().optional()}),ee=t({type:r("ready"),sandboxId:e(),expiresInMs:o().optional()}),te=t({type:r("result"),id:e(),exitCode:o().nullable(),stdout:e(),stderr:e(),durationMs:o(),timedOut:i(),truncated:i()}),oe=w("type",[G,K,Y,q,ee]),xe=w("type",[W,J,X,Z,V,te]);function I(a){let l=new URL(U,a);return l.protocol=l.protocol==="https:"?"wss:":"ws:",l.toString()}function A(a){return re(oe,a)}function re(a,l){if(typeof l!=="string")return null;try{let y=a.safeParse(JSON.parse(l));return y.success?y.data:null}catch{return null}}var de=new Set([T.occupied.code,T.replaced.code,T.unauthorized.code,T.unknownSandbox.code]),H=72,R=30000,L=1000;function me(a,l,y){return new Promise((g)=>{let h=j.now(),f=new z(a.outputLimitBytes),k=new z(a.outputLimitBytes),b=!1,v=!1,F=(m,p)=>{if(v)return;if(v=!0,clearTimeout(D),y?.removeEventListener("abort",C),p)k.append(Buffer.from(`${p}
|
|
2
|
-
`));g({type:"result",id:a.id,exitCode:m,stdout:f.text(),stderr:k.text(),durationMs:Math.round(j.now()-h),timedOut:b,truncated:f.truncated||k.truncated})},M=ne("bash",["-lc",a.code],{cwd:a.cwd??l,env:{...O(),...a.env},detached:!0,stdio:["ignore","pipe","pipe"]}),_=()=>{if(!M.pid)return;try{process.kill(-M.pid,"SIGKILL")}catch{M.kill("SIGKILL")}},D=setTimeout(()=>{b=!0,_()},a.timeoutSeconds*1000),C=()=>{_(),F(null,"stopped: the daemon closed its socket")};if(y?.addEventListener("abort",C,{once:!0}),M.stdout.on("data",(m)=>f.append(m)),M.stderr.on("data",(m)=>k.append(m)),M.on("error",(m)=>F(null,m.message)),M.on("close",(m)=>F(m)),y?.aborted)C()})}async function Oe(a){let l=se(),y=crypto.randomUUID(),g=a.mcpFile?await ge(a.mcpFile,a.log):null,h=a.computer?await fe(a.log):null,f=L;try{while(!a.signal.aborted){let k=Date.now(),b;try{b=await a.credential()}catch(F){if(F instanceof x)throw F;a.log(`stage session unavailable (${F instanceof Error?F.message:String(F)}), retrying in ${Math.round(f/1000)}s`),await Q(f,a.signal),f=Math.min(f*2,R);continue}let v=await Me(a,b,y,l,h,g);if(a.signal.aborted)return;if(de.has(v.code))throw Error(v.reason||`core closed the socket (${v.code})`);if(Date.now()-k>R)f=L;a.log(`disconnected (${v.reason||v.code}), reconnecting in ${Math.round(f/1000)}s`),await Q(f,a.signal),f=Math.min(f*2,R)}}finally{h?.stop(),await g?.stop()}}class z{#o=[];#e;#t=0;truncated=!1;constructor(a){this.#e=a}append(a){if(this.#t>=this.#e){this.truncated=!0;return}let l=this.#e-this.#t;if(a.byteLength>l){this.#o.push(a.subarray(0,l)),this.#t=this.#e,this.truncated=!0;return}this.#o.push(a),this.#t+=a.byteLength}text(){let a=Buffer.concat(this.#o).toString("utf8");return this.truncated?`${a}
|
|
3
|
-
[output truncated]`:a}}function ue(a){let l=[a.action];if(a.coordinate)l.push(`at ${a.coordinate.join(",")}`);if(a.text!==void 0)l.push(JSON.stringify(N(a.text)));if(a.region)l.push(`region ${a.region.join(",")}`);return l.join(" ")}function he(){let a=ye();return{vcpu:ae(),memoryMb:Math.round(pe()/1048576),...a?{storageGb:a}:{}}}function ye(){try{let a=ie(ce());return Math.round(a.blocks*a.bsize/1073741824)}catch{return}}function N(a){let l=a.trim().split(`
|
|
4
|
-
`)[0]??"";return l.length>H?`${l.slice(0,H)}…`:l}async function fe(a){let{startDesktop:l}=await import("./chunk-5tnnqapc.js"),{display:y,driver:g,permissions:h}=await l(!1);if(a(`computer use on, ${y.width}x${y.height} screenshots`),!h.screenRecording||!h.accessibility)a(" screen recording or accessibility is missing, run `broods machine --doctor --request`");return g}async function ge(a,l){let{McpHost:y,readMcpServersFile:g}=await import("./chunk-bbvew31z.js"),h=new y(g(a),l);return l(`mcp servers from ${a}: ${h.names().join(", ")}`),h}async function be(a,l,y){try{if(a.type==="mcp-list"){let h=await l.listTools(a.server);return y(` mcp ${a.server}: ${h.length} tools`),{type:"mcp-tools",id:a.id,tools:h}}y(` mcp ${a.server}.${a.tool}`);let g=await l.callTool(a.server,a.tool,a.args);return{type:"mcp-result",id:a.id,result:g}}catch(g){let h=g instanceof Error?g.message:String(g);return y(` mcp ${a.server}: ${h}`),{type:a.type==="mcp-call"?"mcp-result":"mcp-tools",id:a.id,error:h}}}function Me(a,l,y,g,h,f){return new Promise((k)=>{let b=new g(I(a.baseUrl),E(l)),v=new AbortController,F=()=>b.close(1000,"daemon stopped"),M=(m)=>{if(b.readyState===b.OPEN)b.send(JSON.stringify(m))},_,D=(m)=>{if(clearTimeout(_),v.signal.aborted)return;_=setTimeout(()=>{a.credential().then((p)=>M({type:"credential",token:p}),(p)=>a.log(`credential refresh failed (${p instanceof Error?p.message:String(p)}), retrying`)).finally(()=>D(m))},Math.max((m-Date.now())/2,L))},C=(m,p)=>{a.signal.removeEventListener("abort",F),clearTimeout(_),v.abort(),k({code:m,reason:p})};a.signal.addEventListener("abort",F,{once:!0}),b.onopen=()=>M({type:"hello",sandbox:a.sandbox,hostname:le(),platform:process.platform,computer:h!==null,mcp:f?.names(),instance:y,force:a.force,specs:he()}),b.onmessage=(m)=>{let p=A(m.data);if(p?.type==="ready"){if(_===void 0)a.log(`connected as ${a.sandbox} (${p.sandboxId})`);if(p.expiresInMs!==void 0)D(Date.now()+p.expiresInMs);return}if(p?.type==="computer"&&h){a.log(` ${ue(p)}`),h.run(p).then((S)=>{if(S.error)a.log(` error: ${S.error}`);M(S)});return}if((p?.type==="mcp-call"||p?.type==="mcp-list")&&f){be(p,f,a.log).then(M);return}if(p?.type!=="exec")return;a.log(`$ ${N(p.code)}`),me(p,a.cwd,v.signal).then((S)=>{a.log(` exit ${S.exitCode??"none"} in ${S.durationMs}ms${S.timedOut?" (timed out)":""}`),M(S)})},b.onerror=()=>C(1006,"connection failed"),b.onclose=(m)=>C(m.code,m.reason)})}export{Oe as runMachineDaemon};
|