@standardagents/builder 0.24.4 → 0.24.5
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/built-in-routes.js +20 -17
- package/dist/built-in-routes.js.map +1 -1
- package/dist/client/{ApiKeysView-1m7uIS8S.js → ApiKeysView-CmObAp7n.js} +1 -1
- package/dist/client/{CenteredContentView-DJzHRMGj.js → CenteredContentView-gJXa9UHE.js} +1 -1
- package/dist/client/{CompositionView-nzqzVKAg.js → CompositionView-BohQwGLE.js} +1 -1
- package/dist/client/{ConfirmDialog.vue_vue_type_script_setup_true_lang-YX8WE_iB.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-A1C0eTY7.js} +1 -1
- package/dist/client/{CopyButton.vue_vue_type_script_setup_true_lang-BpJt6BT0.js → CopyButton.vue_vue_type_script_setup_true_lang-D5q8qf4n.js} +1 -1
- package/dist/client/{DataTable.vue_vue_type_script_setup_true_lang-Dg3HMMJ0.js → DataTable.vue_vue_type_script_setup_true_lang-DzPpurCp.js} +1 -1
- package/dist/client/{JsonViewer-BdNA5OCG.js → JsonViewer-CKqMMqjU.js} +1 -1
- package/dist/client/{LoginView-BlF_2TtB.js → LoginView-BY2NMQQF.js} +1 -1
- package/dist/client/{MarketplaceView-DrlOb57k.js → MarketplaceView-DVEMUvDq.js} +1 -1
- package/dist/client/{Modal.vue_vue_type_script_setup_true_lang-hkOmEwrb.js → Modal.vue_vue_type_script_setup_true_lang-1t6cxO9H.js} +1 -1
- package/dist/client/{ModelModal.vue_vue_type_script_setup_true_lang-p3esoV-i.js → ModelModal.vue_vue_type_script_setup_true_lang-WFlATqyT.js} +1 -1
- package/dist/client/{ModelsView-CHBanMSH.js → ModelsView-_qZmXle8.js} +1 -1
- package/dist/client/{PromptEditView-b5B43l4Q.js → PromptEditView-DzY493YB.js} +1 -1
- package/dist/client/{PromptModal-BF5bdmNQ.js → PromptModal-BQYwnWKw.js} +1 -1
- package/dist/client/{PromptsView-6TfMOScI.js → PromptsView-DBiQ9X1g.js} +1 -1
- package/dist/client/{ProvidersView-CA5Yx2Fn.js → ProvidersView-DEH34_v0.js} +1 -1
- package/dist/client/{ThreadInspectorPane.vue_vue_type_script_setup_true_lang-ejyFhmNy.js → ThreadInspectorPane.vue_vue_type_script_setup_true_lang-Dtd1VFrj.js} +2 -2
- package/dist/client/{ThreadsView-yJpVmf42.js → ThreadsView-m1CAq3Aw.js} +1 -1
- package/dist/client/{ToolsView-DE1TDnlU.js → ToolsView-D-qvyctb.js} +1 -1
- package/dist/client/{UsersView-BXDHjJLB.js → UsersView-DaXRB61v.js} +1 -1
- package/dist/client/{VariablesView-Bz-CbaEv.js → VariablesView-DDomn-IB.js} +1 -1
- package/dist/client/assets/{ThreadInspectorPane-DLSVKyBu.css → ThreadInspectorPane-CjK6SKEi.css} +1 -1
- package/dist/client/{index-TIntu1KJ.js → index-DihZBCmQ.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{index-jDKWlMKG.d.ts → index-D7KMmRgr.d.ts} +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +55 -36
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +55 -36
- package/dist/runtime.js.map +1 -1
- package/dist/test.d.ts +1 -1
- package/package.json +5 -5
package/dist/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as ThreadEnv, A as Agent, h as ThreadMetadata, i as ToolResult, M as Message, l as FileRecord, F as FlowState, n as FileStats, G as GrepResult, m as AttachmentRef, r as MessageContent, E as Env, g as ThreadInstance } from './index-
|
|
2
|
-
export { f as BuilderThreadEndpointHandler, B as Controller, a as ControllerContext, j as FlowResult, p as ImageContentPart, I as ImageMetadata, L as LLMResponse, q as MultimodalContent, R as RequestContext, S as StorageBackend, k as TelemetryEvent, o as TextContentPart, b as ThreadEndpointContext, T as ToolCall, c as createThreadEndpointHandler, d as defineController } from './index-
|
|
1
|
+
import { e as ThreadEnv, A as Agent, h as ThreadMetadata, i as ToolResult, M as Message, l as FileRecord, F as FlowState, n as FileStats, G as GrepResult, m as AttachmentRef, r as MessageContent, E as Env, g as ThreadInstance } from './index-D7KMmRgr.js';
|
|
2
|
+
export { f as BuilderThreadEndpointHandler, B as Controller, a as ControllerContext, j as FlowResult, p as ImageContentPart, I as ImageMetadata, L as LLMResponse, q as MultimodalContent, R as RequestContext, S as StorageBackend, k as TelemetryEvent, o as TextContentPart, b as ThreadEndpointContext, T as ToolCall, c as createThreadEndpointHandler, d as defineController } from './index-D7KMmRgr.js';
|
|
3
3
|
import { CodeExecutionOptions, CodeExecutionResult, SubagentRegistryEntry, InjectMessageInput, QueueMessageInput, ClientToolRequest, ClientToolResponse, SkillMetadata, SkillFileInput, ModelDefinition as ModelDefinition$1, ToolArgs, PromptTextPart, PromptEnvPart, VariableDefinition, SubpromptConfig as SubpromptConfig$1, PromptToolConfig as PromptToolConfig$1, SubagentToolConfig as SubagentToolConfig$1, ReasoningConfig, SideConfig as SideConfig$1, LLMProviderInterface, ContentPart, TextPart, ImagePart, FilePart, NamespaceContext, DefinitionLoader } from '@standardagents/spec';
|
|
4
4
|
export { AgentType, DefinitionLoader, GlobalNamespaceContext, HookSignatures, ImageContent, ModelCapabilities, ModelProvider, NamespaceContext, PackageSignature, PackedExports, PackedMeta, PackedMetadata, PackedNamespaceContext, PromptInput, PromptTextPart, ProviderAssistantMessage, ProviderError, ProviderErrorCode, ProviderFactory, ProviderFactoryConfig, ProviderFinishReason, ProviderGeneratedImage, ProviderMessage, ProviderMessageContent, ModelCapabilities as ProviderModelCapabilities, ProviderReasoningDetail, ProviderRequest, ProviderResponse, ProviderStreamChunk, ProviderSystemMessage, ProviderTool, ProviderToolCallPart, ProviderToolMessage, ProviderToolResultContent, ProviderUsage, ProviderUserMessage, ReasoningConfig, StructuredPrompt, TextContent, Tool, ToolArgs, ToolArgsNode, ToolArgsRawShape, ToolContent, belongsToPackage, defineAgent, defineHook, defineModel, definePrompt, defineTool, isPacked, isVisibleInNamespace, mapReasoningLevel } from '@standardagents/spec';
|
|
5
5
|
import { DurableObject, WorkerEntrypoint } from 'cloudflare:workers';
|
|
@@ -846,6 +846,7 @@ declare class DurableThread<Env extends ThreadEnv = ThreadEnv> extends DurableOb
|
|
|
846
846
|
error: string | null;
|
|
847
847
|
error_type: string | null;
|
|
848
848
|
cost_input: number | null;
|
|
849
|
+
cost_cached: number | null;
|
|
849
850
|
cost_output: number | null;
|
|
850
851
|
cost_total: number | null;
|
|
851
852
|
message_history_length: number | null;
|
package/dist/runtime.js
CHANGED
|
@@ -236,14 +236,14 @@ function calculateUsageCost(usage, pricing) {
|
|
|
236
236
|
const inputPrice = useLongContext ? pricing.longInputPrice ?? pricing.inputPrice : pricing.inputPrice;
|
|
237
237
|
const outputPrice = useLongContext ? pricing.longOutputPrice ?? pricing.outputPrice : pricing.outputPrice;
|
|
238
238
|
const cachedTokenPrice = useLongContext ? pricing.longCachedPrice ?? pricing.cachedPrice ?? pricing.inputPrice : pricing.cachedPrice ?? pricing.inputPrice;
|
|
239
|
-
const costInput = roundCost(
|
|
240
|
-
|
|
241
|
-
);
|
|
239
|
+
const costInput = roundCost(uncachedPromptTokens * inputPrice / TOKENS_PER_MILLION);
|
|
240
|
+
const costCached = roundCost(cachedTokens * cachedTokenPrice / TOKENS_PER_MILLION);
|
|
242
241
|
const costOutput = roundCost(billableOutputTokens * outputPrice / TOKENS_PER_MILLION);
|
|
243
242
|
return {
|
|
244
243
|
costInput,
|
|
244
|
+
costCached,
|
|
245
245
|
costOutput,
|
|
246
|
-
costTotal: roundCost(costInput + costOutput)
|
|
246
|
+
costTotal: roundCost(costInput + costCached + costOutput)
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
var TOKENS_PER_MILLION;
|
|
@@ -2111,6 +2111,7 @@ var init_LLMRequest = __esm({
|
|
|
2111
2111
|
reasoning_tokens: response.usage.completion_tokens_details?.reasoning_tokens || 0,
|
|
2112
2112
|
total_tokens: response.usage.total_tokens,
|
|
2113
2113
|
cost_input: calculatedCost?.costInput,
|
|
2114
|
+
cost_cached: calculatedCost?.costCached,
|
|
2114
2115
|
cost_output: calculatedCost?.costOutput,
|
|
2115
2116
|
latency_ms: Date.now() - startTime,
|
|
2116
2117
|
time_to_first_token_ms: timing?.latencyMs ?? void 0,
|
|
@@ -2140,19 +2141,20 @@ var init_LLMRequest = __esm({
|
|
|
2140
2141
|
reasoning_tokens = ?5,
|
|
2141
2142
|
total_tokens = ?6,
|
|
2142
2143
|
cost_input = ?7,
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2144
|
+
cost_cached = ?8,
|
|
2145
|
+
cost_output = ?9,
|
|
2146
|
+
latency_ms = ?10,
|
|
2147
|
+
finish_reason = ?11,
|
|
2148
|
+
tools_called = ?12,
|
|
2149
|
+
cost_total = ?13,
|
|
2150
|
+
is_complete = ?14,
|
|
2151
|
+
reasoning_content = ?15,
|
|
2152
|
+
provider_tools = ?16,
|
|
2153
|
+
actual_provider = ?17,
|
|
2154
|
+
standard_agents_router_used = ?18,
|
|
2155
|
+
time_to_first_token_ms = ?19,
|
|
2156
|
+
generation_ms = ?20
|
|
2157
|
+
WHERE id = ?21
|
|
2156
2158
|
`,
|
|
2157
2159
|
logData.response_body,
|
|
2158
2160
|
logData.input_tokens,
|
|
@@ -2161,6 +2163,7 @@ var init_LLMRequest = __esm({
|
|
|
2161
2163
|
logData.reasoning_tokens,
|
|
2162
2164
|
logData.total_tokens,
|
|
2163
2165
|
logData.cost_input ?? null,
|
|
2166
|
+
logData.cost_cached ?? null,
|
|
2164
2167
|
logData.cost_output ?? null,
|
|
2165
2168
|
logData.latency_ms,
|
|
2166
2169
|
logData.finish_reason,
|
|
@@ -14671,8 +14674,23 @@ var migration31 = {
|
|
|
14671
14674
|
}
|
|
14672
14675
|
};
|
|
14673
14676
|
|
|
14677
|
+
// src/durable-objects/migrations/032_add_cost_cached.ts
|
|
14678
|
+
var migration32 = {
|
|
14679
|
+
version: 32,
|
|
14680
|
+
name: "add_cost_cached",
|
|
14681
|
+
async up(sql) {
|
|
14682
|
+
const tableInfo = sql.exec(`PRAGMA table_info(logs)`).toArray();
|
|
14683
|
+
const hasCostCached = tableInfo.some((col) => col.name === "cost_cached");
|
|
14684
|
+
if (!hasCostCached) {
|
|
14685
|
+
await sql.exec(`
|
|
14686
|
+
ALTER TABLE logs ADD COLUMN cost_cached REAL;
|
|
14687
|
+
`);
|
|
14688
|
+
}
|
|
14689
|
+
}
|
|
14690
|
+
};
|
|
14691
|
+
|
|
14674
14692
|
// src/durable-objects/migrations/index.ts
|
|
14675
|
-
var migrations = [migration, migration2, migration3, migration4, migration5, migration6, migration7, migration8, migration9, migration10, migration11, migration12, migration13, migration14, migration15, migration16, migration17, migration18, migration19, migration20, migration21, migration22, migration23, migration24, migration25, migration26, migration27, migration28, migration29, migration30, migration31];
|
|
14693
|
+
var migrations = [migration, migration2, migration3, migration4, migration5, migration6, migration7, migration8, migration9, migration10, migration11, migration12, migration13, migration14, migration15, migration16, migration17, migration18, migration19, migration20, migration21, migration22, migration23, migration24, migration25, migration26, migration27, migration28, migration29, migration30, migration31, migration32];
|
|
14676
14694
|
var LATEST_SCHEMA_VERSION = migrations.length;
|
|
14677
14695
|
|
|
14678
14696
|
// src/durable-objects/DurableThread.ts
|
|
@@ -16788,9 +16806,9 @@ var DurableThread = class _DurableThread extends DurableObject {
|
|
|
16788
16806
|
* Each migration is run in order, starting from the current version + 1.
|
|
16789
16807
|
*/
|
|
16790
16808
|
async runMigrations(fromVersion) {
|
|
16791
|
-
for (const
|
|
16792
|
-
if (
|
|
16793
|
-
await
|
|
16809
|
+
for (const migration43 of migrations) {
|
|
16810
|
+
if (migration43.version > fromVersion) {
|
|
16811
|
+
await migration43.up(this.ctx.storage.sql);
|
|
16794
16812
|
}
|
|
16795
16813
|
}
|
|
16796
16814
|
}
|
|
@@ -18506,7 +18524,7 @@ ${resultContent}${attachmentSummary}`;
|
|
|
18506
18524
|
l.request_body, l.request_headers, l.response_body, l.response_headers,
|
|
18507
18525
|
l.status_code, l.reasoning_content, l.input_tokens, l.cached_tokens, l.output_tokens,
|
|
18508
18526
|
l.reasoning_tokens, l.total_tokens, l.latency_ms, l.time_to_first_token_ms, l.generation_ms,
|
|
18509
|
-
l.finish_reason, l.error, l.error_type, l.cost_input, l.cost_output, l.cost_total,
|
|
18527
|
+
l.finish_reason, l.error, l.error_type, l.cost_input, l.cost_cached, l.cost_output, l.cost_total,
|
|
18510
18528
|
l.message_history_length, l.tools_available, l.prompt_name, l.tools_called,
|
|
18511
18529
|
l.queued_tools, l.provider_tools, l.parent_log_id, l.tools_schema, l.system_prompt,
|
|
18512
18530
|
l.errors, l.retry_of_log_id, l.tool_results, l.is_complete, l.created_at,
|
|
@@ -18596,6 +18614,7 @@ ${resultContent}${attachmentSummary}`;
|
|
|
18596
18614
|
error: row.error,
|
|
18597
18615
|
error_type: row.error_type,
|
|
18598
18616
|
cost_input: row.cost_input,
|
|
18617
|
+
cost_cached: row.cost_cached,
|
|
18599
18618
|
cost_output: row.cost_output,
|
|
18600
18619
|
cost_total: row.cost_total,
|
|
18601
18620
|
message_history_length: row.message_history_length,
|
|
@@ -20498,7 +20517,7 @@ ${resultContent}${attachmentSummary}`;
|
|
|
20498
20517
|
};
|
|
20499
20518
|
|
|
20500
20519
|
// src/durable-objects/agentbuilder-migrations/0001_initial.ts
|
|
20501
|
-
var
|
|
20520
|
+
var migration33 = {
|
|
20502
20521
|
version: 1,
|
|
20503
20522
|
async up(sql) {
|
|
20504
20523
|
sql.exec(`
|
|
@@ -20597,7 +20616,7 @@ var migration32 = {
|
|
|
20597
20616
|
};
|
|
20598
20617
|
|
|
20599
20618
|
// src/durable-objects/agentbuilder-migrations/0002_add_tenvs_properties.ts
|
|
20600
|
-
var
|
|
20619
|
+
var migration34 = {
|
|
20601
20620
|
version: 2,
|
|
20602
20621
|
async up(sql) {
|
|
20603
20622
|
sql.exec(`ALTER TABLE threads ADD COLUMN tenvs TEXT`);
|
|
@@ -20609,7 +20628,7 @@ var migration33 = {
|
|
|
20609
20628
|
};
|
|
20610
20629
|
|
|
20611
20630
|
// src/durable-objects/agentbuilder-migrations/0003_add_parent_and_terminated.ts
|
|
20612
|
-
var
|
|
20631
|
+
var migration35 = {
|
|
20613
20632
|
version: 3,
|
|
20614
20633
|
async up(sql) {
|
|
20615
20634
|
sql.exec(`ALTER TABLE threads ADD COLUMN parent TEXT REFERENCES threads(id)`);
|
|
@@ -20622,7 +20641,7 @@ var migration34 = {
|
|
|
20622
20641
|
};
|
|
20623
20642
|
|
|
20624
20643
|
// src/durable-objects/agentbuilder-migrations/0004_add_env_tables.ts
|
|
20625
|
-
var
|
|
20644
|
+
var migration36 = {
|
|
20626
20645
|
version: 4,
|
|
20627
20646
|
async up(sql) {
|
|
20628
20647
|
sql.exec(`ALTER TABLE threads ADD COLUMN env TEXT`);
|
|
@@ -20646,7 +20665,7 @@ var migration35 = {
|
|
|
20646
20665
|
};
|
|
20647
20666
|
|
|
20648
20667
|
// src/durable-objects/agentbuilder-migrations/0005_add_pending_subagent_env_requests.ts
|
|
20649
|
-
var
|
|
20668
|
+
var migration37 = {
|
|
20650
20669
|
version: 5,
|
|
20651
20670
|
async up(sql) {
|
|
20652
20671
|
sql.exec(`
|
|
@@ -20672,7 +20691,7 @@ var migration36 = {
|
|
|
20672
20691
|
};
|
|
20673
20692
|
|
|
20674
20693
|
// src/durable-objects/agentbuilder-migrations/0006_add_env_value_types.ts
|
|
20675
|
-
var
|
|
20694
|
+
var migration38 = {
|
|
20676
20695
|
version: 6,
|
|
20677
20696
|
async up(sql) {
|
|
20678
20697
|
sql.exec(
|
|
@@ -20687,7 +20706,7 @@ var migration37 = {
|
|
|
20687
20706
|
};
|
|
20688
20707
|
|
|
20689
20708
|
// src/durable-objects/agentbuilder-migrations/0007_platform_identity_replica.ts
|
|
20690
|
-
var
|
|
20709
|
+
var migration39 = {
|
|
20691
20710
|
version: 7,
|
|
20692
20711
|
async up(sql) {
|
|
20693
20712
|
sql.exec(`ALTER TABLE users ADD COLUMN platform_user_id TEXT`);
|
|
@@ -20716,7 +20735,7 @@ var migration38 = {
|
|
|
20716
20735
|
};
|
|
20717
20736
|
|
|
20718
20737
|
// src/durable-objects/agentbuilder-migrations/0008_add_skills.ts
|
|
20719
|
-
var
|
|
20738
|
+
var migration40 = {
|
|
20720
20739
|
version: 8,
|
|
20721
20740
|
async up(sql) {
|
|
20722
20741
|
sql.exec(`
|
|
@@ -20747,7 +20766,7 @@ var migration39 = {
|
|
|
20747
20766
|
};
|
|
20748
20767
|
|
|
20749
20768
|
// src/durable-objects/agentbuilder-migrations/0009_add_user_permissions.ts
|
|
20750
|
-
var
|
|
20769
|
+
var migration41 = {
|
|
20751
20770
|
version: 9,
|
|
20752
20771
|
async up(sql) {
|
|
20753
20772
|
sql.exec(`ALTER TABLE users ADD COLUMN permissions TEXT`);
|
|
@@ -20758,7 +20777,7 @@ var migration40 = {
|
|
|
20758
20777
|
};
|
|
20759
20778
|
|
|
20760
20779
|
// src/durable-objects/agentbuilder-migrations/0010_add_device_logins.ts
|
|
20761
|
-
var
|
|
20780
|
+
var migration42 = {
|
|
20762
20781
|
version: 10,
|
|
20763
20782
|
async up(sql) {
|
|
20764
20783
|
sql.exec(`
|
|
@@ -20778,7 +20797,7 @@ var migration41 = {
|
|
|
20778
20797
|
};
|
|
20779
20798
|
|
|
20780
20799
|
// src/durable-objects/agentbuilder-migrations/index.ts
|
|
20781
|
-
var migrations2 = [
|
|
20800
|
+
var migrations2 = [migration33, migration34, migration35, migration36, migration37, migration38, migration39, migration40, migration41, migration42];
|
|
20782
20801
|
var LATEST_SCHEMA_VERSION2 = 10;
|
|
20783
20802
|
|
|
20784
20803
|
// src/utils/crypto.ts
|
|
@@ -21541,9 +21560,9 @@ ${result ?? error ?? "No result content."}${attachmentSummary}`;
|
|
|
21541
21560
|
}
|
|
21542
21561
|
}
|
|
21543
21562
|
async runMigrations(fromVersion) {
|
|
21544
|
-
for (const
|
|
21545
|
-
if (
|
|
21546
|
-
await
|
|
21563
|
+
for (const migration43 of migrations2) {
|
|
21564
|
+
if (migration43.version > fromVersion) {
|
|
21565
|
+
await migration43.up(this.ctx.storage.sql);
|
|
21547
21566
|
}
|
|
21548
21567
|
}
|
|
21549
21568
|
}
|