@theokit/agents 6.4.1 → 6.4.2
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/{bridge-entry-C_jckCIk.d.ts → bridge-entry-B-DQXIgk.d.ts} +10 -1
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/{chunk-C5RUE4DB.js → chunk-UJPG3K26.js} +31 -4
- package/dist/{chunk-C5RUE4DB.js.map → chunk-UJPG3K26.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2082,7 +2082,16 @@ type McpApprovalSpec = HumanInTheLoopOptions | string;
|
|
|
2082
2082
|
*/
|
|
2083
2083
|
declare function mcpToolApprovals(specs: Record<string, McpApprovalSpec>): Record<string, HumanInTheLoopOptions>;
|
|
2084
2084
|
|
|
2085
|
-
/**
|
|
2085
|
+
/**
|
|
2086
|
+
* Canal por onde uma entrada omitida é NOMEADA. Sem ele, estreitar o raio viraria fail-open.
|
|
2087
|
+
*
|
|
2088
|
+
* **`onWarn` é opcional, o AVISO não é.** Omitido, os avisos vão para `stderr` — nunca para lugar
|
|
2089
|
+
* nenhum. O review do M112 mediu por que isso importa: o único chamador de produção
|
|
2090
|
+
* (`agents/chat.ts:530` do agent-builder) **não passava** `onWarn`, e toda a defesa contra
|
|
2091
|
+
* `error-handling.md § 2` — repetida em quatro artefatos — dependia da frase *"o erro segue visível
|
|
2092
|
+
* pelo canal"*. Sem assinante, a entrada era descartada em silêncio absoluto: o usuário veria "a tool
|
|
2093
|
+
* sumiu" e nada mais.
|
|
2094
|
+
*/
|
|
2086
2095
|
interface LoadMcpJsonOptions {
|
|
2087
2096
|
onWarn?: (aviso: string) => void;
|
|
2088
2097
|
}
|
package/dist/bridge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { i as AGENT_BRAND, j as AfterToolCallContext, k as AgentBuilder, l as AgentDefinition, m as AgentDefinitionError, n as AgentExecutionContext, o as AgentManifest, f as AgentManifestEntry, p as AgentManifestSource, q as AgentManifestTool, t as AgentRoute, u as AgentRouteContext, v as AgentRunInfo, w as AgentStreamEvent, x as AgentTurnMetadata, y as AgentsPluginOptions, z as ApiErrorContext, B as ApiErrorDecision, E as ApiErrorPolicy, h as ApprovalPosture, F as ApprovalRequiredEvent, I as ArtifactChunkEvent, J as ArtifactStartEvent, K as BackgroundDelegation, N as BeforeToolCallContext, O as BudgetExceededError, Q as CheckpointSavedEvent, C as CompiledAgentOptions, U as CompiledContextWindow, a as CompiledTool, V as ContextualTool, Y as DefineAgentConfig, Z as DefinicaoOuThunk, _ as DelegateFn, $ as DelegateOptions, a0 as DelegationBudgetExceededError, a1 as DelegationError, D as DelegationResult, a2 as DoneEvent, a3 as ErrorEvent, a4 as FileEditEvent, aa as InferAgentInput, ab as InferAgentToolNames, ac as IterationEvent, ad as LLMCallContext, ai as McpApprovalSpec, aj as McpFileError, ak as McpRegistryConfig, al as McpRequestContext, am as McpSelection, ao as PartialToolCallEvent, aq as ProcessInputContext, au as RunStartedEvent, av as ScoreVerdict, aw as ScoredDelegation, ax as Scorer, ay as SdkAgentHandle, az as SdkMessage, aA as SdkSendOptions, aB as SdkTurnHandle, aC as Segment, aF as StateUpdateEvent, S as StreamEvent, aG as TextDeltaEvent, aH as ThinkingEvent, aJ as ToolCallEvent, aK as ToolCallVeto, aL as ToolHooks, aM as ToolHooksPlugin, aN as ToolResultEvent, aO as ToolWalkResult, aQ as ToolboxWalkResult, aR as agentsPlugin, aS as buildModelSelection, aT as compileAgentDefinition, aU as compileAgentModule, aV as compileContextWindow, aW as compileProjectContext, aX as compileSkills, aY as compileTools, aZ as createAgentExecutionContext, a_ as createApiErrorHandler, a$ as createSdkAgentStream, b0 as createThinkTagExtractor, b1 as createToolHooksPlugin, b2 as delegate, b3 as delegateBackground, b4 as delegateWithScoring, b5 as extractThinkTagStream, b6 as generateAgentManifest, b7 as generateAgentRoutes, b8 as isAgentContext, b9 as isAgentDefinition, ba as isApprovalRequired, bb as isDone, bc as isError, bd as isPartialToolCall, be as isTextDelta, bf as isToolCall, bg as isToolResult, bi as loadMcpJson, bk as mcpRegistry, bl as mcpToolApprovals, bn as presentUIMessageStream, bo as projectContextMetadataOnlyKnobs, bp as reasoningEffortOf, bt as resolveMcpServers, bu as runWithApiErrorHandling, bv as streamAgentResponse, s as streamAgentUIMessages, bw as toAgentFactory, bx as translateSdkEvent } from './bridge-entry-
|
|
1
|
+
export { i as AGENT_BRAND, j as AfterToolCallContext, k as AgentBuilder, l as AgentDefinition, m as AgentDefinitionError, n as AgentExecutionContext, o as AgentManifest, f as AgentManifestEntry, p as AgentManifestSource, q as AgentManifestTool, t as AgentRoute, u as AgentRouteContext, v as AgentRunInfo, w as AgentStreamEvent, x as AgentTurnMetadata, y as AgentsPluginOptions, z as ApiErrorContext, B as ApiErrorDecision, E as ApiErrorPolicy, h as ApprovalPosture, F as ApprovalRequiredEvent, I as ArtifactChunkEvent, J as ArtifactStartEvent, K as BackgroundDelegation, N as BeforeToolCallContext, O as BudgetExceededError, Q as CheckpointSavedEvent, C as CompiledAgentOptions, U as CompiledContextWindow, a as CompiledTool, V as ContextualTool, Y as DefineAgentConfig, Z as DefinicaoOuThunk, _ as DelegateFn, $ as DelegateOptions, a0 as DelegationBudgetExceededError, a1 as DelegationError, D as DelegationResult, a2 as DoneEvent, a3 as ErrorEvent, a4 as FileEditEvent, aa as InferAgentInput, ab as InferAgentToolNames, ac as IterationEvent, ad as LLMCallContext, ai as McpApprovalSpec, aj as McpFileError, ak as McpRegistryConfig, al as McpRequestContext, am as McpSelection, ao as PartialToolCallEvent, aq as ProcessInputContext, au as RunStartedEvent, av as ScoreVerdict, aw as ScoredDelegation, ax as Scorer, ay as SdkAgentHandle, az as SdkMessage, aA as SdkSendOptions, aB as SdkTurnHandle, aC as Segment, aF as StateUpdateEvent, S as StreamEvent, aG as TextDeltaEvent, aH as ThinkingEvent, aJ as ToolCallEvent, aK as ToolCallVeto, aL as ToolHooks, aM as ToolHooksPlugin, aN as ToolResultEvent, aO as ToolWalkResult, aQ as ToolboxWalkResult, aR as agentsPlugin, aS as buildModelSelection, aT as compileAgentDefinition, aU as compileAgentModule, aV as compileContextWindow, aW as compileProjectContext, aX as compileSkills, aY as compileTools, aZ as createAgentExecutionContext, a_ as createApiErrorHandler, a$ as createSdkAgentStream, b0 as createThinkTagExtractor, b1 as createToolHooksPlugin, b2 as delegate, b3 as delegateBackground, b4 as delegateWithScoring, b5 as extractThinkTagStream, b6 as generateAgentManifest, b7 as generateAgentRoutes, b8 as isAgentContext, b9 as isAgentDefinition, ba as isApprovalRequired, bb as isDone, bc as isError, bd as isPartialToolCall, be as isTextDelta, bf as isToolCall, bg as isToolResult, bi as loadMcpJson, bk as mcpRegistry, bl as mcpToolApprovals, bn as presentUIMessageStream, bo as projectContextMetadataOnlyKnobs, bp as reasoningEffortOf, bt as resolveMcpServers, bu as runWithApiErrorHandling, bv as streamAgentResponse, s as streamAgentUIMessages, bw as toAgentFactory, bx as translateSdkEvent } from './bridge-entry-B-DQXIgk.js';
|
|
2
2
|
import '@theokit/http';
|
|
3
3
|
import '@theokit/sdk';
|
|
4
4
|
import 'zod';
|
package/dist/bridge.js
CHANGED
|
@@ -3415,6 +3415,13 @@ __name(mcpToolApprovals, "mcpToolApprovals");
|
|
|
3415
3415
|
import { existsSync, readFileSync } from "fs";
|
|
3416
3416
|
import { join } from "path";
|
|
3417
3417
|
import { TheokitAgentError } from "@theokit/sdk/errors";
|
|
3418
|
+
function canalDeAviso(opts) {
|
|
3419
|
+
return opts.onWarn ?? ((aviso) => {
|
|
3420
|
+
process.stderr.write(`[@theokit/agents] ${aviso}
|
|
3421
|
+
`);
|
|
3422
|
+
});
|
|
3423
|
+
}
|
|
3424
|
+
__name(canalDeAviso, "canalDeAviso");
|
|
3418
3425
|
var McpFileError = class extends TheokitAgentError {
|
|
3419
3426
|
static {
|
|
3420
3427
|
__name(this, "McpFileError");
|
|
@@ -3440,7 +3447,7 @@ function loadMcpJson(cwd, opts = {}) {
|
|
|
3440
3447
|
} catch (err) {
|
|
3441
3448
|
throw new McpFileError(`${path} is not valid JSON: ${descrever(err)}`);
|
|
3442
3449
|
}
|
|
3443
|
-
return parseMcpJson(parsed, path, opts
|
|
3450
|
+
return parseMcpJson(parsed, path, canalDeAviso(opts));
|
|
3444
3451
|
}
|
|
3445
3452
|
__name(loadMcpJson, "loadMcpJson");
|
|
3446
3453
|
function parseMcpJson(raw, source, onWarn) {
|
|
@@ -3456,10 +3463,10 @@ function parseMcpJson(raw, source, onWarn) {
|
|
|
3456
3463
|
for (const [name, entryRaw] of Object.entries(serversRaw)) {
|
|
3457
3464
|
const motivo = validarEntrada(name, entryRaw);
|
|
3458
3465
|
if (motivo !== void 0) {
|
|
3459
|
-
onWarn
|
|
3466
|
+
onWarn(`${source}: server "${name}" ignorado \u2014 ${motivo}`);
|
|
3460
3467
|
continue;
|
|
3461
3468
|
}
|
|
3462
|
-
out[name] = entryRaw;
|
|
3469
|
+
out[name] = montarEntrada(entryRaw);
|
|
3463
3470
|
}
|
|
3464
3471
|
return out;
|
|
3465
3472
|
}
|
|
@@ -3507,6 +3514,26 @@ function validarRemoto(entry) {
|
|
|
3507
3514
|
return void 0;
|
|
3508
3515
|
}
|
|
3509
3516
|
__name(validarRemoto, "validarRemoto");
|
|
3517
|
+
function montarEntrada(entry) {
|
|
3518
|
+
if (entry.url !== void 0) {
|
|
3519
|
+
const remoto = {
|
|
3520
|
+
url: entry.url
|
|
3521
|
+
};
|
|
3522
|
+
if (entry.type !== void 0) remoto.type = entry.type;
|
|
3523
|
+
if (entry.headers !== void 0) remoto.headers = entry.headers;
|
|
3524
|
+
if (entry.auth !== void 0) remoto.auth = entry.auth;
|
|
3525
|
+
if (entry.requestTimeoutMs !== void 0) remoto.requestTimeoutMs = entry.requestTimeoutMs;
|
|
3526
|
+
return remoto;
|
|
3527
|
+
}
|
|
3528
|
+
const stdio = {
|
|
3529
|
+
command: entry.command
|
|
3530
|
+
};
|
|
3531
|
+
if (entry.args !== void 0) stdio.args = entry.args;
|
|
3532
|
+
if (entry.env !== void 0) stdio.env = entry.env;
|
|
3533
|
+
if (entry.cwd !== void 0) stdio.cwd = entry.cwd;
|
|
3534
|
+
return stdio;
|
|
3535
|
+
}
|
|
3536
|
+
__name(montarEntrada, "montarEntrada");
|
|
3510
3537
|
function descrever(err) {
|
|
3511
3538
|
return err instanceof Error ? err.message : String(err);
|
|
3512
3539
|
}
|
|
@@ -3732,4 +3759,4 @@ export {
|
|
|
3732
3759
|
generateAgentManifest,
|
|
3733
3760
|
agentsPlugin
|
|
3734
3761
|
};
|
|
3735
|
-
//# sourceMappingURL=chunk-
|
|
3762
|
+
//# sourceMappingURL=chunk-UJPG3K26.js.map
|