zidane 5.13.11 → 5.13.13
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/{acp-HSVnQBfG.js → acp-CqXcM2Km.js} +7 -7
- package/dist/{acp-HSVnQBfG.js.map → acp-CqXcM2Km.js.map} +1 -1
- package/dist/acp-cli.js +6 -6
- package/dist/acp.d.ts +2 -2
- package/dist/acp.js +1 -1
- package/dist/{agent-w6htlFlx.d.ts → agent-NkKgz5Dh.d.ts} +38 -2
- package/dist/agent-NkKgz5Dh.d.ts.map +1 -0
- package/dist/{auth-nA0ZMTbM.js → auth-CGTf8v1_.js} +2 -2
- package/dist/{auth-nA0ZMTbM.js.map → auth-CGTf8v1_.js.map} +1 -1
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat.d.ts +6 -6
- package/dist/chat.js +3 -3
- package/dist/contexts/daytona.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +2 -2
- package/dist/{headless-0O6HMNBQ.js → headless-C6Idunwh.js} +6 -6
- package/dist/{headless-0O6HMNBQ.js.map → headless-C6Idunwh.js.map} +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{index-BH0lvT7N.d.ts → index-BFY7mcar.d.ts} +2 -2
- package/dist/{index-BH0lvT7N.d.ts.map → index-BFY7mcar.d.ts.map} +1 -1
- package/dist/{index-C4sPfyg6.d.ts → index-BgB_425D.d.ts} +43 -3
- package/dist/index-BgB_425D.d.ts.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +10 -10
- package/dist/{logger-MCqSKpby.d.ts → logger-LQmSBfD_.d.ts} +2 -2
- package/dist/{logger-MCqSKpby.d.ts.map → logger-LQmSBfD_.d.ts.map} +1 -1
- package/dist/{login-D5rb4IG8.js → login-DE-_d045.js} +2 -2
- package/dist/{login-D5rb4IG8.js.map → login-DE-_d045.js.map} +1 -1
- package/dist/{mcp-C_TIj91j.js → mcp-2OGi_NQu.js} +2 -2
- package/dist/{mcp-C_TIj91j.js.map → mcp-2OGi_NQu.js.map} +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{messages-DEsLGBB9.js → messages-U_87Z7GH.js} +2 -2
- package/dist/{messages-DEsLGBB9.js.map → messages-U_87Z7GH.js.map} +1 -1
- package/dist/output/stream-json.d.ts +2 -2
- package/dist/output/stream-json.js +1 -1
- package/dist/output/terminal.d.ts +2 -2
- package/dist/{presets-HDIxliiq.js → presets-eC4VwuHh.js} +2 -2
- package/dist/{presets-HDIxliiq.js.map → presets-eC4VwuHh.js.map} +1 -1
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/{providers-OBIysrMe.js → providers-DyMPTo51.js} +3 -3
- package/dist/{providers-OBIysrMe.js.map → providers-DyMPTo51.js.map} +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +2 -2
- package/dist/{read-state-DH2IuQHX.js → read-state-CLK9yVpm.js} +2 -2
- package/dist/{read-state-DH2IuQHX.js.map → read-state-CLK9yVpm.js.map} +1 -1
- package/dist/restate.d.ts +88 -3
- package/dist/restate.d.ts.map +1 -1
- package/dist/restate.js +185 -59
- package/dist/restate.js.map +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/{session-BDWZZaYa.js → session-DQ4bEncf.js} +2 -2
- package/dist/{session-BDWZZaYa.js.map → session-DQ4bEncf.js.map} +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/session.js +2 -2
- package/dist/skills.d.ts +2 -2
- package/dist/{tool-formatters-C7N1Pb1q.d.ts → tool-formatters-DvtGhbJN.d.ts} +2 -2
- package/dist/{tool-formatters-C7N1Pb1q.d.ts.map → tool-formatters-DvtGhbJN.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/{tools-DhzKzB1y.js → tools-BvATiiCO.js} +192 -54
- package/dist/tools-BvATiiCO.js.map +1 -0
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +3 -3
- package/dist/{transcript-anchors-Cycsq0w1.js → transcript-anchors-Cn1Unhn-.js} +7 -7
- package/dist/{transcript-anchors-Cycsq0w1.js.map → transcript-anchors-Cn1Unhn-.js.map} +1 -1
- package/dist/{transcript-anchors-CJsVfcaq.d.ts → transcript-anchors-DFmfOesU.d.ts} +4 -4
- package/dist/{transcript-anchors-CJsVfcaq.d.ts.map → transcript-anchors-DFmfOesU.d.ts.map} +1 -1
- package/dist/tui.d.ts +3 -3
- package/dist/tui.js +8 -8
- package/dist/{turn-operations-BtyfLdPi.d.ts → turn-operations-DWUN8cHo.d.ts} +3 -3
- package/dist/{turn-operations-BtyfLdPi.d.ts.map → turn-operations-DWUN8cHo.d.ts.map} +1 -1
- package/dist/{types-DxHDaqN7.js → types-CyVGdbia.js} +45 -2
- package/dist/{types-DxHDaqN7.js.map → types-CyVGdbia.js.map} +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/RESTATE.md +38 -11
- package/docs/RUN_IN_BACKGROUND.md +4 -6
- package/docs/SKILL.md +2 -1
- package/package.json +1 -1
- package/dist/agent-w6htlFlx.d.ts.map +0 -1
- package/dist/index-C4sPfyg6.d.ts.map +0 -1
- package/dist/tools-DhzKzB1y.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BgB_425D.d.ts","names":[],"sources":["../src/cache-telemetry.ts","../src/compact/messages.ts","../src/compact/prompt.ts","../src/compact/errors.ts","../src/compact/compact.ts","../src/compact/restore.ts","../src/compact/utils.ts","../src/run-summary.ts","../src/tools/edit.ts","../src/tools/glob.ts","../src/tools/grep.ts","../src/tools/interaction.ts","../src/tools/list-files.ts","../src/tools/multi-edit.ts","../src/tools/read-file.ts","../src/tools/shell.ts","../src/tools/shell-kill.ts","../src/tools/skills-read.ts","../src/tools/skills-run-script.ts","../src/tools/skills-use.ts","../src/tools/spawn.ts","../src/tools/tool-search.ts","../src/tools/truncate.ts","../src/tools/validation.ts","../src/tools/wait-task.ts","../src/tools/write-file.ts","../src/headless.ts","../src/eval.ts","../src/loop.ts","../src/loop-persistence.ts","../src/mcp/oauth-provider.ts","../src/mcp/login.ts","../src/mcp/oauth-callback.ts","../src/metrics.ts","../src/repeat-guard.ts","../src/stats.ts","../src/system-prompt.ts","../src/timeout.ts","../src/tracing.ts","../src/zod.ts","../src/presets/basic.ts","../src/presets/index.ts"],"mappings":";;;;;;;;;;;AA0EqD;AAIrD;;;;AAA8B;UA1Bb,sBAAA;EAqCuB;EAnCtC,UAAA;EAmCsC;EAjCtC,WAAA;EAuCO;EArCP,SAAA;EAqDA;EAnDA,UAAA;EAmDmB;EAjDnB,KAAA;EAwEqB;EAtErB,QAAA;EAsE+B;EApE/B,cAAA;AAAA;;UAIe,kBAAA;EAmFsE;EAjFrF,OAAA,WAAkB,kBAAA;EAiFoB;EA/EtC,OAAA,EAAS,QAAA,CAAS,OAAA,CAAQ,MAAA,CAAO,kBAAA;AAAA;AA+EoD;AAAA,KA3E3E,kBAAA;AAAA,UAWK,uBAAA;;;;;;EAMf,GAAA,IAAO,IAAA;EAoFD;;;;;EA9EN,OAAA;EAgFmB;AA2DrB;;;;;;;;EAjIE,mBAAA;AAAA;;;;;AAmIqC;;;;AC1NvC;;;;;iBD8GgB,OAAA,CAAQ,CAAS;;;;AC1GJ;AAE7B;;;iBD2HgB,uBAAA,CAAwB,OAAA,EAAS,aAAA,GAAgB,sBAAsB;;;;;;ACvHtD;AAiBjC;;iBD+HgB,mBAAA,CACd,IAAA,EAAM,sBAAA,EACN,IAAA,EAAM,sBAAA,GACL,kBAAA;;;;;;;;;;;;;AC9He;AAuElB;;;;;;;;AAAgF;AA8FhF;iBDoBgB,uBAAA,CACd,KAAA,EAAO,QAAA,CAAS,UAAA,GAChB,OAAA,GAAS,uBAAA;;;;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AtC3tCb;;;;;;;;iBuClCgB,eAAA,CAAgB,UAAA,EAAY,MAAA,oBAA0B,MAAM;;;;;;;;;;;;cCL/D,UAAA;SAA4F,OAAA;;;;;;;;;cAAA,QAAA;;;;;;;;;;AxCuCzG;;;;;;;;;;;;AAcgB;AAIhB;;;;;KyCzCY,MAAA,GAAS,IAAA,CAAK,OAAA,CAAQ,YAAA;;;;iBAKlB,YAAA,CAAa,MAAA,EAAQ,MAAA,GAAS,MAAM;;;;;;;;;AzCwCC;AAIrD;;;;AAA8B;AAW9B;;;;;;;;;AAsBqB;AAuBrB;;iByCtEgB,cAAA,CAAA,GAAkB,OAAA,EAAS,MAAA,KAAW,MAAM"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as EnsureToolResultPairingOptions, $n as ToolResultVideoContent, An as RepeatGuardToolMatcher, At as SchemaSanitizeOptions, B as Session, Bn as SpawnHookContext, Bt as classifyOpenAICompatError, Cn as PromptAudioPart, Cr as ContextMcpGroup, D as ReadStateEntry, Dn as PromptTextPart, Dt as TurnResult, E as ToolMap, En as PromptPart, Et as ToolSpec, F as SkillDiagnostic, Fn as SessionContentBlock, Ft as OpenRouterParams, Gn as ToolOutcome, Gt as LocalParams, H as SessionRun, Hn as ThinkingLevel, Ht as openaiCompat, I as SkillResource, In as SessionEndStatus, It as openrouter, J as createRemoteStore, Jn as ToolResultDocumentContent, K as loadSession, Kn as ToolResultAudioContent, Kt as local, L as SkillSource, Ln as SessionHookContext, Lt as OpenAICompatAuthHeader, M as resolveReadStateMap, Mn as ResolveContentRefBlock, Mt as SchemaSanitizeResult, N as ShellInterpolationApproval, Nn as RetryConfig, Nt as sanitizeToolSchema, O as ReadStateMap, On as PromptVideoPart, Ot as XaiParams, P as SkillConfig, Pn as RunHookMap, Pt as sanitizeToolSpecs, Q as createFileMapStore, Qn as ToolResultTextContent, Qt as baseten, R as SkillsConfig, Rn as SessionMessage, Rt as OpenAICompatHttpError, S as resultToString, Sn as OAuthRefreshHookContext, Sr as ContextItem, St as StreamOptions, T as ToolDef, Tn as PromptImagePart, Tr as ContextUsageSplit, Tt as ToolResult, U as SessionStore, Ut as OpenAIParams, V as SessionData, Vn as StreamHookContext, Vt as mapOAIFinishReason, W as createSession, Wn as ToolHookContext, Wt as openai, X as FileMapAdapter, Xn as ToolResultImageContent, Xt as cerebras, Y as createMemoryStore, Yn as ToolResultDocumentRefContent, Yt as CerebrasParams, Z as FileMapStoreOptions, Zn as ToolResultImageRefContent, Zt as BasetenParams, _n as DedupHasher, _r as ContextBreakdown, _t as toOpenAI, a as McpConnector, an as AgentBehavior, ar as AgentAbortedError, at as TOOL_USE_INTERRUPTED_MARKER, b as normalizeMcpBlocks, bn as McpToolHookContext, br as ContextCategoryId, bt as ProviderCapabilities, c as createAgent, cn as AgentStats, cr as AgentProviderError, ct as autoDetectAndConvert, d as DeactivationReason, dr as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, dt as ensureToolResultPairing, en as ArceeParams, er as TurnFinishReason, et as ORPHANED_TOOL_RESULT_MARKER, f as SkillActivationState, fn as CompactEndHookContext, fr as ClassifiedError, ft as filterUnresolvedToolUses, g as McpConnection, gr as toTypedError, gt as toAnthropic, h as ConnectMcpServersOptions, hn as CompactStartHookContext, hr as matchesContextExceeded, ht as remintDuplicateToolCallIds, i as AgentOptions, in as applyAnthropicCacheBreakpoints, ir as toolResultToText, it as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, j as readStateKey, jn as ResolveContentRef, jt as SchemaSanitizeProfile, k as getReadState, kn as RepeatGuardConfig, kt as xai, l as ActivationVia, ln as AutoCompact, lr as AgentToolNotAllowedError, lt as detectTurnInterruption, m as createSkillActivationState, mn as CompactHookContext, mr as errorMessage, mt as fromOpenAI, n as AgentHookMap, nn as AnthropicParams, nr as toolOutputBudgetByteLength, nt as PairingRepairMode, o as McpToolMeta, or as AgentBudgetExceededError, ot as ToWireMessagesOptions, p as SkillActivationStateOptions, pn as CompactFunction, pr as ClassifiedErrorKind, pt as fromAnthropic, q as RemoteStoreOptions, qn as ToolResultContent, r as AgentHooks, rn as anthropic, rr as toolOutputByteLength, rt as RemintResult, s as McpToolWrap, sn as AgentRunOptions, sr as AgentContextExceededError, st as TurnInterruptionState, t as Agent, tn as arcee, tr as TurnUsage, tt as PairingRepair, u as ActiveSkill, un as AutoCompactConfig, ur as AgentToolPairingError, ut as ensureEndsWithUserMessage, v as connectMcpServers, vn as DedupToolConfig, vr as ContextBreakdownOptions, vt as toWireMessages, w as ToolContext, wn as PromptDocumentPart, wr as ContextSnapshot, wt as ToolCall, x as normalizeMcpServers, xr as ContextExactCounts, xt as StreamCallbacks, yn as McpServerConfig, yr as ContextCategory, yt as Provider, z as CreateSessionOptions, zn as SessionTurn, zt as OpenAICompatParams } from "./agent-
|
|
1
|
+
import { $ as EnsureToolResultPairingOptions, $n as ToolResultVideoContent, An as RepeatGuardToolMatcher, At as SchemaSanitizeOptions, B as Session, Bn as SpawnHookContext, Bt as classifyOpenAICompatError, Cn as PromptAudioPart, Cr as ContextMcpGroup, D as ReadStateEntry, Dn as PromptTextPart, Dt as TurnResult, E as ToolMap, En as PromptPart, Et as ToolSpec, F as SkillDiagnostic, Fn as SessionContentBlock, Ft as OpenRouterParams, Gn as ToolOutcome, Gt as LocalParams, H as SessionRun, Hn as ThinkingLevel, Ht as openaiCompat, I as SkillResource, In as SessionEndStatus, It as openrouter, J as createRemoteStore, Jn as ToolResultDocumentContent, K as loadSession, Kn as ToolResultAudioContent, Kt as local, L as SkillSource, Ln as SessionHookContext, Lt as OpenAICompatAuthHeader, M as resolveReadStateMap, Mn as ResolveContentRefBlock, Mt as SchemaSanitizeResult, N as ShellInterpolationApproval, Nn as RetryConfig, Nt as sanitizeToolSchema, O as ReadStateMap, On as PromptVideoPart, Ot as XaiParams, P as SkillConfig, Pn as RunHookMap, Pt as sanitizeToolSpecs, Q as createFileMapStore, Qn as ToolResultTextContent, Qt as baseten, R as SkillsConfig, Rn as SessionMessage, Rt as OpenAICompatHttpError, S as resultToString, Sn as OAuthRefreshHookContext, Sr as ContextItem, St as StreamOptions, T as ToolDef, Tn as PromptImagePart, Tr as ContextUsageSplit, Tt as ToolResult, U as SessionStore, Ut as OpenAIParams, V as SessionData, Vn as StreamHookContext, Vt as mapOAIFinishReason, W as createSession, Wn as ToolHookContext, Wt as openai, X as FileMapAdapter, Xn as ToolResultImageContent, Xt as cerebras, Y as createMemoryStore, Yn as ToolResultDocumentRefContent, Yt as CerebrasParams, Z as FileMapStoreOptions, Zn as ToolResultImageRefContent, Zt as BasetenParams, _n as DedupHasher, _r as ContextBreakdown, _t as toOpenAI, a as McpConnector, an as AgentBehavior, ar as AgentAbortedError, at as TOOL_USE_INTERRUPTED_MARKER, b as normalizeMcpBlocks, bn as McpToolHookContext, br as ContextCategoryId, bt as ProviderCapabilities, c as createAgent, cn as AgentStats, cr as AgentProviderError, ct as autoDetectAndConvert, d as DeactivationReason, dr as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, dt as ensureToolResultPairing, en as ArceeParams, er as TurnFinishReason, et as ORPHANED_TOOL_RESULT_MARKER, f as SkillActivationState, fn as CompactEndHookContext, fr as ClassifiedError, ft as filterUnresolvedToolUses, g as McpConnection, gr as toTypedError, gt as toAnthropic, h as ConnectMcpServersOptions, hn as CompactStartHookContext, hr as matchesContextExceeded, ht as remintDuplicateToolCallIds, i as AgentOptions, in as applyAnthropicCacheBreakpoints, ir as toolResultToText, it as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, j as readStateKey, jn as ResolveContentRef, jt as SchemaSanitizeProfile, k as getReadState, kn as RepeatGuardConfig, kt as xai, l as ActivationVia, ln as AutoCompact, lr as AgentToolNotAllowedError, lt as detectTurnInterruption, m as createSkillActivationState, mn as CompactHookContext, mr as errorMessage, mt as fromOpenAI, n as AgentHookMap, nn as AnthropicParams, nr as toolOutputBudgetByteLength, nt as PairingRepairMode, o as McpToolMeta, or as AgentBudgetExceededError, ot as ToWireMessagesOptions, p as SkillActivationStateOptions, pn as CompactFunction, pr as ClassifiedErrorKind, pt as fromAnthropic, q as RemoteStoreOptions, qn as ToolResultContent, r as AgentHooks, rn as anthropic, rr as toolOutputByteLength, rt as RemintResult, s as McpToolWrap, sn as AgentRunOptions, sr as AgentContextExceededError, st as TurnInterruptionState, t as Agent, tn as arcee, tr as TurnUsage, tt as PairingRepair, u as ActiveSkill, un as AutoCompactConfig, ur as AgentToolPairingError, ut as ensureEndsWithUserMessage, v as connectMcpServers, vn as DedupToolConfig, vr as ContextBreakdownOptions, vt as toWireMessages, w as ToolContext, wn as PromptDocumentPart, wr as ContextSnapshot, wt as ToolCall, x as normalizeMcpServers, xr as ContextExactCounts, xt as StreamCallbacks, yn as McpServerConfig, yr as ContextCategory, yt as Provider, z as CreateSessionOptions, zn as SessionTurn, zt as OpenAICompatParams } from "./agent-NkKgz5Dh.js";
|
|
2
2
|
import { _ as TaskStallInfo, a as ContextType, c as ExecutionContext, d as ListFilesEntry, f as ListFilesOptions, g as TaskHandle, h as TaskExitInfo, i as ContextMount, l as ExecutionHandle, m as TaskEntry, n as ContextCapabilities, o as DetachedTasksCapability, p as SpawnConfig, r as ContextHardening, s as ExecResult, t as BackgroundTaskStatus, u as ListFileMetadata, v as resolveDetachedTasksCapability } from "./types-Bs2oY7Ux.js";
|
|
3
3
|
import { n as createSandboxContext, r as createProcessContext, t as SandboxProvider } from "./index-CF15aqlk.js";
|
|
4
|
-
import { $ as PERSISTED_STUB_PREFIX, $r as
|
|
4
|
+
import { $ as PERSISTED_STUB_PREFIX, $r as compactConversation, $t as buildEvalRunSummary, A as stableStringify, An as HeadlessOptions, Ar as RunSummaryBudget, At as EvalRunSummary, B as OAuthCallbackHandle, Br as estimateTokens, Bt as EvalWorkspaceSnapshot, C as splitSystemPrompt, Ci as CacheDimensionDiff, Cn as relativeArtifactPath, Cr as InteractionToolOptions, Ct as EvalDefinition, D as defaultRepeatGuardNormalize, Di as fnv1a32, Dr as edit, Dt as EvalRunMetricAggregate, E as statsByModel, Ei as diffCacheDimensions, Er as glob, Et as EvalMetricError, F as MetricAttributes, Fr as RunSummaryRepeatGuard, Ft as EvalScorerContext, G as LoginMcpServerResult, Gn as runHeadless, Gr as buildPostCompactAttachments, Gt as MetricSpecMap, H as OAuthCallbackResult, Hn as headlessEventToJsonl, Hr as PostCompactAttachments, Ht as MetricDirection, I as MetricsHookSet, In as OpenAIChatMessage, Ir as RunSummaryTokens, It as EvalTestRunner, J as McpCredentialStore, Jr as selectRecentFiles, Jt as ReusableExecutionContext, K as loginMcpServer, Kn as transcriptToOpenAIMessages, Kr as selectFilesFromReadState, Kt as MetricStats, L as MetricsHooksOptions, Lr as RunSummaryValidation, Lt as EvalVariantSummary, M as Histogram, Mn as HeadlessResult, Mr as RunSummaryCollector, Mt as EvalRunUsage, N as InstrumentOptions, Nn as HeadlessStatus, Nr as RunSummaryCollectorOptions, Nt as EvalScore, O as defaultRepeatGuardTracked, Oi as installCacheBreakLogger, On as HeadlessErrorInfo, Or as RunSummary, Ot as EvalRunReporter, P as Meter, Pn as HeadlessUsage, Pr as RunSummaryError, Pt as EvalScorer, Q as hasAuthorizationHeader, Qn as validateToolArgs, Qr as CompactStartEvent, Qt as artifactPath, R as UpDownCounter, Rr as createRunSummaryCollector, Rt as EvalWorkspaceFile, S as replaceDynamicSection, Si as CacheBreakLoggerOptions, Sn as registerEvalTests, St as EvalCaseResult, T as flattenTurns, Ti as CacheDimensionSnapshot, Tn as statusCompleted, Tr as grep, Tt as EvalMetric, U as startOAuthCallback, Ur as PostCompactRestoreOptions, Ut as MetricEmitter, V as OAuthCallbackOptions, Vr as utf8ByteLength, Vt as LlmJudgeOptions, W as LoginMcpServerOptions, Wr as RecentFile, Wt as MetricSpec, X as McpOAuthProviderOptions, Xn as waitTask, Xr as CompactOptions, Xt as TrajectoryStep, Y as McpOAuthProvider, Yr as CompactEndEvent, Yt as Trajectory, Z as createMemoryMcpCredentialStore, Zn as ValidationResult, Zr as CompactResult, Zt as TrajectoryStepKind, _ as appendDynamicSection, _i as anchorPreviewFor, _n as formatEvalRunSummary, _r as CreateShellToolOptions, _t as EvalAgentRunResult, a as basicTools, ai as CompactPromptOptions, an as createEvalRunReporter, ar as SpawnToolOptions, at as maybePersistToolResult, b as joinSystemPrompt, bi as summaryToTurn, bn as llmJudge, bt as EvalArtifacts, c as Span, ci as buildCompactPrompt, cn as defineMetrics, cr as SubagentRegistry, ct as INTERRUPT_MESSAGE_FOR_TOOL_USE, d as TracingHookSet, di as buildTailCompactPrompt, dn as fileContains, dr as createSkillsUseTool, dt as TOOL_USE_SKIPPED_MESSAGE, ei as CompactInvalidInputError, en as buildRegisteredEvals, et as PERSISTENCE_PREVIEW_BYTES, f as TracingHooksOptions, fi as buildUpToCompactPrompt, fn as fileContentQuality, fr as SkillsRunScriptToolOptions, ft as CreateEvalAgentOptions, g as SystemPromptParts, gi as SummaryToTurnInput, gn as formatEvalCaseSummary, gt as EvalAgentRunOptions, h as SYSTEM_PROMPT_BOUNDARY, hi as CompactionSlice, hn as finalizeEvalMetrics, hr as createSkillsReadTool, ht as EvalAgentMcpServers, i as _default, ii as CompactPromptBuilder, in as createEvalAgent, ir as ChildAgent, it as cleanupPersistedSession, j as Counter, jr as RunSummaryByModel, jt as EvalRunSummaryCase, k as normalizeShellCommand, ki as snapshotCacheDimensions, kn as HeadlessEvent, kr as RunSummaryBlock, kt as EvalRunReporterOptions, l as StartSpan, li as buildFromCompactPrompt, ln as efficiencyMetricValues, lr as createSpawnTool, lt as SHELL_CASCADE_CANCEL_MESSAGE, m as OperationTimeoutError, mi as CompactScope, mn as fileExistsOneOf, mr as SkillsReadToolOptions, mt as EvalAgent, ni as BASE_INSTRUCTIONS, nn as clearRegisteredEvals, nt as PersistOutcome, o as zodToJsonSchema, oi as NO_TOOLS_PREAMBLE, on as createReusableExecutionContext, or as SpawnToolState, ot as resolvePersistDir, p as createTracingHooks, pi as ANCHOR_PREVIEW_MAX_CHARS, pn as fileExists, pr as createSkillsRunScriptTool, pt as EFFICIENCY_METRICS, q as McpCredentialEntry, qr as selectFilesFromSession, qt as RegisterEvalTestsOptions, r as definePreset, ri as CompactDirection, rn as computeEvalTagScores, rt as buildPersistedStub, s as GEN_AI_ATTRIBUTES, si as TRAILER, sn as defineEval, sr as SubagentDef, st as resolveTasksDir, t as Preset, ti as CompactPromptTooLongError, tn as buildTrajectory, tt as PersistInput, u as TracingConventions, ui as buildFullCompactPrompt, un as emitEfficiencyMetrics, ur as SkillsUseToolOptions, ut as TOOL_USE_CANCELLED_MESSAGE, v as appendStaticSection, vi as sliceForCompaction, vn as formatTrajectoryLine, vr as createShellTool, vt as EvalAgentRunStats, w as ModelUsage, wi as CacheDimensionName, wn as runEvalCase, wr as createInteractionTool, wt as EvalDefinitionContext, x as renderSystemForWire, xi as truncateHeadForPtlRetry, xn as normalizeMetric, xr as multiEdit, xt as EvalCaseOptions, y as hasSystemPromptBoundary, yi as stripImagesFromTurns, yn as functionalityMetric, yt as EvalAgentStats, z as createMetricsHooks, zr as BYTES_PER_TOKEN, zt as EvalWorkspaceOptions } from "./index-BgB_425D.js";
|
|
5
5
|
import { a as effectiveContextWindow, i as OUTPUT_RESERVE_TOKENS, n as AutoCompactDecision, o as shouldAutoCompact, r as AutoCompactInput, t as AUTO_COMPACT_MIN_GROWTH_FRACTION } from "./policy-DcGlpaNs.js";
|
|
6
|
-
import { a as Logger, c as consoleSink, d as jsonSink, i as LogSink, l as createLogger, n as LogLevel, o as LoggingHookSet, r as LogRecord, s as LoggingHooksOptions, t as ConsoleSinkOptions, u as createLoggingHooks } from "./logger-
|
|
7
|
-
import { C as buildCatalog, S as parseSkillFile, T as installAllowedToolsGate, _ as SourcedScanPath, a as SkillValidationResult, c as parseAllowedToolPattern, d as validateSkillForWrite, f as validateSkillName, g as stripShellInterpolations, h as interpolateShellCommands, i as SkillValidationIssue, l as validateResourcePath, m as InterpolateShellCommandsOptions, n as writeSkillToDisk, o as isToolAllowedByUnion, p as resolveSkills, r as writeSkillsToDisk, s as matchesAllowedTool, t as defineSkill, u as validateResourcePathReal, v as discoverSkills, w as IMPLICITLY_ALLOWED_SKILL_TOOLS } from "./index-
|
|
6
|
+
import { a as Logger, c as consoleSink, d as jsonSink, i as LogSink, l as createLogger, n as LogLevel, o as LoggingHookSet, r as LogRecord, s as LoggingHooksOptions, t as ConsoleSinkOptions, u as createLoggingHooks } from "./logger-LQmSBfD_.js";
|
|
7
|
+
import { C as buildCatalog, S as parseSkillFile, T as installAllowedToolsGate, _ as SourcedScanPath, a as SkillValidationResult, c as parseAllowedToolPattern, d as validateSkillForWrite, f as validateSkillName, g as stripShellInterpolations, h as interpolateShellCommands, i as SkillValidationIssue, l as validateResourcePath, m as InterpolateShellCommandsOptions, n as writeSkillToDisk, o as isToolAllowedByUnion, p as resolveSkills, r as writeSkillsToDisk, s as matchesAllowedTool, t as defineSkill, u as validateResourcePathReal, v as discoverSkills, w as IMPLICITLY_ALLOWED_SKILL_TOOLS } from "./index-BFY7mcar.js";
|
|
8
8
|
export { ANCHOR_PREVIEW_MAX_CHARS, AUTO_COMPACT_MIN_GROWTH_FRACTION, type ActivationVia, type ActiveSkill, type Agent, AgentAbortedError, type AgentBehavior, AgentBudgetExceededError, AgentContextExceededError, type AgentHookMap, type AgentHooks, type AgentOptions, AgentProviderError, type AgentRunOptions, type AgentStats, AgentToolNotAllowedError, AgentToolPairingError, type AnthropicParams, type ArceeParams, type AutoCompact, type AutoCompactConfig, type AutoCompactDecision, type AutoCompactInput, BASE_INSTRUCTIONS, BYTES_PER_TOKEN, type BackgroundTaskStatus, type BasetenParams, CONTEXT_EXCEEDED_MESSAGE_PATTERNS, type CacheBreakLoggerOptions, type CacheDimensionDiff, type CacheDimensionName, type CacheDimensionSnapshot, type CerebrasParams, type ChildAgent, type ClassifiedError, type ClassifiedErrorKind, type CompactDirection, type CompactEndEvent, type CompactEndHookContext, type CompactFunction, type CompactHookContext, CompactInvalidInputError, type CompactOptions, type CompactPromptBuilder, type CompactPromptOptions, CompactPromptTooLongError, type CompactResult, type CompactScope, type CompactStartEvent, type CompactStartHookContext, type CompactionSlice, type ConnectMcpServersOptions, type ConsoleSinkOptions, type ContextBreakdown, type ContextBreakdownOptions, type ContextCapabilities, type ContextCategory, type ContextCategoryId, type ContextExactCounts, type ContextHardening, type ContextItem, type ContextMcpGroup, type ContextMount, type ContextSnapshot, type ContextType, type ContextUsageSplit, type Counter, type CreateEvalAgentOptions, type CreateSessionOptions, type CreateShellToolOptions, type DeactivationReason, type DedupHasher, type DedupToolConfig, type DetachedTasksCapability, EFFICIENCY_METRICS, type EnsureToolResultPairingOptions, type EvalAgent, type EvalAgentMcpServers, type EvalAgentRunOptions, type EvalAgentRunResult, type EvalAgentRunStats, type EvalAgentStats, type EvalArtifacts, type EvalCaseOptions, type EvalCaseResult, type EvalDefinition, type EvalDefinitionContext, type EvalMetric, EvalMetricError, type EvalRunMetricAggregate, type EvalRunReporter, type EvalRunReporterOptions, type EvalRunSummary, type EvalRunSummaryCase, type EvalRunUsage, type EvalScore, type EvalScorer, type EvalScorerContext, type EvalTestRunner, type EvalVariantSummary, type EvalWorkspaceFile, type EvalWorkspaceOptions, type EvalWorkspaceSnapshot, type ExecResult, type ExecutionContext, type ExecutionHandle, type FileMapAdapter, type FileMapStoreOptions, GEN_AI_ATTRIBUTES, type HeadlessErrorInfo, type HeadlessEvent, type HeadlessOptions, type HeadlessResult, type HeadlessStatus, type HeadlessUsage, type Histogram, IMPLICITLY_ALLOWED_SKILL_TOOLS, INTERRUPT_MESSAGE_FOR_TOOL_USE, type InstrumentOptions, type InteractionToolOptions, type InterpolateShellCommandsOptions, type ListFileMetadata, type ListFilesEntry, type ListFilesOptions, type LlmJudgeOptions, type LocalParams, type LogLevel, type LogRecord, type LogSink, type Logger, type LoggingHookSet, type LoggingHooksOptions, type LoginMcpServerOptions, type LoginMcpServerResult, type McpConnection, type McpConnector, type McpCredentialEntry, type McpCredentialStore, McpOAuthProvider, type McpOAuthProviderOptions, type McpServerConfig, type McpToolHookContext, type McpToolMeta, type McpToolWrap, type Meter, type MetricAttributes, type MetricDirection, type MetricEmitter, type MetricSpec, type MetricSpecMap, type MetricStats, type MetricsHookSet, type MetricsHooksOptions, type ModelUsage, NO_TOOLS_PREAMBLE, type OAuthCallbackHandle, type OAuthCallbackOptions, type OAuthCallbackResult, type OAuthRefreshHookContext, ORPHANED_TOOL_RESULT_MARKER, OUTPUT_RESERVE_TOKENS, type OpenAIChatMessage, type OpenAICompatAuthHeader, OpenAICompatHttpError, type OpenAICompatParams, type OpenAIParams, type OpenRouterParams, OperationTimeoutError, PERSISTED_STUB_PREFIX, PERSISTENCE_PREVIEW_BYTES, type PairingRepair, type PairingRepairMode, type PersistInput, type PersistOutcome, type PostCompactAttachments, type PostCompactRestoreOptions, type Preset, type PromptAudioPart, type PromptDocumentPart, type PromptImagePart, type PromptPart, type PromptTextPart, type PromptVideoPart, type Provider, type ProviderCapabilities, type ReadStateEntry, type ReadStateMap, type RecentFile, type RegisterEvalTestsOptions, type RemintResult, type RemoteStoreOptions, type RepeatGuardConfig, type RepeatGuardToolMatcher, type ResolveContentRef, type ResolveContentRefBlock, type RetryConfig, type ReusableExecutionContext, type RunHookMap, type RunSummary, type RunSummaryBlock, type RunSummaryBudget, type RunSummaryByModel, type RunSummaryCollector, type RunSummaryCollectorOptions, type RunSummaryError, type RunSummaryRepeatGuard, type RunSummaryTokens, type RunSummaryValidation, SHELL_CASCADE_CANCEL_MESSAGE, SYNTHETIC_TOOL_RESULT_PLACEHOLDER, SYSTEM_PROMPT_BOUNDARY, type SandboxProvider, type SchemaSanitizeOptions, type SchemaSanitizeProfile, type SchemaSanitizeResult, type Session, type SessionContentBlock, type SessionData, type SessionEndStatus, type SessionHookContext, type SessionMessage, type SessionRun, type SessionStore, type SessionTurn, type ShellInterpolationApproval, type SkillActivationState, type SkillActivationStateOptions, type SkillConfig, type SkillDiagnostic, type SkillResource, type SkillSource, type SkillValidationIssue, type SkillValidationResult, type SkillsConfig, type SkillsReadToolOptions, type SkillsRunScriptToolOptions, type SkillsUseToolOptions, type SourcedScanPath, type Span, type SpawnConfig, type SpawnHookContext, type SpawnToolOptions, type SpawnToolState, type StartSpan, type StreamCallbacks, type StreamHookContext, type StreamOptions, type SubagentDef, type SubagentRegistry, type SummaryToTurnInput, type SystemPromptParts, TOOL_USE_CANCELLED_MESSAGE, TOOL_USE_INTERRUPTED_MARKER, TOOL_USE_SKIPPED_MESSAGE, TRAILER, type TaskEntry, type TaskExitInfo, type TaskHandle, type TaskStallInfo, type ThinkingLevel, type ToWireMessagesOptions, type ToolCall, type ToolContext, type ToolDef, type ToolHookContext, type ToolMap, type ToolOutcome, type ToolResult, type ToolResultAudioContent, type ToolResultContent, type ToolResultDocumentContent, type ToolResultDocumentRefContent, type ToolResultImageContent, type ToolResultImageRefContent, type ToolResultTextContent, type ToolResultVideoContent, type ToolSpec, type TracingConventions, type TracingHookSet, type TracingHooksOptions, type Trajectory, type TrajectoryStep, type TrajectoryStepKind, type TurnFinishReason, type TurnInterruptionState, type TurnResult, type TurnUsage, type UpDownCounter, type ValidationResult, type XaiParams, anchorPreviewFor, anthropic, appendDynamicSection, appendStaticSection, applyAnthropicCacheBreakpoints, arcee, artifactPath, autoDetectAndConvert, baseten, _default as basic, basicTools, buildCatalog, buildCompactPrompt, buildEvalRunSummary, buildFromCompactPrompt, buildFullCompactPrompt, buildPersistedStub, buildPostCompactAttachments, buildRegisteredEvals, buildTailCompactPrompt, buildTrajectory, buildUpToCompactPrompt, cerebras, classifyOpenAICompatError, cleanupPersistedSession, clearRegisteredEvals, compactConversation, computeEvalTagScores, connectMcpServers, consoleSink, createAgent, createEvalAgent, createEvalRunReporter, createFileMapStore, createInteractionTool, createLogger, createLoggingHooks, createMemoryMcpCredentialStore, createMemoryStore, createMetricsHooks, createProcessContext, createRemoteStore, createReusableExecutionContext, createRunSummaryCollector, createSandboxContext, createSession, createShellTool, createSkillActivationState, createSkillsReadTool, createSkillsRunScriptTool, createSkillsUseTool, createSpawnTool, createTracingHooks, defaultRepeatGuardNormalize, defaultRepeatGuardTracked, defineEval, defineMetrics, definePreset, defineSkill, detectTurnInterruption, diffCacheDimensions, discoverSkills, edit, effectiveContextWindow, efficiencyMetricValues, emitEfficiencyMetrics, ensureEndsWithUserMessage, ensureToolResultPairing, errorMessage, estimateTokens, fileContains, fileContentQuality, fileExists, fileExistsOneOf, filterUnresolvedToolUses, finalizeEvalMetrics, flattenTurns, fnv1a32, formatEvalCaseSummary, formatEvalRunSummary, formatTrajectoryLine, fromAnthropic, fromOpenAI, functionalityMetric, getReadState, glob, grep, hasAuthorizationHeader, hasSystemPromptBoundary, headlessEventToJsonl, installAllowedToolsGate, installCacheBreakLogger, interpolateShellCommands, isToolAllowedByUnion, joinSystemPrompt, jsonSink, llmJudge, loadSession, local, loginMcpServer, mapOAIFinishReason, matchesAllowedTool, matchesContextExceeded, maybePersistToolResult, multiEdit, normalizeMcpBlocks, normalizeMcpServers, normalizeMetric, normalizeShellCommand, openai, openaiCompat, openrouter, parseAllowedToolPattern, parseSkillFile, readStateKey, registerEvalTests, relativeArtifactPath, remintDuplicateToolCallIds, renderSystemForWire, replaceDynamicSection, resolveDetachedTasksCapability, resolvePersistDir, resolveReadStateMap, resolveSkills, resolveTasksDir, resultToString, runEvalCase, runHeadless, sanitizeToolSchema, sanitizeToolSpecs, selectFilesFromReadState, selectFilesFromSession, selectRecentFiles, shouldAutoCompact, sliceForCompaction, snapshotCacheDimensions, splitSystemPrompt, stableStringify, startOAuthCallback, statsByModel, statusCompleted, stripImagesFromTurns, stripShellInterpolations, summaryToTurn, toAnthropic, toOpenAI, toTypedError, toWireMessages, toolOutputBudgetByteLength, toolOutputByteLength, toolResultToText, transcriptToOpenAIMessages, truncateHeadForPtlRetry, utf8ByteLength, validateResourcePath, validateResourcePathReal, validateSkillForWrite, validateSkillName, validateToolArgs, waitTask, writeSkillToDisk, writeSkillsToDisk, xai, zodToJsonSchema };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { A as joinSystemPrompt, C as sanitizeToolSchema, D as appendDynamicSection, E as SYSTEM_PROMPT_BOUNDARY, M as replaceDynamicSection, N as splitSystemPrompt, O as appendStaticSection, a as detectTurnInterruption, b as openaiCompat, c as filterUnresolvedToolUses, d as remintDuplicateToolCallIds, g as OpenAICompatHttpError, h as toWireMessages, i as autoDetectAndConvert, j as renderSystemForWire, k as hasSystemPromptBoundary, l as fromAnthropic, m as toOpenAI, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, o as ensureEndsWithUserMessage, p as toAnthropic, r as TOOL_USE_INTERRUPTED_MARKER, s as ensureToolResultPairing, t as ORPHANED_TOOL_RESULT_MARKER, u as fromOpenAI, v as classifyOpenAICompatError, w as sanitizeToolSpecs, y as mapOAIFinishReason } from "./messages-
|
|
2
|
-
import { $ as
|
|
1
|
+
import { A as joinSystemPrompt, C as sanitizeToolSchema, D as appendDynamicSection, E as SYSTEM_PROMPT_BOUNDARY, M as replaceDynamicSection, N as splitSystemPrompt, O as appendStaticSection, a as detectTurnInterruption, b as openaiCompat, c as filterUnresolvedToolUses, d as remintDuplicateToolCallIds, g as OpenAICompatHttpError, h as toWireMessages, i as autoDetectAndConvert, j as renderSystemForWire, k as hasSystemPromptBoundary, l as fromAnthropic, m as toOpenAI, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, o as ensureEndsWithUserMessage, p as toAnthropic, r as TOOL_USE_INTERRUPTED_MARKER, s as ensureToolResultPairing, t as ORPHANED_TOOL_RESULT_MARKER, u as fromOpenAI, v as classifyOpenAICompatError, w as sanitizeToolSpecs, y as mapOAIFinishReason } from "./messages-U_87Z7GH.js";
|
|
2
|
+
import { $ as sliceForCompaction, A as PERSISTED_STUB_PREFIX, B as selectFilesFromSession, C as normalizeShellCommand, D as TOOL_USE_CANCELLED_MESSAGE, E as SHELL_CASCADE_CANCEL_MESSAGE, G as TRAILER, H as compactConversation, I as resolvePersistDir, J as buildFullCompactPrompt, K as buildCompactPrompt, L as resolveTasksDir, M as buildPersistedStub, N as cleanupPersistedSession, O as TOOL_USE_SKIPPED_MESSAGE, P as maybePersistToolResult, Q as anchorPreviewFor, R as buildPostCompactAttachments, S as defaultRepeatGuardTracked, T as INTERRUPT_MESSAGE_FOR_TOOL_USE, U as BASE_INSTRUCTIONS, V as selectRecentFiles, W as NO_TOOLS_PREAMBLE, X as buildUpToCompactPrompt, Y as buildTailCompactPrompt, Z as ANCHOR_PREVIEW_MAX_CHARS, _ as createSkillsReadTool, a as multiEdit, at as OperationTimeoutError, c as grep, ct as OUTPUT_RESERVE_TOKENS, d as createAgent, et as stripImagesFromTurns, g as createSkillsRunScriptTool, h as createSkillsUseTool, it as CompactPromptTooLongError, j as PERSISTENCE_PREVIEW_BYTES, k as validateToolArgs, l as glob, lt as effectiveContextWindow, n as createSpawnTool, nt as truncateHeadForPtlRetry, p as waitTask, q as buildFromCompactPrompt, rt as CompactInvalidInputError, s as createInteractionTool, st as AUTO_COMPACT_MIN_GROWTH_FRACTION, tt as summaryToTurn, u as edit, ut as shouldAutoCompact, v as createShellTool, w as stableStringify, x as defaultRepeatGuardNormalize, z as selectFilesFromReadState } from "./tools-BvATiiCO.js";
|
|
3
3
|
import { n as estimateTokens, r as utf8ByteLength, t as BYTES_PER_TOKEN } from "./utils-ngQzYzZD.js";
|
|
4
4
|
import { n as createSandboxContext, r as createProcessContext, t as resolveDetachedTasksCapability } from "./contexts-DHi8LPCp.js";
|
|
5
|
-
import { a as
|
|
6
|
-
import { o as readStateKey, s as resolveReadStateMap, t as getReadState } from "./read-state-
|
|
5
|
+
import { a as toolOutputBudgetByteLength, o as toolOutputByteLength, s as toolResultToText } from "./types-CyVGdbia.js";
|
|
6
|
+
import { o as readStateKey, s as resolveReadStateMap, t as getReadState } from "./read-state-CLK9yVpm.js";
|
|
7
7
|
import { a as AgentToolNotAllowedError, f as matchesContextExceeded, i as AgentProviderError, l as errorMessage, m as toTypedError, n as AgentBudgetExceededError, o as AgentToolPairingError, r as AgentContextExceededError, s as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, t as AgentAbortedError } from "./errors-BpPfMo_4.js";
|
|
8
8
|
import { _ as validateResourcePath, a as writeSkillsToDisk, b as validateSkillName, d as buildCatalog, f as IMPLICITLY_ALLOWED_SKILL_TOOLS, g as parseAllowedToolPattern, h as matchesAllowedTool, i as writeSkillToDisk, m as isToolAllowedByUnion, n as stripShellInterpolations, o as discoverSkills, p as installAllowedToolsGate, r as resolveSkills, t as interpolateShellCommands, u as parseSkillFile, v as validateResourcePathReal, x as createSkillActivationState, y as validateSkillForWrite } from "./interpolate-ConAiXGy.js";
|
|
9
9
|
import { i as statsByModel, n as flattenTurns } from "./stats-DAKBEKjc.js";
|
|
10
|
-
import { a as normalizeMcpServers, d as createMemoryMcpCredentialStore, f as hasAuthorizationHeader, i as normalizeMcpBlocks, n as connectMcpServers, o as resultToString, u as McpOAuthProvider } from "./mcp-
|
|
11
|
-
import { i as basic_default, n as definePreset, r as basicTools } from "./presets-
|
|
12
|
-
import { a as headlessEventToJsonl, c as runHeadless, d as createRunSummaryCollector, l as transcriptToOpenAIMessages } from "./headless-
|
|
13
|
-
import { a as createMemoryStore, i as createRemoteStore, o as createFileMapStore, r as loadSession, t as createSession } from "./session-
|
|
10
|
+
import { a as normalizeMcpServers, d as createMemoryMcpCredentialStore, f as hasAuthorizationHeader, i as normalizeMcpBlocks, n as connectMcpServers, o as resultToString, u as McpOAuthProvider } from "./mcp-2OGi_NQu.js";
|
|
11
|
+
import { i as basic_default, n as definePreset, r as basicTools } from "./presets-eC4VwuHh.js";
|
|
12
|
+
import { a as headlessEventToJsonl, c as runHeadless, d as createRunSummaryCollector, l as transcriptToOpenAIMessages } from "./headless-C6Idunwh.js";
|
|
13
|
+
import { a as createMemoryStore, i as createRemoteStore, o as createFileMapStore, r as loadSession, t as createSession } from "./session-DQ4bEncf.js";
|
|
14
14
|
import { EFFICIENCY_METRICS, EvalMetricError, artifactPath, buildEvalRunSummary, buildRegisteredEvals, buildTrajectory, clearRegisteredEvals, computeEvalTagScores, createEvalAgent, createEvalRunReporter, createReusableExecutionContext, defineEval, defineMetrics, efficiencyMetricValues, emitEfficiencyMetrics, fileContains, fileContentQuality, fileExists, fileExistsOneOf, finalizeEvalMetrics, formatEvalCaseSummary, formatEvalRunSummary, formatTrajectoryLine, functionalityMetric, llmJudge, normalizeMetric, registerEvalTests, relativeArtifactPath, runEvalCase, statusCompleted } from "./eval.js";
|
|
15
15
|
import { i as jsonSink, n as createLogger, r as createLoggingHooks, t as consoleSink } from "./logger-Ktm-lj1s.js";
|
|
16
|
-
import { n as startOAuthCallback, t as loginMcpServer } from "./login-
|
|
17
|
-
import { a as local, f as arcee, i as openai, l as cerebras, m as applyAnthropicCacheBreakpoints, p as anthropic, r as openrouter, t as xai, u as baseten } from "./providers-
|
|
16
|
+
import { n as startOAuthCallback, t as loginMcpServer } from "./login-DE-_d045.js";
|
|
17
|
+
import { a as local, f as arcee, i as openai, l as cerebras, m as applyAnthropicCacheBreakpoints, p as anthropic, r as openrouter, t as xai, u as baseten } from "./providers-DyMPTo51.js";
|
|
18
18
|
import { defineSkill } from "./skills.js";
|
|
19
19
|
//#region src/cache-telemetry.ts
|
|
20
20
|
const FNV_OFFSET = 2166136261;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as AgentHooks } from "./agent-
|
|
1
|
+
import { r as AgentHooks } from "./agent-NkKgz5Dh.js";
|
|
2
2
|
import { Hookable } from "hookable";
|
|
3
3
|
|
|
4
4
|
//#region src/logger.d.ts
|
|
@@ -99,4 +99,4 @@ interface LoggingHookSet {
|
|
|
99
99
|
declare function createLoggingHooks(options: LoggingHooksOptions): LoggingHookSet;
|
|
100
100
|
//#endregion
|
|
101
101
|
export { Logger as a, consoleSink as c, jsonSink as d, LogSink as i, createLogger as l, LogLevel as n, LoggingHookSet as o, LogRecord as r, LoggingHooksOptions as s, ConsoleSinkOptions as t, createLoggingHooks as u };
|
|
102
|
-
//# sourceMappingURL=logger-
|
|
102
|
+
//# sourceMappingURL=logger-LQmSBfD_.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger-
|
|
1
|
+
{"version":3,"file":"logger-LQmSBfD_.d.ts","names":[],"sources":["../src/logger.ts"],"mappings":";;;;KAgCY,QAAA;AAAA,UAEK,SAAA;EACf,KAAA,EAAO,QAAA;EAUiB;EARxB,SAAA;EAWqB;EATrB,OAAA;EAUiC;EARjC,KAAA,EAAO,MAAM;AAAA;AAAA,UAGE,OAAA;EACf,IAAA,GAAO,MAAA,EAAQ,SAAS;AAAA;AAAA,UAGT,MAAA;EACf,KAAA,GAAQ,OAAA,UAAiB,KAAA,GAAQ,MAAA;EACjC,IAAA,GAAO,OAAA,UAAiB,KAAA,GAAQ,MAAA;EAChC,IAAA,GAAO,OAAA,UAAiB,KAAA,GAAQ,MAAA;EAChC,KAAA,GAAQ,OAAA,UAAiB,KAAA,GAAQ,MAAA;EAHzB;;;;;EASR,IAAA,GAAO,KAAA,EAAO,MAAA,sBAA4B,MAAA;EARlB;;;;EAAA,SAaf,cAAA,EAAgB,QAAA,CAAS,MAAA;AAAA;;;;;iBAWpB,YAAA,CACd,IAAA,EAAM,OAAA,EACN,cAAA,GAAgB,QAAA,CAAS,MAAA,qBACxB,MAAA;AAAA,UA6Bc,kBAAA;EAhD2B;;;;;EAsD1C,QAAA,GAAW,QAAQ;EAtCL;EAwCd,MAAA;IAAW,KAAA,GAAQ,KAAA;EAAA;AAAA;;;;;;;;iBAiBL,WAAA,CAAY,OAAA,GAAS,kBAAA,GAA0B,OAAO;;;;AAtD7D;iBA2EO,QAAA,CAAS,OAAA,GAAS,kBAAA,GAA0B,OAAO;AAAA,UAqBlD,mBAAA;EACf,MAAA,EAAQ,MAAA;EA9DW;;;;;EAoEnB,KAAA,GAAQ,QAAQ;EAlEgB;AAAA;AAiBlC;;;;;EAyDE,gBAAA;AAAA;AAAA,UAGe,cAAA;EACf,OAAA,GAAU,KAAA,EAAO,QAAQ,CAAC,UAAA;AAAA;;;;;;;;AAxCuC;AAqBnE;;;;;;iBAoCgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAsB,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createTolerantClient, l as sseToJsonFetchIfNeeded, u as McpOAuthProvider } from "./mcp-
|
|
1
|
+
import { c as createTolerantClient, l as sseToJsonFetchIfNeeded, u as McpOAuthProvider } from "./mcp-2OGi_NQu.js";
|
|
2
2
|
import { createServer } from "node:http";
|
|
3
3
|
//#region src/mcp/oauth-callback.ts
|
|
4
4
|
const DEFAULT_PATH = "/callback";
|
|
@@ -264,4 +264,4 @@ async function raceLoginCallback(handle, timeoutMs, signal) {
|
|
|
264
264
|
//#endregion
|
|
265
265
|
export { startOAuthCallback as n, loginMcpServer as t };
|
|
266
266
|
|
|
267
|
-
//# sourceMappingURL=login-
|
|
267
|
+
//# sourceMappingURL=login-DE-_d045.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-D5rb4IG8.js","names":[],"sources":["../src/mcp/oauth-callback.ts","../src/mcp/login.ts"],"sourcesContent":["/**\n * Local loopback HTTP callback for OAuth 2.0 authorization code flows.\n *\n * Stands up a one-shot server on `127.0.0.1:<random>` that captures the\n * `?code=...` redirect from a browser-driven OAuth flow and resolves a\n * promise with the code. Used as the `redirectUrl` half of the MCP SDK's\n * `OAuthClientProvider` (the persistence half lives separately).\n *\n * Design:\n * - Loopback-only (`127.0.0.1`) — the OAuth spec treats `http://127.0.0.1:<port>`\n * as a public-client redirect URI per RFC 8252 §7.3. Browsers do NOT block it,\n * and Anthropic / OpenAI / Linear / GitHub all accept it.\n * - Random port (`port = 0`) — the OS picks an unused one. We read the actual\n * port back from `server.address()` after `listen()`.\n * - Single-shot — the first GET to `path` with a `code` (or `error`) wins;\n * subsequent requests get 404. The server keeps listening (in case the user\n * hits \"back\" and re-authorizes), so callers must `close()` once they have\n * the code or have given up.\n * - Abort-aware — wiring an external `AbortSignal` rejects the promise and\n * closes the server immediately. Required for the TUI's \"esc cancels login\"\n * UX.\n * - No HTML framework — a single inline `<html>` string keeps this isolated\n * from any UI dependency.\n */\n\nimport type { AddressInfo } from 'node:net'\nimport { createServer } from 'node:http'\n\n/**\n * Result of a successful callback. `state` is forwarded verbatim from the\n * query string — callers verify it against their pre-flight value to defend\n * against CSRF (the MCP SDK does this internally when it controls `state`).\n */\nexport interface OAuthCallbackResult {\n code: string\n state?: string\n}\n\nexport interface OAuthCallbackHandle {\n /**\n * Full URI to register with the authorization server, e.g.\n * `http://127.0.0.1:51823/callback`. Stable for the lifetime of the\n * handle.\n */\n redirectUri: string\n /**\n * Resolves with `{ code, state }` on a successful callback. Rejects with:\n * - The OAuth-spec `error` field (`access_denied`, `server_error`, ...)\n * when the authorization server redirects with `?error=...`.\n * - `'OAuth callback aborted'` when the external `AbortSignal` fires.\n * - `'OAuth callback server closed'` when `close()` is called before any\n * callback arrives.\n *\n * Single-shot — only the first matching request resolves the promise.\n */\n promise: Promise<OAuthCallbackResult>\n /**\n * Idempotent shutdown. Safe to call from a `finally` block whether the\n * flow succeeded, failed, or was aborted. Resolves once the server stops\n * accepting connections.\n */\n close: () => Promise<void>\n}\n\nexport interface OAuthCallbackOptions {\n /** Cancels the flow — rejects `promise` and closes the server. */\n signal?: AbortSignal\n /**\n * Path component the authorization server should redirect to. Defaults\n * to `/callback`. Useful when matching a pre-registered URI that uses a\n * different path.\n */\n path?: string\n /**\n * Override the loopback host. Defaults to `127.0.0.1`. Don't bind to\n * `0.0.0.0` here — the OAuth code is a one-time secret and the server\n * would otherwise accept it from any host on the LAN.\n */\n host?: string\n /**\n * Override the port. Defaults to `0` (OS-assigned). Pin to a fixed port\n * only when the authorization server requires a pre-registered redirect\n * URI; the random-port path is preferred so concurrent flows don't clash.\n */\n port?: number\n}\n\nconst DEFAULT_PATH = '/callback'\nconst DEFAULT_HOST = '127.0.0.1'\n\nconst SUCCESS_HTML = `<!doctype html>\n<html><head><meta charset=\"utf-8\"><title>Logged in</title>\n<style>body{font:14px/1.5 -apple-system,system-ui,sans-serif;margin:6rem auto;max-width:28rem;text-align:center;color:#1d1d1f}.ok{color:#1f8a4c;font-weight:600}</style>\n</head><body>\n<p class=\"ok\">Logged in.</p>\n<p>You can close this tab and return to the terminal.</p>\n</body></html>`\n\nfunction errorHtml(message: string): string {\n // No interpolation into HTML attributes — message goes only inside <p> text\n // where the SAMEORIGIN browser context is rendering. Escape angle brackets\n // and ampersands defensively anyway: a malicious authorization server could\n // theoretically craft an `error_description` containing markup, and we\n // don't want stored XSS even in a one-shot loopback page.\n const escaped = message\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n return `<!doctype html>\n<html><head><meta charset=\"utf-8\"><title>Login failed</title>\n<style>body{font:14px/1.5 -apple-system,system-ui,sans-serif;margin:6rem auto;max-width:28rem;text-align:center;color:#1d1d1f}.err{color:#c43c2c;font-weight:600}</style>\n</head><body>\n<p class=\"err\">Login failed.</p>\n<p>${escaped}</p>\n<p>You can close this tab and return to the terminal.</p>\n</body></html>`\n}\n\n/**\n * Start a one-shot OAuth callback server. The returned handle's `redirectUri`\n * should be passed to the authorization server as the `redirect_uri` query\n * parameter; `promise` resolves once the user finishes the browser flow.\n *\n * Always `await handle.close()` in a `finally` block — even on success, the\n * server stays open until told to shut down (so it can serve the\n * \"you can close this tab\" page).\n */\nexport async function startOAuthCallback(\n opts: OAuthCallbackOptions = {},\n): Promise<OAuthCallbackHandle> {\n const path = opts.path ?? DEFAULT_PATH\n const host = opts.host ?? DEFAULT_HOST\n const port = opts.port ?? 0\n\n if (!path.startsWith('/'))\n throw new Error(`OAuth callback path must start with \"/\" (got: ${JSON.stringify(path)})`)\n\n if (opts.signal?.aborted)\n throw new Error('OAuth callback aborted')\n\n let resolveResult: (value: OAuthCallbackResult) => void\n let rejectResult: (error: Error) => void\n const promise = new Promise<OAuthCallbackResult>((resolve, reject) => {\n resolveResult = resolve\n rejectResult = reject\n })\n // Attach a default no-op catch so a rejection without a consumer doesn't\n // raise an unhandled-rejection warning. Callers that DO `await promise`\n // still receive the rejection — Promises fan out to all listeners.\n promise.catch(() => {})\n\n let settled = false\n const resolveOnce = (value: OAuthCallbackResult) => {\n if (settled)\n return\n settled = true\n resolveResult(value)\n }\n const rejectOnce = (error: Error) => {\n if (settled)\n return\n settled = true\n rejectResult(error)\n }\n\n const server = createServer((req, res) => {\n const url = new URL(req.url ?? '/', `http://${host}`)\n if (url.pathname !== path) {\n res.writeHead(404, { 'content-type': 'text/plain' })\n res.end('Not Found')\n return\n }\n\n // `no-store` prevents the browser from replaying the page (with the\n // now-spent code in its URL bar) when the user hits back, refreshes,\n // or restores the tab from history. The code is a one-time secret.\n const htmlHeaders = {\n 'content-type': 'text/html; charset=utf-8',\n 'cache-control': 'no-store',\n }\n\n const error = url.searchParams.get('error')\n if (error) {\n const desc = url.searchParams.get('error_description') ?? error\n res.writeHead(400, htmlHeaders)\n res.end(errorHtml(desc))\n rejectOnce(new Error(`OAuth authorization failed: ${desc}`))\n return\n }\n\n const code = url.searchParams.get('code')\n if (!code) {\n // No code, no error — likely a stray probe. Serve a minimal page,\n // don't resolve. The browser will eventually arrive with the real\n // redirect, or the caller will time out via signal.\n res.writeHead(400, { 'content-type': 'text/plain' })\n res.end('Missing \"code\" query parameter.')\n return\n }\n\n const state = url.searchParams.get('state') ?? undefined\n res.writeHead(200, htmlHeaders)\n res.end(SUCCESS_HTML)\n resolveOnce({ code, state })\n })\n\n // Surface socket errors that arrive before the request handler — e.g. EADDRINUSE\n // on a pinned port, or an early TLS-style probe that the parser rejects.\n server.on('error', (err) => {\n rejectOnce(err instanceof Error ? err : new Error(String(err)))\n })\n\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(port, host, () => {\n server.off('error', reject)\n resolve()\n })\n })\n\n const addr = server.address() as AddressInfo | null\n if (!addr || typeof addr === 'string') {\n server.close()\n throw new Error('OAuth callback server did not bind to a TCP port')\n }\n\n // `closeServer` and `onAbort` reference each other — pre-declare both so\n // either ordering reads cleanly and the lint doesn't trip on the cycle.\n let closing: Promise<void> | undefined\n let closeServer: () => Promise<void>\n const onAbort = () => {\n rejectOnce(new Error('OAuth callback aborted'))\n void closeServer()\n }\n closeServer = (): Promise<void> => {\n if (closing)\n return closing\n closing = new Promise<void>((resolve) => {\n // `close()` on a Node http server waits for in-flight requests to drain.\n // The flow has already settled (or is being aborted), so we also call\n // `closeAllConnections()` to drop keep-alive sockets immediately — a\n // browser keeps the connection open after the success page, which would\n // otherwise hang the close for the keep-alive timeout (~5s).\n const anyServer = server as { closeAllConnections?: () => void }\n anyServer.closeAllConnections?.()\n server.close(() => {\n opts.signal?.removeEventListener('abort', onAbort)\n // If neither a callback nor an abort happened before close(), reject\n // pending awaits so callers don't hang. Tag the rejection as\n // 'aborted' when the signal already fired — Bun fires the abort\n // listener via a microtask, so server.close() may resolve first\n // even though semantically the abort came first.\n if (opts.signal?.aborted)\n rejectOnce(new Error('OAuth callback aborted'))\n else\n rejectOnce(new Error('OAuth callback server closed'))\n resolve()\n })\n })\n return closing\n }\n opts.signal?.addEventListener('abort', onAbort, { once: true })\n\n return {\n redirectUri: `http://${host}:${addr.port}${path}`,\n promise,\n close: closeServer,\n }\n}\n","/**\n * Interactive OAuth login orchestrator for one MCP server.\n *\n * Composes the three pieces shipped separately:\n * - `startOAuthCallback` (`./oauth-callback`) — local loopback HTTP\n * listener that catches the `?code=...` redirect.\n * - `McpOAuthProvider` (`./oauth-provider`) — SDK adapter that persists\n * tokens / client info via an injected `McpCredentialStore`.\n * - The MCP SDK's transport `authProvider` + `finishAuth` plumbing —\n * `client.connect()` triggers the SDK to call `redirectToAuthorization`\n * (which opens the browser); we wait for the loopback callback to\n * deliver the code, hand it to `transport.finishAuth`, and reconnect.\n *\n * Returns once tokens are persisted. Caller decides whether to immediately\n * reconnect the server (re-run `connectMcpServers` / `agent.warmup()`) or\n * defer to the next session activation. The returned `tools` array is\n * provided as a convenience — callers that want the connection live in\n * this call rather than rebuilding can wire them in directly.\n */\n\nimport type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js'\nimport type { Hookable } from 'hookable'\nimport type { AgentHooks } from '../agent'\nimport type { McpServerConfig } from '../types'\nimport type { OAuthCallbackHandle } from './oauth-callback'\nimport type { McpCredentialStore } from './oauth-provider'\nimport { startOAuthCallback } from './oauth-callback'\nimport { McpOAuthProvider } from './oauth-provider'\nimport { sseToJsonFetchIfNeeded } from './sse-to-json-fetch'\nimport { createTolerantClient } from './tolerant-client'\n\nexport interface LoginMcpServerOptions {\n /** Persistence — same store the bootstrap path reads from. */\n store: McpCredentialStore\n /**\n * Invoked with the authorization URL once it's ready. Hosts typically\n * (a) emit `mcp:auth:url` for the TUI, and (b) call `tryOpenBrowser`.\n * The URL is identical to the one passed to the `mcp:auth:url` hook\n * fired automatically — this callback is a synchronous hook for callers\n * that don't want to wire the agent hook machinery.\n */\n onAuthorizationUrl?: (url: URL) => void | Promise<void>\n /** Cancels the flow (esc / close modal / SIGINT). */\n signal?: AbortSignal\n /** Agent hooks. The flow emits `mcp:auth:url`/`success`/`error` when wired. */\n hooks?: Hookable<AgentHooks>\n /** Override `client_name` shown on consent screens. Default: 'zidane'. */\n clientName?: string\n /** Override the requested OAuth scope. */\n scope?: string\n /**\n * Override the loopback callback path. Default: `/callback`. Useful only\n * for servers that pinned a different path during registration.\n */\n callbackPath?: string\n /**\n * Maximum time to wait for the user to complete the browser flow, in ms.\n * The user can also cancel via `signal`. Default: 5 minutes.\n */\n timeoutMs?: number\n}\n\nexport interface LoginMcpServerResult {\n /** Stored OAuth tokens after a successful exchange. */\n tokens: NonNullable<ReturnType<McpOAuthProvider['tokens']>>\n /**\n * Upstream tool descriptors discovered after re-connecting with the new\n * tokens. Already filtered by the server's `enabledTools` / `disabledTools`\n * is NOT applied here — that's a bootstrap concern. Hosts that want filtering\n * should pass the result through `connectMcpServers` rebuild on the next\n * session activation rather than reusing this list verbatim.\n */\n tools: Array<{ name: string, description?: string | null, inputSchema?: unknown }>\n}\n\nconst DEFAULT_LOGIN_TIMEOUT_MS = 5 * 60_000\n\n/**\n * Run the full interactive OAuth flow for `config`. Only supports `sse` and\n * `streamable-http` transports — `stdio` MCP servers don't speak OAuth.\n *\n * Throws on:\n * - Wrong transport.\n * - Abort signal.\n * - Browser-side error (user denied, server rejected, etc.).\n * - Code exchange failure.\n * - Post-exchange connect failure.\n *\n * Always closes the loopback callback server before returning, success or\n * failure.\n */\nexport async function loginMcpServer(\n config: McpServerConfig,\n options: LoginMcpServerOptions,\n): Promise<LoginMcpServerResult> {\n if (config.transport !== 'sse' && config.transport !== 'streamable-http')\n throw new Error(`MCP OAuth: cannot login for transport \"${config.transport}\" — only sse / streamable-http are supported`)\n if (!config.url)\n throw new Error(`MCP OAuth: server \"${config.name}\" is missing a url`)\n\n const hooks = options.hooks\n\n let callback: OAuthCallbackHandle | undefined\n try {\n callback = await startOAuthCallback({\n signal: options.signal,\n path: options.callbackPath,\n })\n\n const handle = callback\n const provider = new McpOAuthProvider({\n name: config.name,\n store: options.store,\n redirectUri: handle.redirectUri,\n clientName: options.clientName,\n scope: options.scope,\n onAuthorizationUrl: async (url) => {\n await hooks?.callHook('mcp:auth:url', { name: config.name, url: url.toString() })\n await options.onAuthorizationUrl?.(url)\n },\n })\n\n const transport = await createInteractiveTransport(config, provider)\n const client = await createTolerantClient({ name: 'zidane', version: '1.0.0' })\n\n // First connect → SDK has no tokens, so it calls\n // `provider.redirectToAuthorization(url)` (which routes to our\n // `onAuthorizationUrl`), then throws `UnauthorizedError`. This is the\n // expected path — we catch and wait on the loopback for the code.\n let needsAuth = false\n try {\n await client.connect(transport)\n }\n catch (err) {\n if (!isUnauthorizedError(err)) {\n await client.close().catch(() => {})\n throw err\n }\n needsAuth = true\n }\n\n if (needsAuth) {\n const { code } = await raceLoginCallback(handle, options.timeoutMs ?? DEFAULT_LOGIN_TIMEOUT_MS, options.signal)\n // SDK exchanges code → tokens; provider.saveTokens persists them.\n await (transport as { finishAuth: (code: string) => Promise<void> }).finishAuth(code)\n // Reconnect with a FRESH transport. The previous one is already in\n // the \"started\" state from the failed connect — reusing it throws\n // \"StreamableHTTPClientTransport already started!\" inside\n // `transport.start()`. The SDK's canonical example\n // (`simpleOAuthClient.js`) uses the same pattern: recurse with a\n // new transport, reuse the client. Close the stale transport\n // first so its abort controllers + sockets don't leak.\n await transport.close().catch(() => {})\n const freshTransport = await createInteractiveTransport(config, provider)\n await client.connect(freshTransport)\n }\n\n const { tools } = await client.listTools()\n await client.close()\n\n const tokens = provider.tokens()\n if (!tokens)\n throw new Error(`MCP OAuth: login for \"${config.name}\" returned no tokens (server may have rejected the exchange silently)`)\n\n await hooks?.callHook('mcp:auth:success', { name: config.name })\n return { tokens, tools }\n }\n catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n await hooks?.callHook('mcp:auth:error', { name: config.name, error })\n throw error\n }\n finally {\n await callback?.close()\n }\n}\n\n/**\n * Build an `sse` / `streamable-http` transport pre-wired with `authProvider`.\n * Mirrors the bootstrap-side `createTransport` shape but inlined here so the\n * login flow doesn't depend on the bootstrap module's private export.\n */\nasync function createInteractiveTransport(config: McpServerConfig, authProvider: OAuthClientProvider) {\n if (config.transport === 'sse') {\n const { SSEClientTransport } = await import('@modelcontextprotocol/sdk/client/sse.js')\n return new SSEClientTransport(new URL(config.url!), {\n requestInit: config.headers ? { headers: config.headers } : undefined,\n authProvider,\n })\n }\n // streamable-http\n const { StreamableHTTPClientTransport } = await import('@modelcontextprotocol/sdk/client/streamableHttp.js')\n return new StreamableHTTPClientTransport(new URL(config.url!), {\n requestInit: config.headers ? { headers: config.headers } : undefined,\n fetch: sseToJsonFetchIfNeeded(),\n authProvider,\n })\n}\n\nfunction isUnauthorizedError(err: unknown): boolean {\n if (!err || typeof err !== 'object')\n return false\n const e = err as { name?: string, message?: string, constructor?: { name?: string } }\n if (e.name === 'UnauthorizedError' || e.constructor?.name === 'UnauthorizedError')\n return true\n return typeof e.message === 'string' && e.message.toLowerCase().startsWith('unauthorized')\n}\n\n/**\n * Wait on the callback handle, with a hard timeout AND honor the external\n * abort signal. Unlike `callback.promise` alone, this provides a deterministic\n * failure mode for \"user opened the browser then walked away\" — the modal\n * doesn't hang forever waiting for a redirect that may never come.\n */\nasync function raceLoginCallback(\n handle: OAuthCallbackHandle,\n timeoutMs: number,\n signal: AbortSignal | undefined,\n): Promise<{ code: string, state?: string }> {\n if (signal?.aborted)\n throw new Error('OAuth login aborted')\n let timer: ReturnType<typeof setTimeout> | undefined\n let onAbort: (() => void) | undefined\n try {\n return await new Promise<{ code: string, state?: string }>((resolve, reject) => {\n timer = setTimeout(\n () => reject(new Error(`OAuth login timed out after ${timeoutMs}ms`)),\n timeoutMs,\n )\n if (signal) {\n onAbort = () => reject(new Error('OAuth login aborted'))\n signal.addEventListener('abort', onAbort, { once: true })\n }\n handle.promise.then(resolve, reject)\n })\n }\n finally {\n if (timer)\n clearTimeout(timer)\n if (signal && onAbort)\n signal.removeEventListener('abort', onAbort)\n }\n}\n"],"mappings":";;;AAuFA,MAAM,eAAe;AACrB,MAAM,eAAe;AAErB,MAAM,eAAe;;;;;;;AAQrB,SAAS,UAAU,SAAyB;CAU1C,OAAO;;;;;KAJS,QACb,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAMR,EAAE;;;AAGb;;;;;;;;;;AAWA,eAAsB,mBACpB,OAA6B,CAAC,GACA;CAC9B,MAAM,OAAO,KAAK,QAAQ;CAC1B,MAAM,OAAO,KAAK,QAAQ;CAC1B,MAAM,OAAO,KAAK,QAAQ;CAE1B,IAAI,CAAC,KAAK,WAAW,GAAG,GACtB,MAAM,IAAI,MAAM,iDAAiD,KAAK,UAAU,IAAI,EAAE,EAAE;CAE1F,IAAI,KAAK,QAAQ,SACf,MAAM,IAAI,MAAM,w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MAAM;EACrC,CAAC;CACH,UACQ;EACN,IAAI,OACF,aAAa,KAAK;EACpB,IAAI,UAAU,SACZ,OAAO,oBAAoB,SAAS,OAAO;CAC/C;AACF"}
|
|
1
|
+
{"version":3,"file":"login-DE-_d045.js","names":[],"sources":["../src/mcp/oauth-callback.ts","../src/mcp/login.ts"],"sourcesContent":["/**\n * Local loopback HTTP callback for OAuth 2.0 authorization code flows.\n *\n * Stands up a one-shot server on `127.0.0.1:<random>` that captures the\n * `?code=...` redirect from a browser-driven OAuth flow and resolves a\n * promise with the code. Used as the `redirectUrl` half of the MCP SDK's\n * `OAuthClientProvider` (the persistence half lives separately).\n *\n * Design:\n * - Loopback-only (`127.0.0.1`) — the OAuth spec treats `http://127.0.0.1:<port>`\n * as a public-client redirect URI per RFC 8252 §7.3. Browsers do NOT block it,\n * and Anthropic / OpenAI / Linear / GitHub all accept it.\n * - Random port (`port = 0`) — the OS picks an unused one. We read the actual\n * port back from `server.address()` after `listen()`.\n * - Single-shot — the first GET to `path` with a `code` (or `error`) wins;\n * subsequent requests get 404. The server keeps listening (in case the user\n * hits \"back\" and re-authorizes), so callers must `close()` once they have\n * the code or have given up.\n * - Abort-aware — wiring an external `AbortSignal` rejects the promise and\n * closes the server immediately. Required for the TUI's \"esc cancels login\"\n * UX.\n * - No HTML framework — a single inline `<html>` string keeps this isolated\n * from any UI dependency.\n */\n\nimport type { AddressInfo } from 'node:net'\nimport { createServer } from 'node:http'\n\n/**\n * Result of a successful callback. `state` is forwarded verbatim from the\n * query string — callers verify it against their pre-flight value to defend\n * against CSRF (the MCP SDK does this internally when it controls `state`).\n */\nexport interface OAuthCallbackResult {\n code: string\n state?: string\n}\n\nexport interface OAuthCallbackHandle {\n /**\n * Full URI to register with the authorization server, e.g.\n * `http://127.0.0.1:51823/callback`. Stable for the lifetime of the\n * handle.\n */\n redirectUri: string\n /**\n * Resolves with `{ code, state }` on a successful callback. Rejects with:\n * - The OAuth-spec `error` field (`access_denied`, `server_error`, ...)\n * when the authorization server redirects with `?error=...`.\n * - `'OAuth callback aborted'` when the external `AbortSignal` fires.\n * - `'OAuth callback server closed'` when `close()` is called before any\n * callback arrives.\n *\n * Single-shot — only the first matching request resolves the promise.\n */\n promise: Promise<OAuthCallbackResult>\n /**\n * Idempotent shutdown. Safe to call from a `finally` block whether the\n * flow succeeded, failed, or was aborted. Resolves once the server stops\n * accepting connections.\n */\n close: () => Promise<void>\n}\n\nexport interface OAuthCallbackOptions {\n /** Cancels the flow — rejects `promise` and closes the server. */\n signal?: AbortSignal\n /**\n * Path component the authorization server should redirect to. Defaults\n * to `/callback`. Useful when matching a pre-registered URI that uses a\n * different path.\n */\n path?: string\n /**\n * Override the loopback host. Defaults to `127.0.0.1`. Don't bind to\n * `0.0.0.0` here — the OAuth code is a one-time secret and the server\n * would otherwise accept it from any host on the LAN.\n */\n host?: string\n /**\n * Override the port. Defaults to `0` (OS-assigned). Pin to a fixed port\n * only when the authorization server requires a pre-registered redirect\n * URI; the random-port path is preferred so concurrent flows don't clash.\n */\n port?: number\n}\n\nconst DEFAULT_PATH = '/callback'\nconst DEFAULT_HOST = '127.0.0.1'\n\nconst SUCCESS_HTML = `<!doctype html>\n<html><head><meta charset=\"utf-8\"><title>Logged in</title>\n<style>body{font:14px/1.5 -apple-system,system-ui,sans-serif;margin:6rem auto;max-width:28rem;text-align:center;color:#1d1d1f}.ok{color:#1f8a4c;font-weight:600}</style>\n</head><body>\n<p class=\"ok\">Logged in.</p>\n<p>You can close this tab and return to the terminal.</p>\n</body></html>`\n\nfunction errorHtml(message: string): string {\n // No interpolation into HTML attributes — message goes only inside <p> text\n // where the SAMEORIGIN browser context is rendering. Escape angle brackets\n // and ampersands defensively anyway: a malicious authorization server could\n // theoretically craft an `error_description` containing markup, and we\n // don't want stored XSS even in a one-shot loopback page.\n const escaped = message\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n return `<!doctype html>\n<html><head><meta charset=\"utf-8\"><title>Login failed</title>\n<style>body{font:14px/1.5 -apple-system,system-ui,sans-serif;margin:6rem auto;max-width:28rem;text-align:center;color:#1d1d1f}.err{color:#c43c2c;font-weight:600}</style>\n</head><body>\n<p class=\"err\">Login failed.</p>\n<p>${escaped}</p>\n<p>You can close this tab and return to the terminal.</p>\n</body></html>`\n}\n\n/**\n * Start a one-shot OAuth callback server. The returned handle's `redirectUri`\n * should be passed to the authorization server as the `redirect_uri` query\n * parameter; `promise` resolves once the user finishes the browser flow.\n *\n * Always `await handle.close()` in a `finally` block — even on success, the\n * server stays open until told to shut down (so it can serve the\n * \"you can close this tab\" page).\n */\nexport async function startOAuthCallback(\n opts: OAuthCallbackOptions = {},\n): Promise<OAuthCallbackHandle> {\n const path = opts.path ?? DEFAULT_PATH\n const host = opts.host ?? DEFAULT_HOST\n const port = opts.port ?? 0\n\n if (!path.startsWith('/'))\n throw new Error(`OAuth callback path must start with \"/\" (got: ${JSON.stringify(path)})`)\n\n if (opts.signal?.aborted)\n throw new Error('OAuth callback aborted')\n\n let resolveResult: (value: OAuthCallbackResult) => void\n let rejectResult: (error: Error) => void\n const promise = new Promise<OAuthCallbackResult>((resolve, reject) => {\n resolveResult = resolve\n rejectResult = reject\n })\n // Attach a default no-op catch so a rejection without a consumer doesn't\n // raise an unhandled-rejection warning. Callers that DO `await promise`\n // still receive the rejection — Promises fan out to all listeners.\n promise.catch(() => {})\n\n let settled = false\n const resolveOnce = (value: OAuthCallbackResult) => {\n if (settled)\n return\n settled = true\n resolveResult(value)\n }\n const rejectOnce = (error: Error) => {\n if (settled)\n return\n settled = true\n rejectResult(error)\n }\n\n const server = createServer((req, res) => {\n const url = new URL(req.url ?? '/', `http://${host}`)\n if (url.pathname !== path) {\n res.writeHead(404, { 'content-type': 'text/plain' })\n res.end('Not Found')\n return\n }\n\n // `no-store` prevents the browser from replaying the page (with the\n // now-spent code in its URL bar) when the user hits back, refreshes,\n // or restores the tab from history. The code is a one-time secret.\n const htmlHeaders = {\n 'content-type': 'text/html; charset=utf-8',\n 'cache-control': 'no-store',\n }\n\n const error = url.searchParams.get('error')\n if (error) {\n const desc = url.searchParams.get('error_description') ?? error\n res.writeHead(400, htmlHeaders)\n res.end(errorHtml(desc))\n rejectOnce(new Error(`OAuth authorization failed: ${desc}`))\n return\n }\n\n const code = url.searchParams.get('code')\n if (!code) {\n // No code, no error — likely a stray probe. Serve a minimal page,\n // don't resolve. The browser will eventually arrive with the real\n // redirect, or the caller will time out via signal.\n res.writeHead(400, { 'content-type': 'text/plain' })\n res.end('Missing \"code\" query parameter.')\n return\n }\n\n const state = url.searchParams.get('state') ?? undefined\n res.writeHead(200, htmlHeaders)\n res.end(SUCCESS_HTML)\n resolveOnce({ code, state })\n })\n\n // Surface socket errors that arrive before the request handler — e.g. EADDRINUSE\n // on a pinned port, or an early TLS-style probe that the parser rejects.\n server.on('error', (err) => {\n rejectOnce(err instanceof Error ? err : new Error(String(err)))\n })\n\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(port, host, () => {\n server.off('error', reject)\n resolve()\n })\n })\n\n const addr = server.address() as AddressInfo | null\n if (!addr || typeof addr === 'string') {\n server.close()\n throw new Error('OAuth callback server did not bind to a TCP port')\n }\n\n // `closeServer` and `onAbort` reference each other — pre-declare both so\n // either ordering reads cleanly and the lint doesn't trip on the cycle.\n let closing: Promise<void> | undefined\n let closeServer: () => Promise<void>\n const onAbort = () => {\n rejectOnce(new Error('OAuth callback aborted'))\n void closeServer()\n }\n closeServer = (): Promise<void> => {\n if (closing)\n return closing\n closing = new Promise<void>((resolve) => {\n // `close()` on a Node http server waits for in-flight requests to drain.\n // The flow has already settled (or is being aborted), so we also call\n // `closeAllConnections()` to drop keep-alive sockets immediately — a\n // browser keeps the connection open after the success page, which would\n // otherwise hang the close for the keep-alive timeout (~5s).\n const anyServer = server as { closeAllConnections?: () => void }\n anyServer.closeAllConnections?.()\n server.close(() => {\n opts.signal?.removeEventListener('abort', onAbort)\n // If neither a callback nor an abort happened before close(), reject\n // pending awaits so callers don't hang. Tag the rejection as\n // 'aborted' when the signal already fired — Bun fires the abort\n // listener via a microtask, so server.close() may resolve first\n // even though semantically the abort came first.\n if (opts.signal?.aborted)\n rejectOnce(new Error('OAuth callback aborted'))\n else\n rejectOnce(new Error('OAuth callback server closed'))\n resolve()\n })\n })\n return closing\n }\n opts.signal?.addEventListener('abort', onAbort, { once: true })\n\n return {\n redirectUri: `http://${host}:${addr.port}${path}`,\n promise,\n close: closeServer,\n }\n}\n","/**\n * Interactive OAuth login orchestrator for one MCP server.\n *\n * Composes the three pieces shipped separately:\n * - `startOAuthCallback` (`./oauth-callback`) — local loopback HTTP\n * listener that catches the `?code=...` redirect.\n * - `McpOAuthProvider` (`./oauth-provider`) — SDK adapter that persists\n * tokens / client info via an injected `McpCredentialStore`.\n * - The MCP SDK's transport `authProvider` + `finishAuth` plumbing —\n * `client.connect()` triggers the SDK to call `redirectToAuthorization`\n * (which opens the browser); we wait for the loopback callback to\n * deliver the code, hand it to `transport.finishAuth`, and reconnect.\n *\n * Returns once tokens are persisted. Caller decides whether to immediately\n * reconnect the server (re-run `connectMcpServers` / `agent.warmup()`) or\n * defer to the next session activation. The returned `tools` array is\n * provided as a convenience — callers that want the connection live in\n * this call rather than rebuilding can wire them in directly.\n */\n\nimport type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js'\nimport type { Hookable } from 'hookable'\nimport type { AgentHooks } from '../agent'\nimport type { McpServerConfig } from '../types'\nimport type { OAuthCallbackHandle } from './oauth-callback'\nimport type { McpCredentialStore } from './oauth-provider'\nimport { startOAuthCallback } from './oauth-callback'\nimport { McpOAuthProvider } from './oauth-provider'\nimport { sseToJsonFetchIfNeeded } from './sse-to-json-fetch'\nimport { createTolerantClient } from './tolerant-client'\n\nexport interface LoginMcpServerOptions {\n /** Persistence — same store the bootstrap path reads from. */\n store: McpCredentialStore\n /**\n * Invoked with the authorization URL once it's ready. Hosts typically\n * (a) emit `mcp:auth:url` for the TUI, and (b) call `tryOpenBrowser`.\n * The URL is identical to the one passed to the `mcp:auth:url` hook\n * fired automatically — this callback is a synchronous hook for callers\n * that don't want to wire the agent hook machinery.\n */\n onAuthorizationUrl?: (url: URL) => void | Promise<void>\n /** Cancels the flow (esc / close modal / SIGINT). */\n signal?: AbortSignal\n /** Agent hooks. The flow emits `mcp:auth:url`/`success`/`error` when wired. */\n hooks?: Hookable<AgentHooks>\n /** Override `client_name` shown on consent screens. Default: 'zidane'. */\n clientName?: string\n /** Override the requested OAuth scope. */\n scope?: string\n /**\n * Override the loopback callback path. Default: `/callback`. Useful only\n * for servers that pinned a different path during registration.\n */\n callbackPath?: string\n /**\n * Maximum time to wait for the user to complete the browser flow, in ms.\n * The user can also cancel via `signal`. Default: 5 minutes.\n */\n timeoutMs?: number\n}\n\nexport interface LoginMcpServerResult {\n /** Stored OAuth tokens after a successful exchange. */\n tokens: NonNullable<ReturnType<McpOAuthProvider['tokens']>>\n /**\n * Upstream tool descriptors discovered after re-connecting with the new\n * tokens. Already filtered by the server's `enabledTools` / `disabledTools`\n * is NOT applied here — that's a bootstrap concern. Hosts that want filtering\n * should pass the result through `connectMcpServers` rebuild on the next\n * session activation rather than reusing this list verbatim.\n */\n tools: Array<{ name: string, description?: string | null, inputSchema?: unknown }>\n}\n\nconst DEFAULT_LOGIN_TIMEOUT_MS = 5 * 60_000\n\n/**\n * Run the full interactive OAuth flow for `config`. Only supports `sse` and\n * `streamable-http` transports — `stdio` MCP servers don't speak OAuth.\n *\n * Throws on:\n * - Wrong transport.\n * - Abort signal.\n * - Browser-side error (user denied, server rejected, etc.).\n * - Code exchange failure.\n * - Post-exchange connect failure.\n *\n * Always closes the loopback callback server before returning, success or\n * failure.\n */\nexport async function loginMcpServer(\n config: McpServerConfig,\n options: LoginMcpServerOptions,\n): Promise<LoginMcpServerResult> {\n if (config.transport !== 'sse' && config.transport !== 'streamable-http')\n throw new Error(`MCP OAuth: cannot login for transport \"${config.transport}\" — only sse / streamable-http are supported`)\n if (!config.url)\n throw new Error(`MCP OAuth: server \"${config.name}\" is missing a url`)\n\n const hooks = options.hooks\n\n let callback: OAuthCallbackHandle | undefined\n try {\n callback = await startOAuthCallback({\n signal: options.signal,\n path: options.callbackPath,\n })\n\n const handle = callback\n const provider = new McpOAuthProvider({\n name: config.name,\n store: options.store,\n redirectUri: handle.redirectUri,\n clientName: options.clientName,\n scope: options.scope,\n onAuthorizationUrl: async (url) => {\n await hooks?.callHook('mcp:auth:url', { name: config.name, url: url.toString() })\n await options.onAuthorizationUrl?.(url)\n },\n })\n\n const transport = await createInteractiveTransport(config, provider)\n const client = await createTolerantClient({ name: 'zidane', version: '1.0.0' })\n\n // First connect → SDK has no tokens, so it calls\n // `provider.redirectToAuthorization(url)` (which routes to our\n // `onAuthorizationUrl`), then throws `UnauthorizedError`. This is the\n // expected path — we catch and wait on the loopback for the code.\n let needsAuth = false\n try {\n await client.connect(transport)\n }\n catch (err) {\n if (!isUnauthorizedError(err)) {\n await client.close().catch(() => {})\n throw err\n }\n needsAuth = true\n }\n\n if (needsAuth) {\n const { code } = await raceLoginCallback(handle, options.timeoutMs ?? DEFAULT_LOGIN_TIMEOUT_MS, options.signal)\n // SDK exchanges code → tokens; provider.saveTokens persists them.\n await (transport as { finishAuth: (code: string) => Promise<void> }).finishAuth(code)\n // Reconnect with a FRESH transport. The previous one is already in\n // the \"started\" state from the failed connect — reusing it throws\n // \"StreamableHTTPClientTransport already started!\" inside\n // `transport.start()`. The SDK's canonical example\n // (`simpleOAuthClient.js`) uses the same pattern: recurse with a\n // new transport, reuse the client. Close the stale transport\n // first so its abort controllers + sockets don't leak.\n await transport.close().catch(() => {})\n const freshTransport = await createInteractiveTransport(config, provider)\n await client.connect(freshTransport)\n }\n\n const { tools } = await client.listTools()\n await client.close()\n\n const tokens = provider.tokens()\n if (!tokens)\n throw new Error(`MCP OAuth: login for \"${config.name}\" returned no tokens (server may have rejected the exchange silently)`)\n\n await hooks?.callHook('mcp:auth:success', { name: config.name })\n return { tokens, tools }\n }\n catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n await hooks?.callHook('mcp:auth:error', { name: config.name, error })\n throw error\n }\n finally {\n await callback?.close()\n }\n}\n\n/**\n * Build an `sse` / `streamable-http` transport pre-wired with `authProvider`.\n * Mirrors the bootstrap-side `createTransport` shape but inlined here so the\n * login flow doesn't depend on the bootstrap module's private export.\n */\nasync function createInteractiveTransport(config: McpServerConfig, authProvider: OAuthClientProvider) {\n if (config.transport === 'sse') {\n const { SSEClientTransport } = await import('@modelcontextprotocol/sdk/client/sse.js')\n return new SSEClientTransport(new URL(config.url!), {\n requestInit: config.headers ? { headers: config.headers } : undefined,\n authProvider,\n })\n }\n // streamable-http\n const { StreamableHTTPClientTransport } = await import('@modelcontextprotocol/sdk/client/streamableHttp.js')\n return new StreamableHTTPClientTransport(new URL(config.url!), {\n requestInit: config.headers ? { headers: config.headers } : undefined,\n fetch: sseToJsonFetchIfNeeded(),\n authProvider,\n })\n}\n\nfunction isUnauthorizedError(err: unknown): boolean {\n if (!err || typeof err !== 'object')\n return false\n const e = err as { name?: string, message?: string, constructor?: { name?: string } }\n if (e.name === 'UnauthorizedError' || e.constructor?.name === 'UnauthorizedError')\n return true\n return typeof e.message === 'string' && e.message.toLowerCase().startsWith('unauthorized')\n}\n\n/**\n * Wait on the callback handle, with a hard timeout AND honor the external\n * abort signal. Unlike `callback.promise` alone, this provides a deterministic\n * failure mode for \"user opened the browser then walked away\" — the modal\n * doesn't hang forever waiting for a redirect that may never come.\n */\nasync function raceLoginCallback(\n handle: OAuthCallbackHandle,\n timeoutMs: number,\n signal: AbortSignal | undefined,\n): Promise<{ code: string, state?: string }> {\n if (signal?.aborted)\n throw new Error('OAuth login aborted')\n let timer: ReturnType<typeof setTimeout> | undefined\n let onAbort: (() => void) | undefined\n try {\n return await new Promise<{ code: string, state?: string }>((resolve, reject) => {\n timer = setTimeout(\n () => reject(new Error(`OAuth login timed out after ${timeoutMs}ms`)),\n timeoutMs,\n )\n if (signal) {\n onAbort = () => reject(new Error('OAuth login aborted'))\n signal.addEventListener('abort', onAbort, { once: true })\n }\n handle.promise.then(resolve, reject)\n })\n }\n finally {\n if (timer)\n clearTimeout(timer)\n if (signal && onAbort)\n signal.removeEventListener('abort', onAbort)\n }\n}\n"],"mappings":";;;AAuFA,MAAM,eAAe;AACrB,MAAM,eAAe;AAErB,MAAM,eAAe;;;;;;;AAQrB,SAAS,UAAU,SAAyB;CAU1C,OAAO;;;;;KAJS,QACb,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAMR,EAAE;;;AAGb;;;;;;;;;;AAWA,eAAsB,mBACpB,OAA6B,CAAC,GACA;CAC9B,MAAM,OAAO,KAAK,QAAQ;CAC1B,MAAM,OAAO,KAAK,QAAQ;CAC1B,MAAM,OAAO,KAAK,QAAQ;CAE1B,IAAI,CAAC,KAAK,WAAW,GAAG,GACtB,MAAM,IAAI,MAAM,iDAAiD,KAAK,UAAU,IAAI,EAAE,EAAE;CAE1F,IAAI,KAAK,QAAQ,SACf,MAAM,IAAI,MAAM,wBAAwB;CAE1C,IAAI;CACJ,IAAI;CACJ,MAAM,UAAU,IAAI,SAA8B,SAAS,WAAW;EACpE,gBAAgB;EAChB,eAAe;CACjB,CAAC;CAID,QAAQ,YAAY,CAAC,CAAC;CAEtB,IAAI,UAAU;CACd,MAAM,eAAe,UAA+B;EAClD,IAAI,SACF;EACF,UAAU;EACV,cAAc,KAAK;CACrB;CACA,MAAM,cAAc,UAAiB;EACnC,IAAI,SACF;EACF,UAAU;EACV,aAAa,KAAK;CACpB;CAEA,MAAM,SAAS,cAAc,KAAK,QAAQ;EACxC,MAAM,MAAM,IAAI,IAAI,IAAI,OAAO,KAAK,UAAU,MAAM;EACpD,IAAI,IAAI,aAAa,MAAM;GACzB,IAAI,UAAU,KAAK,EAAE,gBAAgB,aAAa,CAAC;GACnD,IAAI,IAAI,WAAW;GACnB;EACF;EAKA,MAAM,cAAc;GAClB,gBAAgB;GAChB,iBAA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B;CACF,CAAC;AACH;AAEA,SAAS,oBAAoB,KAAuB;CAClD,IAAI,CAAC,OAAO,OAAO,QAAQ,UACzB,OAAO;CACT,MAAM,IAAI;CACV,IAAI,EAAE,SAAS,uBAAuB,EAAE,aAAa,SAAS,qBAC5D,OAAO;CACT,OAAO,OAAO,EAAE,YAAY,YAAY,EAAE,QAAQ,YAAY,EAAE,WAAW,cAAc;AAC3F;;;;;;;AAQA,eAAe,kBACb,QACA,WACA,QAC2C;CAC3C,IAAI,QAAQ,SACV,MAAM,IAAI,MAAM,qBAAqB;CACvC,IAAI;CACJ,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,IAAI,SAA2C,SAAS,WAAW;GAC9E,QAAQ,iBACA,uBAAO,IAAI,MAAM,+BAA+B,UAAU,GAAG,CAAC,GACpE,SACF;GACA,IAAI,QAAQ;IACV,gBAAgB,uBAAO,IAAI,MAAM,qBAAqB,CAAC;IACvD,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;GAC1D;GACA,OAAO,QAAQ,KAAK,SAAS,MAAM;EACrC,CAAC;CACH,UACQ;EACN,IAAI,OACF,aAAa,KAAK;EACpB,IAAI,UAAU,SACZ,OAAO,oBAAoB,SAAS,OAAO;CAC/C;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as toolOutputByteLength, s as toolResultToText } from "./types-CyVGdbia.js";
|
|
2
2
|
import { l as errorMessage } from "./errors-BpPfMo_4.js";
|
|
3
3
|
import { a as sniffImageMediaTypeFromBase64, n as reconcileImageMediaType, o as sniffMediaTypeFromBase64, r as reconcileMediaType } from "./media-sniff-Bn76JxAu.js";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
@@ -1539,4 +1539,4 @@ async function raceWithTimeoutAndSignal(task, timeoutMs, timeoutMessage, signal)
|
|
|
1539
1539
|
//#endregion
|
|
1540
1540
|
export { normalizeMcpServers as a, createTolerantClient as c, createMemoryMcpCredentialStore as d, hasAuthorizationHeader as f, normalizeMcpBlocks as i, sseToJsonFetchIfNeeded as l, connectMcpServers as n, resultToString as o, deriveMcpToolMeta as r, wrapDiscoveredMcpTools as s, attachStderrWarnPump as t, McpOAuthProvider as u };
|
|
1541
1541
|
|
|
1542
|
-
//# sourceMappingURL=mcp-
|
|
1542
|
+
//# sourceMappingURL=mcp-2OGi_NQu.js.map
|