@theokit/sdk 4.63.3 → 4.63.4
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 +67 -0
- package/dist/{agent-3JK7VXNN.js → agent-A5XMIVNP.js} +6 -6
- package/dist/{agent-3JK7VXNN.js.map → agent-A5XMIVNP.js.map} +1 -1
- package/dist/{agent-PVINJTUR.cjs → agent-UX7WFI6B.cjs} +7 -7
- package/dist/{agent-PVINJTUR.cjs.map → agent-UX7WFI6B.cjs.map} +1 -1
- package/dist/chunk-247ZTLNU.js +73 -0
- package/dist/chunk-247ZTLNU.js.map +1 -0
- package/dist/{chunk-GPKAF7SG.js → chunk-32WTYBUH.js} +3 -3
- package/dist/{chunk-GPKAF7SG.js.map → chunk-32WTYBUH.js.map} +1 -1
- package/dist/{chunk-CQBXOJ6U.cjs → chunk-43ZQRWAP.cjs} +5 -5
- package/dist/{chunk-CQBXOJ6U.cjs.map → chunk-43ZQRWAP.cjs.map} +1 -1
- package/dist/{chunk-JJ3OVRUM.cjs → chunk-7VT4P3Z4.cjs} +136 -35
- package/dist/chunk-7VT4P3Z4.cjs.map +1 -0
- package/dist/chunk-AKJP2STZ.cjs +81 -0
- package/dist/chunk-AKJP2STZ.cjs.map +1 -0
- package/dist/{chunk-ZWRG4NWT.cjs → chunk-GMLBYDW4.cjs} +4 -4
- package/dist/{chunk-ZWRG4NWT.cjs.map → chunk-GMLBYDW4.cjs.map} +1 -1
- package/dist/{chunk-LXI4XZEC.js → chunk-LKBEROHN.js} +3 -3
- package/dist/{chunk-LXI4XZEC.js.map → chunk-LKBEROHN.js.map} +1 -1
- package/dist/{chunk-25BD2R5G.js → chunk-LYTOXSRH.js} +113 -12
- package/dist/chunk-LYTOXSRH.js.map +1 -0
- package/dist/{chunk-K5OJUYSZ.js → chunk-NDGGJQTZ.js} +13 -4
- package/dist/chunk-NDGGJQTZ.js.map +1 -0
- package/dist/{chunk-ZCIRZE37.cjs → chunk-VCLBZAZU.cjs} +14 -5
- package/dist/chunk-VCLBZAZU.cjs.map +1 -0
- package/dist/{context-AGQ3DIZU.cjs → context-WFLTTMK3.cjs} +7 -7
- package/dist/{context-AGQ3DIZU.cjs.map → context-WFLTTMK3.cjs.map} +1 -1
- package/dist/context-WI2DFG7V.js +7 -0
- package/dist/{context-GQRFBCLP.js.map → context-WI2DFG7V.js.map} +1 -1
- package/dist/cron.cjs +6 -6
- package/dist/cron.js +5 -5
- package/dist/eval.cjs +5 -5
- package/dist/eval.js +4 -4
- package/dist/index.cjs +20 -20
- package/dist/index.js +7 -7
- package/dist/internal/agent-loop/replay-messages.d.ts +41 -0
- package/dist/internal/local-agent/local-option-keys.d.ts +2 -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 +92 -0
- package/dist/internal/runtime/hooks/hooks-executor.d.ts +9 -0
- package/dist/internal/runtime/hooks/hooks-source.d.ts +9 -0
- package/dist/subagents-loader-UCNO7FUH.cjs +17 -0
- package/dist/{subagents-loader-YEUFFPAL.cjs.map → subagents-loader-UCNO7FUH.cjs.map} +1 -1
- package/dist/subagents-loader-XP5ERVDZ.js +8 -0
- package/dist/{subagents-loader-CRT5LLL3.js.map → subagents-loader-XP5ERVDZ.js.map} +1 -1
- package/dist/subagents-loader.cjs +3 -3
- package/dist/subagents-loader.js +2 -2
- package/docs/error-codes.md +5 -5
- package/package.json +1 -1
- package/dist/chunk-25BD2R5G.js.map +0 -1
- package/dist/chunk-AQO3NSRG.cjs +0 -41
- package/dist/chunk-AQO3NSRG.cjs.map +0 -1
- package/dist/chunk-JJ3OVRUM.cjs.map +0 -1
- package/dist/chunk-K5OJUYSZ.js.map +0 -1
- package/dist/chunk-UFLD2HEV.js +0 -35
- package/dist/chunk-UFLD2HEV.js.map +0 -1
- package/dist/chunk-ZCIRZE37.cjs.map +0 -1
- package/dist/context-GQRFBCLP.js +0 -7
- package/dist/subagents-loader-CRT5LLL3.js +0 -8
- package/dist/subagents-loader-YEUFFPAL.cjs +0 -17
package/dist/chunk-AQO3NSRG.cjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var os = require('os');
|
|
4
|
-
var path = require('path');
|
|
5
|
-
|
|
6
|
-
// src/internal/persistence/paths.ts
|
|
7
|
-
var THEOKIT_DIR_LITERAL = ".theokit";
|
|
8
|
-
var CLAUDE_DIR_NAME = ".claude";
|
|
9
|
-
function getTheokitHome(cwd) {
|
|
10
|
-
const override = process.env.THEOKIT_HOME?.trim();
|
|
11
|
-
if (override !== void 0 && override.length > 0) {
|
|
12
|
-
return override;
|
|
13
|
-
}
|
|
14
|
-
return path.join(cwd, THEOKIT_DIR_LITERAL);
|
|
15
|
-
}
|
|
16
|
-
function projectConfigRoots(cwd) {
|
|
17
|
-
return [path.join(cwd, THEOKIT_DIR_LITERAL), path.join(cwd, CLAUDE_DIR_NAME)];
|
|
18
|
-
}
|
|
19
|
-
function pluginBundleRoots(cwd) {
|
|
20
|
-
return projectConfigRoots(cwd).map((root) => path.join(root, "plugins"));
|
|
21
|
-
}
|
|
22
|
-
function getProfilesRoot() {
|
|
23
|
-
return path.join(os.homedir(), THEOKIT_DIR_LITERAL, "profiles");
|
|
24
|
-
}
|
|
25
|
-
function displayTheokitHome(cwd) {
|
|
26
|
-
const resolved = getTheokitHome(cwd);
|
|
27
|
-
const home = os.homedir();
|
|
28
|
-
if (resolved === home) return "~";
|
|
29
|
-
if (resolved.startsWith(`${home}/`)) {
|
|
30
|
-
return `~${resolved.slice(home.length)}`;
|
|
31
|
-
}
|
|
32
|
-
return resolved;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exports.displayTheokitHome = displayTheokitHome;
|
|
36
|
-
exports.getProfilesRoot = getProfilesRoot;
|
|
37
|
-
exports.getTheokitHome = getTheokitHome;
|
|
38
|
-
exports.pluginBundleRoots = pluginBundleRoots;
|
|
39
|
-
exports.projectConfigRoots = projectConfigRoots;
|
|
40
|
-
//# sourceMappingURL=chunk-AQO3NSRG.cjs.map
|
|
41
|
-
//# sourceMappingURL=chunk-AQO3NSRG.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/persistence/paths.ts"],"names":["join","homedir"],"mappings":";;;;;;AAuCA,IAAM,mBAAA,GAAsB,UAAA;AAG5B,IAAM,eAAA,GAAkB,SAAA;AAuBjB,SAAS,eAAe,GAAA,EAAqB;AAClD,EAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,GAAA,CAAI,YAAA,EAAc,IAAA,EAAK;AAChD,EAAA,IAAI,QAAA,KAAa,MAAA,IAAa,QAAA,CAAS,MAAA,GAAS,CAAA,EAAG;AACjD,IAAA,OAAO,QAAA;AAAA,EACT;AACA,EAAA,OAAOA,SAAA,CAAK,KAAK,mBAAmB,CAAA;AACtC;AA6BO,SAAS,mBAAmB,GAAA,EAAuB;AACxD,EAAA,OAAO,CAACA,UAAK,GAAA,EAAK,mBAAmB,GAAGA,SAAA,CAAK,GAAA,EAAK,eAAe,CAAC,CAAA;AACpE;AAeO,SAAS,kBAAkB,GAAA,EAAuB;AACvD,EAAA,OAAO,kBAAA,CAAmB,GAAG,CAAA,CAAE,GAAA,CAAI,CAAC,IAAA,KAASA,SAAA,CAAK,IAAA,EAAM,SAAS,CAAC,CAAA;AACpE;AAeO,SAAS,eAAA,GAA0B;AACxC,EAAA,OAAOA,SAAA,CAAKC,UAAA,EAAQ,EAAG,mBAAA,EAAqB,UAAU,CAAA;AACxD;AAmBO,SAAS,mBAAmB,GAAA,EAAqB;AACtD,EAAA,MAAM,QAAA,GAAW,eAAe,GAAG,CAAA;AACnC,EAAA,MAAM,OAAOA,UAAA,EAAQ;AACrB,EAAA,IAAI,QAAA,KAAa,MAAM,OAAO,GAAA;AAC9B,EAAA,IAAI,QAAA,CAAS,UAAA,CAAW,CAAA,EAAG,IAAI,GAAG,CAAA,EAAG;AACnC,IAAA,OAAO,CAAA,CAAA,EAAI,QAAA,CAAS,KAAA,CAAM,IAAA,CAAK,MAAM,CAAC,CAAA,CAAA;AAAA,EACxC;AACA,EAAA,OAAO,QAAA;AACT","file":"chunk-AQO3NSRG.cjs","sourcesContent":["/**\n * Path resolution for SDK state files (ADR D60).\n *\n * Theokit anchors state at `<cwd>/.theokit/` by default (per-cwd). An\n * optional `THEOKIT_HOME` environment variable overrides this, enabling\n * test isolation, profile switching, and multi-tenant deployments.\n *\n * Rules:\n * - `getTheokitHome(cwd)` is the canonical resolver **for cwd-anchored state**. Never hardcode\n * `path.join(cwd, \".theokit\")` in callers — use this function so tests\n * and overrides stay consistent.\n *\n * M94 — this comment said \"the ONLY canonical resolver\", and stopped being true: the\n * transcript gained `transcriptRoot()`, which is **home-anchored** (`~/.theokit`) with the same\n * `THEOKIT_HOME` override. The two defaults differ on purpose — unifying would move the\n * transcript of everyone who does NOT set the variable, which is a data migration and not a\n * re-export.\n *\n * A consequence worth writing down: **without `THEOKIT_HOME` the state stays split in two**\n * — registry in `<cwd>/.theokit`, transcript in `~/.theokit`. M94 unifies only for those who set\n * the variable. Unifying both defaults is another milestone's work.\n * - `getProfilesRoot()` is intentionally home-anchored (not affected by\n * `THEOKIT_HOME`) so `theokit profile list` discovers all profiles\n * regardless of which is active.\n * - `displayTheokitHome(cwd)` returns a human-readable path for logs.\n *\n * @internal\n */\n\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\n/**\n * The project config directory literal.\n *\n * Renamed from `THEOKIT_DIR_NAME` in #410. Sharing a name with the (now removed) sovereign env var\n * was the MECHANISM of that defect, not scenery: every grep for the variable landed on this const\n * and looked answered, so \"is it read?\" returned five hits and nobody checked what they were.\n */\nconst THEOKIT_DIR_LITERAL = \".theokit\";\n\n/** The Claude Code CLI's project configuration directory. */\nconst CLAUDE_DIR_NAME = \".claude\";\n\n/**\n * Resolve the directory cwd-anchored SDK state lives in.\n *\n * `THEOKIT_HOME` wins when it is set and not blank after trimming; the trimmed value is used, and\n * it is used VERBATIM — it is not resolved against `cwd`, so a relative value stays relative and\n * `.theokit` is not appended to it. Otherwise the answer is `<cwd>/.theokit`.\n *\n * The environment is read on every call, so a change to the variable takes effect immediately\n * rather than being frozen at import.\n *\n * This creates nothing and checks nothing: the returned path may not exist, and the caller owns\n * the `mkdir`. Call it instead of writing `join(cwd, \".theokit\")` by hand, or the override stops\n * working for that one call site and tests silently touch the real home.\n *\n * Not the whole story about where state lives — the transcript is home-anchored via\n * `transcriptRoot()`, honoring the same variable but defaulting to `~/.theokit`. With\n * `THEOKIT_HOME` unset, state is genuinely split between two roots.\n *\n * Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package\n * declares in `exports` but does NOT cover with its semver contract.\n */\nexport function getTheokitHome(cwd: string): string {\n const override = process.env.THEOKIT_HOME?.trim();\n if (override !== undefined && override.length > 0) {\n return override;\n }\n return join(cwd, THEOKIT_DIR_LITERAL);\n}\n\n/**\n * Every directory a project's configuration may be read from, in precedence order.\n *\n * `.theokit` first, then `.claude`. The order is the whole contract: a project that declares a\n * skill, agent or rule in both means the explicit namespace to win, and a caller merging these\n * roots must therefore keep the FIRST occurrence of a name rather than the last.\n *\n * `.claude` is read because the formats already agree and only the location did not. Measured\n * 2026-08-26: the SKILL.md frontmatter this SDK requires (`name` + `description`) is exactly what\n * the CLI writes, its hook config is the same JSON shape, and 59 of the CLI's agent declarations\n * parse here unchanged. A repository set up for the CLI was failing on the directory name alone.\n *\n * NOT a rename of `.theokit`, and not a migration. Both are read, so nothing that works today stops\n * working — which is why this returns a LIST and not a single resolved answer.\n *\n * Deliberately NOT affected by `THEOKIT_HOME`, and this is the one thing to remember about it.\n * That variable relocates cwd-anchored SDK *state* — sessions, the credential store. A project's\n * *configuration* is a property of the repository, not of where this SDK keeps its state, and the\n * loaders that read these directories have always anchored on `cwd` directly. Honouring the\n * override here would silently move where a project's agents and skills come from, which is a\n * behaviour change wearing the costume of a refactor.\n *\n * Creates nothing and checks nothing; either path may not exist, and the caller owns that.\n *\n * Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package\n * declares in `exports` but does NOT cover with its semver contract.\n */\nexport function projectConfigRoots(cwd: string): string[] {\n return [join(cwd, THEOKIT_DIR_LITERAL), join(cwd, CLAUDE_DIR_NAME)];\n}\n\n/**\n * Every directory that may hold a plugin BUNDLE contributed by the Claude Code CLI.\n *\n * A CLI plugin is not a JS entry point — it is a folder whose `skills/` and `agents/` are what it\n * exists to provide. Measured 2026-08-26 on an installed one: seven agents and three skills beside\n * a manifest in `.claude-plugin/plugin.json`. Parsing that manifest and stopping there produced a\n * plugin that loaded and did nothing.\n *\n * Project-scoped deliberately. The CLI also keeps plugins under `~/.claude/plugins/cache`, behind\n * its own installer and enable/disable state — reproducing that is an installation system, not\n * reading a project's configuration, and guessing at someone's enablement would run code they\n * turned off.\n */\nexport function pluginBundleRoots(cwd: string): string[] {\n return projectConfigRoots(cwd).map((root) => join(root, \"plugins\"));\n}\n\n/**\n * The directory holding every profile: always `~/.theokit/profiles`, from `os.homedir()`.\n *\n * Deliberately NOT affected by `THEOKIT_HOME`, which is the one thing to remember about it. If it\n * followed the override, a session pointed at one profile would only be able to see that profile,\n * and `theokit profile list` could never enumerate the rest. Profiles are the thing the override\n * switches between, so their index cannot live behind it.\n *\n * Takes no `cwd` for the same reason. Creates nothing; the path may not exist.\n *\n * Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package\n * declares in `exports` but does NOT cover with its semver contract.\n */\nexport function getProfilesRoot(): string {\n return join(homedir(), THEOKIT_DIR_LITERAL, \"profiles\");\n}\n\n/**\n * The same path `getTheokitHome(cwd)` returns, shortened for display: the home directory prefix\n * collapses to `~`, so `/home/ada/.theokit` prints as `~/.theokit`.\n *\n * For humans only — log lines, CLI output, error messages. The result is NOT a usable path: `~`\n * is a shell convention that `fs` does not expand, so passing this to a filesystem call resolves\n * a literal directory named `~` relative to the process cwd. Use `getTheokitHome` for anything\n * that touches disk.\n *\n * Collapsing is a prefix match on the home directory followed by a literal `/`, so a sibling like\n * `/home/adalovelace` is left alone even though `/home/ada` is a string prefix of it. A path\n * outside the home directory comes back unchanged — and so does a Windows path, where the\n * separator is a backslash and the prefix test therefore never matches.\n *\n * Semver-exempt: reachable via the `@theokit/sdk/internal/persistence` sub-path, which the package\n * declares in `exports` but does NOT cover with its semver contract.\n */\nexport function displayTheokitHome(cwd: string): string {\n const resolved = getTheokitHome(cwd);\n const home = homedir();\n if (resolved === home) return \"~\";\n if (resolved.startsWith(`${home}/`)) {\n return `~${resolved.slice(home.length)}`;\n }\n return resolved;\n}\n"]}
|