@theokit/sdk 4.19.2 → 4.19.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/dist/cron.cjs +20 -25
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +21 -26
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +20 -25
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +21 -26
- package/dist/eval.js.map +1 -1
- package/dist/filesystem/index.cjs +7 -2
- package/dist/filesystem/index.cjs.map +1 -1
- package/dist/filesystem/index.js +7 -2
- package/dist/filesystem/index.js.map +1 -1
- package/dist/index.cjs +20 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -25
- package/dist/index.js.map +1 -1
- package/dist/internal/persistence/index.cjs +1 -3
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +1 -3
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/security/index.cjs +7 -2
- package/dist/internal/security/index.cjs.map +1 -1
- package/dist/internal/security/index.js +8 -3
- package/dist/internal/security/index.js.map +1 -1
- package/dist/path-safety.cjs +7 -2
- package/dist/path-safety.cjs.map +1 -1
- package/dist/path-safety.js +8 -3
- package/dist/path-safety.js.map +1 -1
- package/dist/persistence.cjs +1 -3
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +1 -3
- package/dist/persistence.js.map +1 -1
- package/dist/provider-catalog.json +469 -144
- package/dist/skills.cjs +7 -2
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.js +7 -2
- package/dist/skills.js.map +1 -1
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js.map +1 -1
- package/package.json +13 -12
package/dist/cron.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z, toJSONSchema } from 'zod';
|
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import { randomUUID, randomBytes, createHash } from 'crypto';
|
|
4
4
|
import { mkdir, readFile, open, rename, unlink, statfs, readdir, stat, access } from 'fs/promises';
|
|
5
|
-
import { join, dirname, resolve,
|
|
5
|
+
import { join, dirname, resolve, relative, sep, isAbsolute } from 'path';
|
|
6
6
|
import { existsSync, readFileSync, realpathSync, mkdirSync, lstatSync, readlinkSync, readdirSync, statSync, chmodSync, openSync, writeFileSync, fsyncSync, closeSync, renameSync, unlinkSync } from 'fs';
|
|
7
7
|
import { homedir } from 'os';
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
@@ -848,6 +848,11 @@ var init_atomic_write = __esm({
|
|
|
848
848
|
warnedNfsDirs = /* @__PURE__ */ new Set();
|
|
849
849
|
}
|
|
850
850
|
});
|
|
851
|
+
function isInside(target, base) {
|
|
852
|
+
if (target === base) return true;
|
|
853
|
+
const prefix = base.endsWith(sep) ? base : base + sep;
|
|
854
|
+
return target.startsWith(prefix);
|
|
855
|
+
}
|
|
851
856
|
function safePathJoin(base, ...parts) {
|
|
852
857
|
if (base === "") {
|
|
853
858
|
throw new Error("safePathJoin: base must be non-empty");
|
|
@@ -858,7 +863,7 @@ function safePathJoin(base, ...parts) {
|
|
|
858
863
|
}
|
|
859
864
|
const baseResolved = resolve(base);
|
|
860
865
|
const target = resolve(base, ...parts);
|
|
861
|
-
if (target
|
|
866
|
+
if (!isInside(target, baseResolved)) {
|
|
862
867
|
throw new PathTraversalError(parts.join("/"), target);
|
|
863
868
|
}
|
|
864
869
|
return target;
|
|
@@ -883,7 +888,7 @@ function assertNoSymlinkEscape(path, base) {
|
|
|
883
888
|
}
|
|
884
889
|
const resolved = realpathOfDeepestExisting(path);
|
|
885
890
|
if (resolved === void 0) return;
|
|
886
|
-
if (resolved
|
|
891
|
+
if (!isInside(resolved, baseResolved)) {
|
|
887
892
|
throw new PathTraversalError(`symlink ${path}`, resolved);
|
|
888
893
|
}
|
|
889
894
|
}
|
|
@@ -17165,9 +17170,7 @@ async function loadDriver(filePath) {
|
|
|
17165
17170
|
}
|
|
17166
17171
|
try {
|
|
17167
17172
|
const mod = await (driverLoaderOverrides?.nodeSqlite?.() ?? Promise.resolve(
|
|
17168
|
-
process.getBuiltinModule?.(
|
|
17169
|
-
"node:sqlite"
|
|
17170
|
-
) ?? (() => {
|
|
17173
|
+
process.getBuiltinModule?.("node:sqlite") ?? (() => {
|
|
17171
17174
|
throw new Error("node:sqlite built-in unavailable (Node < 22.3)");
|
|
17172
17175
|
})()
|
|
17173
17176
|
));
|
|
@@ -19701,8 +19704,8 @@ async function getRegisteredAgentOrThrow(agentId) {
|
|
|
19701
19704
|
// src/agent.ts
|
|
19702
19705
|
init_errors();
|
|
19703
19706
|
init_discovery();
|
|
19704
|
-
init_agent_factory_registry();
|
|
19705
19707
|
init_agent_session();
|
|
19708
|
+
init_agent_factory_registry();
|
|
19706
19709
|
var streamObjectImport;
|
|
19707
19710
|
var Agent = class _Agent {
|
|
19708
19711
|
constructor() {
|
|
@@ -19994,9 +19997,7 @@ var Agent = class _Agent {
|
|
|
19994
19997
|
reg = getRegisteredAgent(agentId);
|
|
19995
19998
|
}
|
|
19996
19999
|
if (reg === void 0 || reg.runtime !== "local") {
|
|
19997
|
-
throw new UnknownAgentError(
|
|
19998
|
-
`No local agent "${agentId}" registered \u2014 compact targets local sessions.`
|
|
19999
|
-
);
|
|
20000
|
+
throw new UnknownAgentError(`No local agent "${agentId}" registered \u2014 compact targets local sessions.`);
|
|
20000
20001
|
}
|
|
20001
20002
|
const cwd = reg.cwd ?? process.cwd();
|
|
20002
20003
|
const optModel = reg.options.model;
|
|
@@ -20006,20 +20007,16 @@ var Agent = class _Agent {
|
|
|
20006
20007
|
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await Promise.resolve().then(() => (init_session_transcript(), session_transcript_exports));
|
|
20007
20008
|
const baseDir = reg.options.local?.baseDir !== void 0 ? expandTilde2(reg.options.local.baseDir) : defaultBaseDir2();
|
|
20008
20009
|
const store = new FsSessionStore2({ baseDir, cwd });
|
|
20009
|
-
return enqueueSessionWrite(
|
|
20010
|
-
|
|
20011
|
-
agentId,
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20017
|
-
summarize: options.summarize ?? buildDefaultSummarizer2({
|
|
20018
|
-
agentModel: model,
|
|
20019
|
-
...reg.options.apiKey !== void 0 ? { apiKey: reg.options.apiKey } : {}
|
|
20020
|
-
})
|
|
20010
|
+
return enqueueSessionWrite(cwd, agentId, () => compactSessionTranscript2({
|
|
20011
|
+
store,
|
|
20012
|
+
loc: { cwd, agentId, model },
|
|
20013
|
+
sessionId: agentId,
|
|
20014
|
+
trigger: options.trigger ?? "manual",
|
|
20015
|
+
summarize: options.summarize ?? buildDefaultSummarizer2({
|
|
20016
|
+
agentModel: model,
|
|
20017
|
+
...reg.options.apiKey !== void 0 ? { apiKey: reg.options.apiKey } : {}
|
|
20021
20018
|
})
|
|
20022
|
-
);
|
|
20019
|
+
}));
|
|
20023
20020
|
}
|
|
20024
20021
|
/**
|
|
20025
20022
|
* M51 — inject a SYNTHETIC user+assistant pair into a LOCAL session's persisted transcript WITHOUT
|
|
@@ -20036,9 +20033,7 @@ var Agent = class _Agent {
|
|
|
20036
20033
|
reg = getRegisteredAgent(agentId);
|
|
20037
20034
|
}
|
|
20038
20035
|
if (reg === void 0 || reg.runtime !== "local") {
|
|
20039
|
-
throw new UnknownAgentError(
|
|
20040
|
-
`No local agent "${agentId}" registered \u2014 injectSessionTurn targets local sessions.`
|
|
20041
|
-
);
|
|
20036
|
+
throw new UnknownAgentError(`No local agent "${agentId}" registered \u2014 injectSessionTurn targets local sessions.`);
|
|
20042
20037
|
}
|
|
20043
20038
|
const cwd = reg.cwd ?? process.cwd();
|
|
20044
20039
|
const optModel = reg.options.model;
|