@theokit/sdk 5.0.0-next.1 → 5.0.0-next.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 (111) hide show
  1. package/CHANGELOG.md +195 -0
  2. package/dist/{agent-XMKRP27S.js → agent-2KJ3IGRA.js} +10 -10
  3. package/dist/{agent-XMKRP27S.js.map → agent-2KJ3IGRA.js.map} +1 -1
  4. package/dist/{agent-CgNzshyV.d.cts → agent-C3KO5LKm.d.cts} +49 -3
  5. package/dist/{agent-CdYJfKr6.d.ts → agent-CvmTR9uf.d.ts} +49 -3
  6. package/dist/{agent-2E7DI47Y.cjs → agent-V6YLX3W6.cjs} +11 -11
  7. package/dist/{agent-2E7DI47Y.cjs.map → agent-V6YLX3W6.cjs.map} +1 -1
  8. package/dist/{chunk-WFC26L6Y.js → chunk-2XRAWOZZ.js} +25 -2
  9. package/dist/chunk-2XRAWOZZ.js.map +1 -0
  10. package/dist/{chunk-XCCGNU3D.js → chunk-4S5TWFIZ.js} +5 -5
  11. package/dist/chunk-4S5TWFIZ.js.map +1 -0
  12. package/dist/{chunk-JTZ74HFD.js → chunk-67ADYSTW.js} +29 -9
  13. package/dist/chunk-67ADYSTW.js.map +1 -0
  14. package/dist/{chunk-2ZLVT7H3.js → chunk-CYKKYNOT.js} +3 -3
  15. package/dist/{chunk-2ZLVT7H3.js.map → chunk-CYKKYNOT.js.map} +1 -1
  16. package/dist/{chunk-WJXOICRC.js → chunk-DX4RUWOK.js} +3 -3
  17. package/dist/{chunk-WJXOICRC.js.map → chunk-DX4RUWOK.js.map} +1 -1
  18. package/dist/{chunk-CEILSTWB.cjs → chunk-GGZ5GPE3.cjs} +29 -8
  19. package/dist/chunk-GGZ5GPE3.cjs.map +1 -0
  20. package/dist/{chunk-7ZK4DJD7.cjs → chunk-GJKMSGZ7.cjs} +4 -4
  21. package/dist/{chunk-7ZK4DJD7.cjs.map → chunk-GJKMSGZ7.cjs.map} +1 -1
  22. package/dist/{chunk-NCGWJ3HS.js → chunk-GO5QW4YL.js} +74 -35
  23. package/dist/chunk-GO5QW4YL.js.map +1 -0
  24. package/dist/{chunk-HWSALKOR.cjs → chunk-H6YM3PV6.cjs} +5 -5
  25. package/dist/chunk-H6YM3PV6.cjs.map +1 -0
  26. package/dist/{chunk-RHZ6HP23.cjs → chunk-IU5N5224.cjs} +8 -8
  27. package/dist/{chunk-RHZ6HP23.cjs.map → chunk-IU5N5224.cjs.map} +1 -1
  28. package/dist/{chunk-UNK4HNJH.js → chunk-J2SH3PNH.js} +3 -3
  29. package/dist/{chunk-UNK4HNJH.js.map → chunk-J2SH3PNH.js.map} +1 -1
  30. package/dist/{chunk-WMH2MSOP.cjs → chunk-K6VDRJ6I.cjs} +114 -75
  31. package/dist/chunk-K6VDRJ6I.cjs.map +1 -0
  32. package/dist/{chunk-2NE7DTOK.cjs → chunk-KBXADFBJ.cjs} +15 -15
  33. package/dist/{chunk-2NE7DTOK.cjs.map → chunk-KBXADFBJ.cjs.map} +1 -1
  34. package/dist/{chunk-6HIACV34.js → chunk-L4RPP6ZC.js} +3 -3
  35. package/dist/{chunk-6HIACV34.js.map → chunk-L4RPP6ZC.js.map} +1 -1
  36. package/dist/{chunk-LKFET5A3.cjs → chunk-LOHMT36V.cjs} +25 -2
  37. package/dist/chunk-LOHMT36V.cjs.map +1 -0
  38. package/dist/{chunk-ILGZ2ZZV.js → chunk-N6OOOYFZ.js} +3 -3
  39. package/dist/{chunk-ILGZ2ZZV.js.map → chunk-N6OOOYFZ.js.map} +1 -1
  40. package/dist/{chunk-LHSWHYF3.cjs → chunk-RXZSVNDG.cjs} +5 -5
  41. package/dist/{chunk-LHSWHYF3.cjs.map → chunk-RXZSVNDG.cjs.map} +1 -1
  42. package/dist/{chunk-G4ZGYKJG.cjs → chunk-SYVWE64W.cjs} +6 -6
  43. package/dist/chunk-SYVWE64W.cjs.map +1 -0
  44. package/dist/{chunk-V6ZY4AX6.cjs → chunk-VNDJS6I3.cjs} +8 -8
  45. package/dist/{chunk-V6ZY4AX6.cjs.map → chunk-VNDJS6I3.cjs.map} +1 -1
  46. package/dist/{chunk-IJM7UGS5.js → chunk-XJZEBGXD.js} +5 -5
  47. package/dist/chunk-XJZEBGXD.js.map +1 -0
  48. package/dist/context/index.cjs +7 -7
  49. package/dist/context/index.js +3 -3
  50. package/dist/{context-74SBFD27.cjs → context-NI33FS2R.cjs} +7 -7
  51. package/dist/{context-74SBFD27.cjs.map → context-NI33FS2R.cjs.map} +1 -1
  52. package/dist/context-Y7B7SI5X.js +6 -0
  53. package/dist/{context-NZ2AC6S7.js.map → context-Y7B7SI5X.js.map} +1 -1
  54. package/dist/{cron-Bw6mSgD4.d.cts → cron-C3PhZED0.d.cts} +1 -1
  55. package/dist/{cron-DJv9oXSZ.d.ts → cron-crfMMdAw.d.ts} +1 -1
  56. package/dist/cron.cjs +10 -10
  57. package/dist/cron.d.cts +3 -3
  58. package/dist/cron.d.ts +3 -3
  59. package/dist/cron.js +9 -9
  60. package/dist/eval.cjs +9 -9
  61. package/dist/eval.js +8 -8
  62. package/dist/{index-manager-QH6OXEV5.js → index-manager-E56WW5RO.js} +5 -5
  63. package/dist/{index-manager-QH6OXEV5.js.map → index-manager-E56WW5RO.js.map} +1 -1
  64. package/dist/{index-manager-DXR2RSFI.cjs → index-manager-OL6HTYAO.cjs} +6 -6
  65. package/dist/{index-manager-DXR2RSFI.cjs.map → index-manager-OL6HTYAO.cjs.map} +1 -1
  66. package/dist/index.cjs +31 -31
  67. package/dist/index.d.cts +5 -5
  68. package/dist/index.d.ts +5 -5
  69. package/dist/index.js +13 -13
  70. package/dist/internal/memory/storage/index.cjs +31 -31
  71. package/dist/internal/memory/storage/index.js +3 -3
  72. package/dist/internal/persistence/index.cjs +4 -4
  73. package/dist/internal/persistence/index.js +1 -1
  74. package/dist/internal/persistence/paths.d.cts +25 -12
  75. package/dist/internal/persistence/paths.d.ts +25 -12
  76. package/dist/internal/runtime/compat/compat-config-file.d.ts +31 -0
  77. package/dist/internal/runtime/compat/foreign-config-sources.d.ts +31 -1
  78. package/dist/internal/runtime/hooks/hooks-executor.d.ts +2 -1
  79. package/dist/internal/runtime/plugin-loader/plugin-bundles.d.ts +2 -1
  80. package/dist/project.cjs +3 -3
  81. package/dist/project.js +1 -1
  82. package/dist/{sdk-agent-Dxjb0IfM.d.cts → sdk-agent-BOiKqOgL.d.cts} +28 -1
  83. package/dist/{sdk-agent-ldzpyAaF.d.ts → sdk-agent-D4a_BR_6.d.ts} +28 -1
  84. package/dist/subagents-loader-TPZLTXYZ.cjs +16 -0
  85. package/dist/{subagents-loader-YWFE7KYE.cjs.map → subagents-loader-TPZLTXYZ.cjs.map} +1 -1
  86. package/dist/subagents-loader-Y6JFYXAY.js +7 -0
  87. package/dist/{subagents-loader-LSKM2UIK.js.map → subagents-loader-Y6JFYXAY.js.map} +1 -1
  88. package/dist/subagents-loader.cjs +3 -3
  89. package/dist/subagents-loader.d.cts +2 -2
  90. package/dist/subagents-loader.d.ts +2 -2
  91. package/dist/subagents-loader.js +2 -2
  92. package/dist/types/agent.d.ts +47 -1
  93. package/dist/types/sdk-agent.d.ts +28 -1
  94. package/dist/workflow.d.cts +1 -1
  95. package/dist/workflow.d.ts +1 -1
  96. package/docs/error-codes.md +21 -21
  97. package/docs/harness-capability-map.md +3 -1
  98. package/package.json +1 -1
  99. package/dist/chunk-CEILSTWB.cjs.map +0 -1
  100. package/dist/chunk-G4ZGYKJG.cjs.map +0 -1
  101. package/dist/chunk-HWSALKOR.cjs.map +0 -1
  102. package/dist/chunk-IJM7UGS5.js.map +0 -1
  103. package/dist/chunk-JTZ74HFD.js.map +0 -1
  104. package/dist/chunk-LKFET5A3.cjs.map +0 -1
  105. package/dist/chunk-NCGWJ3HS.js.map +0 -1
  106. package/dist/chunk-WFC26L6Y.js.map +0 -1
  107. package/dist/chunk-WMH2MSOP.cjs.map +0 -1
  108. package/dist/chunk-XCCGNU3D.js.map +0 -1
  109. package/dist/context-NZ2AC6S7.js +0 -6
  110. package/dist/subagents-loader-LSKM2UIK.js +0 -7
  111. package/dist/subagents-loader-YWFE7KYE.cjs +0 -16
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkV6ZY4AX6_cjs = require('../../../chunk-V6ZY4AX6.cjs');
3
+ var chunkVNDJS6I3_cjs = require('../../../chunk-VNDJS6I3.cjs');
4
4
  var chunkTMKTSYDS_cjs = require('../../../chunk-TMKTSYDS.cjs');
5
- var chunkLHSWHYF3_cjs = require('../../../chunk-LHSWHYF3.cjs');
5
+ var chunkRXZSVNDG_cjs = require('../../../chunk-RXZSVNDG.cjs');
6
6
  require('../../../chunk-KRD3GQAA.cjs');
7
7
  require('../../../chunk-MUUQ2WFJ.cjs');
8
- require('../../../chunk-LKFET5A3.cjs');
8
+ require('../../../chunk-LOHMT36V.cjs');
9
9
  require('../../../chunk-7A6535RA.cjs');
10
10
  require('../../../chunk-SA6K24NB.cjs');
11
11
  require('../../../chunk-GZV6AVRL.cjs');
@@ -19,23 +19,23 @@ require('../../../chunk-6LHQPOMI.cjs');
19
19
 
20
20
  Object.defineProperty(exports, "appendDiaryEntry", {
21
21
  enumerable: true,
22
- get: function () { return chunkV6ZY4AX6_cjs.appendDiaryEntry; }
22
+ get: function () { return chunkVNDJS6I3_cjs.appendDiaryEntry; }
23
23
  });
24
24
  Object.defineProperty(exports, "diaryPath", {
25
25
  enumerable: true,
26
- get: function () { return chunkV6ZY4AX6_cjs.diaryPath; }
26
+ get: function () { return chunkVNDJS6I3_cjs.diaryPath; }
27
27
  });
28
28
  Object.defineProperty(exports, "entryHash", {
29
29
  enumerable: true,
30
- get: function () { return chunkV6ZY4AX6_cjs.entryHash; }
30
+ get: function () { return chunkVNDJS6I3_cjs.entryHash; }
31
31
  });
32
32
  Object.defineProperty(exports, "readAllSqliteFacts", {
33
33
  enumerable: true,
34
- get: function () { return chunkV6ZY4AX6_cjs.readAllSqliteFacts; }
34
+ get: function () { return chunkVNDJS6I3_cjs.readAllSqliteFacts; }
35
35
  });
36
36
  Object.defineProperty(exports, "renderDiaryEntry", {
37
37
  enumerable: true,
38
- get: function () { return chunkV6ZY4AX6_cjs.renderDiaryEntry; }
38
+ get: function () { return chunkVNDJS6I3_cjs.renderDiaryEntry; }
39
39
  });
40
40
  Object.defineProperty(exports, "persistActiveMemoryTranscript", {
41
41
  enumerable: true,
@@ -43,95 +43,95 @@ Object.defineProperty(exports, "persistActiveMemoryTranscript", {
43
43
  });
44
44
  Object.defineProperty(exports, "MEMORY_INDEX_MAX_BYTES", {
45
45
  enumerable: true,
46
- get: function () { return chunkLHSWHYF3_cjs.MEMORY_INDEX_MAX_BYTES; }
46
+ get: function () { return chunkRXZSVNDG_cjs.MEMORY_INDEX_MAX_BYTES; }
47
47
  });
48
48
  Object.defineProperty(exports, "MEMORY_INDEX_MAX_LINES", {
49
49
  enumerable: true,
50
- get: function () { return chunkLHSWHYF3_cjs.MEMORY_INDEX_MAX_LINES; }
50
+ get: function () { return chunkRXZSVNDG_cjs.MEMORY_INDEX_MAX_LINES; }
51
51
  });
52
52
  Object.defineProperty(exports, "appendFact", {
53
53
  enumerable: true,
54
- get: function () { return chunkLHSWHYF3_cjs.appendFact; }
54
+ get: function () { return chunkRXZSVNDG_cjs.appendFact; }
55
55
  });
56
56
  Object.defineProperty(exports, "appendFactToMarkdown", {
57
57
  enumerable: true,
58
- get: function () { return chunkLHSWHYF3_cjs.appendFactToMarkdown; }
58
+ get: function () { return chunkRXZSVNDG_cjs.appendFactToMarkdown; }
59
59
  });
60
60
  Object.defineProperty(exports, "asMemoryRoot", {
61
61
  enumerable: true,
62
- get: function () { return chunkLHSWHYF3_cjs.asMemoryRoot; }
62
+ get: function () { return chunkRXZSVNDG_cjs.asMemoryRoot; }
63
63
  });
64
64
  Object.defineProperty(exports, "claudeProjectMemoryDir", {
65
65
  enumerable: true,
66
- get: function () { return chunkLHSWHYF3_cjs.claudeProjectMemoryDir; }
66
+ get: function () { return chunkRXZSVNDG_cjs.claudeProjectMemoryDir; }
67
67
  });
68
68
  Object.defineProperty(exports, "collectMarkdownFiles", {
69
69
  enumerable: true,
70
- get: function () { return chunkLHSWHYF3_cjs.collectMarkdownFiles; }
70
+ get: function () { return chunkRXZSVNDG_cjs.collectMarkdownFiles; }
71
71
  });
72
72
  Object.defineProperty(exports, "defaultIndexPath", {
73
73
  enumerable: true,
74
- get: function () { return chunkLHSWHYF3_cjs.defaultIndexPath; }
74
+ get: function () { return chunkRXZSVNDG_cjs.defaultIndexPath; }
75
75
  });
76
76
  Object.defineProperty(exports, "discoverSessionFiles", {
77
77
  enumerable: true,
78
- get: function () { return chunkLHSWHYF3_cjs.discoverSessionFiles; }
78
+ get: function () { return chunkRXZSVNDG_cjs.discoverSessionFiles; }
79
79
  });
80
80
  Object.defineProperty(exports, "discoverWikiFiles", {
81
81
  enumerable: true,
82
- get: function () { return chunkLHSWHYF3_cjs.discoverWikiFiles; }
82
+ get: function () { return chunkRXZSVNDG_cjs.discoverWikiFiles; }
83
83
  });
84
84
  Object.defineProperty(exports, "indexBudgetWarning", {
85
85
  enumerable: true,
86
- get: function () { return chunkLHSWHYF3_cjs.indexBudgetWarning; }
86
+ get: function () { return chunkRXZSVNDG_cjs.indexBudgetWarning; }
87
87
  });
88
88
  Object.defineProperty(exports, "lanceStoragePath", {
89
89
  enumerable: true,
90
- get: function () { return chunkLHSWHYF3_cjs.lanceStoragePath; }
90
+ get: function () { return chunkRXZSVNDG_cjs.lanceStoragePath; }
91
91
  });
92
92
  Object.defineProperty(exports, "memoryMdPath", {
93
93
  enumerable: true,
94
- get: function () { return chunkLHSWHYF3_cjs.memoryMdPath; }
94
+ get: function () { return chunkRXZSVNDG_cjs.memoryMdPath; }
95
95
  });
96
96
  Object.defineProperty(exports, "memoryReadRoots", {
97
97
  enumerable: true,
98
- get: function () { return chunkLHSWHYF3_cjs.memoryReadRoots; }
98
+ get: function () { return chunkRXZSVNDG_cjs.memoryReadRoots; }
99
99
  });
100
100
  Object.defineProperty(exports, "notesDir", {
101
101
  enumerable: true,
102
- get: function () { return chunkLHSWHYF3_cjs.notesDir; }
102
+ get: function () { return chunkRXZSVNDG_cjs.notesDir; }
103
103
  });
104
104
  Object.defineProperty(exports, "projectMemoryDir", {
105
105
  enumerable: true,
106
- get: function () { return chunkLHSWHYF3_cjs.projectMemoryDir; }
106
+ get: function () { return chunkRXZSVNDG_cjs.projectMemoryDir; }
107
107
  });
108
108
  Object.defineProperty(exports, "readFacts", {
109
109
  enumerable: true,
110
- get: function () { return chunkLHSWHYF3_cjs.readFacts; }
110
+ get: function () { return chunkRXZSVNDG_cjs.readFacts; }
111
111
  });
112
112
  Object.defineProperty(exports, "readFactsFromMarkdown", {
113
113
  enumerable: true,
114
- get: function () { return chunkLHSWHYF3_cjs.readFactsFromMarkdown; }
114
+ get: function () { return chunkRXZSVNDG_cjs.readFactsFromMarkdown; }
115
115
  });
116
116
  Object.defineProperty(exports, "resolveMemoryRoot", {
117
117
  enumerable: true,
118
- get: function () { return chunkLHSWHYF3_cjs.resolveMemoryRoot; }
118
+ get: function () { return chunkRXZSVNDG_cjs.resolveMemoryRoot; }
119
119
  });
120
120
  Object.defineProperty(exports, "sessionSummaryPath", {
121
121
  enumerable: true,
122
- get: function () { return chunkLHSWHYF3_cjs.sessionSummaryPath; }
122
+ get: function () { return chunkRXZSVNDG_cjs.sessionSummaryPath; }
123
123
  });
124
124
  Object.defineProperty(exports, "sessionsDir", {
125
125
  enumerable: true,
126
- get: function () { return chunkLHSWHYF3_cjs.sessionsDir; }
126
+ get: function () { return chunkRXZSVNDG_cjs.sessionsDir; }
127
127
  });
128
128
  Object.defineProperty(exports, "wikiDir", {
129
129
  enumerable: true,
130
- get: function () { return chunkLHSWHYF3_cjs.wikiDir; }
130
+ get: function () { return chunkRXZSVNDG_cjs.wikiDir; }
131
131
  });
132
132
  Object.defineProperty(exports, "writeSessionSummary", {
133
133
  enumerable: true,
134
- get: function () { return chunkLHSWHYF3_cjs.writeSessionSummary; }
134
+ get: function () { return chunkRXZSVNDG_cjs.writeSessionSummary; }
135
135
  });
136
136
  //# sourceMappingURL=index.cjs.map
137
137
  //# sourceMappingURL=index.cjs.map
@@ -1,9 +1,9 @@
1
- export { appendDiaryEntry, diaryPath, entryHash, readAllSqliteFacts, renderDiaryEntry } from '../../../chunk-WJXOICRC.js';
1
+ export { appendDiaryEntry, diaryPath, entryHash, readAllSqliteFacts, renderDiaryEntry } from '../../../chunk-DX4RUWOK.js';
2
2
  export { persistActiveMemoryTranscript } from '../../../chunk-OR6XIWLB.js';
3
- export { MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, appendFact, appendFactToMarkdown, asMemoryRoot, claudeProjectMemoryDir, collectMarkdownFiles, defaultIndexPath, discoverSessionFiles, discoverWikiFiles, indexBudgetWarning, lanceStoragePath, memoryMdPath, memoryReadRoots, notesDir, projectMemoryDir, readFacts, readFactsFromMarkdown, resolveMemoryRoot, sessionSummaryPath, sessionsDir, wikiDir, writeSessionSummary } from '../../../chunk-UNK4HNJH.js';
3
+ export { MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, appendFact, appendFactToMarkdown, asMemoryRoot, claudeProjectMemoryDir, collectMarkdownFiles, defaultIndexPath, discoverSessionFiles, discoverWikiFiles, indexBudgetWarning, lanceStoragePath, memoryMdPath, memoryReadRoots, notesDir, projectMemoryDir, readFacts, readFactsFromMarkdown, resolveMemoryRoot, sessionSummaryPath, sessionsDir, wikiDir, writeSessionSummary } from '../../../chunk-J2SH3PNH.js';
4
4
  import '../../../chunk-KVNWIAO4.js';
5
5
  import '../../../chunk-FD2UT76F.js';
6
- import '../../../chunk-WFC26L6Y.js';
6
+ import '../../../chunk-2XRAWOZZ.js';
7
7
  import '../../../chunk-EH6XD3FY.js';
8
8
  import '../../../chunk-UKMBRMGT.js';
9
9
  import '../../../chunk-JOFVLOFY.js';
@@ -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 chunkCEILSTWB_cjs = require('../../chunk-CEILSTWB.cjs');
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 chunkCEILSTWB_cjs.displayTheokitHome; }
114
+ get: function () { return chunkGGZ5GPE3_cjs.displayTheokitHome; }
115
115
  });
116
116
  Object.defineProperty(exports, "getProfilesRoot", {
117
117
  enumerable: true,
118
- get: function () { return chunkCEILSTWB_cjs.getProfilesRoot; }
118
+ get: function () { return chunkGGZ5GPE3_cjs.getProfilesRoot; }
119
119
  });
120
120
  Object.defineProperty(exports, "getTheokitHome", {
121
121
  enumerable: true,
122
- get: function () { return chunkCEILSTWB_cjs.getTheokitHome; }
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-JTZ74HFD.js';
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, then `.claude`. The order is the whole contract: a project that declares a
55
- * skill, agent or rule in both means the explicit namespace to win, and a caller merging these
56
- * roots must therefore keep the FIRST occurrence of a name rather than the last.
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?: readonly string[]): string[];
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?: readonly string[]): string[];
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, then `.claude`. The order is the whole contract: a project that declares a
55
- * skill, agent or rule in both means the explicit namespace to win, and a caller merging these
56
- * roots must therefore keep the FIRST occurrence of a name rather than the last.
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?: readonly string[]): string[];
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?: readonly string[]): string[];
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 string[]): void;
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 string[]);
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 string[]): Promise<string[]>;
22
+ compatSources?: readonly CompatSourceDeclaration[]): Promise<string[]>;
package/dist/project.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLKFET5A3_cjs = require('./chunk-LKFET5A3.cjs');
3
+ var chunkLOHMT36V_cjs = require('./chunk-LOHMT36V.cjs');
4
4
  var chunkJLRLCBJ4_cjs = require('./chunk-JLRLCBJ4.cjs');
5
5
  var chunkJ7J7J2GN_cjs = require('./chunk-J7J7J2GN.cjs');
6
6
  require('./chunk-6LHQPOMI.cjs');
@@ -11,7 +11,7 @@ var DEFAULT_FILENAME = "THEO.md";
11
11
  async function readProjectInstructions(cwd, options) {
12
12
  const filename = options?.filename ?? DEFAULT_FILENAME;
13
13
  const scope = options?.scope ?? "nearest";
14
- const paths = chunkLKFET5A3_cjs.walkUpForFile(cwd, filename, options?.stopDir);
14
+ const paths = chunkLOHMT36V_cjs.walkUpForFile(cwd, filename, options?.stopDir);
15
15
  const files = [];
16
16
  for (const path of paths) {
17
17
  try {
@@ -30,7 +30,7 @@ function reduceContent(files, scope) {
30
30
  }
31
31
  async function writeProjectInstructions(cwd, content, options) {
32
32
  const filename = options?.filename ?? DEFAULT_FILENAME;
33
- if (!chunkLKFET5A3_cjs.isSafePattern(filename)) {
33
+ if (!chunkLOHMT36V_cjs.isSafePattern(filename)) {
34
34
  throw new chunkJ7J7J2GN_cjs.ConfigurationError(
35
35
  `writeProjectInstructions: unsafe filename ${JSON.stringify(filename)} (no path traversal, separators, or absolute paths)`,
36
36
  { code: "unsafe_filename" }
package/dist/project.js CHANGED
@@ -1,4 +1,4 @@
1
- import { walkUpForFile, isSafePattern } from './chunk-WFC26L6Y.js';
1
+ import { walkUpForFile, isSafePattern } from './chunk-2XRAWOZZ.js';
2
2
  import { replaceFileAtomic } from './chunk-3JHIFQ4I.js';
3
3
  import { ConfigurationError } from './chunk-ALUN2B4W.js';
4
4
  import './chunk-CZJ6Q7CW.js';
@@ -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} (name + description only), this carries the full
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} (name + description only), this carries the full
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-YWFE7KYE.cjs"}
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-LSKM2UIK.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"subagents-loader-Y6JFYXAY.js"}