@byfriends/sdk 0.2.0 → 0.2.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/index.d.mts +3 -0
- package/dist/index.mjs +18 -6
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1109,6 +1109,7 @@ declare const ByfConfigPatchSchema: z.ZodObject<{
|
|
|
1109
1109
|
}, z.core.$strip>>>;
|
|
1110
1110
|
env: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
1111
1111
|
customHeaders: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
1112
|
+
extraBody: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1112
1113
|
}, z.core.$strip>>>;
|
|
1113
1114
|
defaultProvider: z.ZodOptional<z.ZodString>;
|
|
1114
1115
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
@@ -1245,6 +1246,7 @@ declare const ByfConfigSchema: z.ZodObject<{
|
|
|
1245
1246
|
}, z.core.$strip>>;
|
|
1246
1247
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1247
1248
|
customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1249
|
+
extraBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1248
1250
|
}, z.core.$strip>>>;
|
|
1249
1251
|
defaultProvider: z.ZodOptional<z.ZodString>;
|
|
1250
1252
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
@@ -3678,6 +3680,7 @@ declare const ProviderConfigSchema: z.ZodObject<{
|
|
|
3678
3680
|
}, z.core.$strip>>;
|
|
3679
3681
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3680
3682
|
customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3683
|
+
extraBody: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3681
3684
|
}, z.core.$strip>;
|
|
3682
3685
|
|
|
3683
3686
|
declare class ProviderManager {
|
package/dist/index.mjs
CHANGED
|
@@ -66181,7 +66181,8 @@ const DEFAULT_MASKING_CONFIG = {
|
|
|
66181
66181
|
function getToolPriority(toolName) {
|
|
66182
66182
|
switch (toolName) {
|
|
66183
66183
|
case "Write":
|
|
66184
|
-
case "Edit":
|
|
66184
|
+
case "Edit":
|
|
66185
|
+
case "Agent": return "high";
|
|
66185
66186
|
case "Bash": return "medium";
|
|
66186
66187
|
case "Read":
|
|
66187
66188
|
case "Glob":
|
|
@@ -67182,7 +67183,7 @@ var ContextMemory = class {
|
|
|
67182
67183
|
}
|
|
67183
67184
|
case "tool.result": {
|
|
67184
67185
|
let result = event.result;
|
|
67185
|
-
if (!this.agent.records.restoring && this.scratchManager !== void 0 && typeof result.output === "string") {
|
|
67186
|
+
if (!this.agent.records.restoring && this.scratchManager !== void 0 && typeof result.output === "string" && (this.toolCallInfo.get(event.toolCallId)?.name ?? "unknown") !== "Agent") {
|
|
67186
67187
|
const offloadResult = await offloadOutput(event.toolCallId, this.toolCallInfo.get(event.toolCallId)?.name ?? "unknown", result, this.scratchManager, DEFAULT_OFFLOADING_CONFIG);
|
|
67187
67188
|
if (offloadResult.offloaded) {
|
|
67188
67189
|
result = {
|
|
@@ -84816,6 +84817,7 @@ const OAuthRefSchema = z.object({
|
|
|
84816
84817
|
key: z.string().min(1)
|
|
84817
84818
|
});
|
|
84818
84819
|
const StringRecordSchema = z.record(z.string(), z.string());
|
|
84820
|
+
const ExtraBodySchema = z.record(z.string(), z.unknown());
|
|
84819
84821
|
const ProviderConfigSchema = z.object({
|
|
84820
84822
|
type: ProviderTypeSchema,
|
|
84821
84823
|
apiKey: z.string().optional(),
|
|
@@ -84824,7 +84826,8 @@ const ProviderConfigSchema = z.object({
|
|
|
84824
84826
|
thinkingEffortKey: z.string().optional(),
|
|
84825
84827
|
oauth: OAuthRefSchema.optional(),
|
|
84826
84828
|
env: StringRecordSchema.optional(),
|
|
84827
|
-
customHeaders: StringRecordSchema.optional()
|
|
84829
|
+
customHeaders: StringRecordSchema.optional(),
|
|
84830
|
+
extraBody: ExtraBodySchema.optional()
|
|
84828
84831
|
});
|
|
84829
84832
|
const ModelAliasSchema = z.object({
|
|
84830
84833
|
provider: z.string(),
|
|
@@ -89018,6 +89021,11 @@ var summary_continuation_default = "Your previous response was too brief. Please
|
|
|
89018
89021
|
* agent receives a technically complete handoff.
|
|
89019
89022
|
*/
|
|
89020
89023
|
const SUMMARY_MIN_LENGTH = 200;
|
|
89024
|
+
/**
|
|
89025
|
+
* Soft upper bound (characters) communicated to the subagent via prompt so
|
|
89026
|
+
* it self-regulates summary length. Not enforced at runtime.
|
|
89027
|
+
*/
|
|
89028
|
+
const SUMMARY_MAX_LENGTH = 8e3;
|
|
89021
89029
|
const SUMMARY_CONTINUATION_ATTEMPTS = 1;
|
|
89022
89030
|
const HOOK_TEXT_PREVIEW_LENGTH = 500;
|
|
89023
89031
|
const SUBAGENT_MAX_TOKENS_ERROR = "Subagent turn failed before completing its final summary: reason=max_tokens";
|
|
@@ -89130,7 +89138,7 @@ var SessionSubagentHost = class {
|
|
|
89130
89138
|
options.signal.throwIfAborted();
|
|
89131
89139
|
await this.triggerSubagentStart(parent, profileName, options.prompt, options.signal);
|
|
89132
89140
|
options.signal.throwIfAborted();
|
|
89133
|
-
let childPrompt = options.prompt
|
|
89141
|
+
let childPrompt = `${`Summary length constraint: minimum ${SUMMARY_MIN_LENGTH} characters, maximum ${SUMMARY_MAX_LENGTH} characters.`}\n\n${options.prompt}`;
|
|
89134
89142
|
if (profileName === "explore") {
|
|
89135
89143
|
const gitContext = await collectGitContext(child.runtime.kaos, child.config.cwd);
|
|
89136
89144
|
if (gitContext) childPrompt = `${gitContext}\n\n${childPrompt}`;
|
|
@@ -103776,13 +103784,17 @@ function toKosongProviderConfig(provider, model, byfRequestHeaders, maxOutputSiz
|
|
|
103776
103784
|
...byfRequestHeaders,
|
|
103777
103785
|
...provider.customHeaders
|
|
103778
103786
|
};
|
|
103787
|
+
const generationKwargs = {
|
|
103788
|
+
prompt_cache_key: promptCacheKey,
|
|
103789
|
+
extra_body: provider.extraBody
|
|
103790
|
+
};
|
|
103779
103791
|
if (Object.keys(defaultHeaders).length === 0) return {
|
|
103780
103792
|
type: "openai-completions",
|
|
103781
103793
|
model,
|
|
103782
103794
|
baseUrl: providerValue(provider.baseUrl, provider.env, "BYF_BASE_URL"),
|
|
103783
103795
|
reasoningKey,
|
|
103784
103796
|
thinkingEffortKey: provider.thinkingEffortKey,
|
|
103785
|
-
generationKwargs
|
|
103797
|
+
generationKwargs,
|
|
103786
103798
|
apiKey: providerApiKey(provider)
|
|
103787
103799
|
};
|
|
103788
103800
|
return {
|
|
@@ -103791,7 +103803,7 @@ function toKosongProviderConfig(provider, model, byfRequestHeaders, maxOutputSiz
|
|
|
103791
103803
|
baseUrl: providerValue(provider.baseUrl, provider.env, "BYF_BASE_URL"),
|
|
103792
103804
|
reasoningKey,
|
|
103793
103805
|
thinkingEffortKey: provider.thinkingEffortKey,
|
|
103794
|
-
generationKwargs
|
|
103806
|
+
generationKwargs,
|
|
103795
103807
|
defaultHeaders,
|
|
103796
103808
|
apiKey: providerApiKey(provider)
|
|
103797
103809
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byfriends/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Public TypeScript SDK for BYF agents and sessions",
|
|
5
5
|
"license": "Proprietary",
|
|
6
6
|
"author": "ByronFinn",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/yazl": "^2.4.6",
|
|
52
|
-
"@byfriends/agent-core": "^0.2.
|
|
53
|
-
"@byfriends/
|
|
54
|
-
"@byfriends/
|
|
55
|
-
"@byfriends/kaos": "^0.2.
|
|
52
|
+
"@byfriends/agent-core": "^0.2.1",
|
|
53
|
+
"@byfriends/oauth": "^0.1.1",
|
|
54
|
+
"@byfriends/kosong": "^0.2.1",
|
|
55
|
+
"@byfriends/kaos": "^0.2.1"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown && pnpm run build:dts",
|