@tangle-network/sandbox 0.2.1 → 0.4.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.
@@ -383,13 +383,28 @@ declare class ResponsesValidationError extends Error {
383
383
  constructor(message: string, code: string, param?: string);
384
384
  }
385
385
  /**
386
- * Reject Responses requests that ask for tool types Tangle cannot
387
- * service. Function tools, the OpenAI computer-use preview tool, and
388
- * the code interpreter (every Tangle sandbox can run code) are
389
- * accepted; web_search and file_search are explicitly rejected with
390
- * the OpenAI error shape.
386
+ * Reject Responses requests that ask for unsupported tool types.
387
+ * Function tools, computer-use preview, code interpreter, and
388
+ * web_search/web_search_preview are accepted. file_search is rejected
389
+ * (no vector-store backend). Unknown types are rejected.
391
390
  */
392
391
  declare function validateResponsesRequest(req: ResponseCreateParamsBase): void;
392
+ interface TangleRouterResponsesWebSearchOptions {
393
+ provider?: string;
394
+ maxResults?: number;
395
+ maxTotalResults?: number;
396
+ searchContextSize?: "low" | "medium" | "high";
397
+ }
398
+ /**
399
+ * Tangle Router's `/v1/responses` supports web search through the
400
+ * OpenRouter-compatible server-tool marker. Native OpenAI Responses
401
+ * `web_search` / `web_search_preview` tools are not forwarded to OpenAI;
402
+ * the router uses this marker to run Tangle-billed search first, inject
403
+ * cited context, and strip the marker before the upstream Responses call.
404
+ */
405
+ declare function normalizeResponsesWebSearchForTangleRouter<T extends {
406
+ tools?: unknown;
407
+ }>(req: T, options?: TangleRouterResponsesWebSearchOptions): T;
393
408
  /**
394
409
  * Build a settled `Response` shell from an aggregated output + usage.
395
410
  * Caller fills in the runtime-specific fields (id, model, created_at,
@@ -639,4 +654,4 @@ declare function outcomeToFinishReason(outcome: string, hasToolCall: boolean): O
639
654
  */
640
655
  declare function openaiMessagesToSandboxInput(messages: ChatCompletionMessageParam[], tools: ChatCompletionTool[] | undefined, model: string): SandboxRunInput;
641
656
  //#endregion
642
- export { type ActionRateLimitOptions, type AfterHookOutcome, type AuditEvent, type AuditLogOptions, type BeforeHookOutcome, type BufferedToolCall, type CostCapOptions, type DestructiveActionGuardOptions, type EgressPolicyOptions, EmbeddingValidationError, HookChain, type HookSurface, InMemoryResponseStore, type MultimodalPart, type NormalizedEmbeddingInput, type NormalizedEmbeddingRequest, type OpenAIFinishReason, type PriorToolCall, type PriorToolResult, type PriorTurn, type RedactionRegion, type ResponseStore, ResponsesValidationError, Run, type RunEvent, type RunEventSource, type RunOptions, type RunStatus, type SandboxRunInput, type SandboxToolSpec, type ScreenshotRedactionOptions, type TangleSSEEvent, type ToolCallContext, type ToolOutput, type ToolResult, type TranslatorContext, actionRateLimitHook, assembleResponseOutput, auditLogHook, buildResponseShell, costCapHook, createTranslatorContext, destructiveActionGuardHook, egressPolicyHook, openaiMessagesToSandboxInput, outcomeToFinishReason, resolvePreviousResponseId, runEvents, sandboxEventToChatChunk, sandboxEventToCompletionChunk, sandboxEventToResponsesEvent, screenshotRedactionHook, usageFromEvents, validateEmbeddingRequest, validateResponsesRequest };
657
+ export { type ActionRateLimitOptions, type AfterHookOutcome, type AuditEvent, type AuditLogOptions, type BeforeHookOutcome, type BufferedToolCall, type CostCapOptions, type DestructiveActionGuardOptions, type EgressPolicyOptions, EmbeddingValidationError, HookChain, type HookSurface, InMemoryResponseStore, type MultimodalPart, type NormalizedEmbeddingInput, type NormalizedEmbeddingRequest, type OpenAIFinishReason, type PriorToolCall, type PriorToolResult, type PriorTurn, type RedactionRegion, type ResponseStore, ResponsesValidationError, Run, type RunEvent, type RunEventSource, type RunOptions, type RunStatus, type SandboxRunInput, type SandboxToolSpec, type ScreenshotRedactionOptions, type TangleRouterResponsesWebSearchOptions, type TangleSSEEvent, type ToolCallContext, type ToolOutput, type ToolResult, type TranslatorContext, actionRateLimitHook, assembleResponseOutput, auditLogHook, buildResponseShell, costCapHook, createTranslatorContext, destructiveActionGuardHook, egressPolicyHook, normalizeResponsesWebSearchForTangleRouter, openaiMessagesToSandboxInput, outcomeToFinishReason, resolvePreviousResponseId, runEvents, sandboxEventToChatChunk, sandboxEventToCompletionChunk, sandboxEventToResponsesEvent, screenshotRedactionHook, usageFromEvents, validateEmbeddingRequest, validateResponsesRequest };