@theokit/sdk 4.63.1 → 4.63.3

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 (45) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/{agent-YWMBM7LX.js → agent-3JK7VXNN.js} +5 -5
  3. package/dist/{agent-YWMBM7LX.js.map → agent-3JK7VXNN.js.map} +1 -1
  4. package/dist/{agent-WK7MKIMH.cjs → agent-PVINJTUR.cjs} +6 -6
  5. package/dist/{agent-WK7MKIMH.cjs.map → agent-PVINJTUR.cjs.map} +1 -1
  6. package/dist/{chunk-KIH6IZ43.js → chunk-25BD2R5G.js} +24 -7
  7. package/dist/chunk-25BD2R5G.js.map +1 -0
  8. package/dist/{chunk-DKD3MH6A.js → chunk-ACDLHN3W.js} +3 -3
  9. package/dist/{chunk-DKD3MH6A.js.map → chunk-ACDLHN3W.js.map} +1 -1
  10. package/dist/{chunk-BVJJ3DRV.js → chunk-GPKAF7SG.js} +3 -3
  11. package/dist/{chunk-BVJJ3DRV.js.map → chunk-GPKAF7SG.js.map} +1 -1
  12. package/dist/{chunk-6RKUO7AW.cjs → chunk-IAHZCGBE.cjs} +5 -4
  13. package/dist/chunk-IAHZCGBE.cjs.map +1 -0
  14. package/dist/{chunk-ZMRD5DZQ.cjs → chunk-JJ3OVRUM.cjs} +39 -22
  15. package/dist/chunk-JJ3OVRUM.cjs.map +1 -0
  16. package/dist/{chunk-UEXIJTLC.js → chunk-L3MTL4NA.js} +3 -3
  17. package/dist/{chunk-UEXIJTLC.js.map → chunk-L3MTL4NA.js.map} +1 -1
  18. package/dist/{chunk-GEEXBYFL.js → chunk-L4BDVXIM.js} +4 -3
  19. package/dist/chunk-L4BDVXIM.js.map +1 -0
  20. package/dist/{chunk-HOXVQ5FR.cjs → chunk-OFRFZRQ4.cjs} +8 -8
  21. package/dist/{chunk-HOXVQ5FR.cjs.map → chunk-OFRFZRQ4.cjs.map} +1 -1
  22. package/dist/{chunk-ITYQ6VBP.cjs → chunk-VLVVJLDH.cjs} +14 -14
  23. package/dist/{chunk-ITYQ6VBP.cjs.map → chunk-VLVVJLDH.cjs.map} +1 -1
  24. package/dist/{chunk-Q7LPTOD6.cjs → chunk-ZWRG4NWT.cjs} +4 -4
  25. package/dist/{chunk-Q7LPTOD6.cjs.map → chunk-ZWRG4NWT.cjs.map} +1 -1
  26. package/dist/cron.cjs +5 -5
  27. package/dist/cron.js +4 -4
  28. package/dist/eval.cjs +4 -4
  29. package/dist/eval.js +3 -3
  30. package/dist/{index-manager-UZBF22BJ.cjs → index-manager-2SRX45WJ.cjs} +6 -5
  31. package/dist/{index-manager-UZBF22BJ.cjs.map → index-manager-2SRX45WJ.cjs.map} +1 -1
  32. package/dist/{index-manager-RBDHP3PM.js → index-manager-SP4ISSDX.js} +5 -4
  33. package/dist/{index-manager-RBDHP3PM.js.map → index-manager-SP4ISSDX.js.map} +1 -1
  34. package/dist/index.cjs +26 -26
  35. package/dist/index.js +8 -8
  36. package/dist/internal/memory/storage/index.cjs +31 -30
  37. package/dist/internal/memory/storage/index.js +3 -2
  38. package/dist/internal/memory/storage/memory-root.d.cts +10 -0
  39. package/dist/internal/memory/storage/memory-root.d.ts +10 -0
  40. package/docs/error-codes.md +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-6RKUO7AW.cjs.map +0 -1
  43. package/dist/chunk-GEEXBYFL.js.map +0 -1
  44. package/dist/chunk-KIH6IZ43.js.map +0 -1
  45. package/dist/chunk-ZMRD5DZQ.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.63.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 076e1b3: The Claude Code interop memory read is keyed by the git repository root, matching the CLI.
8
+
9
+ `claudeProjectMemoryDir` keyed the auto-memory store by `cwd`. The CLI keys it by the repository:
10
+ _"the `<project>` path is derived from the git repository, so all worktrees and subdirectories within
11
+ the same repo share one auto memory directory. Outside a git repo, the project root is used
12
+ instead."_
13
+
14
+ So an agent running from any directory below the root — a monorepo package, a script in `tools/`, a
15
+ test in a subfolder, which is the ordinary case — read a directory the CLI never writes to. It found
16
+ nothing and reported nothing, and that observation is identical to an empty store, which is why it
17
+ survived the interop change that introduced it.
18
+
19
+ Confirmed from disk before the fix: of the CLI project directories that resolve to a SUBDIRECTORY of
20
+ a git repository, none had a `memory/` at all, while their repository root held three fact files.
21
+ The subdirectory directories contained only session transcripts.
22
+
23
+ **Transcripts are the trap and stay as they were.** The CLI keys those by `cwd`, correctly, and
24
+ `encodeProjectDir` is right for them. One encoder serving two axes is what made the two
25
+ indistinguishable in the code; the encoder is still shared, the path it is given is not.
26
+
27
+ `.git` as a FILE — a worktree or a submodule — counts as a repository, so the read does not miss
28
+ again in the layout that most needs it.
29
+
30
+ ## 4.63.2
31
+
32
+ ### Patch Changes
33
+
34
+ - 1466750: A refused `memory.directory` is now reported on the read path, not only on the write path.
35
+
36
+ A relative `directory` is refused by contract, and the write path has said so since the near-miss
37
+ diagnostic landed. The read path did not: `readMemoryForSend` wrapped everything in `safeCall`, which
38
+ reports on `diag` — dropped entirely when the host installed no sink. An app that only CONSUMES
39
+ memory, which is the served case the option exists for, answered every turn normally with an empty
40
+ store and never learned why.
41
+
42
+ Measured against the published package with no sink installed: `Agent.create` did not throw, the turn
43
+ answered normally, nothing was written to either the configured path or the default store, and
44
+ stderr said nothing at all.
45
+
46
+ `safeCall` stays where it was added for, and that trade is unchanged: a corrupt memory file must not
47
+ abort the turn, and reporting it quietly is right because it is transient and local to one entry. A
48
+ `ConfigurationError` from the resolver is the opposite — permanent, repeating on every turn forever,
49
+ and fixable in one line by the person being kept in the dark — so it goes on the channel a failure
50
+ cannot be dropped from.
51
+
52
+ Reported **once per configuration per process**, not per turn. A warning that arrives every turn is a
53
+ warning somebody turns off.
54
+
3
55
  ## 4.63.1
4
56
 
5
57
  ### Patch Changes
@@ -1,14 +1,14 @@
1
- export { Agent } from './chunk-KIH6IZ43.js';
1
+ export { Agent } from './chunk-25BD2R5G.js';
2
2
  import './chunk-A46SWMIF.js';
3
3
  import './chunk-4FFBAUFS.js';
4
4
  import './chunk-K2BQQ445.js';
5
- import './chunk-UEXIJTLC.js';
5
+ import './chunk-L3MTL4NA.js';
6
6
  import './chunk-K5OJUYSZ.js';
7
7
  import './chunk-2SFBB54R.js';
8
8
  import './chunk-UBDMVMBZ.js';
9
9
  import './chunk-H73MEMQB.js';
10
10
  import './chunk-XO4SOZN6.js';
11
- import './chunk-GEEXBYFL.js';
11
+ import './chunk-L4BDVXIM.js';
12
12
  import './chunk-BP46RJ5X.js';
13
13
  import './chunk-DN2PACRI.js';
14
14
  import './chunk-TAZVKYWJ.js';
@@ -53,5 +53,5 @@ import './chunk-3OR54XG4.js';
53
53
  import './chunk-ZZMZWBR6.js';
54
54
  import './chunk-D4CUGAKZ.js';
55
55
  import './chunk-XEQ3TM66.js';
56
- //# sourceMappingURL=agent-YWMBM7LX.js.map
57
- //# sourceMappingURL=agent-YWMBM7LX.js.map
56
+ //# sourceMappingURL=agent-3JK7VXNN.js.map
57
+ //# sourceMappingURL=agent-3JK7VXNN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-YWMBM7LX.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-3JK7VXNN.js"}
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkZMRD5DZQ_cjs = require('./chunk-ZMRD5DZQ.cjs');
3
+ var chunkJJ3OVRUM_cjs = require('./chunk-JJ3OVRUM.cjs');
4
4
  require('./chunk-3FFAEAUJ.cjs');
5
5
  require('./chunk-RMWTPV3M.cjs');
6
6
  require('./chunk-BUUUWQMB.cjs');
7
- require('./chunk-ITYQ6VBP.cjs');
7
+ require('./chunk-VLVVJLDH.cjs');
8
8
  require('./chunk-ZCIRZE37.cjs');
9
9
  require('./chunk-BV2MWEMV.cjs');
10
10
  require('./chunk-KQ7TS7WW.cjs');
11
11
  require('./chunk-GHX4P3V2.cjs');
12
12
  require('./chunk-GKEFRLU7.cjs');
13
- require('./chunk-6RKUO7AW.cjs');
13
+ require('./chunk-IAHZCGBE.cjs');
14
14
  require('./chunk-ZLQSWSJ2.cjs');
15
15
  require('./chunk-KYAJINUI.cjs');
16
16
  require('./chunk-O7DK5PBJ.cjs');
@@ -60,7 +60,7 @@ require('./chunk-EG4QM7ZJ.cjs');
60
60
 
61
61
  Object.defineProperty(exports, "Agent", {
62
62
  enumerable: true,
63
- get: function () { return chunkZMRD5DZQ_cjs.Agent; }
63
+ get: function () { return chunkJJ3OVRUM_cjs.Agent; }
64
64
  });
65
- //# sourceMappingURL=agent-WK7MKIMH.cjs.map
66
- //# sourceMappingURL=agent-WK7MKIMH.cjs.map
65
+ //# sourceMappingURL=agent-PVINJTUR.cjs.map
66
+ //# sourceMappingURL=agent-PVINJTUR.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-WK7MKIMH.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-PVINJTUR.cjs"}
@@ -1,11 +1,11 @@
1
1
  import { submit, emitRunEvent } from './chunk-A46SWMIF.js';
2
2
  import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-4FFBAUFS.js';
3
- import { IndexManager } from './chunk-UEXIJTLC.js';
3
+ import { IndexManager } from './chunk-L3MTL4NA.js';
4
4
  import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-K5OJUYSZ.js';
5
5
  import { extractCodePlugins } from './chunk-2SFBB54R.js';
6
6
  import { createOpenAiCompatibleRuntime } from './chunk-UBDMVMBZ.js';
7
7
  import { persistActiveMemoryTranscript } from './chunk-XO4SOZN6.js';
8
- import { resolveMemoryRoot, writeSessionSummary, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-GEEXBYFL.js';
8
+ import { resolveMemoryRoot, writeSessionSummary, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-L4BDVXIM.js';
9
9
  import { FsSessionStore } from './chunk-BP46RJ5X.js';
10
10
  import { discoverProviderPlugins, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, CircuitBreaker, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, resolveProviderChain, inferProviderFromApiKey, detectPrimaryProvider, warnProviderPrecedenceOnce, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-DN2PACRI.js';
11
11
  import { resolveChildEnv } from './chunk-HKCKOAIO.js';
@@ -9592,12 +9592,29 @@ function buildCompletionCheckDeps() {
9592
9592
  }
9593
9593
  };
9594
9594
  }
9595
+ var reportedRefusedDirectories = /* @__PURE__ */ new Set();
9596
+ function reportRefusedMemoryDirectoryOnce(workspaceCwd, directory, message) {
9597
+ const key = `${workspaceCwd}\0${directory ?? ""}`;
9598
+ if (reportedRefusedDirectories.has(key)) return;
9599
+ reportedRefusedDirectories.add(key);
9600
+ diagFailure(
9601
+ `[theokit-sdk] memory is enabled but its directory was refused, so recall is empty on every turn and nothing is stored: ${message}`
9602
+ );
9603
+ }
9595
9604
  function readMemoryForSend(workspaceCwd, memoryConfig, query) {
9596
9605
  if (memoryConfig?.enabled !== true) return Promise.resolve([]);
9597
9606
  return safeCall(
9598
- async () => selectFactsForInjection(await readMemoryFacts(workspaceCwd, memoryConfig), {
9599
- ...query === void 0 ? {} : { query }
9600
- }),
9607
+ async () => {
9608
+ try {
9609
+ return selectFactsForInjection(await readMemoryFacts(workspaceCwd, memoryConfig), {
9610
+ ...query === void 0 ? {} : { query }
9611
+ });
9612
+ } catch (cause) {
9613
+ if (!(cause instanceof ConfigurationError)) throw cause;
9614
+ reportRefusedMemoryDirectoryOnce(workspaceCwd, memoryConfig?.directory, cause.message);
9615
+ return [];
9616
+ }
9617
+ },
9601
9618
  [],
9602
9619
  "memory read"
9603
9620
  );
@@ -10777,5 +10794,5 @@ async function openLocalStore(reg) {
10777
10794
  }
10778
10795
 
10779
10796
  export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, openRouterMemoryEmbeddingProviderAdapter };
10780
- //# sourceMappingURL=chunk-KIH6IZ43.js.map
10781
- //# sourceMappingURL=chunk-KIH6IZ43.js.map
10797
+ //# sourceMappingURL=chunk-25BD2R5G.js.map
10798
+ //# sourceMappingURL=chunk-25BD2R5G.js.map