@theokit/sdk 4.28.0 → 4.30.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/agent-7YUGJJTU.js +41 -0
- package/dist/agent-7YUGJJTU.js.map +1 -0
- package/dist/{cron-BN6JJlDw.d.ts → agent-Bzg2_uGr.d.cts} +56 -577
- package/dist/{cron-CoQREV_k.d.cts → agent-Ekv8y7_c.d.ts} +56 -577
- package/dist/agent-LD76RI74.cjs +50 -0
- package/dist/agent-LD76RI74.cjs.map +1 -0
- package/dist/{chunk-AKSBP7OO.js → chunk-5IB2UKSN.js} +5 -41
- package/dist/chunk-5IB2UKSN.js.map +1 -0
- package/dist/{chunk-PF5Y5BHG.js → chunk-5YCAR23S.js} +3 -3
- package/dist/{chunk-PF5Y5BHG.js.map → chunk-5YCAR23S.js.map} +1 -1
- package/dist/chunk-BNIFFFH3.js +129 -0
- package/dist/chunk-BNIFFFH3.js.map +1 -0
- package/dist/{chunk-LSLPF6OI.cjs → chunk-DHLZIMP6.cjs} +5 -43
- package/dist/chunk-DHLZIMP6.cjs.map +1 -0
- package/dist/chunk-FKCC2MED.js +43 -0
- package/dist/chunk-FKCC2MED.js.map +1 -0
- package/dist/{chunk-PN53WGEI.cjs → chunk-GWMQ5CS3.cjs} +633 -741
- package/dist/chunk-GWMQ5CS3.cjs.map +1 -0
- package/dist/{chunk-QUTUJ6P6.cjs → chunk-HK7ZHSAX.cjs} +25 -16
- package/dist/chunk-HK7ZHSAX.cjs.map +1 -0
- package/dist/{chunk-XW6RXVGB.js → chunk-ISZ3MBUD.js} +610 -718
- package/dist/chunk-ISZ3MBUD.js.map +1 -0
- package/dist/{chunk-MQLCZ4HJ.cjs → chunk-JLMXKTBX.cjs} +4 -4
- package/dist/{chunk-MQLCZ4HJ.cjs.map → chunk-JLMXKTBX.cjs.map} +1 -1
- package/dist/chunk-LALRCFSN.cjs +46 -0
- package/dist/chunk-LALRCFSN.cjs.map +1 -0
- package/dist/{chunk-I53QDJVI.cjs → chunk-NG6B2PMA.cjs} +5 -5
- package/dist/{chunk-I53QDJVI.cjs.map → chunk-NG6B2PMA.cjs.map} +1 -1
- package/dist/{chunk-DUK5WMKJ.js → chunk-R6ZP6KNB.js} +25 -16
- package/dist/chunk-R6ZP6KNB.js.map +1 -0
- package/dist/chunk-RZQ6E5YZ.cjs +131 -0
- package/dist/chunk-RZQ6E5YZ.cjs.map +1 -0
- package/dist/{chunk-G6GO6BXD.js → chunk-XAUBQMQU.js} +3 -3
- package/dist/{chunk-G6GO6BXD.js.map → chunk-XAUBQMQU.js.map} +1 -1
- package/dist/compact-session-OO2GD76G.js +1 -1
- package/dist/compact-session-OO7NVWPB.cjs +1 -1
- package/dist/cron-CjzvXGT2.d.cts +579 -0
- package/dist/cron-D0Z29gI-.d.ts +579 -0
- package/dist/cron.cjs +13 -11
- package/dist/cron.d.cts +2 -1
- package/dist/cron.d.ts +2 -1
- package/dist/cron.js +12 -10
- package/dist/eval.cjs +17 -15
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +13 -11
- package/dist/eval.js.map +1 -1
- package/dist/{index-manager-CB6I7XFQ.cjs → index-manager-H7HUMW52.cjs} +5 -5
- package/dist/{index-manager-CB6I7XFQ.cjs.map → index-manager-H7HUMW52.cjs.map} +1 -1
- package/dist/{index-manager-L27Q3QAC.js → index-manager-P7ZUX2RG.js} +4 -4
- package/dist/{index-manager-L27Q3QAC.js.map → index-manager-P7ZUX2RG.js.map} +1 -1
- package/dist/index.cjs +65 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -4
- package/dist/index.d.ts +18 -4
- package/dist/index.js +41 -20
- package/dist/index.js.map +1 -1
- package/dist/internal/persistence/index.cjs +10 -10
- package/dist/internal/persistence/index.js +2 -2
- package/dist/internal/persistence/jsonl.d.cts +7 -0
- package/dist/internal/persistence/jsonl.d.ts +7 -0
- package/dist/internal/persistence/session-writer.d.cts +56 -0
- package/dist/internal/persistence/session-writer.d.ts +56 -0
- package/dist/internal/persistence/transcript-ops.d.cts +71 -0
- package/dist/internal/persistence/transcript-ops.d.ts +71 -0
- package/dist/internal/plugins/types.d.cts +1 -1
- package/dist/internal/plugins/types.d.ts +1 -1
- package/dist/persistence.cjs +115 -12
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.d.cts +2 -0
- package/dist/persistence.d.ts +2 -0
- package/dist/persistence.js +105 -3
- package/dist/persistence.js.map +1 -1
- package/dist/skills.cjs +4 -3
- package/dist/skills.js +2 -1
- package/dist/subagents-loader.cjs +19 -0
- package/dist/subagents-loader.cjs.map +1 -0
- package/dist/subagents-loader.d.cts +39 -0
- package/dist/subagents-loader.d.ts +39 -0
- package/dist/subagents-loader.js +16 -0
- package/dist/subagents-loader.js.map +1 -0
- package/dist/types/plugin.d.ts +32 -0
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.js +1 -1
- package/package.json +12 -2
- package/dist/chunk-AKSBP7OO.js.map +0 -1
- package/dist/chunk-DUK5WMKJ.js.map +0 -1
- package/dist/chunk-LSLPF6OI.cjs.map +0 -1
- package/dist/chunk-PN53WGEI.cjs.map +0 -1
- package/dist/chunk-QUTUJ6P6.cjs.map +0 -1
- package/dist/chunk-XW6RXVGB.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-BdL-buYn.cjs';
|
|
2
2
|
export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-BdL-buYn.cjs';
|
|
3
|
-
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as
|
|
4
|
-
export {
|
|
3
|
+
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as SDKProvider } from './agent-Bzg2_uGr.cjs';
|
|
4
|
+
export { u as ActiveMemoryPassArgs, v as ActiveMemoryPassResult, w as AgentMemory, x as BudgetCheck, y as BudgetTotal, z as BudgetUsageEvent, D as CloudEnv, E as CloudRepo, F as ContextBudget, H as ContextManagerKind, K as ContextSnapshot, N as ContextSource, O as ContextSourceStatus, Q as CreateSkillSpec, R as HookName, T as InvalidateCacheOptions, U as MemoryAdapter, V as MemoryAdapterCapabilities, W as MemoryContext, X as MemoryFact, Y as MemoryProviderHandle, Z as MemoryProviderInitOptions, _ as MemoryRevision, $ as MemoryToolSchema, a0 as MemoryTurnMessage, a1 as PersonalityPreset, a2 as PluginContext, a3 as PostAssistantReplyContext, a4 as PostToolCallContext, a5 as PreToolCallContext, a6 as PreUserSendContext, a7 as PreUserSendResult, a8 as ProviderCapability, a9 as ProviderRoute, aa as ProviderTransform, ab as ProviderTransformContext, ac as RecordSessionSummaryArgs, ad as ResolvedProviderRoute, ae as RunUntilIterator, af as SDKAgentPlugins, ag as SDKAgentSkillDetail, ah as SDKAgentSkills, ai as SDKArtifact, aj as SDKContextManager, ak as SDKPluginMetadata, al as SDKProvidersManager, am as SessionLifecycleContext, an as SessionRecord, ao as SessionStore, ap as SettingSource, aq as Skill, ar as SkillsResolver, as as SkillsResolverContext, at as SystemPromptContext, au as SystemPromptMemoryFact, av as SystemPromptSkillRef, aw as TelemetrySettings, ax as ToolCallSummary, ay as ToolResultTransformContext, az as TransformContext, aA as Verdict } from './agent-Bzg2_uGr.cjs';
|
|
5
5
|
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-OJbGyweZ.cjs';
|
|
6
6
|
export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-OJbGyweZ.cjs';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
|
+
import { S as StepResult } from './cron-CjzvXGT2.cjs';
|
|
10
|
+
export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-CjzvXGT2.cjs';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Public compaction / context-management helpers (M2-1, extended V3-3).
|
|
@@ -1767,8 +1769,20 @@ declare function sessionScopePrefix(scope: SessionScope): string;
|
|
|
1767
1769
|
* @public
|
|
1768
1770
|
*/
|
|
1769
1771
|
interface SquadOptions {
|
|
1770
|
-
/**
|
|
1771
|
-
|
|
1772
|
+
/**
|
|
1773
|
+
* Agents run in array order (sequential pipeline). Must be non-empty.
|
|
1774
|
+
*
|
|
1775
|
+
* M81 — accepts an `AgentDefinition` (plain data) as well as a constructed `SDKAgent`. Building a
|
|
1776
|
+
* team used to force the caller to materialize every member by hand first: resolve the credential,
|
|
1777
|
+
* assemble the options, call `Agent.create`, await. That is precisely the work this milestone moves
|
|
1778
|
+
* into the framework elsewhere, so leaving it here would be inconsistent — and with
|
|
1779
|
+
* `discoverSubagents` now public (`@theokit/sdk/subagents-loader`), the data that describes an
|
|
1780
|
+
* agent is reachable, which closes the loop: discover → build a team, with no manual step between.
|
|
1781
|
+
*
|
|
1782
|
+
* Mixing both forms in one list is supported on purpose: a real team usually has members from
|
|
1783
|
+
* different origins.
|
|
1784
|
+
*/
|
|
1785
|
+
agents: ReadonlyArray<SDKAgent | AgentDefinition>;
|
|
1772
1786
|
/**
|
|
1773
1787
|
* Orchestration process. Only `"sequential"` is supported (the default).
|
|
1774
1788
|
* `"hierarchical"` is accepted by the type but rejected at runtime with
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DHZtSNnj.js';
|
|
2
2
|
export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DHZtSNnj.js';
|
|
3
|
-
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as
|
|
4
|
-
export {
|
|
3
|
+
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as SDKProvider } from './agent-Ekv8y7_c.js';
|
|
4
|
+
export { u as ActiveMemoryPassArgs, v as ActiveMemoryPassResult, w as AgentMemory, x as BudgetCheck, y as BudgetTotal, z as BudgetUsageEvent, D as CloudEnv, E as CloudRepo, F as ContextBudget, H as ContextManagerKind, K as ContextSnapshot, N as ContextSource, O as ContextSourceStatus, Q as CreateSkillSpec, R as HookName, T as InvalidateCacheOptions, U as MemoryAdapter, V as MemoryAdapterCapabilities, W as MemoryContext, X as MemoryFact, Y as MemoryProviderHandle, Z as MemoryProviderInitOptions, _ as MemoryRevision, $ as MemoryToolSchema, a0 as MemoryTurnMessage, a1 as PersonalityPreset, a2 as PluginContext, a3 as PostAssistantReplyContext, a4 as PostToolCallContext, a5 as PreToolCallContext, a6 as PreUserSendContext, a7 as PreUserSendResult, a8 as ProviderCapability, a9 as ProviderRoute, aa as ProviderTransform, ab as ProviderTransformContext, ac as RecordSessionSummaryArgs, ad as ResolvedProviderRoute, ae as RunUntilIterator, af as SDKAgentPlugins, ag as SDKAgentSkillDetail, ah as SDKAgentSkills, ai as SDKArtifact, aj as SDKContextManager, ak as SDKPluginMetadata, al as SDKProvidersManager, am as SessionLifecycleContext, an as SessionRecord, ao as SessionStore, ap as SettingSource, aq as Skill, ar as SkillsResolver, as as SkillsResolverContext, at as SystemPromptContext, au as SystemPromptMemoryFact, av as SystemPromptSkillRef, aw as TelemetrySettings, ax as ToolCallSummary, ay as ToolResultTransformContext, az as TransformContext, aA as Verdict } from './agent-Ekv8y7_c.js';
|
|
5
5
|
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-OJbGyweZ.js';
|
|
6
6
|
export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-OJbGyweZ.js';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
|
+
import { S as StepResult } from './cron-D0Z29gI-.js';
|
|
10
|
+
export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-D0Z29gI-.js';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Public compaction / context-management helpers (M2-1, extended V3-3).
|
|
@@ -1767,8 +1769,20 @@ declare function sessionScopePrefix(scope: SessionScope): string;
|
|
|
1767
1769
|
* @public
|
|
1768
1770
|
*/
|
|
1769
1771
|
interface SquadOptions {
|
|
1770
|
-
/**
|
|
1771
|
-
|
|
1772
|
+
/**
|
|
1773
|
+
* Agents run in array order (sequential pipeline). Must be non-empty.
|
|
1774
|
+
*
|
|
1775
|
+
* M81 — accepts an `AgentDefinition` (plain data) as well as a constructed `SDKAgent`. Building a
|
|
1776
|
+
* team used to force the caller to materialize every member by hand first: resolve the credential,
|
|
1777
|
+
* assemble the options, call `Agent.create`, await. That is precisely the work this milestone moves
|
|
1778
|
+
* into the framework elsewhere, so leaving it here would be inconsistent — and with
|
|
1779
|
+
* `discoverSubagents` now public (`@theokit/sdk/subagents-loader`), the data that describes an
|
|
1780
|
+
* agent is reachable, which closes the loop: discover → build a team, with no manual step between.
|
|
1781
|
+
*
|
|
1782
|
+
* Mixing both forms in one list is supported on purpose: a real team usually has members from
|
|
1783
|
+
* different origins.
|
|
1784
|
+
*/
|
|
1785
|
+
agents: ReadonlyArray<SDKAgent | AgentDefinition>;
|
|
1772
1786
|
/**
|
|
1773
1787
|
* Orchestration process. Only `"sequential"` is supported (the default).
|
|
1774
1788
|
* `"hierarchical"` is accepted by the type but rejected at runtime with
|
package/dist/index.js
CHANGED
|
@@ -6,45 +6,47 @@ import './chunk-GJAGKFTR.js';
|
|
|
6
6
|
import { Workflow, agentStep } from './chunk-BFWPZMG7.js';
|
|
7
7
|
import './chunk-UVNG67DG.js';
|
|
8
8
|
import './chunk-CAH3G4IS.js';
|
|
9
|
-
export { Cron } from './chunk-
|
|
10
|
-
import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, shouldUseFixtureMode, isFixtureApiKey, httpRequest, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-
|
|
11
|
-
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-
|
|
9
|
+
export { Cron } from './chunk-5YCAR23S.js';
|
|
10
|
+
import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, shouldUseFixtureMode, isFixtureApiKey, httpRequest, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-ISZ3MBUD.js';
|
|
11
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-ISZ3MBUD.js';
|
|
12
|
+
import './chunk-2SFBB54R.js';
|
|
12
13
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-HRA3CPGG.js';
|
|
13
14
|
export { emitRunEvent } from './chunk-HRA3CPGG.js';
|
|
14
15
|
import './chunk-SQLZ7ONU.js';
|
|
15
16
|
import './chunk-K2BQQ445.js';
|
|
17
|
+
import './chunk-U6QGZHPN.js';
|
|
16
18
|
import { discoverProviderPlugins, mapOllamaTransportError, mapOllamaHttpError } from './chunk-NRSH7RJY.js';
|
|
17
19
|
import './chunk-6CLRANZA.js';
|
|
18
20
|
import './chunk-EEZ7CFMM.js';
|
|
19
|
-
import { lanceStoragePath, LanceIndex, readFactsFromMarkdown, defaultIndexPath, openMemoryDb, memoryDir } from './chunk-
|
|
21
|
+
import { lanceStoragePath, LanceIndex, readFactsFromMarkdown, defaultIndexPath, openMemoryDb, memoryDir } from './chunk-XAUBQMQU.js';
|
|
20
22
|
import './chunk-XIG2IE3L.js';
|
|
21
|
-
import './chunk-
|
|
23
|
+
import './chunk-7GFX45DD.js';
|
|
22
24
|
import './chunk-DGRZNMTU.js';
|
|
23
25
|
import './chunk-FD2UT76F.js';
|
|
24
|
-
import './chunk-U6QGZHPN.js';
|
|
25
26
|
import './chunk-U54XCYG3.js';
|
|
26
27
|
import './chunk-FV3YEMQ7.js';
|
|
27
28
|
import './chunk-6X6ID4MO.js';
|
|
28
|
-
import './chunk-
|
|
29
|
+
import './chunk-UJ7IQJAG.js';
|
|
29
30
|
import './chunk-7AD3ZTZL.js';
|
|
30
31
|
import './chunk-V4XRLPEF.js';
|
|
31
32
|
import './chunk-5PZMMF4H.js';
|
|
32
|
-
import './chunk-77FOZCOT.js';
|
|
33
33
|
import './chunk-HZQEDNF6.js';
|
|
34
|
+
import './chunk-77FOZCOT.js';
|
|
34
35
|
import { withCwdMutex } from './chunk-2XLKLVVR.js';
|
|
35
36
|
export { withCwdMutex } from './chunk-2XLKLVVR.js';
|
|
36
37
|
import './chunk-ZZWTY3RX.js';
|
|
37
38
|
import './chunk-BXV2QUIC.js';
|
|
38
39
|
import { toJsonSchema } from './chunk-4VPXM6UU.js';
|
|
40
|
+
import { replaceFileAtomic } from './chunk-S2BBRVQX.js';
|
|
41
|
+
import './chunk-BNIFFFH3.js';
|
|
39
42
|
import './chunk-WA3FO4R7.js';
|
|
40
43
|
import './chunk-X2FR4OIT.js';
|
|
41
44
|
import { registerBuiltins, listProviders, getCatalogCapabilities, getProviderProfile } from './chunk-KAP4GJHO.js';
|
|
42
45
|
import './chunk-LU7VALW5.js';
|
|
43
46
|
import './chunk-5NBUH3NO.js';
|
|
44
|
-
import './chunk-
|
|
47
|
+
import './chunk-5IB2UKSN.js';
|
|
45
48
|
import './chunk-POQT2OIF.js';
|
|
46
|
-
import './chunk-
|
|
47
|
-
import { replaceFileAtomic } from './chunk-S2BBRVQX.js';
|
|
49
|
+
import './chunk-FKCC2MED.js';
|
|
48
50
|
import { BudgetExceededError, MemoryAdapterError, AuthenticationError, ConfigurationError } from './chunk-WLKFWQSJ.js';
|
|
49
51
|
export { AgentDisposedError, AgentRunError, AuthenticationError, BudgetExceededError, ConfigurationError, IntegrationNotConnectedError, InvalidTaskIdError, MemoryAdapterError, NetworkError, RateLimitError, TaskNotFoundError, TheokitAgentError, UnknownAgentError, UnsupportedBudgetOperationError, UnsupportedRunOperationError, UnsupportedTaskOperationError, isTransientError } from './chunk-WLKFWQSJ.js';
|
|
50
52
|
import { redactSecrets, addPattern } from './chunk-JTFYYKDT.js';
|
|
@@ -1144,7 +1146,7 @@ var Memory = {
|
|
|
1144
1146
|
openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
|
|
1145
1147
|
return await peer.IndexManager.open(openArgs);
|
|
1146
1148
|
}
|
|
1147
|
-
const { IndexManager } = await import('./index-manager-
|
|
1149
|
+
const { IndexManager } = await import('./index-manager-P7ZUX2RG.js');
|
|
1148
1150
|
openArgs.embedding = await resolveEmbedding(opts.embedding, MEMORY_EMBEDDING_ADAPTERS);
|
|
1149
1151
|
return await IndexManager.open(openArgs);
|
|
1150
1152
|
},
|
|
@@ -1574,6 +1576,21 @@ function sessionScopePrefix(scope) {
|
|
|
1574
1576
|
}
|
|
1575
1577
|
|
|
1576
1578
|
// src/squad.ts
|
|
1579
|
+
function ehAgenteConstruido(m) {
|
|
1580
|
+
return typeof m.send === "function";
|
|
1581
|
+
}
|
|
1582
|
+
async function materializar(def, indice) {
|
|
1583
|
+
const { Agent: Agent2 } = await import('./agent-7YUGJJTU.js');
|
|
1584
|
+
return Agent2.create({
|
|
1585
|
+
// `AgentDefinition.model` admite o sentinel `'inherit'`, que não é um id de modelo. Herdar
|
|
1586
|
+
// aqui significa "não declare nada e deixe o default valer" — passar o literal adiante criaria
|
|
1587
|
+
// um agente pedindo um modelo chamado `inherit`.
|
|
1588
|
+
...def.model !== void 0 && def.model !== "inherit" ? { model: def.model } : {},
|
|
1589
|
+
...def.prompt !== void 0 ? { systemPrompt: def.prompt } : {},
|
|
1590
|
+
agentId: `squad-member-${String(indice)}`,
|
|
1591
|
+
local: {}
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1577
1594
|
function createSquad(options) {
|
|
1578
1595
|
const { agents } = options;
|
|
1579
1596
|
if (!Array.isArray(agents) || agents.length === 0) {
|
|
@@ -1589,18 +1606,22 @@ function createSquad(options) {
|
|
|
1589
1606
|
}
|
|
1590
1607
|
return {
|
|
1591
1608
|
run: async (input) => {
|
|
1592
|
-
|
|
1593
|
-
for (let i = 0; i < agents.length; i++) {
|
|
1594
|
-
const agent = agents[i];
|
|
1595
|
-
if (agent === void 0) continue;
|
|
1596
|
-
const opts = i > 0 ? { origin: { kind: "peer", from: `agent-${i - 1}` } } : void 0;
|
|
1597
|
-
builder = builder.then(agentStep(`agent-${i}`, agent, (prev) => String(prev), opts));
|
|
1598
|
-
}
|
|
1599
|
-
const run = await builder.commit().run(input);
|
|
1609
|
+
const run = await (await montarPipeline(agents, options.name)).run(input);
|
|
1600
1610
|
return { result: run.output, status: run.status, steps: run.stepResults };
|
|
1601
1611
|
}
|
|
1602
1612
|
};
|
|
1603
1613
|
}
|
|
1614
|
+
async function montarPipeline(agents, nome) {
|
|
1615
|
+
let builder = Workflow.create({ name: nome ?? "squad" });
|
|
1616
|
+
for (let i = 0; i < agents.length; i++) {
|
|
1617
|
+
const membro = agents[i];
|
|
1618
|
+
if (membro === void 0) continue;
|
|
1619
|
+
const agent = ehAgenteConstruido(membro) ? membro : await materializar(membro, i);
|
|
1620
|
+
const opts = i > 0 ? { origin: { kind: "peer", from: `agent-${i - 1}` } } : void 0;
|
|
1621
|
+
builder = builder.then(agentStep(`agent-${i}`, agent, (prev) => String(prev), opts));
|
|
1622
|
+
}
|
|
1623
|
+
return builder.commit();
|
|
1624
|
+
}
|
|
1604
1625
|
var Squad = class {
|
|
1605
1626
|
constructor() {
|
|
1606
1627
|
}
|