broods 0.12.0 → 0.14.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 +93 -24
- package/dist/{chunk-rr4srzb6.js → chunk-9v4kpqb1.js} +3 -3
- package/dist/cli/index.js +43 -43
- package/dist/index.d.ts +103 -40
- package/dist/index.js +1 -1
- package/package.json +15 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,98 @@
|
|
|
1
1
|
import { SystemModelMessage, LanguageModelCallOptions, RequestOptions, streamText, JSONSchema7, ModelMessage, TextStreamPart, ToolSet } from 'ai';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Every Vercel AI SDK provider that ships language models, plus `custom`
|
|
5
|
+
* (any OpenAI-compatible endpoint) and `minimax`. Image-, speech- and
|
|
6
|
+
* transcription-only providers are deliberately absent: they cannot back
|
|
7
|
+
* `config.model`.
|
|
6
8
|
*/
|
|
7
|
-
declare const
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
declare const MODEL_PROVIDERS: {
|
|
10
|
+
readonly anthropic: {
|
|
11
|
+
readonly label: "Anthropic";
|
|
12
|
+
readonly modelPlaceholder: "claude-sonnet-4-5-20250929";
|
|
13
|
+
};
|
|
14
|
+
readonly azure: {
|
|
15
|
+
readonly label: "Azure OpenAI";
|
|
16
|
+
readonly modelPlaceholder: "gpt-4.1-mini";
|
|
17
|
+
};
|
|
18
|
+
readonly baseten: {
|
|
19
|
+
readonly label: "Baseten";
|
|
20
|
+
readonly modelPlaceholder: "deepseek-ai/DeepSeek-V3";
|
|
21
|
+
};
|
|
22
|
+
readonly bedrock: {
|
|
23
|
+
readonly label: "Amazon Bedrock";
|
|
24
|
+
readonly modelPlaceholder: "anthropic.claude-sonnet-4-5-20250929-v1:0";
|
|
25
|
+
};
|
|
26
|
+
readonly cerebras: {
|
|
27
|
+
readonly label: "Cerebras";
|
|
28
|
+
readonly modelPlaceholder: "llama3.1-8b";
|
|
29
|
+
};
|
|
30
|
+
readonly cohere: {
|
|
31
|
+
readonly label: "Cohere";
|
|
32
|
+
readonly modelPlaceholder: "command-a-03-2025";
|
|
33
|
+
};
|
|
34
|
+
readonly custom: {
|
|
35
|
+
readonly label: "Custom OpenAI-compatible";
|
|
36
|
+
readonly modelPlaceholder: "gpt-oss-120b";
|
|
37
|
+
};
|
|
38
|
+
readonly deepinfra: {
|
|
39
|
+
readonly label: "DeepInfra";
|
|
40
|
+
readonly modelPlaceholder: "deepseek-ai/DeepSeek-V3";
|
|
41
|
+
};
|
|
42
|
+
readonly deepseek: {
|
|
43
|
+
readonly label: "DeepSeek";
|
|
44
|
+
readonly modelPlaceholder: "deepseek-chat";
|
|
45
|
+
};
|
|
46
|
+
readonly fireworks: {
|
|
47
|
+
readonly label: "Fireworks";
|
|
48
|
+
readonly modelPlaceholder: "accounts/fireworks/models/deepseek-v3";
|
|
49
|
+
};
|
|
50
|
+
readonly google: {
|
|
51
|
+
readonly label: "Google";
|
|
52
|
+
readonly modelPlaceholder: "gemini-2.5-flash";
|
|
53
|
+
};
|
|
54
|
+
readonly groq: {
|
|
55
|
+
readonly label: "Groq";
|
|
56
|
+
readonly modelPlaceholder: "llama-3.3-70b-versatile";
|
|
57
|
+
};
|
|
58
|
+
readonly minimax: {
|
|
59
|
+
readonly label: "MiniMax";
|
|
60
|
+
readonly modelPlaceholder: "MiniMax-M2.7";
|
|
61
|
+
};
|
|
62
|
+
readonly mistral: {
|
|
63
|
+
readonly label: "Mistral";
|
|
64
|
+
readonly modelPlaceholder: "mistral-large-latest";
|
|
65
|
+
};
|
|
66
|
+
readonly openai: {
|
|
67
|
+
readonly label: "OpenAI";
|
|
68
|
+
readonly modelPlaceholder: "gpt-4.1-mini";
|
|
69
|
+
};
|
|
70
|
+
readonly perplexity: {
|
|
71
|
+
readonly label: "Perplexity";
|
|
72
|
+
readonly modelPlaceholder: "sonar-pro";
|
|
73
|
+
};
|
|
74
|
+
readonly togetherai: {
|
|
75
|
+
readonly label: "Together.ai";
|
|
76
|
+
readonly modelPlaceholder: "deepseek-ai/DeepSeek-V3";
|
|
77
|
+
};
|
|
78
|
+
readonly v0: {
|
|
79
|
+
readonly label: "Vercel v0";
|
|
80
|
+
readonly modelPlaceholder: "v0-1.0-md";
|
|
81
|
+
};
|
|
82
|
+
readonly vercel: {
|
|
83
|
+
readonly label: "Vercel AI Gateway";
|
|
84
|
+
readonly modelPlaceholder: "openai/gpt-4.1-mini";
|
|
85
|
+
};
|
|
86
|
+
readonly vertex: {
|
|
87
|
+
readonly label: "Google Vertex AI";
|
|
88
|
+
readonly modelPlaceholder: "gemini-2.5-flash";
|
|
89
|
+
};
|
|
90
|
+
readonly xai: {
|
|
91
|
+
readonly label: "xAI Grok";
|
|
92
|
+
readonly modelPlaceholder: "grok-4";
|
|
93
|
+
};
|
|
15
94
|
};
|
|
16
|
-
type AccountModelProviderName = keyof typeof
|
|
95
|
+
type AccountModelProviderName = keyof typeof MODEL_PROVIDERS;
|
|
17
96
|
|
|
18
97
|
/**
|
|
19
98
|
* Agent policy contracts and validation.
|
|
@@ -166,14 +245,6 @@ type AgentModelOutputMetadata = {
|
|
|
166
245
|
[key: string]: unknown;
|
|
167
246
|
};
|
|
168
247
|
type AgentProviderConfig = Partial<Record<AccountModelProviderName, AgentProviderSettings>>;
|
|
169
|
-
/**
|
|
170
|
-
* Constructor settings for a model provider. The keys are an explicit allow-list
|
|
171
|
-
* (no open index signature) so a misspelled option — most commonly the camel
|
|
172
|
-
* `baseUrl` instead of the canonical `base_url`/`baseURL` — is a compile-time
|
|
173
|
-
* error in the SDK and is caught by `normalizeProviderSettings` at runtime.
|
|
174
|
-
* Keep this list in sync with `normalizeProviderSettings` and the SDK's
|
|
175
|
-
* `KNOWN_PROVIDER_SETTING_KEYS`.
|
|
176
|
-
*/
|
|
177
248
|
interface AgentProviderSettings {
|
|
178
249
|
apiKey?: string;
|
|
179
250
|
/** OpenAI-compatible endpoint (`custom`). Snake form, as documented. */
|
|
@@ -181,13 +252,11 @@ interface AgentProviderSettings {
|
|
|
181
252
|
/** OpenAI-compatible endpoint (`custom`). AI-SDK form; the dashboard writes both. */
|
|
182
253
|
baseURL?: string;
|
|
183
254
|
headers?: Record<string, string>;
|
|
255
|
+
/** Endpoint label; becomes the provider id and the pi harness env prefix. */
|
|
256
|
+
name?: string;
|
|
184
257
|
organization?: string;
|
|
185
258
|
project?: string;
|
|
186
|
-
|
|
187
|
-
region?: string;
|
|
188
|
-
accessKeyId?: string;
|
|
189
|
-
secretAccessKey?: string;
|
|
190
|
-
sessionToken?: string;
|
|
259
|
+
[key: string]: unknown;
|
|
191
260
|
}
|
|
192
261
|
interface AgentWorkspaceRef {
|
|
193
262
|
name: string;
|
|
@@ -876,7 +945,7 @@ type ObservabilitySpanRow = {
|
|
|
876
945
|
spanId: string;
|
|
877
946
|
parentSpanId?: string;
|
|
878
947
|
name: string;
|
|
879
|
-
kind: "task" | "subtask" | "model.step" | "tool.call" | "phase";
|
|
948
|
+
kind: "task" | "cron" | "subtask" | "model.step" | "tool.call" | "phase";
|
|
880
949
|
startTimeMs: number;
|
|
881
950
|
endTimeMs: number;
|
|
882
951
|
durationMs: number;
|
|
@@ -921,6 +990,8 @@ type ObservabilityErrorMessage = {
|
|
|
921
990
|
};
|
|
922
991
|
type ObservabilityServerMessage = ObservabilityReadyMessage | ObservabilityBackfillMessage | ObservabilityLogMessage | ObservabilitySpanMessage | ObservabilityErrorMessage;
|
|
923
992
|
declare function isObservabilityClientMessage(v: unknown): v is ObservabilityClientMessage;
|
|
993
|
+
/** Whether a span is a top-level run, each of which owns its own trace. */
|
|
994
|
+
declare function isRootSpanKind(kind: ObservabilitySpanRow["kind"]): boolean;
|
|
924
995
|
|
|
925
996
|
/**
|
|
926
997
|
* Configurable client for running deployed agents over direct core SSE.
|
|
@@ -1900,26 +1971,18 @@ type AgentPolicyDefinitionConfig = Omit<AgentPolicyConfig, "policyIds"> & {
|
|
|
1900
1971
|
* gains a new top-level field that should be code-definable.
|
|
1901
1972
|
*/
|
|
1902
1973
|
/**
|
|
1903
|
-
* SDK-facing model-provider constructor settings.
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
* typo
|
|
1907
|
-
*
|
|
1908
|
-
* `_ProviderKeyParity` assertion below fails `broods check` if they drift.
|
|
1909
|
-
* Every string field also accepts an `env("NAME")` reference.
|
|
1974
|
+
* SDK-facing model-provider constructor settings. Open by design: everything a
|
|
1975
|
+
* provider's Vercel AI SDK factory accepts is forwarded verbatim, so there is no
|
|
1976
|
+
* key list to keep in sync. Only the keys broods reads itself are named (and so
|
|
1977
|
+
* typo-checked at run time by `validateProviderConfig`); every string field also
|
|
1978
|
+
* accepts an `env("NAME")` reference.
|
|
1910
1979
|
*/
|
|
1911
1980
|
interface ProviderSettingsInput {
|
|
1912
1981
|
apiKey?: string | EnvRef;
|
|
1913
1982
|
base_url?: string | EnvRef;
|
|
1914
1983
|
baseURL?: string | EnvRef;
|
|
1915
1984
|
headers?: Record<string, string | EnvRef>;
|
|
1916
|
-
|
|
1917
|
-
project?: string | EnvRef;
|
|
1918
|
-
name?: string | EnvRef;
|
|
1919
|
-
region?: string | EnvRef;
|
|
1920
|
-
accessKeyId?: string | EnvRef;
|
|
1921
|
-
secretAccessKey?: string | EnvRef;
|
|
1922
|
-
sessionToken?: string | EnvRef;
|
|
1985
|
+
[key: string]: unknown;
|
|
1923
1986
|
}
|
|
1924
1987
|
/** Per-provider settings; provider names stay synced with core's `AgentConfig`. */
|
|
1925
1988
|
type ProviderConfigInput = Partial<Record<keyof NonNullable<AgentConfig["provider"]>, ProviderSettingsInput>>;
|
|
@@ -2021,5 +2084,5 @@ declare function isResource(value: unknown): value is AnyResource;
|
|
|
2021
2084
|
declare function isChannelDefinition(value: unknown): value is AnyChannelDefinition;
|
|
2022
2085
|
declare function isBroodsConfig(value: unknown): value is BroodsConfigDefinition;
|
|
2023
2086
|
|
|
2024
|
-
export { BroodsAccountApiError, BroodsAccountClient, BroodsClient, BroodsWebSocketClient, DEFAULT_CORE_BASE_URL, IngressAcceptedError, MAX_OBSERVABILITY_BACKFILL, BroodsWebSocketClient as WebSocketClient, BroodsWebSocketClient as WebsocketClient, defineAgent, defineBroods, defineChannelRecord, defineCron, defineDiscordChannel, defineGitHubChannel, defineHarness, definePancakeChannel, definePolicy, defineSandbox, defineSkill, defineSlackChannel, defineTelegramChannel, defineTool, defineWorkspace, defineZaloChannel, env, envPlaceholder, isBroodsConfig, isChannelDefinition, isObservabilityClientMessage, isResource, normalizeHttpServiceUrl, readSseStream, resolveRunEvents, toWebSocketBaseUrl };
|
|
2087
|
+
export { BroodsAccountApiError, BroodsAccountClient, BroodsClient, BroodsWebSocketClient, DEFAULT_CORE_BASE_URL, IngressAcceptedError, MAX_OBSERVABILITY_BACKFILL, BroodsWebSocketClient as WebSocketClient, BroodsWebSocketClient as WebsocketClient, defineAgent, defineBroods, defineChannelRecord, defineCron, defineDiscordChannel, defineGitHubChannel, defineHarness, definePancakeChannel, definePolicy, defineSandbox, defineSkill, defineSlackChannel, defineTelegramChannel, defineTool, defineWorkspace, defineZaloChannel, env, envPlaceholder, isBroodsConfig, isChannelDefinition, isObservabilityClientMessage, isResource, isRootSpanKind, normalizeHttpServiceUrl, readSseStream, resolveRunEvents, toWebSocketBaseUrl };
|
|
2025
2088
|
export type { Account, AccountAgent, AccountChannel, AccountEnvVar, AccountPolicy, AccountSandbox, AccountTool, AccountWorkspace, Agent, AgentChannelWorkspaceScope, AgentChannelsConfig, AgentCodeHookConfig, AgentConfig, AgentConfigDoc, AgentDefinitionConfig, AgentDiscordChannelConfig, AgentGitHubChannelConfig, AgentHandle, AgentHookEventName, AgentHooks, AgentHooksConfig, AgentPancakeChannelConfig, AgentPolicyConfig, AgentPolicyDefinitionConfig, AgentPolicyDocument, AgentProviderSettings, AgentReference, AgentResource, AgentRunEventInput, AgentRunInput, AgentRunModelOverrides, AgentRunOverrides, AgentRunResult, AgentSkillsDefinitionConfig, AgentSlackChannelConfig, AgentStreamPart, AgentSubagentDefinitionConfig, AgentTelegramChannelConfig, AgentWebhookHookConfig, AgentWorkspaceInput, AgentWorkspaceRef, AgentWorkspaceRefInput, AgentZaloChannelConfig, AnyChannelDefinition, AnyResource, AsyncAgentRun, AsyncPollOptions, AsyncRequestAccepted, AsyncStatus, BroodsAccount, BroodsAccountClientOptions, BroodsClientOptions, BroodsConfigDefinition, BroodsProjectConfig, BroodsWebSocketClientOptions, ChannelDefinition, ChannelMessageReceived, ChannelRecordConfig, ChannelRecordDefinitionConfig, ChannelRecordResource, ChannelReference, ChannelType, CliManifest, CliManifestResource, CliResourceKind, CreateAgentResult, CreateClientCronInput, CreateCronInput, CreateToolInput, Cron, CronDefinitionConfig, CronDoc, CronLastStatus, CronResource, CronRun, CronStatus, CustomTool, DeleteAccountResult, DiscordChannelDefinition, DiscordChannelInput, DiscordMessageSource, DiscordSource, Doc, EnvAccessor, EnvRef, EnvRefString, GeneratedIds, GitHubChannelDefinition, GitHubChannelInput, GitHubMessageSource, GitHubSource, HarnessDefinition, HarnessType, HookContext, Id, IngressMode, IngressStatus, LogLevel, ObservabilityBackfillMessage, ObservabilityClientMessage, ObservabilityErrorMessage, ObservabilityLogEntry, ObservabilityLogMessage, ObservabilityReadyMessage, ObservabilityServerMessage, ObservabilitySpanMessage, ObservabilitySpanRow, ObservabilitySubscribeMessage, ObservabilityUnsubscribeMessage, PancakeChannelDefinition, PancakeChannelInput, PancakeMessageSource, PancakeSource, PolicyDefinitionConfig, PolicyResource, ProjectDoc, ProviderConfigInput, ProviderSettingsInput, ResourceApi, ResourceDefinition, ResourceInput, ResourceKind, RotateSecretResult, Sandbox, SandboxConfig, SandboxConfigDoc, SandboxDefinitionConfig, SandboxLifecycleResult, SandboxResource, SandboxSnapshotResult, SandboxTerminalTicket, Skill, SkillDefinitionConfig, SkillResource, SkillUploadInput, SlackChannelDefinition, SlackChannelInput, SlackMessageSource, SlackSource, StageDoc, TelegramChannelDefinition, TelegramChannelInput, TelegramMessageSource, TelegramSource, ToolApprovalSummary, ToolDefinitionConfig, ToolExecuteContext, ToolExecuteOptions, ToolResource, ToolScope, UpdateAgentInput, UpdateCronInput, UpdateToolInput, WebSocketAttachInput, WebSocketClientAttachMessage, WebSocketClientCancelMessage, WebSocketClientControlMessage, WebSocketClientExecuteMessage, WebSocketClientMessage, WebSocketConstructorLike, WebSocketHandlers, WebSocketLike, WebSocketOutputMessage, WebSocketRunInput, WebSocketServerMessage, WebSocketStreamMessage, WebSocketSubscription, Workspace, WorkspaceConfig, WorkspaceConfigDoc, WorkspaceFileEntry, WorkspaceResource, ZaloChannelDefinition, ZaloChannelInput, ZaloMessageSource, ZaloSource };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h,b as O,c as R}from"./chunk-ce3yb3yz.js";import{A as N,B as _,C as P,D as H,E as K,F as U,G as B,H as j,I as F,J as G,K as z,L as Z,M as V,N as X,O as Y,d as I,e as v,p as k,q as S,r as A,s as M,t as W,u as L,v as w,w as E,x as D,y as T,z as q}from"./chunk-9v4kpqb1.js";import"./chunk-pfhy5049.js";var o=500;function a(t){if(typeof t!=="object"||t===null)return!1;let e=t;if(e.type==="subscribe"){let r=e.stream;if(r!=="logs"&&r!=="traces")return!1;let n=e.backfill;if(n!==void 0&&(typeof n!=="number"||!Number.isSafeInteger(n)||n<0||n>500))return!1;if(e.liveOnly!==void 0&&typeof e.liveOnly!=="boolean")return!1;let s=e.minLevel;if(s!==void 0&&s!=="INFO"&&s!=="WARN"&&s!=="ERROR")return!1;return!0}if(e.type==="unsubscribe"){let r=e.stream;return r==="logs"||r==="traces"}return!1}function i(t){return t==="task"||t==="cron"||t==="subtask"}export{O as BroodsAccountApiError,R as BroodsAccountClient,A as BroodsClient,W as BroodsWebSocketClient,k as DEFAULT_CORE_BASE_URL,S as IngressAcceptedError,o as MAX_OBSERVABILITY_BACKFILL,W as WebSocketClient,W as WebsocketClient,H as defineAgent,P as defineBroods,z as defineChannelRecord,Z as defineCron,q as defineDiscordChannel,D as defineGitHubChannel,K as defineHarness,N as definePancakeChannel,G as definePolicy,B as defineSandbox,j as defineSkill,T as defineSlackChannel,E as defineTelegramChannel,F as defineTool,U as defineWorkspace,_ as defineZaloChannel,w as env,h as envPlaceholder,Y as isBroodsConfig,X as isChannelDefinition,a as isObservabilityClientMessage,V as isResource,i as isRootSpanKind,M as normalizeHttpServiceUrl,v as readSseStream,I as resolveRunEvents,L as toWebSocketBaseUrl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "broods",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "CLI + TypeScript SDK for the broods agent platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,13 @@
|
|
|
33
33
|
"import": "./dist/account.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"typesVersions": {
|
|
37
|
+
"*": {
|
|
38
|
+
"account": [
|
|
39
|
+
"./dist/account.d.ts"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
36
43
|
"main": "./dist/index.js",
|
|
37
44
|
"types": "./dist/index.d.ts",
|
|
38
45
|
"files": [
|
|
@@ -41,9 +48,9 @@
|
|
|
41
48
|
"LICENSE.md"
|
|
42
49
|
],
|
|
43
50
|
"scripts": {
|
|
44
|
-
"build": "bun scripts/build.ts && rollup -c rollup.dts.config.mjs &&
|
|
51
|
+
"build": "bun scripts/build.ts && rollup -c rollup.dts.config.mjs && rm -rf .dts-temp",
|
|
45
52
|
"check": "tsc --noEmit",
|
|
46
|
-
"pack:check": "bun run build &&
|
|
53
|
+
"pack:check": "bun run build && publint && attw --pack .",
|
|
47
54
|
"test": "bun test"
|
|
48
55
|
},
|
|
49
56
|
"engines": {
|
|
@@ -57,14 +64,16 @@
|
|
|
57
64
|
},
|
|
58
65
|
"devDependencies": {
|
|
59
66
|
"@ai-sdk/tui": "^1.0.59",
|
|
60
|
-
"
|
|
67
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
61
68
|
"@chat-adapter/discord": "^4.35.0",
|
|
62
69
|
"@chat-adapter/github": "^4.35.0",
|
|
63
70
|
"@chat-adapter/slack": "^4.35.0",
|
|
64
71
|
"@chat-adapter/telegram": "^4.35.0",
|
|
65
72
|
"@types/bun": "^1.3.14",
|
|
73
|
+
"ai": "^7.0.58",
|
|
74
|
+
"publint": "^0.3.23",
|
|
66
75
|
"rollup": "^4.62.2",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
76
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
77
|
+
"typescript": "^6.0.3"
|
|
69
78
|
}
|
|
70
79
|
}
|