@theokit/sdk 5.1.0 → 5.2.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/{agent-ARLOD4JX.cjs → agent-GACKKINM.cjs} +7 -7
  3. package/dist/{agent-ARLOD4JX.cjs.map → agent-GACKKINM.cjs.map} +1 -1
  4. package/dist/{agent-N6WJ54ML.js → agent-VUNM33WJ.js} +6 -6
  5. package/dist/{agent-N6WJ54ML.js.map → agent-VUNM33WJ.js.map} +1 -1
  6. package/dist/{chunk-OYD3U3LY.js → chunk-43H4EBS2.js} +7 -7
  7. package/dist/{chunk-OYD3U3LY.js.map → chunk-43H4EBS2.js.map} +1 -1
  8. package/dist/{chunk-AW6F6HZR.js → chunk-AI4MXACC.js} +3 -3
  9. package/dist/{chunk-AW6F6HZR.js.map → chunk-AI4MXACC.js.map} +1 -1
  10. package/dist/{chunk-D3CCY3A2.cjs → chunk-DEJCKB65.cjs} +39 -39
  11. package/dist/{chunk-D3CCY3A2.cjs.map → chunk-DEJCKB65.cjs.map} +1 -1
  12. package/dist/{chunk-OQRGVTQF.js → chunk-DLFWMJE3.js} +3 -3
  13. package/dist/{chunk-OQRGVTQF.js.map → chunk-DLFWMJE3.js.map} +1 -1
  14. package/dist/{chunk-NYQ3IS7K.cjs → chunk-DWB3CN46.cjs} +8 -3
  15. package/dist/chunk-DWB3CN46.cjs.map +1 -0
  16. package/dist/{chunk-QYLZQ43D.cjs → chunk-IQBDR5YZ.cjs} +5 -5
  17. package/dist/{chunk-QYLZQ43D.cjs.map → chunk-IQBDR5YZ.cjs.map} +1 -1
  18. package/dist/{chunk-67SBTGMA.cjs → chunk-PEAOQMWE.cjs} +4 -4
  19. package/dist/{chunk-67SBTGMA.cjs.map → chunk-PEAOQMWE.cjs.map} +1 -1
  20. package/dist/{chunk-WMWEI3NS.js → chunk-RP3VXJMA.js} +8 -3
  21. package/dist/chunk-RP3VXJMA.js.map +1 -0
  22. package/dist/{chunk-KGANQYP7.cjs → chunk-SSIRPWWD.cjs} +5 -5
  23. package/dist/{chunk-KGANQYP7.cjs.map → chunk-SSIRPWWD.cjs.map} +1 -1
  24. package/dist/{chunk-XU6MLSC6.js → chunk-WHTMFN4Q.js} +3 -3
  25. package/dist/{chunk-XU6MLSC6.js.map → chunk-WHTMFN4Q.js.map} +1 -1
  26. package/dist/{context-4QOEWRDF.cjs → context-3YMZDEX5.cjs} +7 -7
  27. package/dist/{context-4QOEWRDF.cjs.map → context-3YMZDEX5.cjs.map} +1 -1
  28. package/dist/context-XNREEC7M.js +6 -0
  29. package/dist/{context-Z3CFTT3H.js.map → context-XNREEC7M.js.map} +1 -1
  30. package/dist/cron.cjs +6 -6
  31. package/dist/cron.js +5 -5
  32. package/dist/eval.cjs +5 -5
  33. package/dist/eval.js +4 -4
  34. package/dist/index.cjs +55 -21
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +66 -1
  37. package/dist/index.d.ts +66 -1
  38. package/dist/index.js +41 -8
  39. package/dist/index.js.map +1 -1
  40. package/dist/internal/persistence/index.cjs +4 -4
  41. package/dist/internal/persistence/index.js +1 -1
  42. package/dist/internal/runtime/compat/foreign-config-sources.d.ts +16 -6
  43. package/dist/subagents-loader-7G76XOZU.cjs +16 -0
  44. package/dist/{subagents-loader-GEHYCMEX.cjs.map → subagents-loader-7G76XOZU.cjs.map} +1 -1
  45. package/dist/subagents-loader-PAZVOZHI.js +7 -0
  46. package/dist/{subagents-loader-DOBTTICM.js.map → subagents-loader-PAZVOZHI.js.map} +1 -1
  47. package/dist/subagents-loader.cjs +3 -3
  48. package/dist/subagents-loader.js +2 -2
  49. package/docs/harness-capability-map.md +4 -1
  50. package/package.json +1 -1
  51. package/dist/chunk-NYQ3IS7K.cjs.map +0 -1
  52. package/dist/chunk-WMWEI3NS.js.map +0 -1
  53. package/dist/context-Z3CFTT3H.js +0 -6
  54. package/dist/subagents-loader-DOBTTICM.js +0 -7
  55. package/dist/subagents-loader-GEHYCMEX.cjs +0 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,93 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#585](https://github.com/usetheokit/theokit-sdk/pull/585) [`86bf6c1`](https://github.com/usetheokit/theokit-sdk/commit/86bf6c1ab90438835df5bb0d4a791596c58004ba) Thanks [@usetheodev](https://github.com/usetheodev)! - `effectiveToolNames` — ask what tools an agent will actually have ([#583](https://github.com/usetheokit/theokit-sdk/issues/583))
8
+
9
+ `Agent.describe()` was the only reflection surface, and it builds its catalog as
10
+ `(options.tools ?? [])` — literally the array the caller passed. The SDK's own builtins were never in
11
+ it, so the two states that matter most were indistinguishable:
12
+
13
+ ```
14
+ Agent.create({ tools: [] }) describe().tools = [] ← holds a shell
15
+ the same + withheldBuiltinTools: ["shell"] describe().tools = [] ← holds nothing
16
+ ```
17
+
18
+ A consumer confirming that a role declared read-only really is one had no instrument. What they did
19
+ instead, measured in a real session: ask the agent to enumerate its own catalog — needs a credential,
20
+ needs the network, and returns the list the *model* decided to write. That same session recorded a
21
+ subagent answering *"I can't run shell commands in this environment"* while its catalog listed
22
+ `shell`. An attempt measures the model's disposition; the catalog measures its authority.
23
+
24
+ ```ts
25
+ import { effectiveToolNames } from "@theokit/sdk";
26
+
27
+ const { names, unresolved } = effectiveToolNames({ tools: [], withheldBuiltinTools: ["shell"] });
28
+ // names: [] — the shell is genuinely gone
29
+ // unresolved: [] — nothing else could contribute, so [] is the whole catalog
30
+ ```
31
+
32
+ **Options in, not an agent id** — synchronous, credential-free, answerable *before* the agent runs,
33
+ so a test can compare what it declared against what the runtime will declare. `describe()` needs a
34
+ registered agent and answers too late for that.
35
+
36
+ **Not a bare array**, deliberately. MCP tools need a live connection; plugin tools and the reasoning
37
+ `think` tool are assembled per run. Returning `string[]` would rebuild the original defect one
38
+ function over. `unresolved` names the sources that are configured and could not be enumerated, and is
39
+ empty when none are — which is the only condition under which `names` may be read as complete.
40
+
41
+ Requested, with this exact shape and rationale, by the `theocode` session after it had to work around
42
+ the gap by extracting a subagent spec into a separate function just to assert on it.
43
+
44
+ ### Patch Changes
45
+
46
+ - Correct a version number in the 5.1.0 release notes
47
+
48
+ The 5.1.0 entry *"Snapshot versions now sort ABOVE the release they are cut from"* illustrates the
49
+ result as `5.0.2-compat-580-…`. **That digit was invented rather than derived.** The pending
50
+ changesets included a `minor`, so the calculated base was `5.1.0`, and the first cut after the change
51
+ printed:
52
+
53
+ ```
54
+ 5.1.0-compat-581-20260905211819
55
+ ```
56
+
57
+ A correction was written before the release and did not reach it: it lived in a pull request that had
58
+ not merged when `changeset version` consumed the changeset, so the uncorrected text shipped.
59
+
60
+ Recorded as a new entry rather than by editing the published one, per this project's changelog
61
+ discipline — a released entry is a record of what was said at the time, and rewriting it hides that
62
+ the correction happened.
63
+
64
+ **Why a wrong digit was worth two entries:** the property that mattered — sorting above `5.0.0` —
65
+ held with either number. An invented value that does not change the conclusion is the kind that stays
66
+ uncorrected forever, and a reader comparing the changelog against what they installed would have
67
+ found an unexplained discrepancy and rightly concluded one of the two was lying.
68
+
69
+ - [#585](https://github.com/usetheokit/theokit-sdk/pull/585) [`86bf6c1`](https://github.com/usetheokit/theokit-sdk/commit/86bf6c1ab90438835df5bb0d4a791596c58004ba) Thanks [@usetheodev](https://github.com/usetheodev)! - `CompatSurface` is declared once ([#586](https://github.com/usetheokit/theokit-sdk/issues/586))
70
+
71
+ It was declared twice, independently — `types/agent.ts` (public, typing
72
+ `AgentOptions.local.compatSources`) and `internal/runtime/compat/foreign-config-sources.ts` (typing
73
+ the admission logic and `persistence/paths.ts`). Neither imported the other.
74
+
75
+ Measured: adding a member to one alone produced **zero** type errors. Structurally identical unions
76
+ compare equal, so the two halves of one public contract could stop agreeing about which surfaces
77
+ exist, silently. Widen the public type and a caller declares a surface the admission logic ignores;
78
+ widen the internal one and the loader admits a surface no public caller can name. Both produce a
79
+ declaration that reads as honoured and is not.
80
+
81
+ `types/` is a leaf by design, so the public declaration stays and the internal module imports it.
82
+
83
+ The runtime list `COMPAT_SURFACES` cannot be derived from a type, so it remains a second copy of the
84
+ members — and a compile-time exhaustiveness check now pairs the two, in both directions.
85
+
86
+ **The first version of that check was decorative and this is worth recording:** annotating the list
87
+ `readonly CompatSurface[]` widens each entry back to `CompatSurface`, so the check compared a type
88
+ against itself and passed on any drift. It was caught by testing the guard rather than trusting it —
89
+ a member added to the public type produced zero errors. `as const satisfies` keeps the literals.
90
+
3
91
  ## 5.1.0
4
92
 
5
93
  ### Minor Changes
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkD3CCY3A2_cjs = require('./chunk-D3CCY3A2.cjs');
3
+ var chunkDEJCKB65_cjs = require('./chunk-DEJCKB65.cjs');
4
4
  require('./chunk-KVSAY6NZ.cjs');
5
5
  require('./chunk-Y2KYR2ED.cjs');
6
6
  require('./chunk-BUUUWQMB.cjs');
7
7
  require('./chunk-Z2JFX372.cjs');
8
- require('./chunk-KGANQYP7.cjs');
8
+ require('./chunk-SSIRPWWD.cjs');
9
9
  require('./chunk-BV2MWEMV.cjs');
10
10
  require('./chunk-D6POWE7E.cjs');
11
11
  require('./chunk-GHX4P3V2.cjs');
@@ -43,8 +43,8 @@ require('./chunk-BJUJT5ED.cjs');
43
43
  require('./chunk-ZF2LDKQQ.cjs');
44
44
  require('./chunk-HCT4HPCL.cjs');
45
45
  require('./chunk-JLRLCBJ4.cjs');
46
- require('./chunk-QYLZQ43D.cjs');
47
- require('./chunk-NYQ3IS7K.cjs');
46
+ require('./chunk-IQBDR5YZ.cjs');
47
+ require('./chunk-DWB3CN46.cjs');
48
48
  require('./chunk-HW7SEELD.cjs');
49
49
  require('./chunk-ATT276RD.cjs');
50
50
  require('./chunk-3EE6LVWT.cjs');
@@ -61,7 +61,7 @@ require('./chunk-6LHQPOMI.cjs');
61
61
 
62
62
  Object.defineProperty(exports, "Agent", {
63
63
  enumerable: true,
64
- get: function () { return chunkD3CCY3A2_cjs.Agent; }
64
+ get: function () { return chunkDEJCKB65_cjs.Agent; }
65
65
  });
66
- //# sourceMappingURL=agent-ARLOD4JX.cjs.map
67
- //# sourceMappingURL=agent-ARLOD4JX.cjs.map
66
+ //# sourceMappingURL=agent-GACKKINM.cjs.map
67
+ //# sourceMappingURL=agent-GACKKINM.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-ARLOD4JX.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-GACKKINM.cjs"}
@@ -1,9 +1,9 @@
1
- export { Agent } from './chunk-OYD3U3LY.js';
1
+ export { Agent } from './chunk-43H4EBS2.js';
2
2
  import './chunk-K2VMFZQ5.js';
3
3
  import './chunk-AWINL3ZC.js';
4
4
  import './chunk-K2BQQ445.js';
5
5
  import './chunk-7SZAV6QG.js';
6
- import './chunk-AW6F6HZR.js';
6
+ import './chunk-AI4MXACC.js';
7
7
  import './chunk-2SFBB54R.js';
8
8
  import './chunk-55GB6JYQ.js';
9
9
  import './chunk-H73MEMQB.js';
@@ -41,8 +41,8 @@ import './chunk-TA3K7SBK.js';
41
41
  import './chunk-Q5EWJPRY.js';
42
42
  import './chunk-EIQFAOFD.js';
43
43
  import './chunk-3JHIFQ4I.js';
44
- import './chunk-OQRGVTQF.js';
45
- import './chunk-WMWEI3NS.js';
44
+ import './chunk-DLFWMJE3.js';
45
+ import './chunk-RP3VXJMA.js';
46
46
  import './chunk-JNAA4G4H.js';
47
47
  import './chunk-6M2OIS4Y.js';
48
48
  import './chunk-R7WIIPUR.js';
@@ -54,5 +54,5 @@ import './chunk-V22DZIXO.js';
54
54
  import './chunk-NJWYQWDL.js';
55
55
  import './chunk-ALUN2B4W.js';
56
56
  import './chunk-CZJ6Q7CW.js';
57
- //# sourceMappingURL=agent-N6WJ54ML.js.map
58
- //# sourceMappingURL=agent-N6WJ54ML.js.map
57
+ //# sourceMappingURL=agent-VUNM33WJ.js.map
58
+ //# sourceMappingURL=agent-VUNM33WJ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-N6WJ54ML.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-VUNM33WJ.js"}
@@ -1,7 +1,7 @@
1
1
  import { submit, emitRunEvent } from './chunk-K2VMFZQ5.js';
2
2
  import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-AWINL3ZC.js';
3
3
  import { IndexManager } from './chunk-7SZAV6QG.js';
4
- import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-AW6F6HZR.js';
4
+ import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-AI4MXACC.js';
5
5
  import { extractCodePlugins } from './chunk-2SFBB54R.js';
6
6
  import { createOpenAiCompatibleRuntime } from './chunk-55GB6JYQ.js';
7
7
  import { persistActiveMemoryTranscript } from './chunk-OR6XIWLB.js';
@@ -24,8 +24,8 @@ import { expandTilde, defaultBaseDir } from './chunk-JOFVLOFY.js';
24
24
  import { withFileLock } from './chunk-TA3K7SBK.js';
25
25
  import { withCwdMutex } from './chunk-Q5EWJPRY.js';
26
26
  import { sweepStaleAtomicTemps, atomicWriteJson } from './chunk-3JHIFQ4I.js';
27
- import { loadSubagents, pluginBundleDirs } from './chunk-OQRGVTQF.js';
28
- import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, projectConfigRoots, pluginBundleRoots } from './chunk-WMWEI3NS.js';
27
+ import { loadSubagents, pluginBundleDirs } from './chunk-DLFWMJE3.js';
28
+ import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, projectConfigRoots, pluginBundleRoots } from './chunk-RP3VXJMA.js';
29
29
  import { readWorkspaceDir, parseSimpleYaml } from './chunk-JNAA4G4H.js';
30
30
  import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-6M2OIS4Y.js';
31
31
  import { parseModelId } from './chunk-R7WIIPUR.js';
@@ -9116,7 +9116,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
9116
9116
  async function localAgentFork(parent, options) {
9117
9117
  const { forkAgentImpl } = await import('./fork-agent-S2EPIML7.js');
9118
9118
  const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
9119
- const { withPersonalityContext } = await import('./context-Z3CFTT3H.js');
9119
+ const { withPersonalityContext } = await import('./context-XNREEC7M.js');
9120
9120
  const create = getAgentFacade().create;
9121
9121
  return withPersonalityContext(
9122
9122
  { slug: parent.personalitySlugSnapshot, isFork: true },
@@ -10889,7 +10889,7 @@ var Agent = class _Agent {
10889
10889
  */
10890
10890
  static async describe(agentId) {
10891
10891
  const agent = await getRegisteredAgentOrThrow(agentId);
10892
- const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-DOBTTICM.js');
10892
+ const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-PAZVOZHI.js');
10893
10893
  const settingSources = agent.options.local?.settingSources;
10894
10894
  const subagents = await loadSubagents2(
10895
10895
  agent.cwd ?? process.cwd(),
@@ -10977,5 +10977,5 @@ async function openLocalStore(reg) {
10977
10977
  }
10978
10978
 
10979
10979
  export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, openRouterMemoryEmbeddingProviderAdapter, resolveSessionDir };
10980
- //# sourceMappingURL=chunk-OYD3U3LY.js.map
10981
- //# sourceMappingURL=chunk-OYD3U3LY.js.map
10980
+ //# sourceMappingURL=chunk-43H4EBS2.js.map
10981
+ //# sourceMappingURL=chunk-43H4EBS2.js.map