@theokit/agents 13.0.0-next.1 → 13.0.0-next.10
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 +228 -0
- package/dist/{agent-compiler-uhleFZj_.d.ts → agent-compiler-CvYfM-0t.d.ts} +63 -2
- package/dist/{bridge-entry-Dqd1t8oL.d.ts → bridge-entry-B3BRB3e_.d.ts} +60 -5
- package/dist/bridge.d.ts +5 -4
- package/dist/bridge.js +7 -3
- package/dist/{chunk-OAQEWLQJ.js → chunk-43O2CCZR.js} +19 -1
- package/dist/chunk-43O2CCZR.js.map +1 -0
- package/dist/{chunk-HU6ZUKDK.js → chunk-6YJIXBMA.js} +12 -3
- package/dist/chunk-6YJIXBMA.js.map +1 -0
- package/dist/{chunk-GHRHJPJS.js → chunk-FXQF7LS3.js} +178 -130
- package/dist/chunk-FXQF7LS3.js.map +1 -0
- package/dist/config.d.ts +12 -1
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/{define-agent-BL3jMyJi.d.ts → define-agent-Dp6e7chT.d.ts} +12 -152
- package/dist/{delegation-scoring--OiOTcAW.d.ts → delegation-scoring-BZdtCdMN.d.ts} +1 -1
- package/dist/index.d.ts +20 -10
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts +113 -33
- package/dist/session.js +98 -47
- package/dist/session.js.map +1 -1
- package/dist/setting-sources-gate-tadmHT0c.d.ts +181 -0
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +1 -1
- package/dist/tools.d.ts +3 -2
- package/dist/tools.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-GHRHJPJS.js.map +0 -1
- package/dist/chunk-HU6ZUKDK.js.map +0 -1
- package/dist/chunk-OAQEWLQJ.js.map +0 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { TrustPosture } from '@theokit/sdk';
|
|
4
|
+
import { R as ResolvedCompatSource } from './setting-sources-gate-tadmHT0c.js';
|
|
4
5
|
export { resolveEffectiveContextWindow as effectiveContextWindow } from '@theokit/sdk/compaction';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -400,6 +401,16 @@ interface ComposedInstructions {
|
|
|
400
401
|
*/
|
|
401
402
|
declare function composeInstructions(base: string, sources: readonly InstructionSource[], options: ComposeInstructionsOptions): ComposedInstructions;
|
|
402
403
|
|
|
404
|
+
/**
|
|
405
|
+
* The narrowed half of `ResolvedCompatSource`, split out because the union's other half is the
|
|
406
|
+
* string literal `'claude-code'` — and `string | 'claude-code'` collapses to `string`, which would
|
|
407
|
+
* make the object arm unreachable to the type system.
|
|
408
|
+
*
|
|
409
|
+
* Its `kind` is that one literal today, so the loader below does not re-check it. A second foreign
|
|
410
|
+
* dialect would widen it, and would have to revisit `COMPAT_COMMANDS_DIR` in the same breath: the
|
|
411
|
+
* directory this reads is `.claude/`, not "whichever dialect asked".
|
|
412
|
+
*/
|
|
413
|
+
type NarrowedCompatSource = Exclude<ResolvedCompatSource, string>;
|
|
403
414
|
/**
|
|
404
415
|
* M76 — load custom commands from `.theokit/commands/`.
|
|
405
416
|
*
|
|
@@ -477,7 +488,7 @@ interface LoadCustomCommandsInput {
|
|
|
477
488
|
* command is a prompt that runs on the operator's behalf, and this directory is usually written
|
|
478
489
|
* for a different product and arrives with the repository.
|
|
479
490
|
*/
|
|
480
|
-
readonly compatSources?: readonly string[];
|
|
491
|
+
readonly compatSources?: readonly (string | NarrowedCompatSource)[];
|
|
481
492
|
readonly builtinNames?: readonly string[];
|
|
482
493
|
/** Where a shadow, a duplicate, or a malformed file is reported. */
|
|
483
494
|
readonly onWarn?: (message: string) => void;
|
package/dist/config.js
CHANGED
|
@@ -535,10 +535,14 @@ var COMMANDS_DIR = join2(".theokit", "commands");
|
|
|
535
535
|
var COMPAT_COMMANDS_DIR = join2(".claude", "commands");
|
|
536
536
|
var CLAUDE_CODE_SOURCE = "claude-code";
|
|
537
537
|
var IGNORE_WARNING3 = /* @__PURE__ */ __name(() => void 0, "IGNORE_WARNING");
|
|
538
|
+
function declaresCommands(sources) {
|
|
539
|
+
return sources?.some((source) => typeof source === "string" ? source === CLAUDE_CODE_SOURCE : source.import.includes("commands")) === true;
|
|
540
|
+
}
|
|
541
|
+
__name(declaresCommands, "declaresCommands");
|
|
538
542
|
function projectCommandDirs(input) {
|
|
539
543
|
if (input.projectDir === void 0) return [];
|
|
540
544
|
const dirs = [];
|
|
541
|
-
if (input.compatSources
|
|
545
|
+
if (declaresCommands(input.compatSources)) {
|
|
542
546
|
dirs.push(join2(input.projectDir, COMPAT_COMMANDS_DIR));
|
|
543
547
|
}
|
|
544
548
|
dirs.push(join2(input.projectDir, COMMANDS_DIR));
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config/layered-config.ts","../src/config/trust-store.ts","../src/config/instruction-imports.ts","../src/config/instruction-tree.ts","../src/config/frontmatter.ts","../src/config/compose-instructions.ts","../src/config/custom-commands.ts","../src/config/command-template.ts","../src/config/context-pressure.ts"],"mappings":";;;;;;;;AAIA,SAASA,YAAYC,2BAA2B;AAChD,SAASC,yBAAyB;AAkH3B,IAAMC,uBAAN,cAAmCC,kBAAAA;EAvH1C,OAuH0CA;;;EACtBC,OAAO;EAEzB,YAAYC,SAAiB;AAE3B,UAAMA,SAAS;MAAEC,MAAM;MAA6BC,aAAa;IAAM,CAAA;EACzE;AACF;AASO,IAAMC,gBAAgB;;;;;;;;;;EAU3BC,QACEC,OAAkC;AAElCC,mBAAeD,MAAME,MAAM;AAE3B,UAAMC,eAAeH,MAAMI,oBAAoB,CAAA;AAC/C,UAAMC,SAASC,WAAWN,MAAME,QAAQC,YAAAA;AACxC,UAAMI,QAAQP,MAAMQ,OAAOC,MAAMJ,MAAAA;AAEjC,WAAO;MACLE;MACAG,kBA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A+B;AACzE,aAAO;IACT;AACA,QAAIE,QAAQtB,SAAStB,iBAAiB;AACpC6B,WAAKG,KAAK,IAAIU,IAAAA,mBAAuBT,OAAOjC,eAAAA,CAAAA,0BAA0C;AACtF,aAAO4C,QAAQ7B,MAAM,GAAGf,eAAAA;IAC1B;AACA,WAAO4C;EACT,CAAA;AACF;AA3CsBhB;;;AC5GtB,SAASkB,qCAAqC;AAO9C,SAASC,qBAAAA,0BAAyB;AA+B3B,IAAMC,sCAAiE;EAC5EC,MAAM;EACNC,UAAU;AACZ;AAGO,IAAMC,gCAAN,cAA4CC,mBAAAA;EAhDnD,OAgDmDA;;;EAC/BC,OAAO;EAEzB,YAAYC,SAAiB;AAG3B,UAAMA,SAAS;MAAEC,MAAM;MAAyCC,aAAa;IAAM,CAAA;EACrF;AACF;AAmBO,SAASC,gBACdC,YACAC,iBACAC,aAAwCZ,qCAAmC;AAE3E,MAAIY,WAAWX,QAAQW,WAAWV,UAAU;AAC1C,UAAM,IAAIC,8BACR,+BAA+BU,OAAOD,WAAWX,IAAI,CAAA,iCAC/CY,OAAOD,WAAWV,QAAQ,CAAA,0DAA2D;EAE/F;AACA,MAAI,CAACY,OAAOC,SAASJ,eAAAA,KAAoBA,mBAAmB,EAAG,QAAO;AACtE,MAAI,CAACG,OAAOC,SAASL,UAAAA,KAAeA,cAAc,EAAG,QAAO;AAE5D,QAAMM,QAAQN,aAAaC;AAC3B,MAAIK,SAASJ,WAAWV,SAAU,QAAO;AACzC,MAAIc,SAASJ,WAAWX,KAAM,QAAO;AACrC,SAAO;AACT;AAlBgBQ;","names":["foldLayers","verifyLayerOrdering","TheokitAgentError","LayerOutOfOrderError","TheokitAgentError","name","message","code","isRetryable","LayeredConfig","resolve","input","assertOrdering","layers","accumulating","accumulatingKeys","folded","foldLayers","value","schema","parse","provenancePerKey","buildProvenance","precedenceReport","buildReport","verifyLayerOrdering","error","contributorsOf","key","filter","layer","values","map","keys","Set","flatMap","Object","provenance","contributors","winner","at","undefined","includes","join","declared","contributed","length","measured","has","declaredButSilent","diverges","chmodSync","existsSync","readFileSync","realpathSync","statSync","resolve","resolveTrustPosture","TheokitAgentError","atomicWriteJson","withFileLock","TrustStorePermissionsError","TheokitAgentError","name","file","mode","toString","code","isRetryable","FORBIDDEN_WRITE_BITS","canonicalDir","path","realpathSync","resolve","TrustStore","isTrusted","key","read","some","r","trusted","existsSync","assertSafePermissions","parsed","JSON","parse","readFileSync","records","trust","record","ensureSecureDir","withFileLock","existing","filter","atomicWriteJson","version","chmodSync","postureFor","capabilities","find","resolveTrustPosture","statSync","existsSync","readFileSync","realpathSync","dirname","resolve","MAX_IMPORT_DEPTH","IMPORT_REGEX","maskCodeSpans","text","replace","m","repeat","length","insideRoot","target","rootDir","real","realpathSync","realRoot","startsWith","importTarget","name","filePath","visited","warn","undefined","resolve","dirname","existsSync","has","expandInstructionImports","input","expand","onWarn","Set","alreadyLoaded","depth","wrap","ctx","masked","matches","matchAll","String","out","cursor","match","push","slice","index","add","content","readFileSync","expanded","join","readFileSync","readdirSync","statSync","join","relative","resolve","assertNoSymlinkEscape","FENCE","splitFrontmatter","raw","lines","split","trim","frontmatter","body","closing","findIndex","line","index","undefined","slice","join","frontmatterValue","key","prefix","startsWith","value","length","unquoted","exec","DEFAULT_FILE_NAMES","IGNORE_WARNING","undefined","loadInstructionTree","input","warn","onWarn","fileNames","accepts","entry","includes","cwd","resolve","blocks","seenInodes","Set","chars","visit","dir","depth","budget","maxDepth","String","entries","readdirSync","path","stats","walkOrder","order","inode","dev","ino","has","add","isDirectory","assertNoSymlinkEscape","relative","length","maxFiles","parsed","parseInstructionFile","content","maxChars","push","truncated","root","roots","count","found","sort","a","b","localeCompare","join","statSync","filter","item","raw","readFileSync","rel","splitFrontmatter","expandInstructionImports","text","body","filePath","rootDir","scopeOf","frontmatter","scopes","parsePathsScope","declared","some","line","test","scopesUnreadable","inPaths","inline","slice","indexOf","trim","startsWith","close","lastIndexOf","split","map","replaceAll","exec","DEFAULT_SEPARATOR","IGNORE_WARNING","undefined","composeInstructions","base","sources","options","warn","onWarn","separator","length","maxChars","String","text","slice","dropped","map","source","name","trimmed","kept","lengthOf","list","content","join","last","at","withoutLast","room","pop","push","readFileSync","readdirSync","statSync","extname","join","relative","COMMANDS_DIR","join","COMPAT_COMMANDS_DIR","CLAUDE_CODE_SOURCE","IGNORE_WARNING","undefined","projectCommandDirs","input","projectDir","dirs","compatSources","includes","push","mergeProjectCommands","loaded","warn","length","projectTrusted","pending","flatMap","dir","readCommandsDir","String","command","shadowed","get","name","source","path","set","loadCustomCommands","onWarn","Map","homeDir","builtins","Set","builtinNames","shadowedBuiltins","keys","filter","has","commands","values","sort","byProjectThenName","a","b","localeCompare","root","entries","readdirSync","entry","stats","statSync","isDirectory","isFile","extname","parseCommandFile","relative","raw","readFileSync","parsed","splitFrontmatter","description","frontmatterValue","frontmatter","slice","body","PLACEHOLDER_REGEX","REFERENCE_REGEX","ARGS_REGEX","QUOTE_TRIM_REGEX","FILE_INLINE_CAP","splitArgs","rawArgs","match","map","arg","replace","templateHints","template","found","Set","sort","a","b","Number","slice","replaceAsync","source","pattern","resolve","matches","matchAll","length","parts","cursor","push","index","join","expandCommandTemplate","deps","args","withArgs","warn","String","command","groups","cmd","undefined","result","shell","ok","text","name","file","content","readFile","resolveEffectiveContextWindow","TheokitAgentError","DEFAULT_CONTEXT_PRESSURE_THRESHOLDS","warn","critical","ContextPressureThresholdError","TheokitAgentError","name","message","code","isRetryable","contextPressure","usedTokens","effectiveWindow","thresholds","String","Number","isFinite","ratio"]}
|
|
1
|
+
{"version":3,"sources":["../src/config/layered-config.ts","../src/config/trust-store.ts","../src/config/instruction-imports.ts","../src/config/instruction-tree.ts","../src/config/frontmatter.ts","../src/config/compose-instructions.ts","../src/config/custom-commands.ts","../src/config/command-template.ts","../src/config/context-pressure.ts"],"mappings":";;;;;;;;AAIA,SAASA,YAAYC,2BAA2B;AAChD,SAASC,yBAAyB;AAkH3B,IAAMC,uBAAN,cAAmCC,k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F;AACA,MAAI,CAACY,OAAOC,SAASJ,eAAAA,KAAoBA,mBAAmB,EAAG,QAAO;AACtE,MAAI,CAACG,OAAOC,SAASL,UAAAA,KAAeA,cAAc,EAAG,QAAO;AAE5D,QAAMM,QAAQN,aAAaC;AAC3B,MAAIK,SAASJ,WAAWV,SAAU,QAAO;AACzC,MAAIc,SAASJ,WAAWX,KAAM,QAAO;AACrC,SAAO;AACT;AAlBgBQ;","names":["foldLayers","verifyLayerOrdering","TheokitAgentError","LayerOutOfOrderError","TheokitAgentError","name","message","code","isRetryable","LayeredConfig","resolve","input","assertOrdering","layers","accumulating","accumulatingKeys","folded","foldLayers","value","schema","parse","provenancePerKey","buildProvenance","precedenceReport","buildReport","verifyLayerOrdering","error","contributorsOf","key","filter","layer","values","map","keys","Set","flatMap","Object","provenance","contributors","winner","at","undefined","includes","join","declared","contributed","length","measured","has","declaredButSilent","diverges","chmodSync","existsSync","readFileSync","realpathSync","statSync","resolve","resolveTrustPosture","TheokitAgentError","atomicWriteJson","withFileLock","TrustStorePermissionsError","TheokitAgentError","name","file","mode","toString","code","isRetryable","FORBIDDEN_WRITE_BITS","canonicalDir","path","realpathSync","resolve","TrustStore","isTrusted","key","read","some","r","trusted","existsSync","assertSafePermissions","parsed","JSON","parse","readFileSync","records","trust","record","ensureSecureDir","withFileLock","existing","filter","atomicWriteJson","version","chmodSync","postureFor","capabilities","find","resolveTrustPosture","statSync","existsSync","readFileSync","realpathSync","dirname","resolve","MAX_IMPORT_DEPTH","IMPORT_REGEX","maskCodeSpans","text","replace","m","repeat","length","insideRoot","target","rootDir","real","realpathSync","realRoot","startsWith","importTarget","name","filePath","visited","warn","undefined","resolve","dirname","existsSync","has","expandInstructionImports","input","expand","onWarn","Set","alreadyLoaded","depth","wrap","ctx","masked","matches","matchAll","String","out","cursor","match","push","slice","index","add","content","readFileSync","expanded","join","readFileSync","readdirSync","statSync","join","relative","resolve","assertNoSymlinkEscape","FENCE","splitFrontmatter","raw","lines","split","trim","frontmatter","body","closing","findIndex","line","index","undefined","slice","join","frontmatterValue","key","prefix","startsWith","value","length","unquoted","exec","DEFAULT_FILE_NAMES","IGNORE_WARNING","undefined","loadInstructionTree","input","warn","onWarn","fileNames","accepts","entry","includes","cwd","resolve","blocks","seenInodes","Set","chars","visit","dir","depth","budget","maxDepth","String","entries","readdirSync","path","stats","walkOrder","order","inode","dev","ino","has","add","isDirectory","assertNoSymlinkEscape","relative","length","maxFiles","parsed","parseInstructionFile","content","maxChars","push","truncated","root","roots","count","found","sort","a","b","localeCompare","join","statSync","filter","item","raw","readFileSync","rel","splitFrontmatter","expandInstructionImports","text","body","filePath","rootDir","scopeOf","frontmatter","scopes","parsePathsScope","declared","some","line","test","scopesUnreadable","inPaths","inline","slice","indexOf","trim","startsWith","close","lastIndexOf","split","map","replaceAll","exec","DEFAULT_SEPARATOR","IGNORE_WARNING","undefined","composeInstructions","base","sources","options","warn","onWarn","separator","length","maxChars","String","text","slice","dropped","map","source","name","trimmed","kept","lengthOf","list","content","join","last","at","withoutLast","room","pop","push","readFileSync","readdirSync","statSync","extname","join","relative","COMMANDS_DIR","join","COMPAT_COMMANDS_DIR","CLAUDE_CODE_SOURCE","IGNORE_WARNING","undefined","declaresCommands","sources","some","source","import","includes","projectCommandDirs","input","projectDir","dirs","compatSources","push","mergeProjectCommands","loaded","warn","length","projectTrusted","pending","flatMap","dir","readCommandsDir","String","command","shadowed","get","name","path","set","loadCustomCommands","onWarn","Map","homeDir","builtins","Set","builtinNames","shadowedBuiltins","keys","filter","has","commands","values","sort","byProjectThenName","a","b","localeCompare","root","entries","readdirSync","entry","stats","statSync","isDirectory","isFile","extname","parseCommandFile","relative","raw","readFileSync","parsed","splitFrontmatter","description","frontmatterValue","frontmatter","slice","body","PLACEHOLDER_REGEX","REFERENCE_REGEX","ARGS_REGEX","QUOTE_TRIM_REGEX","FILE_INLINE_CAP","splitArgs","rawArgs","match","map","arg","replace","templateHints","template","found","Set","sort","a","b","Number","slice","replaceAsync","source","pattern","resolve","matches","matchAll","length","parts","cursor","push","index","join","expandCommandTemplate","deps","args","withArgs","warn","String","command","groups","cmd","undefined","result","shell","ok","text","name","file","content","readFile","resolveEffectiveContextWindow","TheokitAgentError","DEFAULT_CONTEXT_PRESSURE_THRESHOLDS","warn","critical","ContextPressureThresholdError","TheokitAgentError","name","message","code","isRetryable","contextPressure","usedTokens","effectiveWindow","thresholds","String","Number","isFinite","ratio"]}
|
|
@@ -1,157 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomTool, MemorySettings } from '@theokit/sdk';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { G as Guardrail, S as SkillsSelection, C as CompiledAgentOptions } from './agent-compiler-
|
|
3
|
+
import { G as Guardrail, S as SkillsSelection, H as HookApprovalGate, C as CompiledAgentOptions } from './agent-compiler-CvYfM-0t.js';
|
|
4
4
|
import { R as ReasoningEffort, H as HumanInTheLoopOptions, M as McpServersMap } from './types-C16Wuh9E.js';
|
|
5
5
|
import { H as HookHandlers } from './hook-handlers-Cw2FsnE5.js';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* M68 — the trust gate for `settingSources`.
|
|
10
|
-
*
|
|
11
|
-
* ## The defect this module closes
|
|
12
|
-
*
|
|
13
|
-
* `settingSources` enables on-disk config discovery. `'user'` reads `~/.theokit/` — the operator's
|
|
14
|
-
* own machine, which no third party controls. `'project'` reads `<cwd>/.theokit/`, **including
|
|
15
|
-
* `hooks.json`, which executes shell**.
|
|
16
|
-
*
|
|
17
|
-
* The previous API took `readonly SettingSource[]`, and its JSDoc justified the risk this way:
|
|
18
|
-
* *"it is opt-in because `.theokit/` is the app's own repo (informed consent)"*. That premise holds
|
|
19
|
-
* for a web app whose `cwd` is its own deploy. It does **not** hold for the class of product this
|
|
20
|
-
* framework addresses — an agent whose `cwd` is a repository the user just cloned. There `.theokit/`
|
|
21
|
-
* is attacker-controlled content, and enabling `'project'` is remote code execution on the first
|
|
22
|
-
* `build()`.
|
|
23
|
-
*
|
|
24
|
-
* Documenting it did not prevent it. The measured consumer (TheoCode) did not trust the API: it
|
|
25
|
-
* gated from the outside, with a `posture.allows` of its own (`chat.ts:386`, comment B-008). It
|
|
26
|
-
* already **had** the right decision and could not pass it through, because the API only accepted
|
|
27
|
-
* strings. The gate existed on its side and evaporated at the boundary.
|
|
28
|
-
*
|
|
29
|
-
* ## The evidence is the SDK's, not one invented here
|
|
30
|
-
*
|
|
31
|
-
* `TrustPosture` is `@theokit/sdk`'s own trust primitive, and `recordWiring`'s doc says *"a posture
|
|
32
|
-
* is the only thing in this package that retains a capability"*. A bespoke type would make two trust
|
|
33
|
-
* grammars coexist and drift apart (ADR 0063).
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* The framework's capability vocabulary — deliberately a single name (ADR 0065).
|
|
37
|
-
*
|
|
38
|
-
* `allows` is all-or-nothing in the SDK: every declared `K` gets the same boolean. A finer
|
|
39
|
-
* vocabulary (`hooks`, `skills`, `subagents`, `mcp`) would promise the consumer it can gate one
|
|
40
|
-
* without gating the other, and the primitive does not deliver that. An API that suggests a
|
|
41
|
-
* distinction the runtime does not make teaches the wrong thing, and the error only surfaces when
|
|
42
|
-
* somebody depends on the distinction.
|
|
43
|
-
*/
|
|
44
|
-
type SettingSourceCapability = 'projectSettings';
|
|
45
|
-
/** Authorization to read config from the working directory. Requires the posture, never a claim. */
|
|
46
|
-
interface ProjectSettingsGrant {
|
|
47
|
-
/**
|
|
48
|
-
* Typically the output of `resolveTrustPosture` — which is what gives it `source` (`'env' |
|
|
49
|
-
* 'store' | 'default'`) and therefore a refusal that says WHERE the decision came from instead of
|
|
50
|
-
* merely denying.
|
|
51
|
-
*/
|
|
52
|
-
readonly trustedBy: TrustPosture<SettingSourceCapability>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Which on-disk config roots the agent may read.
|
|
56
|
-
*
|
|
57
|
-
* The asymmetry is the design: `user` is a boolean because `~/.theokit/` belongs to the operator;
|
|
58
|
-
* `project` requires evidence because `<cwd>/.theokit/` may not. Omitting a root is not enabling it
|
|
59
|
-
* — never "enabling without a gate". The asymmetry is inherited from the SDK itself, whose
|
|
60
|
-
* `TrustPostureInput.envOverride` documents that `false` and `undefined` both mean "the operator did
|
|
61
|
-
* not turn it on", not "turned it off".
|
|
62
|
-
*/
|
|
63
|
-
interface SettingSourcesSelection {
|
|
64
|
-
/** `~/.theokit/` — the operator's machine. No gate: no third party controls it. */
|
|
65
|
-
readonly user?: boolean;
|
|
66
|
-
/** `<cwd>/.theokit/` — controlled by whoever wrote the open repository. Requires evidence. */
|
|
67
|
-
readonly project?: ProjectSettingsGrant;
|
|
68
|
-
/**
|
|
69
|
-
* `<cwd>/.claude/` — a FOREIGN configuration dialect, read only once declared
|
|
70
|
-
* (`usetheokit/theokit-sdk#524`).
|
|
71
|
-
*
|
|
72
|
-
* ## Two questions, and which half of this field answers each
|
|
73
|
-
*
|
|
74
|
-
* The SDK's docblock separates them, and the separation is the whole point of `compatSources`:
|
|
75
|
-
* a trust gate answers *"do I trust the code in this directory?"*; importing another product's
|
|
76
|
-
* configuration answers *"do I want it imported into this one?"*. They come apart in the ordinary
|
|
77
|
-
* case, because `.claude/` is populated in exactly the repository one trusts most — for a
|
|
78
|
-
* different tool, by a teammate who never heard of this runtime.
|
|
79
|
-
*
|
|
80
|
-
* So the two are answered by two different things here, and it matters which:
|
|
81
|
-
*
|
|
82
|
-
* | Question | Answered by |
|
|
83
|
-
* |---|---|
|
|
84
|
-
* | do I want the foreign dialect imported? | **declaring this field at all** — omitting is not enabling |
|
|
85
|
-
* | do I trust this directory's code to run? | the `TrustPosture` inside the grant |
|
|
86
|
-
*
|
|
87
|
-
* ## Why the grant is `ProjectSettingsGrant` and not a vocabulary of its own
|
|
88
|
-
*
|
|
89
|
-
* Not because the two questions are the same — they are not. Because a separate grant could not
|
|
90
|
-
* carry the distinction even if it existed: `TrustPosture.allows` is `Record<K, boolean>` and the
|
|
91
|
-
* SDK documents every value as moving together with the level, so a `'foreignDialects'` capability
|
|
92
|
-
* beside `'projectSettings'` would promise an operator they can grant one and withhold the other,
|
|
93
|
-
* and `resolveTrustPosture` would hand back the same boolean for both. That is precisely the
|
|
94
|
-
* failure ADR 0065 exists to prevent, and inventing the second name would commit it while looking
|
|
95
|
-
* like rigour.
|
|
96
|
-
*
|
|
97
|
-
* The consent half is therefore carried by the declaration, which is a real and sufficient
|
|
98
|
-
* boundary: an operator who trusts a repository completely still reads no `.claude/` until they
|
|
99
|
-
* write this field. What the grant adds on top is stricter than the SDK — there, listing a dialect
|
|
100
|
-
* is enough — and the extra strictness is deliberate: this reads a `hooks.json` that executes
|
|
101
|
-
* shell out of a directory that usually arrived with the clone.
|
|
102
|
-
*/
|
|
103
|
-
readonly claudeCode?: ProjectSettingsGrant;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Refusal to read the working directory for lack of trust.
|
|
107
|
-
*
|
|
108
|
-
* Descends from `TheokitAgentError` because typed errors are an unbreakable rule here — and because
|
|
109
|
-
* `isTransientError` only sees this hierarchy. A class extending plain `Error` would be invisible to
|
|
110
|
-
* the predicate that separates recoverable from unrecoverable (the defect M67 fixed in five
|
|
111
|
-
* classes).
|
|
112
|
-
*/
|
|
113
|
-
declare class UntrustedSettingSourceError extends TheokitAgentError {
|
|
114
|
-
/** Where the trust decision came from: `'env' | 'store' | 'default'`. */
|
|
115
|
-
readonly trustSource: string;
|
|
116
|
-
/** The refused capability. */
|
|
117
|
-
readonly capability: SettingSourceCapability;
|
|
118
|
-
readonly name = "UntrustedSettingSourceError";
|
|
119
|
-
constructor(message: string,
|
|
120
|
-
/** Where the trust decision came from: `'env' | 'store' | 'default'`. */
|
|
121
|
-
trustSource: string,
|
|
122
|
-
/** The refused capability. */
|
|
123
|
-
capability: SettingSourceCapability);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Translate the declared selection into the `SettingSource`s the SDK accepts, refusing what the
|
|
127
|
-
* posture does not authorize.
|
|
128
|
-
*
|
|
129
|
-
* Refuses rather than ignores (ADR 0064). Ignoring would leave the product running in the belief
|
|
130
|
-
* that the repository's hooks are active — a silent failure mode, on the wrong side. The SDK already
|
|
131
|
-
* picked that side for the same problem: `recordWiring` throws `UngatedCapabilityError` when
|
|
132
|
-
* somebody registers a capability the posture does not gate.
|
|
133
|
-
*
|
|
134
|
-
* @throws {UntrustedSettingSourceError} when `project` is requested and the posture does not grant it.
|
|
135
|
-
*/
|
|
136
|
-
declare function resolveSettingSources(selection: SettingSourcesSelection | undefined): readonly SettingSource[];
|
|
137
|
-
/**
|
|
138
|
-
* The foreign configuration dialects this layer forwards, once the posture authorises them.
|
|
139
|
-
*
|
|
140
|
-
* ## Why it is a separate function and the same vocabulary
|
|
141
|
-
*
|
|
142
|
-
* Separate because the SDK takes them on a separate option (`local.compatSources`); the same
|
|
143
|
-
* `ProjectSettingsGrant` because the thing being authorised is identical — reading a `hooks.json`
|
|
144
|
-
* that executes shell out of a directory the operator does not necessarily control.
|
|
145
|
-
*
|
|
146
|
-
* ## What it deliberately does NOT do
|
|
147
|
-
*
|
|
148
|
-
* Validate the source NAME. The SDK DROPS an unrecognised name rather than turning it into
|
|
149
|
-
* `<cwd>/<name>`, so a typo fails closed there; turning that into a throw here would convert a safe
|
|
150
|
-
* default into a crash. This gate decides authorisation, never vocabulary.
|
|
151
|
-
*
|
|
152
|
-
* @throws {UntrustedSettingSourceError} when a source is requested and the posture does not grant it.
|
|
153
|
-
*/
|
|
154
|
-
declare function resolveCompatSources(selection: SettingSourcesSelection | undefined): readonly string[];
|
|
6
|
+
import { S as SettingSourcesSelection } from './setting-sources-gate-tadmHT0c.js';
|
|
155
7
|
|
|
156
8
|
/**
|
|
157
9
|
* M2 (theokit-ai-first) — `defineAgent`, the zero-config imperative agent surface.
|
|
@@ -248,6 +100,14 @@ interface DefineAgentConfig<TInput extends z.ZodType = z.ZodType> {
|
|
|
248
100
|
* `Agent.create({ local.settingSources })`.
|
|
249
101
|
*/
|
|
250
102
|
settingSources?: SettingSourcesSelection;
|
|
103
|
+
/**
|
|
104
|
+
* #686 — decide whether a hook declared in a config root is spawned at all, BEFORE it runs.
|
|
105
|
+
*
|
|
106
|
+
* Covers any root, including a foreign dialect imported through `settingSources.claudeCode`.
|
|
107
|
+
* Requires `@theokit/sdk >= 5.4.0`: declaring it against an older SDK is REFUSED at assembly
|
|
108
|
+
* rather than forwarded, because a gate that silently does not gate is worse than none.
|
|
109
|
+
*/
|
|
110
|
+
hookApproval?: HookApprovalGate;
|
|
251
111
|
/**
|
|
252
112
|
* M49 — durable memory (the SDK's `.theokit/memory/` subsystem: `Remember:` capture, MEMORY.md
|
|
253
113
|
* store, auto-injected `<memory>` block, `memory_search`/`memory_get` tools). The shape is the
|
|
@@ -302,4 +162,4 @@ declare function isAgentDefinition(value: unknown): value is AgentDefinition;
|
|
|
302
162
|
*/
|
|
303
163
|
declare function compileAgentDefinition(def: AgentDefinition): CompiledAgentOptions;
|
|
304
164
|
|
|
305
|
-
export { type AgentDefinition as A, type DefineAgentConfig as D, type InferAgentInput as I,
|
|
165
|
+
export { type AgentDefinition as A, type DefineAgentConfig as D, type InferAgentInput as I, AGENT_BRAND as a, type InferAgentToolNames as b, compileAgentDefinition as c, isAgentDefinition as i };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluginsSettings, ProviderRoutingSettings, AgentDefinition, BudgetTracker, CustomTool } from '@theokit/sdk';
|
|
2
2
|
import { RetryOptions } from '@theokit/sdk/retry';
|
|
3
|
-
import { C as CompiledAgentOptions, a as CompiledTool } from './agent-compiler-
|
|
3
|
+
import { C as CompiledAgentOptions, a as CompiledTool } from './agent-compiler-CvYfM-0t.js';
|
|
4
4
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { b as MainLoopMeta } from './types-C16Wuh9E.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,17 +2,18 @@ import { PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition, Budg
|
|
|
2
2
|
export { CustomTool, DiagnosticsSink, GenerateObjectError, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, JudgeCredentialError, JudgeResult, LayerOrderError, McpAuthConfig, McpHttpServerConfig, McpOAuthConfig, McpServerConfig, McpStdioServerConfig, Provider, RunEvent, SDKAgent, SessionRecord, Squad, StreamObjectError, Tool, ToolError, ToolResultContentBlock, TrustLevel, TrustPosture, TrustPostureInput, TrustSource, UngatedCapabilityError, Verdict, WiredEntity, applySecurityFloor, auditEnvReachability, foldLayers, recordWiring, resolveTrustPosture, setDiagnosticsSink, verifyLayerOrdering } from '@theokit/sdk';
|
|
3
3
|
import { b as MainLoopMeta, R as ReasoningEffort, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions } from './types-C16Wuh9E.js';
|
|
4
4
|
export { c as AgentOptions, B as BudgetOptions, d as MainLoopOptions, M as McpServersMap, e as PolicyHandler, f as TimeoutAction, g as ToolboxOptions } from './types-C16Wuh9E.js';
|
|
5
|
-
import { C as ContextWindowOptions, S as SkillsOptions, A as AgentManifestEntry, H as HitlDecision, s as streamAgentUIMessages, a as ApprovalPosture } from './bridge-entry-
|
|
6
|
-
export {
|
|
5
|
+
import { C as ContextWindowOptions, S as SkillsOptions, A as AgentManifestEntry, H as HitlDecision, s as streamAgentUIMessages, a as ApprovalPosture, b as AgentModule } from './bridge-entry-B3BRB3e_.js';
|
|
6
|
+
export { c as APPROVAL_MODES, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinitionError, g as AgentExecutionContext, h as AgentManifest, i as AgentManifestSource, j as AgentManifestTool, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentsPluginOptions, o as ApiErrorContext, p as ApiErrorDecision, q as ApiErrorPolicy, r as ApprovalMode, t as ApprovalRequest, B as BeforeToolCallContext, u as CompiledContextWindow, v as ContextualTool, D as DefinitionOrThunk, w as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as McpApprovalSpec, x as McpFileError, y as McpRegistryConfig, z as McpRequestContext, F as McpSelection, P as ProcessInputContext, G as SdkAgentHandle, I as SdkMessage, J as SdkSendOptions, K as SdkTurnHandle, N as Segment, O as ShouldAutoApproveOptions, T as ToolCallVeto, Q as ToolHooks, R as ToolHooksPlugin, W as WRITE_SCOPED_TOOLS, U as agentsPlugin, V as applyPosture, X as buildModelSelection, Y as compileAgentModule, Z as compileContextWindow, _ as compileLoadedAgentModule, $ as compileProjectContext, a0 as compileSkills, a1 as createAgentExecutionContext, a2 as createApiErrorHandler, a3 as createSdkAgentStream, a4 as createThinkTagExtractor, a5 as createToolHooksPlugin, a6 as extractThinkTagStream, a7 as generateAgentManifest, a8 as generateAgentRoutes, a9 as isAgentContext, aa as loadMcpJson, ab as mcpRegistry, ac as mcpToolApprovals, ad as projectContextMetadataOnlyKnobs, ae as reasoningEffortOf, af as resolveMcpServers, ag as runWithApiErrorHandling, ah as shouldAutoApprove, ai as toAgentFactory, aj as translateSdkEvent, ak as withClockCap, al as withEphemeralAgent } from './bridge-entry-B3BRB3e_.js';
|
|
7
7
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
8
8
|
export * from '@theokit/sdk/errors';
|
|
9
9
|
export { ConfigurationError, BudgetExceededError as WindowBudgetExceededError } from '@theokit/sdk/errors';
|
|
10
|
-
import { G as Guardrail, C as CompiledAgentOptions, a as CompiledTool } from './agent-compiler-
|
|
11
|
-
export { b as CostBudgetExceededError, c as GuardrailAction, d as GuardrailPhase, e as GuardrailResult, f as GuardrailViolationError, g as SkillsRequestContext, S as SkillsSelection, T as ToolWalkResult,
|
|
12
|
-
import { S as SettingSourcesSelection } from './
|
|
13
|
-
export {
|
|
14
|
-
import { L as LoopStrategy, R as ReflectionStrategy, b as RoundStreamFactory, S as StreamEvent, c as DelegationResult } from './delegation-scoring
|
|
15
|
-
export { A as AgentStopReason, d as AgentStreamEvent, e as AgentTurnMetadata, f as ApprovalRequiredEvent, g as ArtifactChunkEvent, h as ArtifactStartEvent, B as BackgroundDelegation, i as BudgetExceededError, C as CheckpointSavedEvent, j as DEFAULT_MAX_ITERATIONS, k as DelegateFn, a as DelegateOptions, l as DelegationBudgetExceededError, m as DelegationError, n as DelegationPort, D as DelegationTarget, o as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, p as LoopFinishReason, q as LoopOutcome, r as LoopStrategyConfig, P as PartialToolCallEvent, s as ReflectionContext, t as ReflectionResult, u as ReflectionStrategyConfig, v as RunStartedEvent, w as ScoreVerdict, x as ScoredDelegation, y as Scorer, z as StateUpdateEvent, T as TextDeltaEvent, G as ThinkingEvent, H as ToolCallEvent, J as ToolResultEvent, K as delegate, M as delegateBackground, N as delegateWithScoring, O as isApprovalRequired, Q as isDone, U as isError, V as isPartialToolCall, W as isTextDelta, X as isToolCall, Y as isToolResult, Z as ladderReflectionStrategy, _ as loopStrategyConfigSchema, $ as noopReflectionStrategy, a0 as presentUIMessageStream, a1 as reflectionStrategyConfigSchema, a2 as resolveLoopStrategy, a3 as streamAgentResponse } from './delegation-scoring
|
|
10
|
+
import { G as Guardrail, C as CompiledAgentOptions, a as CompiledTool } from './agent-compiler-CvYfM-0t.js';
|
|
11
|
+
export { b as CostBudgetExceededError, c as GuardrailAction, d as GuardrailPhase, e as GuardrailResult, f as GuardrailViolationError, H as HookApprovalGate, g as HookApprovalRequest, h as HookGateUnsupportedError, i as SkillsRequestContext, S as SkillsSelection, T as ToolWalkResult, j as ToolboxWalkResult, k as compileTools, r as resolveEnabledSkills } from './agent-compiler-CvYfM-0t.js';
|
|
12
|
+
import { S as SettingSourcesSelection } from './setting-sources-gate-tadmHT0c.js';
|
|
13
|
+
export { C as CompatSurface, P as ProjectSettingsGrant, R as ResolvedCompatSource, a as SettingSourceCapability, U as UntrustedSettingSourceError, r as resolveCompatSources, b as resolveSettingSources } from './setting-sources-gate-tadmHT0c.js';
|
|
14
|
+
import { L as LoopStrategy, R as ReflectionStrategy, b as RoundStreamFactory, S as StreamEvent, c as DelegationResult } from './delegation-scoring-BZdtCdMN.js';
|
|
15
|
+
export { A as AgentStopReason, d as AgentStreamEvent, e as AgentTurnMetadata, f as ApprovalRequiredEvent, g as ArtifactChunkEvent, h as ArtifactStartEvent, B as BackgroundDelegation, i as BudgetExceededError, C as CheckpointSavedEvent, j as DEFAULT_MAX_ITERATIONS, k as DelegateFn, a as DelegateOptions, l as DelegationBudgetExceededError, m as DelegationError, n as DelegationPort, D as DelegationTarget, o as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, p as LoopFinishReason, q as LoopOutcome, r as LoopStrategyConfig, P as PartialToolCallEvent, s as ReflectionContext, t as ReflectionResult, u as ReflectionStrategyConfig, v as RunStartedEvent, w as ScoreVerdict, x as ScoredDelegation, y as Scorer, z as StateUpdateEvent, T as TextDeltaEvent, G as ThinkingEvent, H as ToolCallEvent, J as ToolResultEvent, K as delegate, M as delegateBackground, N as delegateWithScoring, O as isApprovalRequired, Q as isDone, U as isError, V as isPartialToolCall, W as isTextDelta, X as isToolCall, Y as isToolResult, Z as ladderReflectionStrategy, _ as loopStrategyConfigSchema, $ as noopReflectionStrategy, a0 as presentUIMessageStream, a1 as reflectionStrategyConfigSchema, a2 as resolveLoopStrategy, a3 as streamAgentResponse } from './delegation-scoring-BZdtCdMN.js';
|
|
16
|
+
export { a as AGENT_BRAND, A as AgentDefinition, D as DefineAgentConfig, I as InferAgentInput, b as InferAgentToolNames, c as compileAgentDefinition, i as isAgentDefinition } from './define-agent-Dp6e7chT.js';
|
|
16
17
|
import { RetryOptions } from '@theokit/sdk/retry';
|
|
17
18
|
export * from '@theokit/sdk/retry';
|
|
18
19
|
import { CompressibleMessage } from '@theokit/sdk/compaction';
|
|
@@ -746,6 +747,15 @@ declare class SettingSourcesCapability implements Capability {
|
|
|
746
747
|
constructor(selection: SettingSourcesSelection);
|
|
747
748
|
apply(draft: CompiledAgentOptionsDraft): void;
|
|
748
749
|
}
|
|
750
|
+
/**
|
|
751
|
+
* #686 — the pre-spawn hook approval gate. A capability so the two compile paths agree: the waist
|
|
752
|
+
* distinguishes "not declared" from "declared", and a field only `defineAgent` could set would make
|
|
753
|
+
* anyone building through capabilities silently ungated.
|
|
754
|
+
*/
|
|
755
|
+
declare class HookApprovalCapability extends FieldCapability<'hookApproval'> {
|
|
756
|
+
readonly name = "hook-approval";
|
|
757
|
+
protected readonly field: "hookApproval";
|
|
758
|
+
}
|
|
749
759
|
declare class PluginsCapability extends FieldCapability<'plugins'> {
|
|
750
760
|
readonly name = "plugins";
|
|
751
761
|
protected readonly field: "plugins";
|
|
@@ -1330,7 +1340,7 @@ declare class InProcessApprovalRequiredError extends TheokitAgentError {
|
|
|
1330
1340
|
* agent without a resolver throws at call time, not lazily on first iteration); the returned value is
|
|
1331
1341
|
* the SDK's `streamAgentUIMessages` generator.
|
|
1332
1342
|
*/
|
|
1333
|
-
declare function streamAgentTurnInProcess(mod:
|
|
1343
|
+
declare function streamAgentTurnInProcess(mod: AgentModule, apiKey: string, input: StreamAgentTurnInProcessInput, deps?: StreamAgentTurnDeps): AsyncGenerator<WireChunk>;
|
|
1334
1344
|
|
|
1335
1345
|
type ListOptionsWithoutPagination = ListAgentsOptions & {
|
|
1336
1346
|
limit?: never;
|
|
@@ -1367,4 +1377,4 @@ type AgentWithNarrowedList = Omit<typeof Agent$1, 'list'> & {
|
|
|
1367
1377
|
type AgentWithNarrowedListAlias = AgentWithNarrowedList;
|
|
1368
1378
|
declare const Agent: AgentWithNarrowedList;
|
|
1369
1379
|
|
|
1370
|
-
export { type A2AAuth, type A2ACapabilities, type A2ASkill, type A2AToolConfig, AcpClient, AcpMessageDecoder, type AcpTransport, Agent, type AgentCard, type AgentConfig, AgentConfigCapability, AgentManifestEntry, AgentRunner, AgentRunnerBuilder, type AgentRunnerRunOptions, type AgentShape, type AgentWithNarrowedListAlias, ApprovalOptions, ApprovalPosture, type BuildAgentCardOptions, type Capability, CapabilityConflictError, CapabilityPreset, CapabilityRegistry, CheckpointCapability, type CompactionCallOptions, type CompactionStrategyConfig, CompiledAgentOptions, type CompiledAgentOptionsDraft, CompiledTool, ContextWindowCapability, type CostGuardOptions, DEFAULT_KEEP_TOKENS, DelegationResult, FieldCapability, type FinalizedDraft, GoalRunner, type GoalRunnerDeps, Guardrail, GuardrailsCapability, HitlDecision, HumanInTheLoopCapability, HumanInTheLoopOptions, type InProcessApprovalRequest, InProcessApprovalRequiredError, type InProcessAwaitApproval, type ListOptionsWithoutPaginationAlias, LoopStrategy, MCP_PROTOCOL_VERSION, MainLoopCapability, MainLoopMeta, type McpJsonSchema, type McpServerInfo, McpServersCapability, type McpToolDescriptor, MemoryCapability, ModelCapability, type NamedTool, type OutputModerationOptions, type PiiOptions, PluginsCapability, ProjectContextCapability, type PromptInjectionOptions, type ProvenanceEntry, ReasoningEffort, ReflectionStrategy, RoundStreamFactory, RunContextCapability, SettingSourcesCapability, SettingSourcesSelection, SkillsCapability, SkillsOptionsCapability, SkillsResolverCapability, type StreamAgentTurnDeps, type StreamAgentTurnInProcessInput, StreamEvent, SubAgentsCapability, type Summarize, type ToolComNome, type ToolDeclaration, ToolOptions, ToolboxCapability, type ToolboxSource, ToolsCapability, Toolset, ToolsetError, type TranscriptCompactionStrategy, UnknownCapabilityError, applyCapabilities, buildAgentCard, buildMcpToolDescriptors, compactionStrategyConfigSchema, costGuard, createA2ATool, createDraft, declareAgentShape, deriveConversationId, encodeAcpMessage, estimateTokens, formatGoalEvent, listSubagentNames, mcpServerInfo, moderateOutputStream, outputModeration, parseConversationId, piiDetector, promptInjectionDetector, resolveCompactionStrategy, runInputGuards, runOutputGuards, setOnce, streamAgentTurnInProcess, streamAgentUIMessages, tokenBudgetCompactionStrategy, unicodeNormalizer, wellKnownCardPath };
|
|
1380
|
+
export { type A2AAuth, type A2ACapabilities, type A2ASkill, type A2AToolConfig, AcpClient, AcpMessageDecoder, type AcpTransport, Agent, type AgentCard, type AgentConfig, AgentConfigCapability, AgentManifestEntry, AgentModule, AgentRunner, AgentRunnerBuilder, type AgentRunnerRunOptions, type AgentShape, type AgentWithNarrowedListAlias, ApprovalOptions, ApprovalPosture, type BuildAgentCardOptions, type Capability, CapabilityConflictError, CapabilityPreset, CapabilityRegistry, CheckpointCapability, type CompactionCallOptions, type CompactionStrategyConfig, CompiledAgentOptions, type CompiledAgentOptionsDraft, CompiledTool, ContextWindowCapability, type CostGuardOptions, DEFAULT_KEEP_TOKENS, DelegationResult, FieldCapability, type FinalizedDraft, GoalRunner, type GoalRunnerDeps, Guardrail, GuardrailsCapability, HitlDecision, HookApprovalCapability, HumanInTheLoopCapability, HumanInTheLoopOptions, type InProcessApprovalRequest, InProcessApprovalRequiredError, type InProcessAwaitApproval, type ListOptionsWithoutPaginationAlias, LoopStrategy, MCP_PROTOCOL_VERSION, MainLoopCapability, MainLoopMeta, type McpJsonSchema, type McpServerInfo, McpServersCapability, type McpToolDescriptor, MemoryCapability, ModelCapability, type NamedTool, type OutputModerationOptions, type PiiOptions, PluginsCapability, ProjectContextCapability, type PromptInjectionOptions, type ProvenanceEntry, ReasoningEffort, ReflectionStrategy, RoundStreamFactory, RunContextCapability, SettingSourcesCapability, SettingSourcesSelection, SkillsCapability, SkillsOptionsCapability, SkillsResolverCapability, type StreamAgentTurnDeps, type StreamAgentTurnInProcessInput, StreamEvent, SubAgentsCapability, type Summarize, type ToolComNome, type ToolDeclaration, ToolOptions, ToolboxCapability, type ToolboxSource, ToolsCapability, Toolset, ToolsetError, type TranscriptCompactionStrategy, UnknownCapabilityError, applyCapabilities, buildAgentCard, buildMcpToolDescriptors, compactionStrategyConfigSchema, costGuard, createA2ATool, createDraft, declareAgentShape, deriveConversationId, encodeAcpMessage, estimateTokens, formatGoalEvent, listSubagentNames, mcpServerInfo, moderateOutputStream, outputModeration, parseConversationId, piiDetector, promptInjectionDetector, resolveCompactionStrategy, runInputGuards, runOutputGuards, setOnce, streamAgentTurnInProcess, streamAgentUIMessages, tokenBudgetCompactionStrategy, unicodeNormalizer, wellKnownCardPath };
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
compileAgentModule,
|
|
9
9
|
compileContextWindow,
|
|
10
10
|
compileHitlGates,
|
|
11
|
+
compileLoadedAgentModule,
|
|
11
12
|
compileSkills,
|
|
12
13
|
compileTools,
|
|
13
14
|
createAgentExecutionContext,
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
streamAgentResponse,
|
|
32
33
|
streamAgentUIMessages,
|
|
33
34
|
toolRuntimeName
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-6YJIXBMA.js";
|
|
35
36
|
import {
|
|
36
37
|
APPROVAL_MODES,
|
|
37
38
|
AgentRunner,
|
|
@@ -45,6 +46,7 @@ import {
|
|
|
45
46
|
DelegationTimeoutError,
|
|
46
47
|
GoalRunner,
|
|
47
48
|
GuardrailViolationError,
|
|
49
|
+
HookGateUnsupportedError,
|
|
48
50
|
JudgeCredentialError,
|
|
49
51
|
WRITE_SCOPED_TOOLS,
|
|
50
52
|
applyPosture,
|
|
@@ -82,7 +84,7 @@ import {
|
|
|
82
84
|
unicodeNormalizer,
|
|
83
85
|
withClockCap,
|
|
84
86
|
withEphemeralAgent
|
|
85
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-FXQF7LS3.js";
|
|
86
88
|
import "./chunk-RKWCXVYG.js";
|
|
87
89
|
import {
|
|
88
90
|
AGENT_BRAND,
|
|
@@ -92,7 +94,7 @@ import {
|
|
|
92
94
|
isAgentDefinition,
|
|
93
95
|
resolveCompatSources,
|
|
94
96
|
resolveSettingSources
|
|
95
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-43O2CCZR.js";
|
|
96
98
|
import "./chunk-OXNDJSAJ.js";
|
|
97
99
|
import {
|
|
98
100
|
__name
|
|
@@ -458,6 +460,13 @@ var SettingSourcesCapability = class {
|
|
|
458
460
|
}
|
|
459
461
|
}
|
|
460
462
|
};
|
|
463
|
+
var HookApprovalCapability = class extends FieldCapability {
|
|
464
|
+
static {
|
|
465
|
+
__name(this, "HookApprovalCapability");
|
|
466
|
+
}
|
|
467
|
+
name = "hook-approval";
|
|
468
|
+
field = "hookApproval";
|
|
469
|
+
};
|
|
461
470
|
var PluginsCapability = class extends FieldCapability {
|
|
462
471
|
static {
|
|
463
472
|
__name(this, "PluginsCapability");
|
|
@@ -1156,6 +1165,8 @@ export {
|
|
|
1156
1165
|
GoalRunner,
|
|
1157
1166
|
GuardrailViolationError,
|
|
1158
1167
|
GuardrailsCapability,
|
|
1168
|
+
HookApprovalCapability,
|
|
1169
|
+
HookGateUnsupportedError,
|
|
1159
1170
|
HumanInTheLoopCapability,
|
|
1160
1171
|
InProcessApprovalRequiredError,
|
|
1161
1172
|
JudgeCredentialError,
|
|
@@ -1202,6 +1213,7 @@ export {
|
|
|
1202
1213
|
compileAgentDefinition,
|
|
1203
1214
|
compileAgentModule,
|
|
1204
1215
|
compileContextWindow,
|
|
1216
|
+
compileLoadedAgentModule,
|
|
1205
1217
|
compileProjectContext,
|
|
1206
1218
|
compileSkills,
|
|
1207
1219
|
compileTools,
|