broods 0.18.0 → 0.19.0
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 +15 -10
- package/dist/account.js +1 -1
- package/dist/{chunk-ce3yb3yz.js → chunk-nq1vqmh0.js} +2 -2
- package/dist/cli/index.js +44 -44
- package/dist/index.d.ts +16 -23
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/account.d.ts
CHANGED
|
@@ -288,11 +288,16 @@ interface AgentChannelsConfig {
|
|
|
288
288
|
zalo?: AgentZaloChannelConfig;
|
|
289
289
|
[key: string]: unknown;
|
|
290
290
|
}
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
/**
|
|
292
|
+
* How an attached partitioned workspace splits its folders for runs arriving
|
|
293
|
+
* through this door. `shared` mounts the workspace root; `conversation` mounts
|
|
294
|
+
* a private child folder per thread, issue or chat under `alias`.
|
|
295
|
+
*/
|
|
296
|
+
type ChannelPartition = {
|
|
297
|
+
by: "shared";
|
|
293
298
|
alias?: never;
|
|
294
299
|
} | {
|
|
295
|
-
|
|
300
|
+
by: "conversation";
|
|
296
301
|
alias: string;
|
|
297
302
|
};
|
|
298
303
|
interface AgentTelegramChannelConfig {
|
|
@@ -304,7 +309,7 @@ interface AgentTelegramChannelConfig {
|
|
|
304
309
|
allowedUserIds?: string[];
|
|
305
310
|
reactionEmoji?: string;
|
|
306
311
|
trace?: "enabled" | "disabled";
|
|
307
|
-
|
|
312
|
+
partition?: ChannelPartition;
|
|
308
313
|
[key: string]: unknown;
|
|
309
314
|
}
|
|
310
315
|
interface AgentGitHubChannelConfig {
|
|
@@ -324,7 +329,7 @@ interface AgentGitHubChannelConfig {
|
|
|
324
329
|
/** 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. */
|
|
325
330
|
triggerOnPROpen?: boolean;
|
|
326
331
|
trace?: "enabled" | "disabled";
|
|
327
|
-
|
|
332
|
+
partition?: ChannelPartition;
|
|
328
333
|
[key: string]: unknown;
|
|
329
334
|
}
|
|
330
335
|
interface AgentSlackChannelConfig {
|
|
@@ -336,7 +341,7 @@ interface AgentSlackChannelConfig {
|
|
|
336
341
|
allowedUserIds?: string[];
|
|
337
342
|
reactionEmoji?: string;
|
|
338
343
|
trace?: "enabled" | "disabled";
|
|
339
|
-
|
|
344
|
+
partition?: ChannelPartition;
|
|
340
345
|
[key: string]: unknown;
|
|
341
346
|
}
|
|
342
347
|
interface AgentDiscordChannelConfig {
|
|
@@ -351,7 +356,7 @@ interface AgentDiscordChannelConfig {
|
|
|
351
356
|
/** Role ids that count as mentioning the agent, e.g. an on-call role. */
|
|
352
357
|
mentionRoleIds?: string[];
|
|
353
358
|
trace?: "enabled" | "disabled";
|
|
354
|
-
|
|
359
|
+
partition?: ChannelPartition;
|
|
355
360
|
[key: string]: unknown;
|
|
356
361
|
}
|
|
357
362
|
interface AgentPancakeChannelConfig {
|
|
@@ -363,7 +368,7 @@ interface AgentPancakeChannelConfig {
|
|
|
363
368
|
webhookSecret?: string;
|
|
364
369
|
senderId?: string;
|
|
365
370
|
trace?: "enabled" | "disabled";
|
|
366
|
-
|
|
371
|
+
partition?: ChannelPartition;
|
|
367
372
|
[key: string]: unknown;
|
|
368
373
|
}
|
|
369
374
|
interface AgentZaloChannelConfig {
|
|
@@ -373,7 +378,7 @@ interface AgentZaloChannelConfig {
|
|
|
373
378
|
botToken?: string;
|
|
374
379
|
webhookSecret?: string;
|
|
375
380
|
trace?: "enabled" | "disabled";
|
|
376
|
-
|
|
381
|
+
partition?: ChannelPartition;
|
|
377
382
|
[key: string]: unknown;
|
|
378
383
|
}
|
|
379
384
|
|
|
@@ -761,7 +766,7 @@ interface ChannelRecordConfig {
|
|
|
761
766
|
* gives the runtime a second place to reply.
|
|
762
767
|
*/
|
|
763
768
|
replyIn?: ChannelReplyIn;
|
|
764
|
-
|
|
769
|
+
partition?: ChannelPartition;
|
|
765
770
|
/** Images the agent may stand a sandbox up from for a thread here. */
|
|
766
771
|
sandboxImages?: string[];
|
|
767
772
|
/** Named groups of people, readable from policy conditions as `userRoles`. */
|
package/dist/account.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c}from"./chunk-nq1vqmh0.js";import"./chunk-3cvxks4m.js";export{b as BroodsAccountApiError,c as BroodsAccountClient,a as envPlaceholder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var c=/^[A-Z][A-Z0-9_]*$/;function u(e){if(!c.test(e)||e.length>64)throw Error("envPlaceholder name must match /^[A-Z][A-Z0-9_]*$/ and be at most 64 characters.");return`\${${e}}`}class
|
|
2
|
-
export{u as a,
|
|
1
|
+
var c=/^[A-Z][A-Z0-9_]*$/;function u(e){if(!c.test(e)||e.length>64)throw Error("envPlaceholder name must match /^[A-Z][A-Z0-9_]*$/ and be at most 64 characters.");return`\${${e}}`}class r extends Error{status;body;constructor(e,t,n,s){super(`${e} ${t} failed with ${n}: ${s}`);this.name="BroodsAccountApiError",this.status=n,this.body=s}}function i(e){return typeof process<"u"?process?.env?.[e]:void 0}function a(e){return`?${new URLSearchParams({project:e.project,stage:e.stage}).toString()}`}class l{baseUrl;accountSecret;fetchImpl;constructor(e={}){let t=e.baseUrl??i("BROODS_BASE_URL")??"https://gateway.broods.app",n=e.accountSecret??i("BROODS_ACCOUNT_SECRET");if(!n)throw Error("BroodsAccountClient requires an accountSecret (or BROODS_ACCOUNT_SECRET).");let s=t.length;while(s>0&&t.charCodeAt(s-1)===47)s-=1;this.baseUrl=t.slice(0,s),this.accountSecret=n,this.fetchImpl=e.fetch??fetch}async getAccount(){let e=await this.request("GET","/v1/account");if(!e)throw new r("GET","/v1/account",404,"Account not found");return e.account}async updateAccount(e){return(await this.request("PATCH","/v1/account",e))?.account??null}async rotateSecret(){let e=await this.request("POST","/v1/account/rotate-secret");if(!e)throw new r("POST","/v1/account/rotate-secret",404,"Account not found");return e}async deleteAccount(){return await this.request("DELETE","/v1/account")??{deleted:!1}}webhookUrl(e,t){let n=[e,t].map(encodeURIComponent);return`${this.baseUrl}/webhooks/${n.join("/")}`}async listAgents(){return(await this.request("GET","/v1/agents"))?.agents??[]}async createAgent(e){let t=await this.request("POST","/v1/agents",e);if(!t)throw new r("POST","/v1/agents",404,"Not found");return t}async getAgent(e){return await this.request("GET",`/v1/agents/${encodeURIComponent(e)}`)}async updateAgent(e,t){return await this.request("PATCH",`/v1/agents/${encodeURIComponent(e)}`,t)}async deleteAgent(e){return(await this.request("DELETE",`/v1/agents/${encodeURIComponent(e)}`))?.deleted??!1}async listEnvVars(){return(await this.request("GET","/v1/env"))?.env??[]}async setEnvVar(e,t){await this.request("PUT",`/v1/env/${encodeURIComponent(e)}`,{value:t})}async deleteEnvVar(e){return(await this.request("DELETE",`/v1/env/${encodeURIComponent(e)}`))?.deleted??!1}async listCrons(){return(await this.request("GET","/v1/crons"))?.crons??[]}async createCron(e){let t=await this.request("POST","/v1/crons",e);if(!t)throw new r("POST","/v1/crons",404,"Not found");return t}async getCron(e){return await this.request("GET",`/v1/crons/${encodeURIComponent(e)}`)}async updateCron(e,t){return await this.request("PATCH",`/v1/crons/${encodeURIComponent(e)}`,t)}async deleteCron(e){return(await this.request("DELETE",`/v1/crons/${encodeURIComponent(e)}`))?.deleted??!1}async listCronRuns(e,t={}){let n=t.limit!==void 0?`?limit=${t.limit}`:"";return(await this.request("GET",`/v1/crons/${encodeURIComponent(e)}/runs${n}`))?.runs??[]}async listWorkspaces(){return(await this.request("GET","/v1/workspaces"))?.workspaces??[]}async createWorkspace(e){let t=await this.request("POST","/v1/workspaces",e);if(!t)throw new r("POST","/v1/workspaces",404,"Not found");return t}async getWorkspace(e){return await this.request("GET",`/v1/workspaces/${encodeURIComponent(e)}`)}async updateWorkspace(e,t){return await this.request("PATCH",`/v1/workspaces/${encodeURIComponent(e)}`,t)}async deleteWorkspace(e){return(await this.request("DELETE",`/v1/workspaces/${encodeURIComponent(e)}`))?.deleted??!1}async listWorkspaceFiles(e){return(await this.request("GET",`/v1/workspaces/${encodeURIComponent(e)}/files`))?.files??[]}async getWorkspaceFileUrl(e,t){let n=`?path=${encodeURIComponent(t)}`;return(await this.request("GET",`/v1/workspaces/${encodeURIComponent(e)}/files${n}`))?.url??null}async uploadWorkspaceFile(e,t){let n=`/v1/workspaces/${encodeURIComponent(e)}/files`,s=await this.request("POST",n,t);if(!s)throw new r("POST",n,404,"Workspace not found");return s.file}async renameWorkspaceFile(e,t,n){return(await this.request("PATCH",`/v1/workspaces/${encodeURIComponent(e)}/files`,{path:t,newPath:n}))?.renamed??!1}async deleteWorkspaceFile(e,t){return(await this.request("DELETE",`/v1/workspaces/${encodeURIComponent(e)}/files`,{path:t}))?.deleted??!1}async listSandboxes(){return(await this.request("GET","/v1/sandboxes"))?.sandboxes??[]}async createSandbox(e){let t=await this.request("POST","/v1/sandboxes",e);if(!t)throw new r("POST","/v1/sandboxes",404,"Not found");return t}async getSandbox(e){return await this.request("GET",`/v1/sandboxes/${encodeURIComponent(e)}`)}async updateSandbox(e,t){return await this.request("PATCH",`/v1/sandboxes/${encodeURIComponent(e)}`,t)}async deleteSandbox(e){return(await this.request("DELETE",`/v1/sandboxes/${encodeURIComponent(e)}`))?.deleted??!1}async suspendSandbox(e,t){return await this.sandboxAction(e,"suspend",{reservationKey:t})}async resumeSandbox(e,t){return await this.sandboxAction(e,"resume",{reservationKey:t})}async terminateSandbox(e,t){return await this.sandboxAction(e,"terminate",{reservationKey:t})}async snapshotSandbox(e,t,n){return await this.sandboxAction(e,"snapshot",{reservationKey:t,name:n})}async openSandboxTerminal(e,t){return await this.sandboxAction(e,"terminal",{reservationKey:t})}async listTools(e){let t=`/v1/tools${a(e)}`,n=await this.request("GET",t);if(!n)throw new r("GET",t,404,"Not found");return n.tools??[]}async createTool(e,t){let n=`/v1/tools${a(e)}`,s=await this.request("POST",n,t);if(!s)throw new r("POST",n,404,"Not found");return s}async getTool(e){return await this.request("GET",`/v1/tools/${encodeURIComponent(e)}`)}async updateTool(e,t){return await this.request("PATCH",`/v1/tools/${encodeURIComponent(e)}`,t)}async deleteTool(e){return(await this.request("DELETE",`/v1/tools/${encodeURIComponent(e)}`))?.deleted??!1}async listPolicies(){return(await this.request("GET","/v1/policies"))?.policies??[]}async createPolicy(e){let t=await this.request("POST","/v1/policies",e);if(!t)throw new r("POST","/v1/policies",404,"Not found");return t}async getPolicy(e){return await this.request("GET",`/v1/policies/${encodeURIComponent(e)}`)}async updatePolicy(e,t){return await this.request("PATCH",`/v1/policies/${encodeURIComponent(e)}`,t)}async deletePolicy(e){return(await this.request("DELETE",`/v1/policies/${encodeURIComponent(e)}`))?.deleted??!1}async listChannels(){return(await this.request("GET","/v1/channels"))?.channels??[]}async createChannel(e){let t=await this.request("POST","/v1/channels",e);if(!t)throw new r("POST","/v1/channels",404,"Not found");return t}async getChannel(e){return await this.request("GET",`/v1/channels/${encodeURIComponent(e)}`)}async updateChannel(e,t){return await this.request("PATCH",`/v1/channels/${encodeURIComponent(e)}`,t)}async deleteChannel(e){return(await this.request("DELETE",`/v1/channels/${encodeURIComponent(e)}`))?.deleted??!1}async listSkills(){return(await this.request("GET","/v1/skills"))?.skills??[]}async createSkill(e){let t=await this.request("POST","/v1/skills",e);if(!t)throw new r("POST","/v1/skills",404,"Not found");return t}async getSkill(e){return await this.request("GET",`/v1/skills/${encodeURIComponent(e)}`)}async uploadSkill(e,t){let n=`/v1/skills/${encodeURIComponent(e)}`,s=await this.request("PUT",n,t);if(!s)throw new r("PUT",n,404,"Skill not found");return s}async deleteSkill(e){return(await this.request("DELETE",`/v1/skills/${encodeURIComponent(e)}`))?.deleted??!1}async sandboxAction(e,t,n){let s=`/v1/sandboxes/${encodeURIComponent(e)}/${t}`,o=await this.request("POST",s,n);if(!o)throw new r("POST",s,404,"Sandbox not found");return o}async request(e,t,n){let s=await this.fetchImpl(`${this.baseUrl}${t}`,{method:e,headers:{Authorization:`Bearer ${this.accountSecret}`,...n!==void 0?{"Content-Type":"application/json"}:{}},...n!==void 0?{body:JSON.stringify(n)}:{}});if(s.status===404)return null;if(!s.ok)throw new r(e,t,s.status,await s.text());return await s.json()}}
|
|
2
|
+
export{u as a,r as b,l as c};
|