@theokit/sdk 5.0.0-next.1 → 5.0.0-next.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/CHANGELOG.md +162 -0
- package/dist/{agent-CgNzshyV.d.cts → agent-C3KO5LKm.d.cts} +49 -3
- package/dist/{agent-CdYJfKr6.d.ts → agent-CvmTR9uf.d.ts} +49 -3
- package/dist/{agent-2E7DI47Y.cjs → agent-GPV2JWZG.cjs} +7 -7
- package/dist/{agent-2E7DI47Y.cjs.map → agent-GPV2JWZG.cjs.map} +1 -1
- package/dist/{agent-XMKRP27S.js → agent-Y24I5JBM.js} +6 -6
- package/dist/{agent-XMKRP27S.js.map → agent-Y24I5JBM.js.map} +1 -1
- package/dist/{chunk-XCCGNU3D.js → chunk-4S5TWFIZ.js} +5 -5
- package/dist/chunk-4S5TWFIZ.js.map +1 -0
- package/dist/{chunk-JTZ74HFD.js → chunk-67ADYSTW.js} +29 -9
- package/dist/chunk-67ADYSTW.js.map +1 -0
- package/dist/{chunk-CEILSTWB.cjs → chunk-GGZ5GPE3.cjs} +29 -8
- package/dist/chunk-GGZ5GPE3.cjs.map +1 -0
- package/dist/{chunk-HWSALKOR.cjs → chunk-H6YM3PV6.cjs} +5 -5
- package/dist/chunk-H6YM3PV6.cjs.map +1 -0
- package/dist/{chunk-NCGWJ3HS.js → chunk-KDR53EO7.js} +71 -32
- package/dist/chunk-KDR53EO7.js.map +1 -0
- package/dist/{chunk-WMH2MSOP.cjs → chunk-QUAEOKDW.cjs} +95 -56
- package/dist/chunk-QUAEOKDW.cjs.map +1 -0
- package/dist/{chunk-G4ZGYKJG.cjs → chunk-SYVWE64W.cjs} +6 -6
- package/dist/chunk-SYVWE64W.cjs.map +1 -0
- package/dist/{chunk-7ZK4DJD7.cjs → chunk-VXDEKILY.cjs} +4 -4
- package/dist/{chunk-7ZK4DJD7.cjs.map → chunk-VXDEKILY.cjs.map} +1 -1
- package/dist/{chunk-IJM7UGS5.js → chunk-XJZEBGXD.js} +5 -5
- package/dist/chunk-XJZEBGXD.js.map +1 -0
- package/dist/{chunk-6HIACV34.js → chunk-ZH26RNQA.js} +3 -3
- package/dist/{chunk-6HIACV34.js.map → chunk-ZH26RNQA.js.map} +1 -1
- package/dist/{context-74SBFD27.cjs → context-NI33FS2R.cjs} +7 -7
- package/dist/{context-74SBFD27.cjs.map → context-NI33FS2R.cjs.map} +1 -1
- package/dist/context-Y7B7SI5X.js +6 -0
- package/dist/{context-NZ2AC6S7.js.map → context-Y7B7SI5X.js.map} +1 -1
- package/dist/{cron-Bw6mSgD4.d.cts → cron-C3PhZED0.d.cts} +1 -1
- package/dist/{cron-DJv9oXSZ.d.ts → cron-crfMMdAw.d.ts} +1 -1
- package/dist/cron.cjs +6 -6
- package/dist/cron.d.cts +3 -3
- package/dist/cron.d.ts +3 -3
- package/dist/cron.js +5 -5
- package/dist/eval.cjs +5 -5
- package/dist/eval.js +4 -4
- package/dist/index.cjs +20 -20
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -7
- package/dist/internal/persistence/index.cjs +4 -4
- package/dist/internal/persistence/index.js +1 -1
- package/dist/internal/persistence/paths.d.cts +25 -12
- package/dist/internal/persistence/paths.d.ts +25 -12
- package/dist/internal/runtime/compat/compat-config-file.d.ts +31 -0
- package/dist/internal/runtime/compat/foreign-config-sources.d.ts +31 -1
- package/dist/internal/runtime/hooks/hooks-executor.d.ts +2 -1
- package/dist/internal/runtime/plugin-loader/plugin-bundles.d.ts +2 -1
- package/dist/{sdk-agent-Dxjb0IfM.d.cts → sdk-agent-BOiKqOgL.d.cts} +28 -1
- package/dist/{sdk-agent-ldzpyAaF.d.ts → sdk-agent-D4a_BR_6.d.ts} +28 -1
- package/dist/subagents-loader-TPZLTXYZ.cjs +16 -0
- package/dist/{subagents-loader-YWFE7KYE.cjs.map → subagents-loader-TPZLTXYZ.cjs.map} +1 -1
- package/dist/subagents-loader-Y6JFYXAY.js +7 -0
- package/dist/{subagents-loader-LSKM2UIK.js.map → subagents-loader-Y6JFYXAY.js.map} +1 -1
- package/dist/subagents-loader.cjs +3 -3
- package/dist/subagents-loader.d.cts +2 -2
- package/dist/subagents-loader.d.ts +2 -2
- package/dist/subagents-loader.js +2 -2
- package/dist/types/agent.d.ts +47 -1
- package/dist/types/sdk-agent.d.ts +28 -1
- package/dist/workflow.d.cts +1 -1
- package/dist/workflow.d.ts +1 -1
- package/docs/error-codes.md +21 -21
- package/docs/harness-capability-map.md +3 -1
- package/package.json +1 -1
- package/dist/chunk-CEILSTWB.cjs.map +0 -1
- package/dist/chunk-G4ZGYKJG.cjs.map +0 -1
- package/dist/chunk-HWSALKOR.cjs.map +0 -1
- package/dist/chunk-IJM7UGS5.js.map +0 -1
- package/dist/chunk-JTZ74HFD.js.map +0 -1
- package/dist/chunk-NCGWJ3HS.js.map +0 -1
- package/dist/chunk-WMH2MSOP.cjs.map +0 -1
- package/dist/chunk-XCCGNU3D.js.map +0 -1
- package/dist/context-NZ2AC6S7.js +0 -6
- package/dist/subagents-loader-LSKM2UIK.js +0 -7
- package/dist/subagents-loader-YWFE7KYE.cjs +0 -16
package/dist/index.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { T as TheokitAgentError, E as ErrorMetadata } from './errors-base-B5g01n
|
|
|
2
2
|
export { a as ErrorCode } from './errors-base-B5g01neU.js';
|
|
3
3
|
import { F as RunEvent, j as CostBreakdown, at as TokenUsage, R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as RunEventSink$1, S as SDKMessage } from './run-CTAdRU3U.js';
|
|
4
4
|
export { A as AgentConversationTurn, e as AssistantMessage, f as CompletionCheck, g as CompletionCheckResult, h as ConversationStep, i as ConversationTurn, j as CostBreakdown, k as CostSource, l as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, m as GenerateRunResult, I as ImageBlock, n as InputProcessorContext, o as InteractionUpdate, p as McpAuthConfig, q as McpHttpServerConfig, r as McpOAuthConfig, s as McpStdioServerConfig, t as MessageOrigin, u as ModelParameterValue, O as OutputProcessorContext, v as PartialToolCallUpdate, w as ProcessorControls, x as ProcessorTripwire, y as ProcessorViolation, z as RunCompactBoundaryEvent, B as RunCompletionCheckEvent, E as RunErrorDetail, F as RunEvent, H as RunGitInfo, J as RunMemoryDegradedEvent, K as RunOperation, L as RunPermissionDeniedEvent, N as RunRateLimitEvent, Q as RunStatus, U as RunTaskCompletedEvent, V as RunTaskStartedEvent, W as RunTaskUpdatedEvent, X as RunTimelineEvent, Y as RunToCompletionOptions, Z as RunToCompletionResult, _ as RunToolProgressEvent, $ as RunTripwireEvent, a0 as SDKAssistantMessage, a1 as SDKImage, a2 as SDKImageDimension, a3 as SDKObjectDelta, a4 as SDKRequestMessage, a5 as SDKStatusMessage, a6 as SDKSystemMessage, a7 as SDKTaskMessage, a8 as SDKThinkingMessage, a9 as SDKToolUseMessage, aa as SDKUserMessage, ab as SDKUserMessageEvent, ac as SendOptions, ad as ShellCommand, ae as ShellConversationTurn, af as ShellOutput, ag as ShellOutputDeltaUpdate, ah as StepCompletedUpdate, ai as StepStartedUpdate, aj as StreamToCompletionResult, ak as SummaryCompletedUpdate, al as SummaryStartedUpdate, am as SummaryUpdate, an as TextBlock, ao as TextDeltaUpdate, ap as ThinkingCompletedUpdate, aq as ThinkingDeltaUpdate, ar as ThinkingMessage, as as TokenDeltaUpdate, at as TokenUsage, au as ToolCall, av as ToolCallCompletedUpdate, aw as ToolCallStartedUpdate, ax as ToolContextMessage, ay as ToolResult, az as ToolResultGuardOptions, aA as ToolUseBlock, aB as TurnEndedUpdate, aC as UserMessage, aD as UserMessageAppendedUpdate } from './run-CTAdRU3U.js';
|
|
5
|
-
import { A as AgentOptions, L as LocalOptions, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as SkillsSettings, c as ListAgentsOptions, d as ListResult, e as SDKAgentInfo, G as GetAgentOptions, f as ListRunsOptions, g as GetRunOptions, h as AgentOperationOptions, i as AgentDescription, P as Plugin$1, j as ProviderProfile, I as InlineSkill, B as BudgetTracker, k as MemoryProvider, l as PreToolCallDecision } from './agent-
|
|
6
|
-
export { m as ActiveMemoryPassArgs, n as ActiveMemoryPassResult, o as AgentSubagentDescription, p as AgentToolDescription, q as BudgetCheck, r as BudgetTotal, s as BudgetUsageEvent, t as BuiltinToolName, u as CloudEnv, v as CloudRepo, w as CompatSource, x as CreateSkillSpec, H as HookName,
|
|
5
|
+
import { A as AgentOptions, L as LocalOptions, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as SkillsSettings, c as ListAgentsOptions, d as ListResult, e as SDKAgentInfo, G as GetAgentOptions, f as ListRunsOptions, g as GetRunOptions, h as AgentOperationOptions, i as AgentDescription, P as Plugin$1, j as ProviderProfile, I as InlineSkill, B as BudgetTracker, k as MemoryProvider, l as PreToolCallDecision } from './agent-CvmTR9uf.js';
|
|
6
|
+
export { m as ActiveMemoryPassArgs, n as ActiveMemoryPassResult, o as AgentSubagentDescription, p as AgentToolDescription, q as BudgetCheck, r as BudgetTotal, s as BudgetUsageEvent, t as BuiltinToolName, u as CloudEnv, v as CloudRepo, w as CompatSource, x as CompatSourceAdapter, y as CompatSurface, z as CreateSkillSpec, H as HookName, D as MemoryProviderAgentRef, E as MemoryProviderFactory, F as MemoryProviderHandle, J as MemoryProviderInitOptions, K as PluginContext, N as PluginHookDisposer, O as PostAssistantReplyContext, Q as PostToolCallContext, R as PreToolCallContext, T as PreUserSendContext, U as PreUserSendResult, V as ProviderTransform, W as ProviderTransformContext, X as RecordSessionSummaryArgs, Y as SessionLifecycleContext, Z as SessionRecord, _ as SessionStore, $ as SettingSource, a0 as Skill, a1 as SkillsResolver, a2 as SkillsResolverContext, a3 as SystemPromptContext, a4 as SystemPromptMemoryFact, a5 as TelemetrySettings, a6 as ToolCallSummary, a7 as ToolResultTransformContext, a8 as TransformContext } from './agent-CvmTR9uf.js';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
import { S as StructuredOutputError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot } from './errors-CLOAyuiv.js';
|
|
10
10
|
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, I as IntegrationNotConnectedError, m as InvalidTaskIdError, M as MemoryAdapterError, n as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, T as TaskNotFoundError, U as UnknownAgentError, o as UnsupportedBudgetOperationError, p as UnsupportedRunOperationError, q as UnsupportedTaskOperationError, r as isTransientError } from './errors-CLOAyuiv.js';
|
|
11
|
-
import { P as ProviderRoutingSettings, S as SDKAgent, C as ContextSettings, a as PluginsSettings, J as JudgeResult, G as GoalOptions, b as GoalEvent, c as GoalResult, M as MemoryId, d as SDKProvider } from './sdk-agent-
|
|
12
|
-
export { A as AgentMemory, e as AgentOperation, f as ContextBudget, g as ContextManagerKind, h as ContextSnapshot, i as ContextSource, j as ContextSourceStatus, I as InvalidateCacheOptions, k as MemoryAdapter, l as MemoryAdapterCapabilities, m as MemoryContext, n as MemoryFact, o as MemoryRevision, p as MemoryToolSchema, q as MemoryTurnMessage, r as PersonalityPreset, s as ProviderCapability, t as ProviderRoute, R as ResolvedProviderRoute, u as RunUntilIterator, v as SDKAgentPlugins, w as SDKAgentSkillDetail, x as SDKAgentSkills, y as SDKArtifact, z as SDKContextManager, B as SDKPluginMetadata, D as SDKProvidersManager, E as SystemPromptSkillRef, V as Verdict } from './sdk-agent-
|
|
13
|
-
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-
|
|
11
|
+
import { P as ProviderRoutingSettings, S as SDKAgent, C as ContextSettings, a as PluginsSettings, J as JudgeResult, G as GoalOptions, b as GoalEvent, c as GoalResult, M as MemoryId, d as SDKProvider } from './sdk-agent-D4a_BR_6.js';
|
|
12
|
+
export { A as AgentMemory, e as AgentOperation, f as ContextBudget, g as ContextManagerKind, h as ContextSnapshot, i as ContextSource, j as ContextSourceStatus, I as InvalidateCacheOptions, k as MemoryAdapter, l as MemoryAdapterCapabilities, m as MemoryContext, n as MemoryFact, o as MemoryRevision, p as MemoryToolSchema, q as MemoryTurnMessage, r as PersonalityPreset, s as ProviderCapability, t as ProviderRoute, R as ResolvedProviderRoute, u as RunUntilIterator, v as SDKAgentPlugins, w as SDKAgentSkillDetail, x as SDKAgentSkills, y as SDKArtifact, z as SDKContextManager, B as SDKPluginMetadata, D as SDKProvidersManager, E as SystemPromptSkillRef, V as Verdict } from './sdk-agent-D4a_BR_6.js';
|
|
13
|
+
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-crfMMdAw.js';
|
|
14
14
|
import { StepResult } from './workflow.js';
|
|
15
15
|
export { Workflow, agentStep, fn } from './workflow.js';
|
|
16
16
|
|
package/dist/index.js
CHANGED
|
@@ -8,15 +8,15 @@ import { Workflow, agentStep } from './chunk-HFEJE7AC.js';
|
|
|
8
8
|
export { Workflow, agentStep, fn } from './chunk-HFEJE7AC.js';
|
|
9
9
|
import './chunk-GBCVPKHE.js';
|
|
10
10
|
import './chunk-HY66GLM6.js';
|
|
11
|
-
export { Cron } from './chunk-
|
|
12
|
-
import { MEMORY_EMBEDDING_ADAPTERS, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-
|
|
13
|
-
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-
|
|
11
|
+
export { Cron } from './chunk-ZH26RNQA.js';
|
|
12
|
+
import { MEMORY_EMBEDDING_ADAPTERS, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-KDR53EO7.js';
|
|
13
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-KDR53EO7.js';
|
|
14
14
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-K2VMFZQ5.js';
|
|
15
15
|
export { emitRunEvent } from './chunk-K2VMFZQ5.js';
|
|
16
16
|
import './chunk-AWINL3ZC.js';
|
|
17
17
|
import './chunk-K2BQQ445.js';
|
|
18
18
|
import './chunk-2ZLVT7H3.js';
|
|
19
|
-
import './chunk-
|
|
19
|
+
import './chunk-XJZEBGXD.js';
|
|
20
20
|
import './chunk-2SFBB54R.js';
|
|
21
21
|
import './chunk-55GB6JYQ.js';
|
|
22
22
|
import './chunk-H73MEMQB.js';
|
|
@@ -55,8 +55,8 @@ import { withCwdMutex } from './chunk-Q5EWJPRY.js';
|
|
|
55
55
|
export { withCwdMutex } from './chunk-Q5EWJPRY.js';
|
|
56
56
|
export { TASK_RESERVED_PREFIXES, isValidTaskId } from './chunk-EIQFAOFD.js';
|
|
57
57
|
import { replaceFileAtomic } from './chunk-3JHIFQ4I.js';
|
|
58
|
-
import './chunk-
|
|
59
|
-
import './chunk-
|
|
58
|
+
import './chunk-4S5TWFIZ.js';
|
|
59
|
+
import './chunk-67ADYSTW.js';
|
|
60
60
|
import './chunk-JNAA4G4H.js';
|
|
61
61
|
import { estimateTokens, CHARS_PER_TOKEN } from './chunk-6M2OIS4Y.js';
|
|
62
62
|
export { estimateTokens } from './chunk-6M2OIS4Y.js';
|
|
@@ -1743,7 +1743,7 @@ function isBuiltAgent(m) {
|
|
|
1743
1743
|
return typeof m.send === "function";
|
|
1744
1744
|
}
|
|
1745
1745
|
async function materialize(def, index) {
|
|
1746
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1746
|
+
const { Agent: Agent2 } = await import('./agent-Y24I5JBM.js');
|
|
1747
1747
|
return Agent2.create({
|
|
1748
1748
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1749
1749
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -7,7 +7,7 @@ var chunkDQZU7JK6_cjs = require('../../chunk-DQZU7JK6.cjs');
|
|
|
7
7
|
var chunkBJUJT5ED_cjs = require('../../chunk-BJUJT5ED.cjs');
|
|
8
8
|
var chunkZF2LDKQQ_cjs = require('../../chunk-ZF2LDKQQ.cjs');
|
|
9
9
|
var chunkJLRLCBJ4_cjs = require('../../chunk-JLRLCBJ4.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkGGZ5GPE3_cjs = require('../../chunk-GGZ5GPE3.cjs');
|
|
11
11
|
require('../../chunk-J7J7J2GN.cjs');
|
|
12
12
|
require('../../chunk-6LHQPOMI.cjs');
|
|
13
13
|
var promises = require('fs/promises');
|
|
@@ -111,15 +111,15 @@ Object.defineProperty(exports, "replaceFileAtomic", {
|
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "displayTheokitHome", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkGGZ5GPE3_cjs.displayTheokitHome; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "getProfilesRoot", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkGGZ5GPE3_cjs.getProfilesRoot; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "getTheokitHome", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkGGZ5GPE3_cjs.getTheokitHome; }
|
|
123
123
|
});
|
|
124
124
|
exports.casUpdate = casUpdate;
|
|
125
125
|
exports.createExclusive = createExclusive;
|
|
@@ -5,7 +5,7 @@ export { applyWalWithFallback, isCorruptionError, openSqliteResilient } from '..
|
|
|
5
5
|
export { JsonlParseError, appendJsonl, loadJsonl, readJsonlIds, withFileLock } from '../../chunk-TA3K7SBK.js';
|
|
6
6
|
export { withCwdMutex } from '../../chunk-Q5EWJPRY.js';
|
|
7
7
|
export { atomicWriteJson, atomicWriteText, replaceFileAtomic } from '../../chunk-3JHIFQ4I.js';
|
|
8
|
-
export { displayTheokitHome, getProfilesRoot, getTheokitHome } from '../../chunk-
|
|
8
|
+
export { displayTheokitHome, getProfilesRoot, getTheokitHome } from '../../chunk-67ADYSTW.js';
|
|
9
9
|
import '../../chunk-ALUN2B4W.js';
|
|
10
10
|
import '../../chunk-CZJ6Q7CW.js';
|
|
11
11
|
import { open } from 'fs/promises';
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
|
+
import { type CompatSourceDeclaration, type CompatSurface } from "../runtime/compat/foreign-config-sources.js";
|
|
29
30
|
/**
|
|
30
31
|
* Resolve the directory cwd-anchored SDK state lives in.
|
|
31
32
|
*
|
|
@@ -48,12 +49,31 @@
|
|
|
48
49
|
* declares in `exports` but does NOT cover with its semver contract.
|
|
49
50
|
*/
|
|
50
51
|
export declare function getTheokitHome(cwd: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* The project's own configuration root: `<cwd>/.theokit`, always — never `THEOKIT_HOME`.
|
|
54
|
+
*
|
|
55
|
+
* `THEOKIT_HOME` relocates cwd-anchored SDK STATE (sessions, credentials). A project's
|
|
56
|
+
* CONFIGURATION belongs to the repository: hooks, MCP servers, context sources, subagents, the
|
|
57
|
+
* personality a project declares, all committed to git and shared by a team. Following the
|
|
58
|
+
* override for any of them would move where a project's declared capabilities come from — a
|
|
59
|
+
* behaviour change wearing the costume of a refactor, which is exactly what this function exists
|
|
60
|
+
* to make impossible to do by accident: every config-class reader calls this instead of writing
|
|
61
|
+
* `join(cwd, ".theokit")` by hand.
|
|
62
|
+
*
|
|
63
|
+
* NOT for the `.claude/`-style foreign roots {@link adaptersForSurface} adds — those are additive,
|
|
64
|
+
* opt-in, and each has its own directory name.
|
|
65
|
+
*
|
|
66
|
+
* Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package
|
|
67
|
+
* declares in `exports` but does NOT cover with its semver contract.
|
|
68
|
+
*/
|
|
69
|
+
export declare function theokitConfigRoot(cwd: string): string;
|
|
51
70
|
/**
|
|
52
71
|
* Every directory a project's configuration may be read from, in precedence order.
|
|
53
72
|
*
|
|
54
|
-
* `.theokit` first
|
|
55
|
-
*
|
|
56
|
-
*
|
|
73
|
+
* `.theokit` first — via {@link theokitConfigRoot}, so it is NEVER affected by `THEOKIT_HOME` for
|
|
74
|
+
* the reason documented there — then `.claude`. The order is the whole contract: a project that
|
|
75
|
+
* declares a skill, agent or rule in both means the explicit namespace to win, and a caller merging
|
|
76
|
+
* these roots must therefore keep the FIRST occurrence of a name rather than the last.
|
|
57
77
|
*
|
|
58
78
|
* `.claude` is read because the formats already agree and only the location did not. Measured
|
|
59
79
|
* 2026-08-26: the SKILL.md frontmatter this SDK requires (`name` + `description`) is exactly what
|
|
@@ -63,19 +83,12 @@ export declare function getTheokitHome(cwd: string): string;
|
|
|
63
83
|
* NOT a rename of `.theokit`, and not a migration. Both are read, so nothing that works today stops
|
|
64
84
|
* working — which is why this returns a LIST and not a single resolved answer.
|
|
65
85
|
*
|
|
66
|
-
* Deliberately NOT affected by `THEOKIT_HOME`, and this is the one thing to remember about it.
|
|
67
|
-
* That variable relocates cwd-anchored SDK *state* — sessions, the credential store. A project's
|
|
68
|
-
* *configuration* is a property of the repository, not of where this SDK keeps its state, and the
|
|
69
|
-
* loaders that read these directories have always anchored on `cwd` directly. Honouring the
|
|
70
|
-
* override here would silently move where a project's agents and skills come from, which is a
|
|
71
|
-
* behaviour change wearing the costume of a refactor.
|
|
72
|
-
*
|
|
73
86
|
* Creates nothing and checks nothing; either path may not exist, and the caller owns that.
|
|
74
87
|
*
|
|
75
88
|
* Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package
|
|
76
89
|
* declares in `exports` but does NOT cover with its semver contract.
|
|
77
90
|
*/
|
|
78
|
-
export declare function projectConfigRoots(cwd: string, sources
|
|
91
|
+
export declare function projectConfigRoots(cwd: string, sources: readonly CompatSourceDeclaration[], surface: CompatSurface): string[];
|
|
79
92
|
/**
|
|
80
93
|
* Every directory that may hold a plugin BUNDLE contributed by the Claude Code CLI.
|
|
81
94
|
*
|
|
@@ -89,7 +102,7 @@ export declare function projectConfigRoots(cwd: string, sources?: readonly strin
|
|
|
89
102
|
* reading a project's configuration, and guessing at someone's enablement would run code they
|
|
90
103
|
* turned off.
|
|
91
104
|
*/
|
|
92
|
-
export declare function pluginBundleRoots(cwd: string, sources
|
|
105
|
+
export declare function pluginBundleRoots(cwd: string, sources: readonly CompatSourceDeclaration[]): string[];
|
|
93
106
|
/**
|
|
94
107
|
* The directory holding every profile: always `~/.theokit/profiles`, from `os.homedir()`.
|
|
95
108
|
*
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
|
+
import { type CompatSourceDeclaration, type CompatSurface } from "../runtime/compat/foreign-config-sources.js";
|
|
29
30
|
/**
|
|
30
31
|
* Resolve the directory cwd-anchored SDK state lives in.
|
|
31
32
|
*
|
|
@@ -48,12 +49,31 @@
|
|
|
48
49
|
* declares in `exports` but does NOT cover with its semver contract.
|
|
49
50
|
*/
|
|
50
51
|
export declare function getTheokitHome(cwd: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* The project's own configuration root: `<cwd>/.theokit`, always — never `THEOKIT_HOME`.
|
|
54
|
+
*
|
|
55
|
+
* `THEOKIT_HOME` relocates cwd-anchored SDK STATE (sessions, credentials). A project's
|
|
56
|
+
* CONFIGURATION belongs to the repository: hooks, MCP servers, context sources, subagents, the
|
|
57
|
+
* personality a project declares, all committed to git and shared by a team. Following the
|
|
58
|
+
* override for any of them would move where a project's declared capabilities come from — a
|
|
59
|
+
* behaviour change wearing the costume of a refactor, which is exactly what this function exists
|
|
60
|
+
* to make impossible to do by accident: every config-class reader calls this instead of writing
|
|
61
|
+
* `join(cwd, ".theokit")` by hand.
|
|
62
|
+
*
|
|
63
|
+
* NOT for the `.claude/`-style foreign roots {@link adaptersForSurface} adds — those are additive,
|
|
64
|
+
* opt-in, and each has its own directory name.
|
|
65
|
+
*
|
|
66
|
+
* Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package
|
|
67
|
+
* declares in `exports` but does NOT cover with its semver contract.
|
|
68
|
+
*/
|
|
69
|
+
export declare function theokitConfigRoot(cwd: string): string;
|
|
51
70
|
/**
|
|
52
71
|
* Every directory a project's configuration may be read from, in precedence order.
|
|
53
72
|
*
|
|
54
|
-
* `.theokit` first
|
|
55
|
-
*
|
|
56
|
-
*
|
|
73
|
+
* `.theokit` first — via {@link theokitConfigRoot}, so it is NEVER affected by `THEOKIT_HOME` for
|
|
74
|
+
* the reason documented there — then `.claude`. The order is the whole contract: a project that
|
|
75
|
+
* declares a skill, agent or rule in both means the explicit namespace to win, and a caller merging
|
|
76
|
+
* these roots must therefore keep the FIRST occurrence of a name rather than the last.
|
|
57
77
|
*
|
|
58
78
|
* `.claude` is read because the formats already agree and only the location did not. Measured
|
|
59
79
|
* 2026-08-26: the SKILL.md frontmatter this SDK requires (`name` + `description`) is exactly what
|
|
@@ -63,19 +83,12 @@ export declare function getTheokitHome(cwd: string): string;
|
|
|
63
83
|
* NOT a rename of `.theokit`, and not a migration. Both are read, so nothing that works today stops
|
|
64
84
|
* working — which is why this returns a LIST and not a single resolved answer.
|
|
65
85
|
*
|
|
66
|
-
* Deliberately NOT affected by `THEOKIT_HOME`, and this is the one thing to remember about it.
|
|
67
|
-
* That variable relocates cwd-anchored SDK *state* — sessions, the credential store. A project's
|
|
68
|
-
* *configuration* is a property of the repository, not of where this SDK keeps its state, and the
|
|
69
|
-
* loaders that read these directories have always anchored on `cwd` directly. Honouring the
|
|
70
|
-
* override here would silently move where a project's agents and skills come from, which is a
|
|
71
|
-
* behaviour change wearing the costume of a refactor.
|
|
72
|
-
*
|
|
73
86
|
* Creates nothing and checks nothing; either path may not exist, and the caller owns that.
|
|
74
87
|
*
|
|
75
88
|
* Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package
|
|
76
89
|
* declares in `exports` but does NOT cover with its semver contract.
|
|
77
90
|
*/
|
|
78
|
-
export declare function projectConfigRoots(cwd: string, sources
|
|
91
|
+
export declare function projectConfigRoots(cwd: string, sources: readonly CompatSourceDeclaration[], surface: CompatSurface): string[];
|
|
79
92
|
/**
|
|
80
93
|
* Every directory that may hold a plugin BUNDLE contributed by the Claude Code CLI.
|
|
81
94
|
*
|
|
@@ -89,7 +102,7 @@ export declare function projectConfigRoots(cwd: string, sources?: readonly strin
|
|
|
89
102
|
* reading a project's configuration, and guessing at someone's enablement would run code they
|
|
90
103
|
* turned off.
|
|
91
104
|
*/
|
|
92
|
-
export declare function pluginBundleRoots(cwd: string, sources
|
|
105
|
+
export declare function pluginBundleRoots(cwd: string, sources: readonly CompatSourceDeclaration[]): string[];
|
|
93
106
|
/**
|
|
94
107
|
* The directory holding every profile: always `~/.theokit/profiles`, from `os.homedir()`.
|
|
95
108
|
*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CompatSourceDeclaration } from "./foreign-config-sources.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read `.theokit/config.json`'s `compat.adapters`, or `[]` when the file is absent, declares no
|
|
4
|
+
* `compat` section, or is malformed — the last two WARN on the diagnostics channel rather than
|
|
5
|
+
* failing silently, matching #526's fail-closed-and-say-so precedent for the code option.
|
|
6
|
+
*
|
|
7
|
+
* SYNC on purpose: the caller is `Agent`'s constructor, which resolves `compatSources` before any
|
|
8
|
+
* submanager exists to await a promise. `existsSync` is already how the same constructor checks for
|
|
9
|
+
* `.theokit`/`.claude`; a once-per-agent read of one small, optional JSON file is the same class of
|
|
10
|
+
* work, not a new one.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readCompatConfigFile(cwd: string): CompatSourceDeclaration[];
|
|
13
|
+
/**
|
|
14
|
+
* The one place `local.compatSources` — explicit code — and `.theokit/config.json` — the
|
|
15
|
+
* project's declared default — are reconciled. Every reader that needs `compatSources` (hooks,
|
|
16
|
+
* skills, plugins, subagents) calls THIS instead of writing `options.local?.compatSources ?? []`
|
|
17
|
+
* by hand: that pattern existed at five call sites before this function did, and every one of them
|
|
18
|
+
* silently meant "the file form doesn't exist" — the same duplication `theokitConfigRoot` closed
|
|
19
|
+
* one layer down, one layer up.
|
|
20
|
+
*
|
|
21
|
+
* PRECEDENCE: explicit code wins. A consumer passing `local.compatSources` made a decision at the
|
|
22
|
+
* call site; the file is the DEFAULT for callers who did not. This is not specified by #524 — it is
|
|
23
|
+
* this SDK's choice, made explicit here rather than left to whichever call site happened to be
|
|
24
|
+
* written first. It means a test or a one-off script can always override the file without editing
|
|
25
|
+
* or deleting it, which the reverse precedence would not allow.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveCompatSources(options: {
|
|
28
|
+
local?: {
|
|
29
|
+
compatSources?: readonly CompatSourceDeclaration[];
|
|
30
|
+
};
|
|
31
|
+
}, cwd: string): readonly CompatSourceDeclaration[];
|
|
@@ -34,6 +34,36 @@ export declare const CLAUDE_CODE_SOURCE: ConfigSourceAdapter;
|
|
|
34
34
|
* the whole reason this exists is that a directory name was never enough to describe a dialect.
|
|
35
35
|
*/
|
|
36
36
|
export declare function adaptersFor(kinds: readonly string[]): ConfigSourceAdapter[];
|
|
37
|
+
/**
|
|
38
|
+
* A surface a foreign source may be admitted to. The four the SDK reads a project directory for.
|
|
39
|
+
*
|
|
40
|
+
* They are listed separately because they carry very different risk, which is the whole reason
|
|
41
|
+
* #524 asks for per-surface control: a skill is text that enters the system prompt, a hook is
|
|
42
|
+
* command execution, a plugin is code loading. A consumer who wants their skills back has no
|
|
43
|
+
* reason to be handed the other two along with them.
|
|
44
|
+
*/
|
|
45
|
+
export type CompatSurface = "hooks" | "plugins" | "skills" | "subagents";
|
|
46
|
+
/**
|
|
47
|
+
* A declared foreign source: a bare kind, or a kind with the surfaces it may be read for.
|
|
48
|
+
*/
|
|
49
|
+
export type CompatSourceDeclaration = string | {
|
|
50
|
+
readonly kind: string;
|
|
51
|
+
readonly import?: readonly string[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The adapters admitted to ONE surface.
|
|
55
|
+
*
|
|
56
|
+
* Three rules, and each one fails closed:
|
|
57
|
+
*
|
|
58
|
+
* - A bare string admits every surface. It is what `5.0.0-next.1` published, so narrowing it
|
|
59
|
+
* silently would turn a working opt-in into a no-op — the exact defect #524 is about, one level
|
|
60
|
+
* up.
|
|
61
|
+
* - An object with no `import` admits nothing. The issue's own rule, and safe to apply strictly
|
|
62
|
+
* because the object form is new and nobody can be depending on it.
|
|
63
|
+
* - An unrecognised surface name is dropped rather than matched loosely, for the same reason an
|
|
64
|
+
* unrecognised KIND is dropped in {@link adaptersFor}: a typo must not silently widen access.
|
|
65
|
+
*/
|
|
66
|
+
export declare function adaptersForSurface(sources: readonly CompatSourceDeclaration[], surface: CompatSurface): ConfigSourceAdapter[];
|
|
37
67
|
/**
|
|
38
68
|
* The adapter whose directory an absolute config path sits under, or `undefined` for a path that
|
|
39
69
|
* belongs to no registered dialect.
|
|
@@ -83,4 +113,4 @@ export declare function undefinedVariablesIn(command: string, supplied: Readonly
|
|
|
83
113
|
*
|
|
84
114
|
* So it goes on the interceptable channel, for the reader holding the question it answers.
|
|
85
115
|
*/
|
|
86
|
-
export declare function reportUndeclaredSources(cwd: string, declared: readonly
|
|
116
|
+
export declare function reportUndeclaredSources(cwd: string, declared: readonly CompatSourceDeclaration[]): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CompatSourceDeclaration } from "../compat/foreign-config-sources.js";
|
|
1
2
|
export interface HookCommand {
|
|
2
3
|
command: string;
|
|
3
4
|
/** Optional matcher restricting the hook to specific tools (regex). */
|
|
@@ -39,7 +40,7 @@ export declare class HooksExecutor {
|
|
|
39
40
|
private config;
|
|
40
41
|
constructor(cwd: string,
|
|
41
42
|
/** Declared foreign dialects (#524). Empty reads `.theokit/` only. */
|
|
42
|
-
compatSources?: readonly
|
|
43
|
+
compatSources?: readonly CompatSourceDeclaration[]);
|
|
43
44
|
initialize(settingSourcesIncludeProject: boolean): Promise<void>;
|
|
44
45
|
/** Fire every hook registered for `event` and aggregate the decisions. */
|
|
45
46
|
run(payload: HookPayload): Promise<HookExecutionResult>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
+
import type { CompatSourceDeclaration } from "../compat/foreign-config-sources.js";
|
|
9
10
|
/**
|
|
10
11
|
* Every plugin folder under the project's plugin roots.
|
|
11
12
|
*
|
|
@@ -18,4 +19,4 @@
|
|
|
18
19
|
*/
|
|
19
20
|
export declare function pluginBundleDirs(cwd: string,
|
|
20
21
|
/** Declared foreign dialects (#524). Empty reads `.theokit/plugins` only. */
|
|
21
|
-
compatSources?: readonly
|
|
22
|
+
compatSources?: readonly CompatSourceDeclaration[]): Promise<string[]>;
|
|
@@ -613,10 +613,27 @@ interface GoalOptions {
|
|
|
613
613
|
interface SystemPromptSkillRef {
|
|
614
614
|
name: string;
|
|
615
615
|
description: string;
|
|
616
|
+
/**
|
|
617
|
+
* Where this skill came from: the absolute path to its `SKILL.md` for a skill read from disk,
|
|
618
|
+
* or the synthetic `inline://<name>` marker `createSkill` stamps on a code-defined one (see
|
|
619
|
+
* `create-skill.ts`) — there is no third case, so this is populated for every skill `list()`
|
|
620
|
+
* returns.
|
|
621
|
+
*
|
|
622
|
+
* It is the ORIGIN and NOT the body: `list()` stays lean by contract, and a skill's instructions
|
|
623
|
+
* are reachable only through {@link SDKAgentSkills.get}. What this adds is the answer to
|
|
624
|
+
* usetheokit/theokit-sdk#524's visibility question — which root a skill came from, so a listing
|
|
625
|
+
* can show that one arrived from `.claude/skills/` rather than the project's own directory, or
|
|
626
|
+
* that it was never on disk at all.
|
|
627
|
+
*
|
|
628
|
+
* Typed optional rather than required because {@link SystemPromptSkillRef} is the shape any
|
|
629
|
+
* future skill producer returns, and this SDK should not assert every one of them can name an
|
|
630
|
+
* origin.
|
|
631
|
+
*/
|
|
632
|
+
source?: string;
|
|
616
633
|
}
|
|
617
634
|
/**
|
|
618
635
|
* A skill resolved WITH its body, returned by {@link SDKAgentSkills.get}. Unlike
|
|
619
|
-
* {@link SystemPromptSkillRef}
|
|
636
|
+
* {@link SystemPromptSkillRef}, which carries metadata only, this carries the full
|
|
620
637
|
* `instructions` — read from the SKILL.md for filesystem skills or the inline
|
|
621
638
|
* `createSkill` body. @public
|
|
622
639
|
*/
|
|
@@ -660,6 +677,16 @@ interface SDKAgentSkills {
|
|
|
660
677
|
interface SDKPluginMetadata {
|
|
661
678
|
name: string;
|
|
662
679
|
description?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Absolute path the plugin manifest was read from.
|
|
682
|
+
*
|
|
683
|
+
* The runtime has ALWAYS returned this — `agent.plugins.list()` hands back the internal
|
|
684
|
+
* `PluginMetadata`, whose own docblock says it carries provenance "so callers can audit where the
|
|
685
|
+
* plugin came from". This type simply did not declare it, so the caller received the field and
|
|
686
|
+
* the compiler denied it existed. Declaring it is what makes the audit usetheokit/theokit-sdk#524
|
|
687
|
+
* asks for reachable in typed code.
|
|
688
|
+
*/
|
|
689
|
+
source?: string;
|
|
663
690
|
}
|
|
664
691
|
/**
|
|
665
692
|
* Public plugin listing handle exposed as `agent.plugins`. Populated when
|
|
@@ -613,10 +613,27 @@ interface GoalOptions {
|
|
|
613
613
|
interface SystemPromptSkillRef {
|
|
614
614
|
name: string;
|
|
615
615
|
description: string;
|
|
616
|
+
/**
|
|
617
|
+
* Where this skill came from: the absolute path to its `SKILL.md` for a skill read from disk,
|
|
618
|
+
* or the synthetic `inline://<name>` marker `createSkill` stamps on a code-defined one (see
|
|
619
|
+
* `create-skill.ts`) — there is no third case, so this is populated for every skill `list()`
|
|
620
|
+
* returns.
|
|
621
|
+
*
|
|
622
|
+
* It is the ORIGIN and NOT the body: `list()` stays lean by contract, and a skill's instructions
|
|
623
|
+
* are reachable only through {@link SDKAgentSkills.get}. What this adds is the answer to
|
|
624
|
+
* usetheokit/theokit-sdk#524's visibility question — which root a skill came from, so a listing
|
|
625
|
+
* can show that one arrived from `.claude/skills/` rather than the project's own directory, or
|
|
626
|
+
* that it was never on disk at all.
|
|
627
|
+
*
|
|
628
|
+
* Typed optional rather than required because {@link SystemPromptSkillRef} is the shape any
|
|
629
|
+
* future skill producer returns, and this SDK should not assert every one of them can name an
|
|
630
|
+
* origin.
|
|
631
|
+
*/
|
|
632
|
+
source?: string;
|
|
616
633
|
}
|
|
617
634
|
/**
|
|
618
635
|
* A skill resolved WITH its body, returned by {@link SDKAgentSkills.get}. Unlike
|
|
619
|
-
* {@link SystemPromptSkillRef}
|
|
636
|
+
* {@link SystemPromptSkillRef}, which carries metadata only, this carries the full
|
|
620
637
|
* `instructions` — read from the SKILL.md for filesystem skills or the inline
|
|
621
638
|
* `createSkill` body. @public
|
|
622
639
|
*/
|
|
@@ -660,6 +677,16 @@ interface SDKAgentSkills {
|
|
|
660
677
|
interface SDKPluginMetadata {
|
|
661
678
|
name: string;
|
|
662
679
|
description?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Absolute path the plugin manifest was read from.
|
|
682
|
+
*
|
|
683
|
+
* The runtime has ALWAYS returned this — `agent.plugins.list()` hands back the internal
|
|
684
|
+
* `PluginMetadata`, whose own docblock says it carries provenance "so callers can audit where the
|
|
685
|
+
* plugin came from". This type simply did not declare it, so the caller received the field and
|
|
686
|
+
* the compiler denied it existed. Declaring it is what makes the audit usetheokit/theokit-sdk#524
|
|
687
|
+
* asks for reachable in typed code.
|
|
688
|
+
*/
|
|
689
|
+
source?: string;
|
|
663
690
|
}
|
|
664
691
|
/**
|
|
665
692
|
* Public plugin listing handle exposed as `agent.plugins`. Populated when
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkSYVWE64W_cjs = require('./chunk-SYVWE64W.cjs');
|
|
4
|
+
require('./chunk-GGZ5GPE3.cjs');
|
|
5
|
+
require('./chunk-HW7SEELD.cjs');
|
|
6
|
+
require('./chunk-J7J7J2GN.cjs');
|
|
7
|
+
require('./chunk-6LHQPOMI.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(exports, "loadSubagents", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkSYVWE64W_cjs.loadSubagents; }
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=subagents-loader-TPZLTXYZ.cjs.map
|
|
16
|
+
//# sourceMappingURL=subagents-loader-TPZLTXYZ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"subagents-loader-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"subagents-loader-TPZLTXYZ.cjs"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { loadSubagents } from './chunk-4S5TWFIZ.js';
|
|
2
|
+
import './chunk-67ADYSTW.js';
|
|
3
|
+
import './chunk-JNAA4G4H.js';
|
|
4
|
+
import './chunk-ALUN2B4W.js';
|
|
5
|
+
import './chunk-CZJ6Q7CW.js';
|
|
6
|
+
//# sourceMappingURL=subagents-loader-Y6JFYXAY.js.map
|
|
7
|
+
//# sourceMappingURL=subagents-loader-Y6JFYXAY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"subagents-loader-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"subagents-loader-Y6JFYXAY.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkSYVWE64W_cjs = require('./chunk-SYVWE64W.cjs');
|
|
4
|
+
require('./chunk-GGZ5GPE3.cjs');
|
|
5
5
|
require('./chunk-HW7SEELD.cjs');
|
|
6
6
|
var chunkJ7J7J2GN_cjs = require('./chunk-J7J7J2GN.cjs');
|
|
7
7
|
require('./chunk-6LHQPOMI.cjs');
|
|
@@ -23,7 +23,7 @@ function resolveSources(options) {
|
|
|
23
23
|
}
|
|
24
24
|
async function discoverSubagents(cwd, options) {
|
|
25
25
|
const sources = resolveSources(options);
|
|
26
|
-
return
|
|
26
|
+
return chunkSYVWE64W_cjs.loadSubagents(cwd, sources.includes("project"), void 0);
|
|
27
27
|
}
|
|
28
28
|
async function loadSubagentDefinition(name, cwd, options) {
|
|
29
29
|
return (await discoverSubagents(cwd, options))[name];
|
package/dist/subagents-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { loadSubagents } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { loadSubagents } from './chunk-4S5TWFIZ.js';
|
|
2
|
+
import './chunk-67ADYSTW.js';
|
|
3
3
|
import './chunk-JNAA4G4H.js';
|
|
4
4
|
import { ConfigurationError } from './chunk-ALUN2B4W.js';
|
|
5
5
|
import './chunk-CZJ6Q7CW.js';
|
package/dist/types/agent.d.ts
CHANGED
|
@@ -30,7 +30,39 @@ export type SettingSource = "project" | "user" | "team" | "mdm" | "plugins" | "a
|
|
|
30
30
|
*
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
export type CompatSource = "claude-code";
|
|
33
|
+
export type CompatSource = "claude-code" | CompatSourceAdapter;
|
|
34
|
+
/**
|
|
35
|
+
* A surface a foreign configuration source may be admitted to.
|
|
36
|
+
*
|
|
37
|
+
* They are named separately because they carry very different risk. A skill is TEXT that enters the
|
|
38
|
+
* system prompt; a subagent is a definition; a plugin is CODE LOADING; a hook is COMMAND EXECUTION.
|
|
39
|
+
* Reusing the skills you already wrote for another product is a reasonable thing to want, and it is
|
|
40
|
+
* not a reason to hand that product's directory the right to run commands.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export type CompatSurface = "hooks" | "plugins" | "skills" | "subagents";
|
|
45
|
+
/**
|
|
46
|
+
* A foreign source admitted to named surfaces only.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* local: { compatSources: [{ kind: "claude-code", import: ["skills", "subagents"] }] }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* `import` is not optional in spirit even though it is in the type: an adapter that omits it
|
|
53
|
+
* imports NOTHING. That is deliberate and it is the fail-closed rule this whole option exists to
|
|
54
|
+
* serve — a typo in a surface name must narrow access, never widen it.
|
|
55
|
+
*
|
|
56
|
+
* The bare `"claude-code"` string keeps meaning every surface. It is what `5.0.0-next.1` published,
|
|
57
|
+
* and silently narrowing it would turn a working opt-in into a no-op that says nothing — which is
|
|
58
|
+
* the defect usetheokit/theokit-sdk#524 reports, one level up.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export interface CompatSourceAdapter {
|
|
63
|
+
readonly kind: "claude-code";
|
|
64
|
+
readonly import?: readonly CompatSurface[];
|
|
65
|
+
}
|
|
34
66
|
/**
|
|
35
67
|
* A tool the SDK declares to the model on its own initiative — not one the consumer passed in
|
|
36
68
|
* {@link AgentOptions.tools}, and not one an MCP server exposed.
|
|
@@ -176,6 +208,20 @@ export interface CloudOptions {
|
|
|
176
208
|
export interface AgentDefinition {
|
|
177
209
|
description: string;
|
|
178
210
|
prompt: string;
|
|
211
|
+
/**
|
|
212
|
+
* Absolute path to the `.md` this subagent was read from, when it came from disk.
|
|
213
|
+
*
|
|
214
|
+
* ABSENT for a subagent declared in code through {@link AgentOptions.subagents} — "you passed
|
|
215
|
+
* this one in" is a different fact from "read from disk", and one value for both would trade one
|
|
216
|
+
* silence for another.
|
|
217
|
+
*
|
|
218
|
+
* It exists so a listing can answer which root a subagent came from, which
|
|
219
|
+
* usetheokit/theokit-sdk#524 asks for by name: a consumer could not tell that an agent arrived
|
|
220
|
+
* from `.claude/agents/` rather than its own directory, and silent inheritance is what made that
|
|
221
|
+
* take a debugging session to notice. `HookCommand.sourcePath` and `Skill.source` already
|
|
222
|
+
* answered it for the other two surfaces.
|
|
223
|
+
*/
|
|
224
|
+
source?: string;
|
|
179
225
|
model?: ModelSelection | "inherit";
|
|
180
226
|
mcpServers?: Array<string | Record<string, McpServerConfig>>;
|
|
181
227
|
/**
|