@standardagents/builder 0.36.2 → 0.37.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.
Files changed (37) hide show
  1. package/dist/built-in-routes.js +167 -131
  2. package/dist/built-in-routes.js.map +1 -1
  3. package/dist/client/{ApiKeysView-CxelZw61.js → ApiKeysView-CTfDKe47.js} +1 -1
  4. package/dist/client/{CenteredContentView-CeQNRQH8.js → CenteredContentView-BrVntknT.js} +1 -1
  5. package/dist/client/{CompositionView-YO0nHsYV.js → CompositionView-BT-1sFij.js} +1 -1
  6. package/dist/client/{ConfirmDialog.vue_vue_type_script_setup_true_lang-_Y_F2vcO.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-yyjbXnqu.js} +1 -1
  7. package/dist/client/{CopyButton.vue_vue_type_script_setup_true_lang-CtC06f6H.js → CopyButton.vue_vue_type_script_setup_true_lang-BWgZbcol.js} +1 -1
  8. package/dist/client/{DataTable.vue_vue_type_script_setup_true_lang-CqaWkS63.js → DataTable.vue_vue_type_script_setup_true_lang-DP_WTiEu.js} +1 -1
  9. package/dist/client/{JsonViewer-71rdOpyq.js → JsonViewer-DY4s92Td.js} +1 -1
  10. package/dist/client/{LoginView-CkDpPh8U.js → LoginView-DHYLpkb0.js} +1 -1
  11. package/dist/client/{MarketplaceView-UYrMBLon.js → MarketplaceView-Bcil0ES3.js} +1 -1
  12. package/dist/client/{Modal.vue_vue_type_script_setup_true_lang-B1HPGo8o.js → Modal.vue_vue_type_script_setup_true_lang-BJgJZ56X.js} +1 -1
  13. package/dist/client/{ModelModal.vue_vue_type_script_setup_true_lang-DejoTM9W.js → ModelModal.vue_vue_type_script_setup_true_lang-BXTP0K4Z.js} +1 -1
  14. package/dist/client/{ModelsView-DKYzp2fJ.js → ModelsView-_RY4gQ79.js} +1 -1
  15. package/dist/client/{PromptEditView-BlYHZ0ao.js → PromptEditView-D8kyGi30.js} +1 -1
  16. package/dist/client/{PromptModal-B1neRzSc.js → PromptModal-DSPIuleV.js} +1 -1
  17. package/dist/client/{PromptsView-C0Ez74j0.js → PromptsView-DPvBDPJf.js} +1 -1
  18. package/dist/client/{ProvidersView-CFc4K0IC.js → ProvidersView-PaPnME7I.js} +1 -1
  19. package/dist/client/{ThreadInspectorPane.vue_vue_type_script_setup_true_lang-CXbSQo2-.js → ThreadInspectorPane.vue_vue_type_script_setup_true_lang-BAUlrnb6.js} +14 -14
  20. package/dist/client/{ThreadsView-B1hFXL-4.js → ThreadsView-BW4SYvFN.js} +1 -1
  21. package/dist/client/{ToolsView-B3KqeOZD.js → ToolsView-xsIVTHh0.js} +1 -1
  22. package/dist/client/{UsersView-CF1tomjI.js → UsersView-CSXdBGA-.js} +1 -1
  23. package/dist/client/{VariablesView-CP0TDspK.js → VariablesView-Bl5S2ZDn.js} +1 -1
  24. package/dist/client/assets/{ThreadInspectorPane-2QOWOtet.css → ThreadInspectorPane-CnbmdCdH.css} +1 -1
  25. package/dist/client/{index-BTs3PMFs.js → index-Df4DTwgs.js} +2 -2
  26. package/dist/client/index.html +1 -1
  27. package/dist/{index-DUIfQjBW.d.ts → index-yV9JL4r3.d.ts} +17 -1
  28. package/dist/index.d.ts +60 -2
  29. package/dist/index.js +10015 -9557
  30. package/dist/index.js.map +1 -1
  31. package/dist/plugin.js +3 -0
  32. package/dist/plugin.js.map +1 -1
  33. package/dist/runtime.d.ts +68 -3
  34. package/dist/runtime.js +10013 -9558
  35. package/dist/runtime.js.map +1 -1
  36. package/dist/test.d.ts +1 -1
  37. package/package.json +5 -5
@@ -26,7 +26,7 @@
26
26
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
27
27
  <link rel="icon" type="image/svg+xml" href="/agents/assets/img/favicon-9uH1rb2F.svg">
28
28
  <title>AgentBuilder Admin</title>
29
- <script type="module" crossorigin src="/agents/index-BTs3PMFs.js"></script>
29
+ <script type="module" crossorigin src="/agents/index-Df4DTwgs.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="/agents/formkit-0eyyCEP_.js">
31
31
  <link rel="modulepreload" crossorigin href="/agents/vendor-TPZjEwCU.js">
32
32
  <link rel="modulepreload" crossorigin href="/agents/syntax-D-ZcovVx.js">
@@ -407,7 +407,7 @@ interface ThreadInstance {
407
407
  }>;
408
408
  hasBridge?(): Promise<boolean>;
409
409
  failPendingMessagesAndBroadcast?(): Promise<number>;
410
- settleTerminalFailure?(errorMessage: string): Promise<void>;
410
+ settleTerminalFailure?(errorMessage: string, threadId?: string): Promise<void>;
411
411
  notifyClientWaiting?(toolCallId: string, threadId: string, userId: string | null): Promise<void>;
412
412
  registerCodeExecutionBridge?(runId: string, bridge: {
413
413
  call(functionId: string, encodedArgs: unknown[]): Promise<unknown>;
@@ -1237,6 +1237,19 @@ interface LogDetails {
1237
1237
  */
1238
1238
  interface DurableThreadRpc {
1239
1239
  stop(): Promise<Response>;
1240
+ emergencyQuarantine?(input: {
1241
+ actionId: string;
1242
+ reason: string;
1243
+ source?: string;
1244
+ forensicHold?: boolean;
1245
+ observed?: Record<string, number>;
1246
+ }): Promise<unknown>;
1247
+ emergencyResume?(input: {
1248
+ actionId: string;
1249
+ reason: string;
1250
+ releaseForensicHold?: boolean;
1251
+ }): Promise<unknown>;
1252
+ getRuntimeSafetyStatus?(): Promise<unknown>;
1240
1253
  /** Newest non-empty user message on the thread, for thread-list previews. */
1241
1254
  getLatestUserMessagePreview(): Promise<string | null>;
1242
1255
  executeBlocking?(threadId: string, agentId: string, initial_messages?: unknown[], data?: unknown): Promise<{
@@ -1428,6 +1441,8 @@ interface ThreadRegistryEntry {
1428
1441
  executing?: boolean;
1429
1442
  /** Short excerpt of the most recent user message, for thread-list rows. */
1430
1443
  last_message_preview?: string | null;
1444
+ /** Unix seconds of the newest message on this thread (never bumped by background activity). */
1445
+ last_message_at?: number | null;
1431
1446
  }
1432
1447
  /**
1433
1448
  * RPC methods exposed by DurableAgentBuilder for external callers.
@@ -1640,6 +1655,7 @@ interface DurableAgentBuilderRpc {
1640
1655
  recordThreadActivity?(threadId: string, options?: {
1641
1656
  executing?: boolean;
1642
1657
  messagePreview?: string | null;
1658
+ messageAt?: number;
1643
1659
  }): Promise<void>;
1644
1660
  getThreadTreeIds?(threadId: string): Promise<string[]>;
1645
1661
  deleteThread(threadId: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ModelDefinition, AgentDefinition } from './runtime.js';
2
2
  export { AgentBuilderEnv, AuthContext, AuthUser, BroadcastOptions, CodeExecutionBridge, DurableAgentBuilder, DurableThread, DurableUserHub, FlowStateSdk, FlowStateWithSdk, HubClientInfo, ImageContextConfig, InjectMessageOptions, LLMProviderInterface, NamespaceResolutionError, PromptContent, PromptDefinition, PromptIncludePart, PromptPart, PromptToolConfig, Provider, ProviderContentPart, ProviderFilePart, ProviderImagePart, ProviderRegistry, ProviderTextPart, SessionToolBinding, SessionToolConfig, SideConfig, SubagentToolConfig, SubpromptConfig, ThreadRegistryEntry, ThreadWatchdog, ThreadWatchdogState, ToolConfig, UpdateThreadParams, User, WatchdogCheckin, WatchdogProbeResult, authenticate, buildImageDescription, cat, createNamespaceContext, emitThreadEvent, enhanceFlowState, exists, find, forceTurn, generateImageDescription, getFileStats, getMessages, getMessagesToSummarize, getShortName, getThumbnail, getUnsummarizedImageAttachments, getVisibleAgentNames, getVisibleModelNames, getVisiblePromptNames, getVisibleToolNames, grep, hasImageAttachments, head, injectMessage, isQualifiedName, linkFile, mkdir, move, optimizeImageContext, parseQualifiedName, qualifyName, queueTool, readFile, readdir, reloadHistory, rename, replaceImagesWithDescriptions, requireAdmin, requireAuth, resolveAgent, resolveHook, resolveModel, resolvePrompt, resolveTool, rmdir, stat, tail, unlink, updateThread, writeFile, writeImage } from './runtime.js';
3
3
  export { AgentPluginOptions, agentbuilder, builder } from './plugin.js';
4
- export { A as Agent, x as AttachmentRef, f as BuilderThreadEndpointHandler, C as CLIENT_STREAM_CHUNK_BYTES, o as ClientDuplex, p as ClientForwarding, m as ClientStreamRequest, n as ClientStreamResponse, k as ClientToolRequest, l as ClientToolResponse, B as Controller, a as ControllerContext, E as Env, w as FileRecord, y as FileStats, u as FlowResult, F as FlowState, G as GrepResult, D as ImageContentPart, I as ImageMetadata, L as LLMResponse, M as Message, J as MessageContent, H as MultimodalContent, R as RequestContext, S as StorageBackend, v as TelemetryEvent, z as TextContentPart, b as ThreadEndpointContext, e as ThreadEnv, q as ThreadInstance, r as ThreadMetadata, T as ToolCall, t as ToolResult, g as callClient, h as callClientStream, c as createThreadEndpointHandler, j as decodeStreamChunk, d as defineController, i as encodeStreamChunk, s as supportsClientForwarding } from './index-DUIfQjBW.js';
4
+ export { A as Agent, x as AttachmentRef, f as BuilderThreadEndpointHandler, C as CLIENT_STREAM_CHUNK_BYTES, o as ClientDuplex, p as ClientForwarding, m as ClientStreamRequest, n as ClientStreamResponse, k as ClientToolRequest, l as ClientToolResponse, B as Controller, a as ControllerContext, E as Env, w as FileRecord, y as FileStats, u as FlowResult, F as FlowState, G as GrepResult, D as ImageContentPart, I as ImageMetadata, L as LLMResponse, M as Message, J as MessageContent, H as MultimodalContent, R as RequestContext, S as StorageBackend, v as TelemetryEvent, z as TextContentPart, b as ThreadEndpointContext, e as ThreadEnv, q as ThreadInstance, r as ThreadMetadata, T as ToolCall, t as ToolResult, g as callClient, h as callClientStream, c as createThreadEndpointHandler, j as decodeStreamChunk, d as defineController, i as encodeStreamChunk, s as supportsClientForwarding } from './index-yV9JL4r3.js';
5
5
  export { AgentType, DefinitionLoader, GlobalNamespaceContext, HookSignatures, ImageContent, ModelCapabilities, ModelProvider, NamespaceContext, PackageSignature, PackedExports, PackedMeta, PackedMetadata, PackedNamespaceContext, PromptInput, PromptTextPart, ProviderAssistantMessage, ProviderConfigSlot, ProviderConfigSlots, ProviderConfigValueSource, ProviderDefinition, ProviderError, ProviderErrorCode, ProviderFactory, ProviderFactoryConfig, ProviderFinishReason, ProviderGeneratedImage, ProviderMessage, ProviderMessageContent, ProviderMethodOverrides, ModelCapabilities as ProviderModelCapabilities, ProviderOverride, ProviderOverrideContext, ProviderReasoningDetail, ProviderRequest, ProviderResponse, ProviderStreamChunk, ProviderSyncOverride, ProviderSystemMessage, ProviderTool, ProviderToolCallPart, ProviderToolMessage, ProviderToolResultContent, ProviderUsage, ProviderUserMessage, ReasoningConfig, StructuredPrompt, TextContent, Tool, ToolArgs, ToolArgsNode, ToolArgsRawShape, ToolContent, belongsToPackage, defineAgent, defineHook, defineModel, definePrompt, defineProvider, defineTool, isPacked, isVisibleInNamespace, mapReasoningLevel, providerConst, providerEnv, providerValue } from '@standardagents/spec';
6
6
  export { C as ConstituentItem, D as DiscoveredPackage, N as NamespacedRegistry, P as PackingAnalysis, a as PackingOptions, b as PackingResult, c as UnpackOptions, d as UnpackResult } from './types-Bpe7IANZ.js';
7
7
  export { D as DiscoveryConfig, P as PackageDiscoveryService, d as discoverPackages } from './discovery-DiMJWisl.js';
@@ -10,6 +10,64 @@ import 'vite';
10
10
  import '@cloudflare/workers-types';
11
11
  import 'zod';
12
12
 
13
+ /**
14
+ * The "visible terminal assistant" boundary, server side.
15
+ *
16
+ * A client's session-state reducer retires its provisional draft on exactly
17
+ * this class of record: a durable assistant message that is no longer pending,
18
+ * is not silent, and carries visible text. Unread state has to agree with that
19
+ * boundary — a thread is unread when a reply the user has not seen has landed,
20
+ * which is the same instant the draft stops being provisional. Anything the
21
+ * reducer refuses to treat as an answer must not stamp recency either:
22
+ *
23
+ * - Pending/streaming partials: the answer has not landed yet.
24
+ * - Empty assistant envelopes: interleaved-reasoning providers persist one at
25
+ * every reasoning/generation boundary mid-turn, and a tool-calling step
26
+ * persists one with tool_calls and no prose. Neither renders anywhere.
27
+ * - Reasoning-only records: reasoning lives in its own column and in content
28
+ * blocks that carry no `text`, so both flatten to an empty string here.
29
+ * - Silent rows: never rendered in any head.
30
+ *
31
+ * A FAILED record with visible text does stamp, matching the reducer: a
32
+ * terminal error message is a real, visible end state the user has not read.
33
+ * A failed record with no content is excluded by the empty-content rule.
34
+ *
35
+ * A record carrying TOOL CALLS is never terminal, no matter how much prose
36
+ * rides along with it: FlowEngine persists the step (content + tool_calls,
37
+ * status completed) BEFORE executing its tools, so a narrated preamble like
38
+ * "Let me check the repo…" is a mid-turn working step every client still
39
+ * renders under a Working indicator. Stamping it would re-mark the thread
40
+ * unread on every step of a narrated turn — the exact false-dot class this
41
+ * field exists to eliminate.
42
+ *
43
+ * Visibility is text OR attachments: an attachment-only reply (content null
44
+ * plus generated images) is a supported terminal answer shape that every head
45
+ * renders, so it must stamp even though its text flattens to empty.
46
+ */
47
+ declare function isVisibleTerminalAssistantMessage(message: Record<string, unknown> | null | undefined): boolean;
48
+ /**
49
+ * True when a column holding a JSON array (tool_calls, attachments) actually
50
+ * carries entries. Rows store these as JSON strings; in-memory records may
51
+ * hold real arrays. Unparseable non-empty strings count as present — failing
52
+ * toward "not terminal" for tool_calls is the safe direction, and attachments
53
+ * only reach here after the text check already failed.
54
+ */
55
+ declare function hasJsonArrayEntries(raw: unknown): boolean;
56
+ /**
57
+ * Visible text of a message record, matching the reducer's extractor: plain
58
+ * string content, or the concatenated `text` of content blocks. Blocks without
59
+ * a string `text` (reasoning, images, tool payloads) contribute nothing.
60
+ */
61
+ declare function assistantMessageText(content: unknown): string;
62
+ /**
63
+ * Unix SECONDS for a message record whose timestamps are stored in
64
+ * microseconds. Prefers the completion time over the creation time: a pending
65
+ * row is created when the request goes out, so `created_at` can precede the
66
+ * visible answer by the whole generation. Returns null when neither column
67
+ * holds a usable number, letting the registry fall back to its own clock.
68
+ */
69
+ declare function messageTimestampSeconds(message: Record<string, unknown> | null | undefined): number | null;
70
+
13
71
  /**
14
72
  * Options for generating a model file.
15
73
  */
@@ -157,4 +215,4 @@ declare function generatePromptFile(data: PromptFileData): string;
157
215
  */
158
216
  declare function generateAgentFile(data: AgentDefinition): string;
159
217
 
160
- export { AgentDefinition, ModelDefinition, generateAgentFile, generateModelFile, generatePromptFile };
218
+ export { AgentDefinition, ModelDefinition, assistantMessageText, generateAgentFile, generateModelFile, generatePromptFile, hasJsonArrayEntries, isVisibleTerminalAssistantMessage, messageTimestampSeconds };