@theokit/sdk 5.5.0 → 5.6.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 +601 -0
- package/dist/{agent-YWSIHHFM.cjs → agent-47NS6ZVL.cjs} +13 -13
- package/dist/{agent-YWSIHHFM.cjs.map → agent-47NS6ZVL.cjs.map} +1 -1
- package/dist/{agent-DyB_lzrx.d.cts → agent-82d_DrCL.d.cts} +11 -2
- package/dist/{agent-CjMVbhhY.d.ts → agent-G6g-uwcB.d.ts} +11 -2
- package/dist/{agent-G3T7Q3SQ.js → agent-JJZM2VIK.js} +12 -12
- package/dist/{agent-G3T7Q3SQ.js.map → agent-JJZM2VIK.js.map} +1 -1
- package/dist/{chunk-ODBID5TG.js → chunk-2UXQASTX.js} +225 -30
- package/dist/chunk-2UXQASTX.js.map +1 -0
- package/dist/{chunk-VPK6PHIE.cjs → chunk-52FDUJSV.cjs} +8 -8
- package/dist/{chunk-VPK6PHIE.cjs.map → chunk-52FDUJSV.cjs.map} +1 -1
- package/dist/{chunk-2XRAWOZZ.js → chunk-5NELQ6LB.js} +65 -3
- package/dist/chunk-5NELQ6LB.js.map +1 -0
- package/dist/{chunk-VY6NKMOA.cjs → chunk-7IZKTQ5G.cjs} +34 -6
- package/dist/chunk-7IZKTQ5G.cjs.map +1 -0
- package/dist/{chunk-7SZAV6QG.js → chunk-7MMTZBTT.js} +3 -3
- package/dist/{chunk-7SZAV6QG.js.map → chunk-7MMTZBTT.js.map} +1 -1
- package/dist/{chunk-SADXXGWU.js → chunk-BZ3YMAMP.js} +3 -3
- package/dist/{chunk-NQTNSHSB.cjs.map → chunk-BZ3YMAMP.js.map} +1 -1
- package/dist/{chunk-LX7SEXOQ.js → chunk-CA5VUAP3.js} +25 -7
- package/dist/chunk-CA5VUAP3.js.map +1 -0
- package/dist/{chunk-IU5N5224.cjs → chunk-EIOMN5VA.cjs} +8 -8
- package/dist/chunk-EIOMN5VA.cjs.map +1 -0
- package/dist/{chunk-M3ZGRGOG.js → chunk-FPIY5CLV.js} +3 -3
- package/dist/{chunk-M3ZGRGOG.js.map → chunk-FPIY5CLV.js.map} +1 -1
- package/dist/{chunk-UKJJRU7C.cjs → chunk-GCHZMH42.cjs} +283 -86
- package/dist/chunk-GCHZMH42.cjs.map +1 -0
- package/dist/{chunk-NQTNSHSB.cjs → chunk-GFFBXSQT.cjs} +5 -5
- package/dist/chunk-GFFBXSQT.cjs.map +1 -0
- package/dist/{chunk-2ZLQZHZC.cjs → chunk-HG4UN4MN.cjs} +4 -4
- package/dist/{chunk-2ZLQZHZC.cjs.map → chunk-HG4UN4MN.cjs.map} +1 -1
- package/dist/{chunk-N6OOOYFZ.js → chunk-HUDNLFY4.js} +4 -4
- package/dist/chunk-HUDNLFY4.js.map +1 -0
- package/dist/{chunk-LOHMT36V.cjs → chunk-LD6HASA5.cjs} +65 -2
- package/dist/chunk-LD6HASA5.cjs.map +1 -0
- package/dist/{chunk-QATRS7JD.cjs → chunk-MYJGWS2J.cjs} +26 -8
- package/dist/chunk-MYJGWS2J.cjs.map +1 -0
- package/dist/{chunk-S6B5XYC3.js → chunk-N2KAIZ5D.js} +33 -6
- package/dist/chunk-N2KAIZ5D.js.map +1 -0
- package/dist/{chunk-HW7SEELD.cjs → chunk-QRVS2PRE.cjs} +31 -8
- package/dist/chunk-QRVS2PRE.cjs.map +1 -0
- package/dist/{chunk-AYA65JA5.cjs → chunk-RWPLWMCZ.cjs} +25 -9
- package/dist/chunk-RWPLWMCZ.cjs.map +1 -0
- package/dist/{chunk-WS5ULCL4.js → chunk-STGSMJMJ.js} +3 -3
- package/dist/{chunk-WS5ULCL4.js.map → chunk-STGSMJMJ.js.map} +1 -1
- package/dist/{chunk-O7L7M42F.js → chunk-T3ZDEYTJ.js} +21 -5
- package/dist/chunk-T3ZDEYTJ.js.map +1 -0
- package/dist/{chunk-43YXGD3P.cjs → chunk-TY56BKSK.cjs} +8 -4
- package/dist/chunk-TY56BKSK.cjs.map +1 -0
- package/dist/chunk-UOLBAPDM.js +66 -0
- package/dist/chunk-UOLBAPDM.js.map +1 -0
- package/dist/{chunk-Z2JFX372.cjs → chunk-VUHXC74Q.cjs} +15 -15
- package/dist/{chunk-Z2JFX372.cjs.map → chunk-VUHXC74Q.cjs.map} +1 -1
- package/dist/{chunk-NSLHPAC7.js → chunk-X7EUUHXU.js} +6 -5
- package/dist/chunk-X7EUUHXU.js.map +1 -0
- package/dist/context/index.cjs +7 -7
- package/dist/context/index.js +3 -3
- package/dist/{context-JTGSBJT6.cjs → context-HR4KMXMA.cjs} +7 -7
- package/dist/{context-JTGSBJT6.cjs.map → context-HR4KMXMA.cjs.map} +1 -1
- package/dist/context-J5BJ3LBS.js +6 -0
- package/dist/{context-3HPU754C.js.map → context-J5BJ3LBS.js.map} +1 -1
- package/dist/{cron-Bgivg88c.d.cts → cron-DWv69ZSD.d.cts} +1 -1
- package/dist/{cron-CNUa7PDo.d.ts → cron-GynWtAax.d.ts} +1 -1
- package/dist/cron.cjs +12 -12
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +11 -11
- package/dist/eval.cjs +11 -11
- package/dist/eval.js +10 -10
- package/dist/{index-manager-W7FDMGEG.js → index-manager-27WLNQEE.js} +5 -5
- package/dist/{index-manager-W7FDMGEG.js.map → index-manager-27WLNQEE.js.map} +1 -1
- package/dist/{index-manager-3UNPYH34.cjs → index-manager-BBHDKMQS.cjs} +6 -6
- package/dist/{index-manager-3UNPYH34.cjs.map → index-manager-BBHDKMQS.cjs.map} +1 -1
- package/dist/index.cjs +274 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +168 -5
- package/dist/index.d.ts +168 -5
- package/dist/index.js +246 -23
- package/dist/index.js.map +1 -1
- package/dist/internal/memory/storage/index.cjs +32 -32
- package/dist/internal/memory/storage/index.js +3 -3
- package/dist/internal/memory/storage/memory-root.d.cts +27 -0
- package/dist/internal/memory/storage/memory-root.d.ts +27 -0
- package/dist/internal/persistence/index.cjs +4 -4
- package/dist/internal/persistence/index.js +1 -1
- package/dist/internal/runtime/compat/foreign-config-sources.d.ts +17 -4
- package/dist/internal/runtime/compat/managed-settings.d.ts +80 -0
- package/dist/internal/runtime/context/context-discovery-runner.d.ts +14 -0
- package/dist/internal/runtime/context/context-discovery.d.ts +37 -0
- package/dist/internal/runtime/context/context-manager.d.ts +21 -1
- package/dist/internal/runtime/context/yaml-frontmatter.d.ts +6 -3
- package/dist/internal/runtime/hooks/hooks-executor.d.ts +13 -1
- package/dist/internal/runtime/hooks/hooks-source.d.ts +36 -1
- package/dist/internal/runtime/skills/discover-skills.d.ts +4 -0
- package/dist/project.cjs +3 -3
- package/dist/project.js +1 -1
- package/dist/skills.cjs +5 -5
- package/dist/skills.js +2 -2
- package/dist/subagents-loader-CJFYQQU2.js +7 -0
- package/dist/{subagents-loader-AIVDQ2D5.js.map → subagents-loader-CJFYQQU2.js.map} +1 -1
- package/dist/subagents-loader-MOO7DC4E.cjs +16 -0
- package/dist/{subagents-loader-DN4LETGL.cjs.map → subagents-loader-MOO7DC4E.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +4 -4
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/subagents-loader.js +3 -3
- package/dist/types/agent.d.ts +6 -1
- package/docs/error-codes.md +20 -18
- package/docs/harness-capability-map.md +9 -1
- package/package.json +1 -1
- package/dist/chunk-2XRAWOZZ.js.map +0 -1
- package/dist/chunk-43YXGD3P.cjs.map +0 -1
- package/dist/chunk-AYA65JA5.cjs.map +0 -1
- package/dist/chunk-HW7SEELD.cjs.map +0 -1
- package/dist/chunk-IU5N5224.cjs.map +0 -1
- package/dist/chunk-JNAA4G4H.js +0 -43
- package/dist/chunk-JNAA4G4H.js.map +0 -1
- package/dist/chunk-LOHMT36V.cjs.map +0 -1
- package/dist/chunk-LX7SEXOQ.js.map +0 -1
- package/dist/chunk-N6OOOYFZ.js.map +0 -1
- package/dist/chunk-NSLHPAC7.js.map +0 -1
- package/dist/chunk-O7L7M42F.js.map +0 -1
- package/dist/chunk-ODBID5TG.js.map +0 -1
- package/dist/chunk-QATRS7JD.cjs.map +0 -1
- package/dist/chunk-S6B5XYC3.js.map +0 -1
- package/dist/chunk-SADXXGWU.js.map +0 -1
- package/dist/chunk-UKJJRU7C.cjs.map +0 -1
- package/dist/chunk-VY6NKMOA.cjs.map +0 -1
- package/dist/context-3HPU754C.js +0 -6
- package/dist/subagents-loader-AIVDQ2D5.js +0 -7
- package/dist/subagents-loader-DN4LETGL.cjs +0 -16
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGCHZMH42_cjs = require('./chunk-GCHZMH42.cjs');
|
|
4
4
|
require('./chunk-KVSAY6NZ.cjs');
|
|
5
5
|
require('./chunk-DZG77WU7.cjs');
|
|
6
6
|
require('./chunk-BUUUWQMB.cjs');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-VUHXC74Q.cjs');
|
|
8
|
+
require('./chunk-7IZKTQ5G.cjs');
|
|
9
9
|
require('./chunk-BV2MWEMV.cjs');
|
|
10
10
|
require('./chunk-D6POWE7E.cjs');
|
|
11
11
|
require('./chunk-GHX4P3V2.cjs');
|
|
12
12
|
require('./chunk-TMKTSYDS.cjs');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-GFFBXSQT.cjs');
|
|
14
14
|
require('./chunk-7FDKWDA2.cjs');
|
|
15
15
|
require('./chunk-C4ZQPWXJ.cjs');
|
|
16
16
|
require('./chunk-FUSDYC2B.cjs');
|
|
@@ -19,7 +19,7 @@ require('./chunk-24SYBZPL.cjs');
|
|
|
19
19
|
require('./chunk-QOGNZMHD.cjs');
|
|
20
20
|
require('./chunk-YIFFF23U.cjs');
|
|
21
21
|
require('./chunk-2ZPEDVLM.cjs');
|
|
22
|
-
require('./chunk-
|
|
22
|
+
require('./chunk-EIOMN5VA.cjs');
|
|
23
23
|
require('./chunk-KRD3GQAA.cjs');
|
|
24
24
|
require('./chunk-RQMCOFAI.cjs');
|
|
25
25
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
@@ -28,8 +28,8 @@ require('./chunk-YSTXFWQE.cjs');
|
|
|
28
28
|
require('./chunk-FRITRLZQ.cjs');
|
|
29
29
|
require('./chunk-NQTD6QOW.cjs');
|
|
30
30
|
require('./chunk-NINIJCHU.cjs');
|
|
31
|
-
require('./chunk-
|
|
32
|
-
require('./chunk-
|
|
31
|
+
require('./chunk-MYJGWS2J.cjs');
|
|
32
|
+
require('./chunk-LD6HASA5.cjs');
|
|
33
33
|
require('./chunk-IJ7M6GOG.cjs');
|
|
34
34
|
require('./chunk-7A6535RA.cjs');
|
|
35
35
|
require('./chunk-SA6K24NB.cjs');
|
|
@@ -43,9 +43,9 @@ 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-
|
|
47
|
-
require('./chunk-
|
|
48
|
-
require('./chunk-
|
|
46
|
+
require('./chunk-RWPLWMCZ.cjs');
|
|
47
|
+
require('./chunk-TY56BKSK.cjs');
|
|
48
|
+
require('./chunk-QRVS2PRE.cjs');
|
|
49
49
|
require('./chunk-ATT276RD.cjs');
|
|
50
50
|
require('./chunk-3EE6LVWT.cjs');
|
|
51
51
|
require('./chunk-ANMJJD6D.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
|
|
64
|
+
get: function () { return chunkGCHZMH42_cjs.Agent; }
|
|
65
65
|
});
|
|
66
|
-
//# sourceMappingURL=agent-
|
|
67
|
-
//# sourceMappingURL=agent-
|
|
66
|
+
//# sourceMappingURL=agent-47NS6ZVL.cjs.map
|
|
67
|
+
//# sourceMappingURL=agent-47NS6ZVL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-47NS6ZVL.cjs"}
|
|
@@ -224,6 +224,10 @@ interface Skill$1 {
|
|
|
224
224
|
source: string;
|
|
225
225
|
category?: string;
|
|
226
226
|
dependencies?: string[];
|
|
227
|
+
/** `disable-model-invocation: true` — the model is never told this skill exists. */
|
|
228
|
+
disableModelInvocation?: boolean;
|
|
229
|
+
/** `user-invocable: false` — carried for a host that has a picker; this SDK has no such surface. */
|
|
230
|
+
userInvocable?: boolean;
|
|
227
231
|
}
|
|
228
232
|
|
|
229
233
|
/**
|
|
@@ -1051,9 +1055,14 @@ type CompatSource = "claude-code" | "theokit" | CompatSourceAdapter;
|
|
|
1051
1055
|
* Reusing the skills you already wrote for another product is a reasonable thing to want, and it is
|
|
1052
1056
|
* not a reason to hand that product's directory the right to run commands.
|
|
1053
1057
|
*
|
|
1058
|
+
* `context` is the foreign root's INSTRUCTIONS — `.claude/rules/*.md`. Same risk class as `skills`:
|
|
1059
|
+
* text a cloned repository wrote, entering the system prompt as if the consumer had written it. It
|
|
1060
|
+
* was missing until usetheokit/theokit-sdk#652, so the four surfaces above failed closed while this
|
|
1061
|
+
* one was admitted by a path that consulted no grant at all.
|
|
1062
|
+
*
|
|
1054
1063
|
* @public
|
|
1055
1064
|
*/
|
|
1056
|
-
type CompatSurface = "hooks" | "plugins" | "skills" | "subagents";
|
|
1065
|
+
type CompatSurface = "context" | "hooks" | "plugins" | "skills" | "subagents";
|
|
1057
1066
|
/**
|
|
1058
1067
|
* A foreign source admitted to named surfaces only.
|
|
1059
1068
|
*
|
|
@@ -1980,4 +1989,4 @@ interface ListResult<T> {
|
|
|
1980
1989
|
nextCursor?: string;
|
|
1981
1990
|
}
|
|
1982
1991
|
|
|
1983
|
-
export { type
|
|
1992
|
+
export { type SessionStore as $, type AgentOptions as A, type BudgetTracker as B, type CloudOptions as C, type CreateSkillSpec as D, type MemoryProviderAgentRef as E, type MemoryProviderFactory as F, type GetAgentOptions as G, type HookName as H, type InlineSkill as I, type MemoryProviderHandle as J, type MemoryProviderInitOptions as K, type LocalOptions as L, type MemorySettings as M, type PluginContext as N, type PluginHookDisposer as O, type Plugin as P, type PostAssistantReplyContext as Q, type PostToolCallContext as R, type SystemPromptResolver as S, type PreToolCallContext as T, type PreUserSendContext as U, type PreUserSendResult as V, type ProviderTransform as W, type ProviderTransformContext as X, type RecordSessionSummaryArgs as Y, type SessionLifecycleContext as Z, type SessionRecord as _, type AgentDefinition as a, type SettingSource as a0, Skill as a1, type SkillsResolver as a2, type SkillsResolverContext as a3, type SystemPromptContext as a4, type SystemPromptMemoryFact as a5, type TelemetrySettings as a6, type ToolCallSummary as a7, type ToolResultTransformContext as a8, type TransformContext as a9, type SkillsSettings as b, type ListAgentsOptions as c, type ListResult as d, type SDKAgentInfo as e, type ListRunsOptions as f, type GetRunOptions as g, type AgentOperationOptions as h, type AgentDescription as i, type ProviderProfile as j, type Skill$1 as k, type MemoryProvider as l, type PreToolCallDecision as m, type ActiveMemoryPassArgs as n, type ActiveMemoryPassResult as o, type AgentSubagentDescription as p, type AgentToolDescription as q, type BudgetCheck as r, type BudgetTotal as s, type BudgetUsageEvent as t, type BuiltinToolName as u, type CloudEnv as v, type CloudRepo as w, type CompatSource as x, type CompatSourceAdapter as y, type CompatSurface as z };
|
|
@@ -224,6 +224,10 @@ interface Skill$1 {
|
|
|
224
224
|
source: string;
|
|
225
225
|
category?: string;
|
|
226
226
|
dependencies?: string[];
|
|
227
|
+
/** `disable-model-invocation: true` — the model is never told this skill exists. */
|
|
228
|
+
disableModelInvocation?: boolean;
|
|
229
|
+
/** `user-invocable: false` — carried for a host that has a picker; this SDK has no such surface. */
|
|
230
|
+
userInvocable?: boolean;
|
|
227
231
|
}
|
|
228
232
|
|
|
229
233
|
/**
|
|
@@ -1051,9 +1055,14 @@ type CompatSource = "claude-code" | "theokit" | CompatSourceAdapter;
|
|
|
1051
1055
|
* Reusing the skills you already wrote for another product is a reasonable thing to want, and it is
|
|
1052
1056
|
* not a reason to hand that product's directory the right to run commands.
|
|
1053
1057
|
*
|
|
1058
|
+
* `context` is the foreign root's INSTRUCTIONS — `.claude/rules/*.md`. Same risk class as `skills`:
|
|
1059
|
+
* text a cloned repository wrote, entering the system prompt as if the consumer had written it. It
|
|
1060
|
+
* was missing until usetheokit/theokit-sdk#652, so the four surfaces above failed closed while this
|
|
1061
|
+
* one was admitted by a path that consulted no grant at all.
|
|
1062
|
+
*
|
|
1054
1063
|
* @public
|
|
1055
1064
|
*/
|
|
1056
|
-
type CompatSurface = "hooks" | "plugins" | "skills" | "subagents";
|
|
1065
|
+
type CompatSurface = "context" | "hooks" | "plugins" | "skills" | "subagents";
|
|
1057
1066
|
/**
|
|
1058
1067
|
* A foreign source admitted to named surfaces only.
|
|
1059
1068
|
*
|
|
@@ -1980,4 +1989,4 @@ interface ListResult<T> {
|
|
|
1980
1989
|
nextCursor?: string;
|
|
1981
1990
|
}
|
|
1982
1991
|
|
|
1983
|
-
export { type
|
|
1992
|
+
export { type SessionStore as $, type AgentOptions as A, type BudgetTracker as B, type CloudOptions as C, type CreateSkillSpec as D, type MemoryProviderAgentRef as E, type MemoryProviderFactory as F, type GetAgentOptions as G, type HookName as H, type InlineSkill as I, type MemoryProviderHandle as J, type MemoryProviderInitOptions as K, type LocalOptions as L, type MemorySettings as M, type PluginContext as N, type PluginHookDisposer as O, type Plugin as P, type PostAssistantReplyContext as Q, type PostToolCallContext as R, type SystemPromptResolver as S, type PreToolCallContext as T, type PreUserSendContext as U, type PreUserSendResult as V, type ProviderTransform as W, type ProviderTransformContext as X, type RecordSessionSummaryArgs as Y, type SessionLifecycleContext as Z, type SessionRecord as _, type AgentDefinition as a, type SettingSource as a0, Skill as a1, type SkillsResolver as a2, type SkillsResolverContext as a3, type SystemPromptContext as a4, type SystemPromptMemoryFact as a5, type TelemetrySettings as a6, type ToolCallSummary as a7, type ToolResultTransformContext as a8, type TransformContext as a9, type SkillsSettings as b, type ListAgentsOptions as c, type ListResult as d, type SDKAgentInfo as e, type ListRunsOptions as f, type GetRunOptions as g, type AgentOperationOptions as h, type AgentDescription as i, type ProviderProfile as j, type Skill$1 as k, type MemoryProvider as l, type PreToolCallDecision as m, type ActiveMemoryPassArgs as n, type ActiveMemoryPassResult as o, type AgentSubagentDescription as p, type AgentToolDescription as q, type BudgetCheck as r, type BudgetTotal as s, type BudgetUsageEvent as t, type BuiltinToolName as u, type CloudEnv as v, type CloudRepo as w, type CompatSource as x, type CompatSourceAdapter as y, type CompatSurface as z };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { Agent } from './chunk-
|
|
1
|
+
export { Agent } from './chunk-2UXQASTX.js';
|
|
2
2
|
import './chunk-K2VMFZQ5.js';
|
|
3
3
|
import './chunk-2QKV4CGK.js';
|
|
4
4
|
import './chunk-K2BQQ445.js';
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
5
|
+
import './chunk-7MMTZBTT.js';
|
|
6
|
+
import './chunk-N2KAIZ5D.js';
|
|
7
7
|
import './chunk-2SFBB54R.js';
|
|
8
8
|
import './chunk-55GB6JYQ.js';
|
|
9
9
|
import './chunk-H73MEMQB.js';
|
|
10
10
|
import './chunk-OR6XIWLB.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-BZ3YMAMP.js';
|
|
12
12
|
import './chunk-AAEZSPTC.js';
|
|
13
13
|
import './chunk-KZSKIUXZ.js';
|
|
14
14
|
import './chunk-UBR5PWD7.js';
|
|
@@ -17,7 +17,7 @@ import './chunk-XB4GI5RZ.js';
|
|
|
17
17
|
import './chunk-24MGQDK3.js';
|
|
18
18
|
import './chunk-2WXHA33T.js';
|
|
19
19
|
import './chunk-HKCKOAIO.js';
|
|
20
|
-
import './chunk-
|
|
20
|
+
import './chunk-HUDNLFY4.js';
|
|
21
21
|
import './chunk-KVNWIAO4.js';
|
|
22
22
|
import './chunk-SVQIW5RJ.js';
|
|
23
23
|
import './chunk-FD2UT76F.js';
|
|
@@ -26,8 +26,8 @@ import './chunk-FJWQP6EE.js';
|
|
|
26
26
|
import './chunk-NAF4L3T6.js';
|
|
27
27
|
import './chunk-CFE6QF2Q.js';
|
|
28
28
|
import './chunk-6X6ID4MO.js';
|
|
29
|
-
import './chunk-
|
|
30
|
-
import './chunk-
|
|
29
|
+
import './chunk-CA5VUAP3.js';
|
|
30
|
+
import './chunk-5NELQ6LB.js';
|
|
31
31
|
import './chunk-SAGRF4IB.js';
|
|
32
32
|
import './chunk-EH6XD3FY.js';
|
|
33
33
|
import './chunk-UKMBRMGT.js';
|
|
@@ -41,9 +41,9 @@ 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-
|
|
45
|
-
import './chunk-
|
|
46
|
-
import './chunk-
|
|
44
|
+
import './chunk-T3ZDEYTJ.js';
|
|
45
|
+
import './chunk-X7EUUHXU.js';
|
|
46
|
+
import './chunk-UOLBAPDM.js';
|
|
47
47
|
import './chunk-6M2OIS4Y.js';
|
|
48
48
|
import './chunk-R7WIIPUR.js';
|
|
49
49
|
import './chunk-XYFGKVZ7.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-
|
|
58
|
-
//# sourceMappingURL=agent-
|
|
57
|
+
//# sourceMappingURL=agent-JJZM2VIK.js.map
|
|
58
|
+
//# sourceMappingURL=agent-JJZM2VIK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-JJZM2VIK.js"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { submit, emitRunEvent } from './chunk-K2VMFZQ5.js';
|
|
2
2
|
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-2QKV4CGK.js';
|
|
3
|
-
import { IndexManager } from './chunk-
|
|
4
|
-
import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-
|
|
3
|
+
import { IndexManager } from './chunk-7MMTZBTT.js';
|
|
4
|
+
import { warnFailureOnce, loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-N2KAIZ5D.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';
|
|
8
|
-
import { writeSessionSummary, resolveMemoryRoot, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-
|
|
8
|
+
import { writeSessionSummary, resolveMemoryRoot, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-BZ3YMAMP.js';
|
|
9
9
|
import { FsSessionStore } from './chunk-AAEZSPTC.js';
|
|
10
10
|
import { discoverProviderPlugins, validateApiKeyShape, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, CircuitBreaker, resolveRunProvider, mergeExplicitApiKey, resolveProviderChain, abortError, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-KZSKIUXZ.js';
|
|
11
11
|
import { resolveChildEnv } from './chunk-HKCKOAIO.js';
|
|
12
|
-
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-
|
|
12
|
+
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-HUDNLFY4.js';
|
|
13
13
|
import { readVersionedJson, writeVersionedJson } from './chunk-SVQIW5RJ.js';
|
|
14
14
|
import { toJsonSchema } from './chunk-7I5Z3UBJ.js';
|
|
15
15
|
import { sanitizeToolInput } from './chunk-FJWQP6EE.js';
|
|
16
16
|
import { withInheritedSubAgentCredentials, subAgentToolsFromDefinitions } from './chunk-CFE6QF2Q.js';
|
|
17
17
|
import { setAgentFacade } from './chunk-6X6ID4MO.js';
|
|
18
|
-
import { escapeBlockBody, buildSkillsBlock, discoverSkills, stripSkillFrontmatter } from './chunk-
|
|
18
|
+
import { escapeBlockBody, buildSkillsBlock, discoverSkills, stripSkillFrontmatter } from './chunk-CA5VUAP3.js';
|
|
19
19
|
import { withToolWhitelist, checkToolWhitelist } from './chunk-SAGRF4IB.js';
|
|
20
20
|
import { validateArtifactPath, PathTraversalError, safePathJoin } from './chunk-EH6XD3FY.js';
|
|
21
21
|
import { insideRoot, atOrInsideRoot } from './chunk-UKMBRMGT.js';
|
|
@@ -24,9 +24,9 @@ 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-
|
|
28
|
-
import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, projectConfigRoots, pluginBundleRoots } from './chunk-
|
|
29
|
-
import { readWorkspaceDir, parseSimpleYaml } from './chunk-
|
|
27
|
+
import { loadSubagents, pluginBundleDirs } from './chunk-T3ZDEYTJ.js';
|
|
28
|
+
import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, adaptersForSurface, projectConfigRoots, pluginBundleRoots } from './chunk-X7EUUHXU.js';
|
|
29
|
+
import { readWorkspaceDir, parseSimpleYaml } from './chunk-UOLBAPDM.js';
|
|
30
30
|
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-6M2OIS4Y.js';
|
|
31
31
|
import { parseModelId } from './chunk-R7WIIPUR.js';
|
|
32
32
|
import { getProviderProfile } from './chunk-XYFGKVZ7.js';
|
|
@@ -38,6 +38,7 @@ import { stat, mkdir, readFile, readdir, access, unlink } from 'fs/promises';
|
|
|
38
38
|
import { randomUUID, createHash } from 'crypto';
|
|
39
39
|
import { join, dirname, resolve, relative, isAbsolute } from 'path';
|
|
40
40
|
import { existsSync, readFileSync } from 'fs';
|
|
41
|
+
import { platform } from 'process';
|
|
41
42
|
import { spawn } from 'child_process';
|
|
42
43
|
import { z } from 'zod';
|
|
43
44
|
import { createRequire } from 'module';
|
|
@@ -2550,6 +2551,116 @@ function readCompatConfigFile(cwd) {
|
|
|
2550
2551
|
function resolveCompatSources(options, cwd) {
|
|
2551
2552
|
return options.local?.compatSources ?? readCompatConfigFile(cwd);
|
|
2552
2553
|
}
|
|
2554
|
+
var KNOWN_KEYS = /* @__PURE__ */ new Set([
|
|
2555
|
+
"disableAllHooks",
|
|
2556
|
+
"disableSkillShellExecution",
|
|
2557
|
+
"permissions",
|
|
2558
|
+
"permissionMode"
|
|
2559
|
+
]);
|
|
2560
|
+
function managedSettingsPathFor(root) {
|
|
2561
|
+
if (root !== void 0) return join(root, "claude-code", "managed-settings.json");
|
|
2562
|
+
if (platform === "darwin") {
|
|
2563
|
+
return "/Library/Application Support/ClaudeCode/managed-settings.json";
|
|
2564
|
+
}
|
|
2565
|
+
if (platform === "win32") {
|
|
2566
|
+
const programData = process.env.PROGRAMDATA ?? "C:\\ProgramData";
|
|
2567
|
+
return join(programData, "ClaudeCode", "managed-settings.json");
|
|
2568
|
+
}
|
|
2569
|
+
return "/etc/claude-code/managed-settings.json";
|
|
2570
|
+
}
|
|
2571
|
+
function readManagedSettings(root) {
|
|
2572
|
+
const path = managedSettingsPathFor(root);
|
|
2573
|
+
const parsed = readPolicyDocument(path);
|
|
2574
|
+
if (parsed === void 0) return {};
|
|
2575
|
+
const out = {};
|
|
2576
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
2577
|
+
applyPolicyKey(out, key, value, path);
|
|
2578
|
+
}
|
|
2579
|
+
return out;
|
|
2580
|
+
}
|
|
2581
|
+
function readPolicyDocument(path) {
|
|
2582
|
+
if (!existsSync(path)) return void 0;
|
|
2583
|
+
let raw;
|
|
2584
|
+
try {
|
|
2585
|
+
raw = readFileSync(path, "utf8");
|
|
2586
|
+
} catch (cause) {
|
|
2587
|
+
diagFailure(
|
|
2588
|
+
`[theokit-sdk] ${path} exists and could not be read (${cause.message}) \u2014 NO operator policy is being applied. Fix the permissions or remove the file.
|
|
2589
|
+
`
|
|
2590
|
+
);
|
|
2591
|
+
return void 0;
|
|
2592
|
+
}
|
|
2593
|
+
let parsed;
|
|
2594
|
+
try {
|
|
2595
|
+
parsed = JSON.parse(raw);
|
|
2596
|
+
} catch (cause) {
|
|
2597
|
+
diagFailure(
|
|
2598
|
+
`[theokit-sdk] ${path} is not valid JSON (${cause.message}) \u2014 NO operator policy is being applied.
|
|
2599
|
+
`
|
|
2600
|
+
);
|
|
2601
|
+
return void 0;
|
|
2602
|
+
}
|
|
2603
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
2604
|
+
diagFailure(
|
|
2605
|
+
`[theokit-sdk] ${path} is not a JSON object \u2014 NO operator policy is being applied.
|
|
2606
|
+
`
|
|
2607
|
+
);
|
|
2608
|
+
return void 0;
|
|
2609
|
+
}
|
|
2610
|
+
return parsed;
|
|
2611
|
+
}
|
|
2612
|
+
var PERMISSION_MODES = ["default", "plan", "acceptEdits", "bypass"];
|
|
2613
|
+
function applyPolicyKey(out, key, value, path) {
|
|
2614
|
+
if (!KNOWN_KEYS.has(key)) {
|
|
2615
|
+
decline(path, key, "this runtime does not enforce it");
|
|
2616
|
+
return;
|
|
2617
|
+
}
|
|
2618
|
+
if (key === "permissionMode") {
|
|
2619
|
+
const mode = readMode(value, path);
|
|
2620
|
+
if (mode !== void 0) out.permissionMode = mode;
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
if (key === "permissions") {
|
|
2624
|
+
const rules = readRuleLists(value, path);
|
|
2625
|
+
if (rules !== void 0) out.permissions = rules;
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
const flag = readBoolean(value, key, path);
|
|
2629
|
+
if (flag === void 0) return;
|
|
2630
|
+
if (key === "disableAllHooks") out.disableAllHooks = flag;
|
|
2631
|
+
if (key === "disableSkillShellExecution") out.disableSkillShellExecution = flag;
|
|
2632
|
+
}
|
|
2633
|
+
function decline(path, key, reason) {
|
|
2634
|
+
diagFailure(`[theokit-sdk] ${path} declares "${key}" \u2014 ${reason}. It is NOT being applied.
|
|
2635
|
+
`);
|
|
2636
|
+
}
|
|
2637
|
+
function readMode(value, path) {
|
|
2638
|
+
if (typeof value === "string" && PERMISSION_MODES.includes(value)) {
|
|
2639
|
+
return value;
|
|
2640
|
+
}
|
|
2641
|
+
decline(
|
|
2642
|
+
path,
|
|
2643
|
+
"permissionMode",
|
|
2644
|
+
`${JSON.stringify(value)} is not one of ${PERMISSION_MODES.join(", ")}`
|
|
2645
|
+
);
|
|
2646
|
+
return void 0;
|
|
2647
|
+
}
|
|
2648
|
+
function readRuleLists(value, path) {
|
|
2649
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
2650
|
+
return value;
|
|
2651
|
+
}
|
|
2652
|
+
decline(
|
|
2653
|
+
path,
|
|
2654
|
+
"permissions",
|
|
2655
|
+
`it is ${Array.isArray(value) ? "an array" : typeof value}, not an object of rule lists`
|
|
2656
|
+
);
|
|
2657
|
+
return void 0;
|
|
2658
|
+
}
|
|
2659
|
+
function readBoolean(value, key, path) {
|
|
2660
|
+
if (typeof value === "boolean") return value;
|
|
2661
|
+
decline(path, key, `it is ${typeof value}, not a boolean`);
|
|
2662
|
+
return void 0;
|
|
2663
|
+
}
|
|
2553
2664
|
function spawnAndCollect(options) {
|
|
2554
2665
|
return new Promise((resolve) => {
|
|
2555
2666
|
const timeoutMs = options.timeoutMs ?? 3e4;
|
|
@@ -2600,16 +2711,26 @@ function spawnAndCollect(options) {
|
|
|
2600
2711
|
|
|
2601
2712
|
// src/internal/runtime/hooks/hooks-executor.ts
|
|
2602
2713
|
var HooksExecutor = class {
|
|
2603
|
-
constructor(cwd, compatSources = [], gate = void 0) {
|
|
2714
|
+
constructor(cwd, compatSources = [], gate = void 0, policy = {}) {
|
|
2604
2715
|
this.cwd = cwd;
|
|
2605
2716
|
this.compatSources = compatSources;
|
|
2606
2717
|
this.gate = gate;
|
|
2718
|
+
this.policy = policy;
|
|
2607
2719
|
}
|
|
2608
2720
|
cwd;
|
|
2609
2721
|
compatSources;
|
|
2610
2722
|
gate;
|
|
2723
|
+
policy;
|
|
2611
2724
|
config = {};
|
|
2612
2725
|
async initialize(settingSourcesIncludeProject) {
|
|
2726
|
+
if (readManagedSettings(this.policy.managedSettingsRoot).disableAllHooks === true) {
|
|
2727
|
+
warnFailureOnce(
|
|
2728
|
+
"hooks-disabled-by-policy",
|
|
2729
|
+
"[theokit-sdk] hooks: an operator policy (managed-settings.json) declares disableAllHooks \u2014 NO hook will run, including any this project declared."
|
|
2730
|
+
);
|
|
2731
|
+
this.config = {};
|
|
2732
|
+
return;
|
|
2733
|
+
}
|
|
2613
2734
|
if (!settingSourcesIncludeProject) {
|
|
2614
2735
|
this.config = {};
|
|
2615
2736
|
return;
|
|
@@ -2681,7 +2802,7 @@ var HooksExecutor = class {
|
|
|
2681
2802
|
cwd: this.cwd,
|
|
2682
2803
|
...Object.keys(env).length > 0 ? { env } : {},
|
|
2683
2804
|
timeoutMs,
|
|
2684
|
-
stdin: JSON.stringify(payload)
|
|
2805
|
+
stdin: JSON.stringify(stdinPayloadFor(payload, command, this.cwd))
|
|
2685
2806
|
});
|
|
2686
2807
|
const failure = this.decisionFromFailure(result, command, env, timeoutMs);
|
|
2687
2808
|
return failure ?? parseDecisionFromStdout(result.stdout);
|
|
@@ -2695,9 +2816,16 @@ var HooksExecutor = class {
|
|
|
2695
2816
|
* spawned.
|
|
2696
2817
|
*/
|
|
2697
2818
|
decisionFromFailure(result, command, env, timeoutMs) {
|
|
2698
|
-
if (result.timedOut)
|
|
2819
|
+
if (result.timedOut)
|
|
2820
|
+
return {
|
|
2821
|
+
decision: "deny",
|
|
2822
|
+
reason: `Hook timed out after ${timeoutMs}ms`
|
|
2823
|
+
};
|
|
2699
2824
|
if (result.spawnError !== void 0) {
|
|
2700
|
-
return {
|
|
2825
|
+
return {
|
|
2826
|
+
decision: "deny",
|
|
2827
|
+
reason: `Hook spawn failed: ${result.spawnError.message}`
|
|
2828
|
+
};
|
|
2701
2829
|
}
|
|
2702
2830
|
if (result.exitCode === 0) return void 0;
|
|
2703
2831
|
const stderr = result.stderr.trim();
|
|
@@ -2710,6 +2838,16 @@ var HooksExecutor = class {
|
|
|
2710
2838
|
};
|
|
2711
2839
|
}
|
|
2712
2840
|
};
|
|
2841
|
+
function stdinPayloadFor(payload, command, cwd) {
|
|
2842
|
+
return {
|
|
2843
|
+
...payload,
|
|
2844
|
+
cwd,
|
|
2845
|
+
...command.sourceEvent === void 0 ? {} : { hook_event_name: command.sourceEvent },
|
|
2846
|
+
...payload.tool === void 0 ? {} : { tool_name: payload.tool },
|
|
2847
|
+
...payload.input === void 0 ? {} : { tool_input: payload.input },
|
|
2848
|
+
...payload.output === void 0 ? {} : { tool_response: payload.output }
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2713
2851
|
function runtimeEnvFor(sourcePath, cwd) {
|
|
2714
2852
|
if (sourcePath === void 0) return {};
|
|
2715
2853
|
return adapterForConfigPath(sourcePath)?.runtimeEnv(cwd) ?? {};
|
|
@@ -2717,19 +2855,35 @@ function runtimeEnvFor(sourcePath, cwd) {
|
|
|
2717
2855
|
function parseDecisionFromStdout(stdout) {
|
|
2718
2856
|
const trimmed = stdout.trim();
|
|
2719
2857
|
if (trimmed.length === 0) return { decision: "allow" };
|
|
2858
|
+
let parsed;
|
|
2720
2859
|
try {
|
|
2721
|
-
|
|
2722
|
-
if (parsed.decision === "deny" || parsed.decision === "feedback") {
|
|
2723
|
-
const result = { decision: parsed.decision };
|
|
2724
|
-
if (parsed.reason !== void 0) result.reason = parsed.reason;
|
|
2725
|
-
if (parsed.feedback !== void 0) result.feedback = parsed.feedback;
|
|
2726
|
-
return result;
|
|
2727
|
-
}
|
|
2728
|
-
if (parsed.decision === "allow") return { decision: "allow" };
|
|
2860
|
+
parsed = JSON.parse(trimmed);
|
|
2729
2861
|
} catch {
|
|
2730
2862
|
return { decision: "feedback", feedback: trimmed };
|
|
2731
2863
|
}
|
|
2732
|
-
return { decision: "allow" };
|
|
2864
|
+
return nestedDecision(parsed) ?? flatDecision(parsed) ?? { decision: "allow" };
|
|
2865
|
+
}
|
|
2866
|
+
function nestedDecision(parsed) {
|
|
2867
|
+
const nested = parsed.hookSpecificOutput;
|
|
2868
|
+
if (nested?.permissionDecision === "allow") return { decision: "allow" };
|
|
2869
|
+
if (nested?.permissionDecision !== "deny" && nested?.permissionDecision !== "ask") {
|
|
2870
|
+
return void 0;
|
|
2871
|
+
}
|
|
2872
|
+
const result = { decision: "deny" };
|
|
2873
|
+
if (nested.permissionDecisionReason !== void 0) {
|
|
2874
|
+
result.reason = nested.permissionDecisionReason;
|
|
2875
|
+
}
|
|
2876
|
+
return result;
|
|
2877
|
+
}
|
|
2878
|
+
function flatDecision(parsed) {
|
|
2879
|
+
if (parsed.decision === "allow") return { decision: "allow" };
|
|
2880
|
+
if (parsed.decision !== "deny" && parsed.decision !== "block" && parsed.decision !== "feedback") {
|
|
2881
|
+
return void 0;
|
|
2882
|
+
}
|
|
2883
|
+
const result = parsed.decision === "feedback" ? { decision: "feedback" } : { decision: "deny" };
|
|
2884
|
+
if (parsed.reason !== void 0) result.reason = parsed.reason;
|
|
2885
|
+
if (parsed.feedback !== void 0) result.feedback = parsed.feedback;
|
|
2886
|
+
return result;
|
|
2733
2887
|
}
|
|
2734
2888
|
|
|
2735
2889
|
// src/internal/runtime/lifecycle/context-budget-event.ts
|
|
@@ -3043,7 +3197,15 @@ async function buildSystemPromptContext(inputs, userText, memoryFacts, manager =
|
|
|
3043
3197
|
agentId: inputs.agentId,
|
|
3044
3198
|
cwd: inputs.workspaceCwd,
|
|
3045
3199
|
model: inputs.model,
|
|
3046
|
-
|
|
3200
|
+
// This is the ONLY place the model learns which skills exist, which is what makes
|
|
3201
|
+
// `disable-model-invocation` enforceable rather than decorative. The scaffold had been writing
|
|
3202
|
+
// authorization frontmatter that the parser discarded, so the default was disclose-all.
|
|
3203
|
+
//
|
|
3204
|
+
// A disclosure rule, not an execution rule: `skills.get(name)` still resolves a hidden skill,
|
|
3205
|
+
// because a caller naming one has already made the decision this field keeps away from the
|
|
3206
|
+
// model. Widening it to execution would break the case the field is FOR — a side-effecting
|
|
3207
|
+
// skill a human may run and the model may not propose.
|
|
3208
|
+
skills: skills.filter((skill) => skill.disableModelInvocation !== true).map((skill) => ({ name: skill.name, description: skill.description })),
|
|
3047
3209
|
userMessage: userText,
|
|
3048
3210
|
memory: memoryFacts.map((fact) => ({ text: fact.text }))
|
|
3049
3211
|
};
|
|
@@ -4067,14 +4229,24 @@ var ContextSourceFrontmatterSchema = z.object({
|
|
|
4067
4229
|
|
|
4068
4230
|
// src/internal/runtime/context/context-manager.ts
|
|
4069
4231
|
var FileContextManager = class {
|
|
4070
|
-
|
|
4232
|
+
/**
|
|
4233
|
+
* @param compatSources - What the consumer declared in `local.compatSources` (or
|
|
4234
|
+
* `.theokit/config.json`), as `resolveCompatSources` resolved it. `undefined` means the caller
|
|
4235
|
+
* did not thread the declaration through at all and every dialect runs — the pre-#652 behaviour,
|
|
4236
|
+
* kept so an internal caller constructing this directly does not silently lose content. An empty
|
|
4237
|
+
* ARRAY is different and is the fix: it means the consumer declared no foreign dialect, so
|
|
4238
|
+
* `.claude/rules/*.md` does not reach the prompt.
|
|
4239
|
+
*/
|
|
4240
|
+
constructor(cwd, settings, settingSourcesIncludeProject, compatSources) {
|
|
4071
4241
|
this.cwd = cwd;
|
|
4072
4242
|
this.settings = settings;
|
|
4073
4243
|
this.settingSourcesIncludeProject = settingSourcesIncludeProject;
|
|
4244
|
+
this.compatSources = compatSources;
|
|
4074
4245
|
}
|
|
4075
4246
|
cwd;
|
|
4076
4247
|
settings;
|
|
4077
4248
|
settingSourcesIncludeProject;
|
|
4249
|
+
compatSources;
|
|
4078
4250
|
state;
|
|
4079
4251
|
/**
|
|
4080
4252
|
* The in-scope file set used by the most recent `refresh`. Tracked so
|
|
@@ -4083,6 +4255,19 @@ var FileContextManager = class {
|
|
|
4083
4255
|
* snapshot untouched, at zero per-send cost.
|
|
4084
4256
|
*/
|
|
4085
4257
|
lastScope = [];
|
|
4258
|
+
/**
|
|
4259
|
+
* The dialect kinds granted the `context` surface, or `undefined` when nothing was declared to
|
|
4260
|
+
* this instance.
|
|
4261
|
+
*
|
|
4262
|
+
* Routed through `adaptersForSurface` rather than reading `.kind` off the declarations, so the
|
|
4263
|
+
* three fail-closed rules #524 established govern this surface identically to the other four: a
|
|
4264
|
+
* bare string admits everything, an object with no `import` admits nothing, and an unrecognised
|
|
4265
|
+
* surface name narrows rather than widens.
|
|
4266
|
+
*/
|
|
4267
|
+
grantedContextDialects() {
|
|
4268
|
+
if (this.compatSources === void 0) return void 0;
|
|
4269
|
+
return adaptersForSurface(this.compatSources, "context").map((a) => a.kind);
|
|
4270
|
+
}
|
|
4086
4271
|
async initialize() {
|
|
4087
4272
|
if (!this.settingSourcesIncludeProject && this.settings.manager !== "file") {
|
|
4088
4273
|
this.state = { config: { sources: [] }, loadedSources: [] };
|
|
@@ -4110,11 +4295,16 @@ var FileContextManager = class {
|
|
|
4110
4295
|
const legacy = await loadSources(config, this.cwd);
|
|
4111
4296
|
const maxBytesPerFile = this.settings.maxBytesPerFile ?? DEFAULT_MAX_BYTES_PER_FILE;
|
|
4112
4297
|
const maxBytesTotal = this.settings.maxBytesTotal ?? DEFAULT_MAX_BYTES_TOTAL;
|
|
4298
|
+
const granted = this.grantedContextDialects();
|
|
4113
4299
|
const discovered = await runDiscovery({
|
|
4114
4300
|
cwd: this.cwd,
|
|
4115
4301
|
maxBytesPerFile,
|
|
4116
4302
|
skipLegacyTheokitContext: true,
|
|
4117
|
-
touchedFiles
|
|
4303
|
+
touchedFiles,
|
|
4304
|
+
// #652 — the grant this path never consulted. Without it, a consumer who enabled project
|
|
4305
|
+
// scope for its OWN `.theokit/` also received a cloned repository's `.claude/rules/*.md`,
|
|
4306
|
+
// through a door the hooks/skills/subagents/plugins gate does not cover.
|
|
4307
|
+
...granted === void 0 ? {} : { declaredCompatKinds: granted }
|
|
4118
4308
|
});
|
|
4119
4309
|
const legacyAsAggregator = legacy.filter((src) => src.status !== "excluded").map((src) => ({
|
|
4120
4310
|
id: src.name,
|
|
@@ -4509,7 +4699,12 @@ function buildContext(args, out) {
|
|
|
4509
4699
|
out.context = new FileContextManager(
|
|
4510
4700
|
args.workspaceCwd,
|
|
4511
4701
|
args.options.context,
|
|
4512
|
-
args.settingSourcesIncludeProject
|
|
4702
|
+
args.settingSourcesIncludeProject,
|
|
4703
|
+
// #652 — the same declaration `buildSkills` and `buildPlugins` already pass. Omitting it here
|
|
4704
|
+
// is what let a foreign root's instructions into the system prompt while its skills, subagents,
|
|
4705
|
+
// hooks and plugins were correctly withheld: four surfaces failing closed and a fifth nobody
|
|
4706
|
+
// had wired to the gate.
|
|
4707
|
+
resolveCompatSources(args.options, args.workspaceCwd)
|
|
4513
4708
|
);
|
|
4514
4709
|
}
|
|
4515
4710
|
function buildProviders(args, out) {
|
|
@@ -9157,7 +9352,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
|
|
|
9157
9352
|
async function localAgentFork(parent, options) {
|
|
9158
9353
|
const { forkAgentImpl } = await import('./fork-agent-S2EPIML7.js');
|
|
9159
9354
|
const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
|
|
9160
|
-
const { withPersonalityContext } = await import('./context-
|
|
9355
|
+
const { withPersonalityContext } = await import('./context-J5BJ3LBS.js');
|
|
9161
9356
|
const create = getAgentFacade().create;
|
|
9162
9357
|
return withPersonalityContext(
|
|
9163
9358
|
{ slug: parent.personalitySlugSnapshot, isFork: true },
|
|
@@ -10934,7 +11129,7 @@ var Agent = class _Agent {
|
|
|
10934
11129
|
*/
|
|
10935
11130
|
static async describe(agentId) {
|
|
10936
11131
|
const agent = await getRegisteredAgentOrThrow(agentId);
|
|
10937
|
-
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-
|
|
11132
|
+
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-CJFYQQU2.js');
|
|
10938
11133
|
const settingSources = agent.options.local?.settingSources;
|
|
10939
11134
|
const subagents = await loadSubagents2(
|
|
10940
11135
|
agent.cwd ?? process.cwd(),
|
|
@@ -11040,6 +11235,6 @@ async function openLocalStore(reg) {
|
|
|
11040
11235
|
return { cwd, model, store: new FsSessionStore2({ baseDir, cwd }) };
|
|
11041
11236
|
}
|
|
11042
11237
|
|
|
11043
|
-
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, openRouterMemoryEmbeddingProviderAdapter, resolveSessionDir };
|
|
11044
|
-
//# sourceMappingURL=chunk-
|
|
11045
|
-
//# sourceMappingURL=chunk-
|
|
11238
|
+
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, managedSettingsPathFor, openRouterMemoryEmbeddingProviderAdapter, readManagedSettings, resolveSessionDir };
|
|
11239
|
+
//# sourceMappingURL=chunk-2UXQASTX.js.map
|
|
11240
|
+
//# sourceMappingURL=chunk-2UXQASTX.js.map
|