@theokit/agents 3.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bridge-entry-8gsH0kVZ.d.ts → bridge-entry-Ddu3Ug_3.d.ts} +33 -17
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +5 -5
- package/dist/{chunk-C2DALG62.js → chunk-OKG5LRGV.js} +29 -18
- package/dist/chunk-OKG5LRGV.js.map +1 -0
- package/dist/index.d.ts +97 -20
- package/dist/index.js +217 -119
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts +4 -0
- package/dist/interactive.js +3 -0
- package/dist/interactive.js.map +1 -0
- package/dist/persistence.d.ts +1 -0
- package/dist/persistence.js +3 -0
- package/dist/persistence.js.map +1 -0
- package/dist/pty.d.ts +1 -0
- package/dist/pty.js +3 -0
- package/dist/pty.js.map +1 -0
- package/dist/sandbox.d.ts +1 -0
- package/dist/sandbox.js +3 -0
- package/dist/sandbox.js.map +1 -0
- package/package.json +26 -5
- package/dist/chunk-C2DALG62.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as Guardrail, L as LoopStrategy, R as ReflectionStrategy, C as CompiledAgentOptions, M as MainLoopMeta, a as CompiledTool, b as ReasoningEffort, c as RoundStreamFactory, S as StreamEvent, D as DelegationResult, d as ContextWindowOptions,
|
|
2
|
-
export {
|
|
3
|
-
import * as _theokit_sdk from '@theokit/sdk';
|
|
1
|
+
import { G as Guardrail, L as LoopStrategy, R as ReflectionStrategy, C as CompiledAgentOptions, M as MainLoopMeta, a as CompiledTool, b as ReasoningEffort, c as RoundStreamFactory, S as StreamEvent, D as DelegationResult, d as ContextWindowOptions, e as SkillsOptions, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions, f as AgentManifestEntry } from './bridge-entry-Ddu3Ug_3.js';
|
|
2
|
+
export { g as AGENT_BRAND, h as AfterToolCallContext, i as AgentBuilder, j as AgentDefinition, k as AgentDefinitionError, l as AgentExecutionContext, m as AgentManifest, n as AgentManifestSource, o as AgentManifestTool, p as AgentOptions, q as AgentRoute, r as AgentRouteContext, s as AgentRunInfo, t as AgentStreamEvent, u as AgentTurnMetadata, v as AgentsPluginOptions, w as ApiErrorContext, x as ApiErrorDecision, y as ApiErrorPolicy, z as ApprovalRequiredEvent, B as ArtifactChunkEvent, E as ArtifactStartEvent, F as BackgroundDelegation, I as BeforeToolCallContext, J as BudgetExceededError, K as BudgetOptions, N as CheckpointSavedEvent, O as CompiledContextWindow, P as ContextualTool, Q as CostBudgetExceededError, U as DEFAULT_MAX_ITERATIONS, V as DefineAgentConfig, W as DelegateFn, X as DelegateOptions, Y as DelegationError, Z as DoneEvent, _ as ErrorEvent, $ as FileEditEvent, a0 as GuardrailAction, a1 as GuardrailPhase, a2 as GuardrailResult, a3 as GuardrailViolationError, a4 as HitlDecision, a5 as InferAgentInput, a6 as InferAgentToolNames, a7 as IterationEvent, a8 as LLMCallContext, a9 as LoopFinishReason, aa as LoopOutcome, ab as LoopStrategyConfig, ac as MainLoopOptions, ad as McpApprovalSpec, ae as McpRegistryConfig, af as McpRequestContext, ag as McpSelection, ah as PartialToolCallEvent, ai as PolicyHandler, aj as ProcessInputContext, ak as ReflectionContext, al as ReflectionResult, am as ReflectionStrategyConfig, an as RunStartedEvent, ao as ScoreVerdict, ap as ScoredDelegation, aq as Scorer, ar as SdkAgentHandle, as as SdkMessage, at as Segment, au as SkillsRequestContext, av as SkillsSelection, aw as StateUpdateEvent, ax as TextDeltaEvent, ay as ThinkingEvent, az as TimeoutAction, aA as ToolCallEvent, aB as ToolCallVeto, aC as ToolHooks, aD as ToolHooksPlugin, aE as ToolResultEvent, aF as ToolWalkResult, aG as ToolboxOptions, aH as ToolboxWalkResult, aI as agentsPlugin, aJ as buildModelSelection, aK as compileAgentDefinition, aL as compileAgentModule, aM as compileContextWindow, aN as compileProjectContext, aO as compileSkills, aP as compileTools, aQ as createAgentExecutionContext, aR as createApiErrorHandler, aS as createSdkAgentStream, aT as createThinkTagExtractor, aU as createToolHooksPlugin, aV as delegate, aW as delegateBackground, aX as delegateWithScoring, aY as extractThinkTagStream, aZ as generateAgentManifest, a_ as generateAgentRoutes, a$ as isAgentContext, b0 as isAgentDefinition, b1 as isApprovalRequired, b2 as isDone, b3 as isError, b4 as isPartialToolCall, b5 as isTextDelta, b6 as isToolCall, b7 as isToolResult, b8 as ladderReflectionStrategy, b9 as loopStrategyConfigSchema, ba as mcpRegistry, bb as mcpToolApprovals, bc as noopReflectionStrategy, bd as presentUIMessageStream, be as projectContextMetadataOnlyKnobs, bf as reflectionStrategyConfigSchema, bg as resolveEnabledSkills, bh as resolveLoopStrategy, bi as resolveMcpServers, bj as runWithApiErrorHandling, bk as streamAgentResponse, bl as streamAgentUIMessages, bm as toAgentFactory, bn as translateSdkEvent } from './bridge-entry-Ddu3Ug_3.js';
|
|
4
3
|
import { PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition, BudgetTracker, CustomTool, InlineSkill } from '@theokit/sdk';
|
|
4
|
+
export { Agent, CustomTool, Provider, SDKAgent, SessionRecord, Squad, Tool } from '@theokit/sdk';
|
|
5
5
|
import { RetryOptions } from '@theokit/sdk/retry';
|
|
6
6
|
import { CompressibleMessage } from '@theokit/sdk/compaction';
|
|
7
7
|
export { CompressibleMessage } from '@theokit/sdk/compaction';
|
|
@@ -498,10 +498,16 @@ declare class ToolsCapability implements Capability {
|
|
|
498
498
|
apply(draft: CompiledAgentOptionsDraft): void;
|
|
499
499
|
}
|
|
500
500
|
/**
|
|
501
|
-
* Enables skills by name
|
|
502
|
-
*
|
|
501
|
+
* Enables skills by name (or inline). M57: a CLASS now (was a factory function). Validation moves to
|
|
502
|
+
* the constructor — fail-fast at authoring, the same place `ModelCapability`/`AgentConfigCapability`
|
|
503
|
+
* validate. The `apply` body (delegate + merge) is unchanged, so the compiled output is identical.
|
|
503
504
|
*/
|
|
504
|
-
declare
|
|
505
|
+
declare class SkillsCapability implements Capability {
|
|
506
|
+
#private;
|
|
507
|
+
readonly name = "skills";
|
|
508
|
+
constructor(entries: readonly (string | InlineSkill)[]);
|
|
509
|
+
apply(draft: CompiledAgentOptionsDraft): void;
|
|
510
|
+
}
|
|
505
511
|
|
|
506
512
|
/**
|
|
507
513
|
* M52 — resolution + composition. The registry is what unlocks FILE-BASED authoring (a config lists
|
|
@@ -531,51 +537,122 @@ declare class CapabilityPreset implements Capability {
|
|
|
531
537
|
apply(draft: CompiledAgentOptionsDraft): void;
|
|
532
538
|
}
|
|
533
539
|
|
|
540
|
+
/**
|
|
541
|
+
* M53 — the capabilities that replace the waist-bound agent decorators, one per field the decorator
|
|
542
|
+
* pipeline produces today (`docs/agents/decorator-to-capability.md` § A).
|
|
543
|
+
*
|
|
544
|
+
* M57 reverses ADR 0001 § 4 (which kept the pure-assignment ones as a factory function to avoid
|
|
545
|
+
* "13 near-identical classes"): the authoring surface is now 100% classes, aligned with the SDK's
|
|
546
|
+
* `X.create()`/class shape. The `FieldCapability` base keeps the assignment ones DRY (one line each);
|
|
547
|
+
* the behaviour-carrying ones are written out. Rationale in ADR 0005.
|
|
548
|
+
*/
|
|
549
|
+
/**
|
|
550
|
+
* Base for a capability whose only job is to assign one waist field — no validation, no merge, no
|
|
551
|
+
* precedence. M57: this replaces the `fieldCapability(name, field)` factory function with a class, so
|
|
552
|
+
* the authoring surface is 100% classes (aligned with the SDK's `X.create()` and the existing
|
|
553
|
+
* `ModelCapability`). The subclasses below are one line each; the shared `apply` lives here (DRY).
|
|
554
|
+
* NOT the Template-Method the ADR-0001 refused — that was inheritance of variable *behaviour*
|
|
555
|
+
* (`shouldContinue`); here the base carries *data* (name/field) and `apply` is identical for all.
|
|
556
|
+
*/
|
|
557
|
+
declare abstract class FieldCapability<K extends keyof CompiledAgentOptionsDraft> implements Capability {
|
|
558
|
+
private readonly value;
|
|
559
|
+
abstract readonly name: string;
|
|
560
|
+
protected abstract readonly field: K;
|
|
561
|
+
constructor(value: NonNullable<CompiledAgentOptionsDraft[K]>);
|
|
562
|
+
apply(draft: CompiledAgentOptionsDraft): void;
|
|
563
|
+
}
|
|
534
564
|
/** `@Memory` → `memory`. */
|
|
535
|
-
declare
|
|
565
|
+
declare class MemoryCapability extends FieldCapability<'memory'> {
|
|
566
|
+
readonly name = "memory";
|
|
567
|
+
protected readonly field: "memory";
|
|
568
|
+
}
|
|
536
569
|
/**
|
|
537
570
|
* `@ContextWindow` → `context`. DELEGATES to `compileContextWindow`, which is the canonical
|
|
538
571
|
* `ContextWindowOptions → ContextSettings` conversion (it also reports the metadata-only knobs).
|
|
539
572
|
* Taking a pre-converted value here would duplicate that knowledge — the exact divergence the M52
|
|
540
573
|
* zero-behavior proof caught in `skills`.
|
|
541
574
|
*/
|
|
542
|
-
declare
|
|
575
|
+
declare class ContextWindowCapability implements Capability {
|
|
576
|
+
private readonly options;
|
|
577
|
+
readonly name = "context-window";
|
|
578
|
+
constructor(options: ContextWindowOptions);
|
|
579
|
+
apply(draft: CompiledAgentOptionsDraft): void;
|
|
580
|
+
}
|
|
543
581
|
/** `@ProjectContext` → `projectContext`. */
|
|
544
|
-
declare
|
|
582
|
+
declare class ProjectContextCapability extends FieldCapability<'projectContext'> {
|
|
583
|
+
readonly name = "project-context";
|
|
584
|
+
protected readonly field: "projectContext";
|
|
585
|
+
}
|
|
545
586
|
/** `@MCP` → `mcpServers`. */
|
|
546
|
-
declare
|
|
587
|
+
declare class McpServersCapability extends FieldCapability<'mcpServers'> {
|
|
588
|
+
readonly name = "mcp";
|
|
589
|
+
protected readonly field: "mcpServers";
|
|
590
|
+
}
|
|
547
591
|
/** `@Guardrails` → `guardrails`. */
|
|
548
|
-
declare
|
|
592
|
+
declare class GuardrailsCapability extends FieldCapability<'guardrails'> {
|
|
593
|
+
readonly name = "guardrails";
|
|
594
|
+
protected readonly field: "guardrails";
|
|
595
|
+
}
|
|
549
596
|
/**
|
|
550
597
|
* `@Checkpoint` → `checkpoint`. Carries the non-durable WARNING the metadata walk used to emit: only
|
|
551
598
|
* `'filesystem'` selects the SDK's durable store, so any other storage cannot resume across
|
|
552
599
|
* requests. The warning moves WITH the feature — a declared checkpoint that silently cannot resume
|
|
553
600
|
* is exactly the kind of no-op this project refuses to ship.
|
|
554
601
|
*/
|
|
555
|
-
declare
|
|
602
|
+
declare class CheckpointCapability implements Capability {
|
|
603
|
+
private readonly options;
|
|
604
|
+
readonly name = "checkpoint";
|
|
605
|
+
constructor(options: CompiledAgentOptions['checkpoint']);
|
|
606
|
+
apply(draft: CompiledAgentOptionsDraft): void;
|
|
607
|
+
}
|
|
556
608
|
/**
|
|
557
609
|
* `@HumanInTheLoop` → `hitl`, keyed `"<namespace>_<tool>"` — the same key `compileHitlGates` mints
|
|
558
610
|
* via `toolRuntimeName`. The separator is `_`, not `.`: the dot is outside the charset the SDK
|
|
559
611
|
* accepts, and a gate keyed with a dot silently failed to match its tool (theokit#145).
|
|
560
612
|
*/
|
|
561
|
-
declare
|
|
613
|
+
declare class HumanInTheLoopCapability extends FieldCapability<'hitl'> {
|
|
614
|
+
readonly name = "human-in-the-loop";
|
|
615
|
+
protected readonly field: "hitl";
|
|
616
|
+
}
|
|
562
617
|
/**
|
|
563
618
|
* `@SubAgents` → `agents`. MERGES instead of `setOnce`: `agents` is a pre-seeded collection on the
|
|
564
619
|
* draft (`createDraft` gives it `{}`), so a `setOnce` would conflict against the seed itself — the
|
|
565
620
|
* same trap the pre-seeded `stream` sprang in M52. Merging also lets a preset declare a baseline
|
|
566
621
|
* child set that a call site extends.
|
|
567
622
|
*/
|
|
568
|
-
declare
|
|
623
|
+
declare class SubAgentsCapability implements Capability {
|
|
624
|
+
private readonly children;
|
|
625
|
+
readonly name = "sub-agents";
|
|
626
|
+
constructor(children: CompiledAgentOptions['agents']);
|
|
627
|
+
apply(draft: CompiledAgentOptionsDraft): void;
|
|
628
|
+
}
|
|
569
629
|
/**
|
|
570
630
|
* `@Skills({ include, autoDiscover })` → `skills`. Delegates to `compileSkills` (same reason as
|
|
571
631
|
* `contextWindow`). Distinct from the M52 `skills([...])`, which takes the plain name/inline list.
|
|
572
632
|
*/
|
|
573
|
-
declare
|
|
633
|
+
declare class SkillsOptionsCapability implements Capability {
|
|
634
|
+
private readonly options;
|
|
635
|
+
readonly name = "skills";
|
|
636
|
+
constructor(options: SkillsOptions);
|
|
637
|
+
apply(draft: CompiledAgentOptionsDraft): void;
|
|
638
|
+
}
|
|
574
639
|
/** Functional-path fields that had no decorator source — closing the gap list, not adding surface. */
|
|
575
|
-
declare
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
640
|
+
declare class SettingSourcesCapability extends FieldCapability<'settingSources'> {
|
|
641
|
+
readonly name = "setting-sources";
|
|
642
|
+
protected readonly field: "settingSources";
|
|
643
|
+
}
|
|
644
|
+
declare class PluginsCapability extends FieldCapability<'plugins'> {
|
|
645
|
+
readonly name = "plugins";
|
|
646
|
+
protected readonly field: "plugins";
|
|
647
|
+
}
|
|
648
|
+
declare class RunContextCapability extends FieldCapability<'runContext'> {
|
|
649
|
+
readonly name = "run-context";
|
|
650
|
+
protected readonly field: "runContext";
|
|
651
|
+
}
|
|
652
|
+
declare class SkillsResolverCapability extends FieldCapability<'skillsResolver'> {
|
|
653
|
+
readonly name = "skills-resolver";
|
|
654
|
+
protected readonly field: "skillsResolver";
|
|
655
|
+
}
|
|
579
656
|
/** The scalar agent config (name/route are HTTP concerns, never agent config). */
|
|
580
657
|
interface AgentConfig {
|
|
581
658
|
readonly systemPrompt?: CompiledAgentOptions['systemPrompt'];
|
|
@@ -872,4 +949,4 @@ declare class AcpClient {
|
|
|
872
949
|
private handleServerRequest;
|
|
873
950
|
}
|
|
874
951
|
|
|
875
|
-
export { type A2AAuth, type A2ACapabilities, type A2ASkill, type A2AToolConfig, AcpClient, AcpMessageDecoder, type AcpTransport, type AgentCard, type AgentConfig, AgentConfigCapability, AgentManifestEntry, AgentRunner, AgentRunnerBuilder, type AgentRunnerRunOptions, ApprovalOptions, type BuildAgentCardOptions, type Capability, CapabilityConflictError, CapabilityPreset, CapabilityRegistry, type CompactionCallOptions, type CompactionStrategyConfig, CompiledAgentOptions, type CompiledAgentOptionsDraft, CompiledTool, ConfigurationError, type CostGuardOptions, DEFAULT_KEEP_TOKENS, DelegationResult, type FinalizedDraft, Guardrail, HumanInTheLoopOptions, LoopStrategy, MCP_PROTOCOL_VERSION, MainLoopCapability, MainLoopMeta, type McpJsonSchema, type McpServerInfo, type McpToolDescriptor, ModelCapability, type OutputModerationOptions, type PiiOptions, type PromptInjectionOptions, type ProvenanceEntry, ReasoningEffort, ReflectionStrategy, RoundStreamFactory,
|
|
952
|
+
export { type A2AAuth, type A2ACapabilities, type A2ASkill, type A2AToolConfig, AcpClient, AcpMessageDecoder, type AcpTransport, type AgentCard, type AgentConfig, AgentConfigCapability, AgentManifestEntry, AgentRunner, AgentRunnerBuilder, type AgentRunnerRunOptions, ApprovalOptions, type BuildAgentCardOptions, type Capability, CapabilityConflictError, CapabilityPreset, CapabilityRegistry, CheckpointCapability, type CompactionCallOptions, type CompactionStrategyConfig, CompiledAgentOptions, type CompiledAgentOptionsDraft, CompiledTool, ConfigurationError, ContextWindowCapability, type CostGuardOptions, DEFAULT_KEEP_TOKENS, DelegationResult, FieldCapability, type FinalizedDraft, Guardrail, GuardrailsCapability, HumanInTheLoopCapability, HumanInTheLoopOptions, LoopStrategy, MCP_PROTOCOL_VERSION, MainLoopCapability, MainLoopMeta, type McpJsonSchema, type McpServerInfo, McpServersCapability, type McpToolDescriptor, MemoryCapability, ModelCapability, type OutputModerationOptions, type PiiOptions, PluginsCapability, ProjectContextCapability, type PromptInjectionOptions, type ProvenanceEntry, ReasoningEffort, ReflectionStrategy, RoundStreamFactory, RunContextCapability, SettingSourcesCapability, SkillsCapability, SkillsOptionsCapability, SkillsResolverCapability, StreamEvent, SubAgentsCapability, type Summarize, type ToolDeclaration, ToolOptions, ToolboxCapability, type ToolboxSource, ToolsCapability, type TranscriptCompactionStrategy, UnknownCapabilityError, applyCapabilities, buildAgentCard, buildMcpToolDescriptors, compactionStrategyConfigSchema, costGuard, createA2ATool, createDraft, deriveConversationId, encodeAcpMessage, estimateTokens, mcpServerInfo, moderateOutputStream, outputModeration, parseConversationId, piiDetector, promptInjectionDetector, resolveCompactionStrategy, runInputGuards, runOutputGuards, setOnce, tokenBudgetCompactionStrategy, unicodeNormalizer, wellKnownCardPath };
|