@theokit/sdk 4.57.0 → 4.58.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/CHANGELOG.md +99 -0
- package/dist/{agent-ZIYCVEZL.js → agent-6WM4QOWS.js} +10 -9
- package/dist/{agent-ZIYCVEZL.js.map → agent-6WM4QOWS.js.map} +1 -1
- package/dist/{agent-2T2EJIP6.cjs → agent-MIYY7TXV.cjs} +11 -10
- package/dist/{agent-2T2EJIP6.cjs.map → agent-MIYY7TXV.cjs.map} +1 -1
- package/dist/{chunk-E7JHD6QJ.cjs → chunk-27AXGJMV.cjs} +25 -15
- package/dist/chunk-27AXGJMV.cjs.map +1 -0
- package/dist/{chunk-LEM2GOMI.js → chunk-5QOIQJ5J.js} +3 -3
- package/dist/{chunk-LEM2GOMI.js.map → chunk-5QOIQJ5J.js.map} +1 -1
- package/dist/{chunk-E3WZ6Y4H.cjs → chunk-7BG5UH3T.cjs} +8 -8
- package/dist/{chunk-E3WZ6Y4H.cjs.map → chunk-7BG5UH3T.cjs.map} +1 -1
- package/dist/chunk-AQO3NSRG.cjs +41 -0
- package/dist/chunk-AQO3NSRG.cjs.map +1 -0
- package/dist/{chunk-7TCRNXNK.js → chunk-CF5OMCZG.js} +40 -16
- package/dist/chunk-CF5OMCZG.js.map +1 -0
- package/dist/{chunk-U2AC6JUP.cjs → chunk-J2UROOIG.cjs} +2 -27
- package/dist/chunk-J2UROOIG.cjs.map +1 -0
- package/dist/{chunk-ZNW6V4Y6.cjs → chunk-LKFET5A3.cjs} +23 -2
- package/dist/chunk-LKFET5A3.cjs.map +1 -0
- package/dist/{chunk-YMA4S2WO.js → chunk-MZ2FGBLZ.js} +33 -11
- package/dist/chunk-MZ2FGBLZ.js.map +1 -0
- package/dist/{chunk-M2JWHKO6.cjs → chunk-N47KLTKD.cjs} +76 -52
- package/dist/chunk-N47KLTKD.cjs.map +1 -0
- package/dist/{chunk-53CBTBWO.cjs → chunk-P6H23T43.cjs} +33 -11
- package/dist/chunk-P6H23T43.cjs.map +1 -0
- package/dist/{chunk-X7O4255I.cjs → chunk-QIRDQZYL.cjs} +4 -4
- package/dist/{chunk-X7O4255I.cjs.map → chunk-QIRDQZYL.cjs.map} +1 -1
- package/dist/{chunk-7FHZ4VQX.js → chunk-SAVIWMZB.js} +3 -3
- package/dist/{chunk-7FHZ4VQX.js.map → chunk-SAVIWMZB.js.map} +1 -1
- package/dist/{chunk-UPRJR6IP.js → chunk-UCBJBJ27.js} +3 -25
- package/dist/chunk-UCBJBJ27.js.map +1 -0
- package/dist/chunk-UFLD2HEV.js +35 -0
- package/dist/chunk-UFLD2HEV.js.map +1 -0
- package/dist/{chunk-GTKFV7O5.js → chunk-WFC26L6Y.js} +23 -2
- package/dist/chunk-WFC26L6Y.js.map +1 -0
- package/dist/{chunk-G6EEYRDD.js → chunk-WLZ7XRWH.js} +24 -14
- package/dist/chunk-WLZ7XRWH.js.map +1 -0
- package/dist/{chunk-HJBMA5MB.cjs → chunk-WNTAPVU5.cjs} +47 -6
- package/dist/chunk-WNTAPVU5.cjs.map +1 -0
- package/dist/{chunk-2QKTVKH3.js → chunk-ZHPWGIUX.js} +48 -8
- package/dist/chunk-ZHPWGIUX.js.map +1 -0
- package/dist/context/index.cjs +7 -7
- package/dist/context/index.js +3 -3
- package/dist/{context-VMIE4BMD.cjs → context-LCKNH2XI.cjs} +7 -6
- package/dist/{context-VMIE4BMD.cjs.map → context-LCKNH2XI.cjs.map} +1 -1
- package/dist/context-MZSKGKYR.js +7 -0
- package/dist/{context-FDOON2DB.js.map → context-MZSKGKYR.js.map} +1 -1
- package/dist/cron.cjs +10 -9
- package/dist/cron.js +9 -8
- package/dist/eval.cjs +9 -8
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +8 -7
- package/dist/eval.js.map +1 -1
- package/dist/{index-manager-AO4LJQZ4.cjs → index-manager-J2QIDI6I.cjs} +5 -4
- package/dist/{index-manager-AO4LJQZ4.cjs.map → index-manager-J2QIDI6I.cjs.map} +1 -1
- package/dist/{index-manager-QDPIYIGV.js → index-manager-WYESAVTX.js} +4 -3
- package/dist/{index-manager-QDPIYIGV.js.map → index-manager-WYESAVTX.js.map} +1 -1
- package/dist/index.cjs +32 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/internal/memory/storage/markdown-store.d.ts +13 -0
- package/dist/internal/persistence/index.cjs +17 -16
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +2 -1
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/persistence/paths.d.cts +42 -0
- package/dist/internal/persistence/paths.d.ts +42 -0
- package/dist/internal/runtime/plugins/plugin-bundles.d.ts +19 -0
- package/dist/project.cjs +3 -3
- package/dist/project.js +1 -1
- package/dist/subagents-loader-6ATCDEKN.js +8 -0
- package/dist/{subagents-loader-J54ESLDV.js.map → subagents-loader-6ATCDEKN.js.map} +1 -1
- package/dist/subagents-loader-X5QKODCL.cjs +17 -0
- package/dist/{subagents-loader-AZIXJ7D3.cjs.map → subagents-loader-X5QKODCL.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +3 -2
- package/dist/subagents-loader.cjs.map +1 -1
- package/dist/subagents-loader.js +2 -1
- package/dist/subagents-loader.js.map +1 -1
- package/docs/error-codes.md +15 -15
- package/package.json +1 -1
- package/dist/chunk-2QKTVKH3.js.map +0 -1
- package/dist/chunk-53CBTBWO.cjs.map +0 -1
- package/dist/chunk-7TCRNXNK.js.map +0 -1
- package/dist/chunk-E7JHD6QJ.cjs.map +0 -1
- package/dist/chunk-G6EEYRDD.js.map +0 -1
- package/dist/chunk-GTKFV7O5.js.map +0 -1
- package/dist/chunk-HJBMA5MB.cjs.map +0 -1
- package/dist/chunk-M2JWHKO6.cjs.map +0 -1
- package/dist/chunk-U2AC6JUP.cjs.map +0 -1
- package/dist/chunk-UPRJR6IP.js.map +0 -1
- package/dist/chunk-YMA4S2WO.js.map +0 -1
- package/dist/chunk-ZNW6V4Y6.cjs.map +0 -1
- package/dist/context-FDOON2DB.js +0 -6
- package/dist/subagents-loader-AZIXJ7D3.cjs +0 -16
- package/dist/subagents-loader-J54ESLDV.js +0 -7
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-WG7R5W6R.js';
|
|
2
|
-
import { IndexManager, writeSessionSummary, memoryDir, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-
|
|
3
|
-
import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-
|
|
2
|
+
import { IndexManager, writeSessionSummary, memoryDir, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-WLZ7XRWH.js';
|
|
3
|
+
import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-MZ2FGBLZ.js';
|
|
4
4
|
import { extractCodePlugins } from './chunk-2SFBB54R.js';
|
|
5
5
|
import { submit, emitRunEvent } from './chunk-SUKXXLWD.js';
|
|
6
6
|
import { createOpenAiCompatibleRuntime } from './chunk-XN7NOENA.js';
|
|
7
7
|
import { FsSessionStore } from './chunk-YJDH3CKG.js';
|
|
8
8
|
import { discoverProviderPlugins, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, CircuitBreaker, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, resolveProviderChain, inferProviderFromApiKey, detectPrimaryProvider, warnProviderPrecedenceOnce, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-IACR5LEM.js';
|
|
9
9
|
import { resolveChildEnv } from './chunk-HKCKOAIO.js';
|
|
10
|
-
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-
|
|
11
|
-
import { readVersionedJson,
|
|
10
|
+
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-SAVIWMZB.js';
|
|
11
|
+
import { readVersionedJson, writeVersionedJson } from './chunk-UCBJBJ27.js';
|
|
12
12
|
import { toJsonSchema } from './chunk-4VPXM6UU.js';
|
|
13
13
|
import { sanitizeToolInput } from './chunk-U54XCYG3.js';
|
|
14
14
|
import { withInheritedSubAgentCredentials, subAgentToolsFromDefinitions } from './chunk-RNB4APBZ.js';
|
|
@@ -22,7 +22,8 @@ import { expandTilde, defaultBaseDir } from './chunk-FKMUFNQE.js';
|
|
|
22
22
|
import { withFileLock } from './chunk-CV7XMBHP.js';
|
|
23
23
|
import { withCwdMutex } from './chunk-Q5EWJPRY.js';
|
|
24
24
|
import { atomicWriteJson } from './chunk-VF7EWVDG.js';
|
|
25
|
-
import { loadSubagents } from './chunk-
|
|
25
|
+
import { loadSubagents, pluginBundleDirs } from './chunk-ZHPWGIUX.js';
|
|
26
|
+
import { getTheokitHome, projectConfigRoots, pluginBundleRoots } from './chunk-UFLD2HEV.js';
|
|
26
27
|
import { readWorkspaceDir, parseSimpleYaml } from './chunk-AG5JPQIY.js';
|
|
27
28
|
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-F7AQV62G.js';
|
|
28
29
|
import { parseModelId } from './chunk-R7WIIPUR.js';
|
|
@@ -2923,13 +2924,24 @@ var SkillsManager = class {
|
|
|
2923
2924
|
await this.refresh();
|
|
2924
2925
|
}
|
|
2925
2926
|
async refresh() {
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2927
|
+
const roots = this.skillsDir === void 0 ? [
|
|
2928
|
+
...projectConfigRoots(this.cwd).map((root) => join(root, "skills")),
|
|
2929
|
+
...(await pluginBundleDirs(this.cwd)).map((bundle) => join(bundle, "skills"))
|
|
2930
|
+
] : [this.skillsDir];
|
|
2931
|
+
const discovered = [];
|
|
2932
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2933
|
+
for (const root of roots) {
|
|
2934
|
+
for (const skill of await discoverSkills(root, {
|
|
2935
|
+
onInvalidSkill: (info) => {
|
|
2936
|
+
diag(`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
|
|
2930
2937
|
`);
|
|
2938
|
+
}
|
|
2939
|
+
})) {
|
|
2940
|
+
if (seen.has(skill.name)) continue;
|
|
2941
|
+
seen.add(skill.name);
|
|
2942
|
+
discovered.push(skill);
|
|
2931
2943
|
}
|
|
2932
|
-
}
|
|
2944
|
+
}
|
|
2933
2945
|
this.skills = this.mergeInline(discovered);
|
|
2934
2946
|
}
|
|
2935
2947
|
/** M22 — merge inline skills over discovered ones; inline wins on a name conflict. */
|
|
@@ -4245,14 +4257,26 @@ var PluginsManager = class {
|
|
|
4245
4257
|
}
|
|
4246
4258
|
await this.refresh();
|
|
4247
4259
|
}
|
|
4248
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: MD-first + JSON fallback + both-present detection per plugin folder — branch table is clearer inlined.
|
|
4249
4260
|
async refresh() {
|
|
4250
4261
|
this.plugins = [];
|
|
4251
|
-
const pluginsRoot
|
|
4262
|
+
for (const pluginsRoot of pluginBundleRoots(this.cwd)) {
|
|
4263
|
+
await this.refreshRoot(pluginsRoot);
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: MD-first + JSON fallback + CLI location + both-present detection per plugin folder — branch table is clearer inlined.
|
|
4267
|
+
async refreshRoot(pluginsRoot) {
|
|
4252
4268
|
const entries = await readWorkspaceDir(pluginsRoot, "plugins_read_error", "plugins directory");
|
|
4253
4269
|
for (const entry of entries) {
|
|
4254
4270
|
if (!entry.isDirectory()) continue;
|
|
4255
4271
|
const folderName = entry.name;
|
|
4272
|
+
const cliPath = join(pluginsRoot, folderName, ".claude-plugin", "plugin.json");
|
|
4273
|
+
if (existsSync(cliPath)) {
|
|
4274
|
+
const cliMetadata = await loadPluginManifestFromJson(cliPath, folderName);
|
|
4275
|
+
if (this.enabled === void 0 || this.enabled.includes(cliMetadata.name)) {
|
|
4276
|
+
this.plugins.push(cliMetadata);
|
|
4277
|
+
}
|
|
4278
|
+
continue;
|
|
4279
|
+
}
|
|
4256
4280
|
const mdPath = join(pluginsRoot, folderName, "PLUGIN.md");
|
|
4257
4281
|
const jsonPath = join(pluginsRoot, folderName, "plugin.json");
|
|
4258
4282
|
const metadata = existsSync(mdPath) ? await loadPluginManifestFromMarkdown(pluginsRoot, folderName) : await loadPluginManifestFromJson(jsonPath, folderName);
|
|
@@ -8962,7 +8986,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
|
|
|
8962
8986
|
async function localAgentFork(parent, options) {
|
|
8963
8987
|
const { forkAgentImpl } = await import('./fork-agent-RSV4E3EA.js');
|
|
8964
8988
|
const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
|
|
8965
|
-
const { withPersonalityContext } = await import('./context-
|
|
8989
|
+
const { withPersonalityContext } = await import('./context-MZSKGKYR.js');
|
|
8966
8990
|
const create = getAgentFacade().create;
|
|
8967
8991
|
return withPersonalityContext(
|
|
8968
8992
|
{ slug: parent.personalitySlugSnapshot, isFork: true },
|
|
@@ -10472,7 +10496,7 @@ var Agent = class _Agent {
|
|
|
10472
10496
|
*/
|
|
10473
10497
|
static async describe(agentId) {
|
|
10474
10498
|
const agent = await getRegisteredAgentOrThrow(agentId);
|
|
10475
|
-
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-
|
|
10499
|
+
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-6ATCDEKN.js');
|
|
10476
10500
|
const settingSources = agent.options.local?.settingSources;
|
|
10477
10501
|
const subagents = await loadSubagents2(
|
|
10478
10502
|
agent.cwd ?? process.cwd(),
|
|
@@ -10547,5 +10571,5 @@ async function openLocalStore(reg) {
|
|
|
10547
10571
|
}
|
|
10548
10572
|
|
|
10549
10573
|
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, openRouterMemoryEmbeddingProviderAdapter };
|
|
10550
|
-
//# sourceMappingURL=chunk-
|
|
10551
|
-
//# sourceMappingURL=chunk-
|
|
10574
|
+
//# sourceMappingURL=chunk-CF5OMCZG.js.map
|
|
10575
|
+
//# sourceMappingURL=chunk-CF5OMCZG.js.map
|