@theokit/sdk 5.15.2 → 5.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{agent-D6WBBNGR.cjs → agent-LTJYDRWI.cjs} +6 -6
- package/dist/{agent-D6WBBNGR.cjs.map → agent-LTJYDRWI.cjs.map} +1 -1
- package/dist/{agent-QRIFX2SY.js → agent-MOSFFVPU.js} +5 -5
- package/dist/{agent-QRIFX2SY.js.map → agent-MOSFFVPU.js.map} +1 -1
- package/dist/{chunk-6XT5LAZG.cjs → chunk-3ZRJ4RNB.cjs} +46 -7
- package/dist/chunk-3ZRJ4RNB.cjs.map +1 -0
- package/dist/{chunk-PSMWZYW6.js → chunk-4OMRDNPY.js} +3 -3
- package/dist/{chunk-PSMWZYW6.js.map → chunk-4OMRDNPY.js.map} +1 -1
- package/dist/{chunk-ATGSV4GS.js → chunk-4TTR63O7.js} +3 -3
- package/dist/{chunk-ATGSV4GS.js.map → chunk-4TTR63O7.js.map} +1 -1
- package/dist/{chunk-JRQJMZKY.js → chunk-HFEAU2L2.js} +44 -5
- package/dist/chunk-HFEAU2L2.js.map +1 -0
- package/dist/{chunk-BTGYRM4J.cjs → chunk-LAZTNGNR.cjs} +49 -49
- package/dist/{chunk-BTGYRM4J.cjs.map → chunk-LAZTNGNR.cjs.map} +1 -1
- package/dist/{chunk-PDFSLD5P.cjs → chunk-QJVTDW3G.cjs} +3 -3
- package/dist/{chunk-PDFSLD5P.cjs.map → chunk-QJVTDW3G.cjs.map} +1 -1
- package/dist/{chunk-VT3NWHFH.cjs → chunk-RB3ZMMUU.cjs} +4 -4
- package/dist/{chunk-VT3NWHFH.cjs.map → chunk-RB3ZMMUU.cjs.map} +1 -1
- package/dist/{chunk-CG64VPPU.js → chunk-WAKGYSQ6.js} +6 -6
- package/dist/{chunk-CG64VPPU.js.map → chunk-WAKGYSQ6.js.map} +1 -1
- package/dist/{compact-session-5DWFHMW4.cjs → compact-session-PIDZQ7AR.cjs} +12 -12
- package/dist/{compact-session-5DWFHMW4.cjs.map → compact-session-PIDZQ7AR.cjs.map} +1 -1
- package/dist/{compact-session-AL65PEMX.js → compact-session-ZPEJSTLA.js} +3 -3
- package/dist/{compact-session-AL65PEMX.js.map → compact-session-ZPEJSTLA.js.map} +1 -1
- package/dist/cron.cjs +5 -5
- package/dist/cron.js +4 -4
- package/dist/eval.cjs +4 -4
- package/dist/eval.js +3 -3
- package/dist/index.cjs +31 -31
- package/dist/index.js +7 -7
- package/dist/{inject-session-E2SZ4A35.js → inject-session-OMBJKMVD.js} +3 -3
- package/dist/{inject-session-E2SZ4A35.js.map → inject-session-OMBJKMVD.js.map} +1 -1
- package/dist/{inject-session-QZULG65O.cjs → inject-session-Z2HIB6P6.cjs} +4 -4
- package/dist/{inject-session-QZULG65O.cjs.map → inject-session-Z2HIB6P6.cjs.map} +1 -1
- package/dist/internal/llm/openai.d.ts +2 -0
- package/dist/internal/llm/responses.d.ts +2 -0
- package/dist/internal/llm/sse.d.ts +6 -0
- package/docs/error-codes.md +5 -4
- package/package.json +1 -1
- package/dist/chunk-6XT5LAZG.cjs.map +0 -1
- package/dist/chunk-JRQJMZKY.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3ZRJ4RNB_cjs = require('./chunk-3ZRJ4RNB.cjs');
|
|
4
4
|
require('./chunk-MJGY3E3C.cjs');
|
|
5
5
|
require('./chunk-YJNYDJ2T.cjs');
|
|
6
6
|
require('./chunk-3F53FLQ7.cjs');
|
|
@@ -28,39 +28,39 @@ require('./chunk-RNXXYF22.cjs');
|
|
|
28
28
|
|
|
29
29
|
Object.defineProperty(exports, "COMPACT_SUMMARY_MARKER", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk3ZRJ4RNB_cjs.COMPACT_SUMMARY_MARKER; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "COMPACT_USER_MESSAGE_MAX_TOKENS", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunk3ZRJ4RNB_cjs.COMPACT_USER_MESSAGE_MAX_TOKENS; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "DEFAULT_PRE_COMPACT_TIMEOUT_MS", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk3ZRJ4RNB_cjs.DEFAULT_PRE_COMPACT_TIMEOUT_MS; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "autoCompactIfNeeded", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk3ZRJ4RNB_cjs.autoCompactIfNeeded; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "buildDefaultSummarizer", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk3ZRJ4RNB_cjs.buildDefaultSummarizer; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "compactSessionTranscript", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk3ZRJ4RNB_cjs.compactSessionTranscript; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "isCompactSummary", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk3ZRJ4RNB_cjs.isCompactSummary; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "resolveSummarizerRoute", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk3ZRJ4RNB_cjs.resolveSummarizerRoute; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "shouldAutoCompact", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk3ZRJ4RNB_cjs.shouldAutoCompact; }
|
|
64
64
|
});
|
|
65
|
-
//# sourceMappingURL=compact-session-
|
|
66
|
-
//# sourceMappingURL=compact-session-
|
|
65
|
+
//# sourceMappingURL=compact-session-PIDZQ7AR.cjs.map
|
|
66
|
+
//# sourceMappingURL=compact-session-PIDZQ7AR.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-PIDZQ7AR.cjs"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, DEFAULT_PRE_COMPACT_TIMEOUT_MS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-
|
|
1
|
+
export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, DEFAULT_PRE_COMPACT_TIMEOUT_MS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-HFEAU2L2.js';
|
|
2
2
|
import './chunk-OIOSY5G6.js';
|
|
3
3
|
import './chunk-2XC6KDJM.js';
|
|
4
4
|
import './chunk-7ACS6P5Z.js';
|
|
@@ -21,5 +21,5 @@ import './chunk-5IUDICRK.js';
|
|
|
21
21
|
import './chunk-Q7GYMXVC.js';
|
|
22
22
|
import './chunk-TNFOU6SB.js';
|
|
23
23
|
import './chunk-3OY6H3I7.js';
|
|
24
|
-
//# sourceMappingURL=compact-session-
|
|
25
|
-
//# sourceMappingURL=compact-session-
|
|
24
|
+
//# sourceMappingURL=compact-session-ZPEJSTLA.js.map
|
|
25
|
+
//# sourceMappingURL=compact-session-ZPEJSTLA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-ZPEJSTLA.js"}
|
package/dist/cron.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkRB3ZMMUU_cjs = require('./chunk-RB3ZMMUU.cjs');
|
|
4
|
+
require('./chunk-LAZTNGNR.cjs');
|
|
5
5
|
require('./chunk-ER3BF23R.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-QJVTDW3G.cjs');
|
|
7
7
|
require('./chunk-PNL63WDP.cjs');
|
|
8
8
|
require('./chunk-HI5TJWQE.cjs');
|
|
9
9
|
require('./chunk-NDXZXGVP.cjs');
|
|
@@ -13,7 +13,7 @@ require('./chunk-GHX4P3V2.cjs');
|
|
|
13
13
|
require('./chunk-EBX6XUN7.cjs');
|
|
14
14
|
require('./chunk-KC2HKUPT.cjs');
|
|
15
15
|
require('./chunk-N2ORTDSO.cjs');
|
|
16
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-3ZRJ4RNB.cjs');
|
|
17
17
|
require('./chunk-MJGY3E3C.cjs');
|
|
18
18
|
require('./chunk-YJNYDJ2T.cjs');
|
|
19
19
|
require('./chunk-3F53FLQ7.cjs');
|
|
@@ -67,7 +67,7 @@ require('./chunk-RNXXYF22.cjs');
|
|
|
67
67
|
|
|
68
68
|
Object.defineProperty(exports, "Cron", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkRB3ZMMUU_cjs.Cron; }
|
|
71
71
|
});
|
|
72
72
|
//# sourceMappingURL=cron.cjs.map
|
|
73
73
|
//# sourceMappingURL=cron.cjs.map
|
package/dist/cron.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Cron } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { Cron } from './chunk-4TTR63O7.js';
|
|
2
|
+
import './chunk-WAKGYSQ6.js';
|
|
3
3
|
import './chunk-GEQLHBJM.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-4OMRDNPY.js';
|
|
5
5
|
import './chunk-3GQYMKVJ.js';
|
|
6
6
|
import './chunk-L5B7EWWH.js';
|
|
7
7
|
import './chunk-ZUWVO442.js';
|
|
@@ -11,7 +11,7 @@ import './chunk-H73MEMQB.js';
|
|
|
11
11
|
import './chunk-BH6M2DGV.js';
|
|
12
12
|
import './chunk-DB5RYCXX.js';
|
|
13
13
|
import './chunk-P7B64NFK.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-HFEAU2L2.js';
|
|
15
15
|
import './chunk-OIOSY5G6.js';
|
|
16
16
|
import './chunk-2XC6KDJM.js';
|
|
17
17
|
import './chunk-7ACS6P5Z.js';
|
package/dist/eval.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkX2XLSE2N_cjs = require('./chunk-X2XLSE2N.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkLAZTNGNR_cjs = require('./chunk-LAZTNGNR.cjs');
|
|
5
5
|
require('./chunk-ER3BF23R.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-QJVTDW3G.cjs');
|
|
7
7
|
var chunkPNL63WDP_cjs = require('./chunk-PNL63WDP.cjs');
|
|
8
8
|
require('./chunk-HI5TJWQE.cjs');
|
|
9
9
|
require('./chunk-NDXZXGVP.cjs');
|
|
@@ -13,7 +13,7 @@ require('./chunk-GHX4P3V2.cjs');
|
|
|
13
13
|
require('./chunk-EBX6XUN7.cjs');
|
|
14
14
|
require('./chunk-KC2HKUPT.cjs');
|
|
15
15
|
require('./chunk-N2ORTDSO.cjs');
|
|
16
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-3ZRJ4RNB.cjs');
|
|
17
17
|
require('./chunk-MJGY3E3C.cjs');
|
|
18
18
|
require('./chunk-YJNYDJ2T.cjs');
|
|
19
19
|
require('./chunk-3F53FLQ7.cjs');
|
|
@@ -800,7 +800,7 @@ function makeDefaultEmbedder(opts) {
|
|
|
800
800
|
let runtime;
|
|
801
801
|
return (texts) => {
|
|
802
802
|
if (runtime === void 0) {
|
|
803
|
-
runtime =
|
|
803
|
+
runtime = chunkLAZTNGNR_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
|
|
804
804
|
}
|
|
805
805
|
return runtime.then((rt) => rt.embed(texts));
|
|
806
806
|
};
|
package/dist/eval.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { shellEscapePosix, LocalSandbox } from './chunk-EF5IONLL.js';
|
|
2
|
-
import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-
|
|
2
|
+
import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-WAKGYSQ6.js';
|
|
3
3
|
import './chunk-GEQLHBJM.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-4OMRDNPY.js';
|
|
5
5
|
import { getTracer } from './chunk-3GQYMKVJ.js';
|
|
6
6
|
import './chunk-L5B7EWWH.js';
|
|
7
7
|
import './chunk-ZUWVO442.js';
|
|
@@ -11,7 +11,7 @@ import './chunk-H73MEMQB.js';
|
|
|
11
11
|
import './chunk-BH6M2DGV.js';
|
|
12
12
|
import './chunk-DB5RYCXX.js';
|
|
13
13
|
import './chunk-P7B64NFK.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-HFEAU2L2.js';
|
|
15
15
|
import './chunk-OIOSY5G6.js';
|
|
16
16
|
import './chunk-2XC6KDJM.js';
|
|
17
17
|
import './chunk-7ACS6P5Z.js';
|
package/dist/index.cjs
CHANGED
|
@@ -10,10 +10,10 @@ var chunk4JF52NED_cjs = require('./chunk-4JF52NED.cjs');
|
|
|
10
10
|
require('./chunk-D3BL3EEB.cjs');
|
|
11
11
|
var chunkERBKPA2N_cjs = require('./chunk-ERBKPA2N.cjs');
|
|
12
12
|
require('./chunk-VTYY7XL5.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var chunkRB3ZMMUU_cjs = require('./chunk-RB3ZMMUU.cjs');
|
|
14
|
+
var chunkLAZTNGNR_cjs = require('./chunk-LAZTNGNR.cjs');
|
|
15
15
|
var chunkER3BF23R_cjs = require('./chunk-ER3BF23R.cjs');
|
|
16
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-QJVTDW3G.cjs');
|
|
17
17
|
require('./chunk-PNL63WDP.cjs');
|
|
18
18
|
require('./chunk-HI5TJWQE.cjs');
|
|
19
19
|
require('./chunk-NDXZXGVP.cjs');
|
|
@@ -23,7 +23,7 @@ require('./chunk-GHX4P3V2.cjs');
|
|
|
23
23
|
require('./chunk-EBX6XUN7.cjs');
|
|
24
24
|
var chunkKC2HKUPT_cjs = require('./chunk-KC2HKUPT.cjs');
|
|
25
25
|
var chunkN2ORTDSO_cjs = require('./chunk-N2ORTDSO.cjs');
|
|
26
|
-
var
|
|
26
|
+
var chunk3ZRJ4RNB_cjs = require('./chunk-3ZRJ4RNB.cjs');
|
|
27
27
|
require('./chunk-MJGY3E3C.cjs');
|
|
28
28
|
require('./chunk-YJNYDJ2T.cjs');
|
|
29
29
|
require('./chunk-3F53FLQ7.cjs');
|
|
@@ -81,8 +81,8 @@ var node_os = require('node:os');
|
|
|
81
81
|
// src/agent-factory.ts
|
|
82
82
|
function createAgentFactory(common) {
|
|
83
83
|
return {
|
|
84
|
-
forSession: (agentId, overrides) =>
|
|
85
|
-
getOrCreate: (agentId, overrides) =>
|
|
84
|
+
forSession: (agentId, overrides) => chunkLAZTNGNR_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
|
|
85
|
+
getOrCreate: (agentId, overrides) => chunkLAZTNGNR_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
function mergeAgentOptions(common, overrides, agentId) {
|
|
@@ -1100,7 +1100,7 @@ var Memory = {
|
|
|
1100
1100
|
return await peer.IndexManager.open(openArgs);
|
|
1101
1101
|
}
|
|
1102
1102
|
const { IndexManager } = await import('./index-manager-CT6MMG7S.cjs');
|
|
1103
|
-
openArgs.embedding = await resolveEmbedding(opts.embedding,
|
|
1103
|
+
openArgs.embedding = await resolveEmbedding(opts.embedding, chunkLAZTNGNR_cjs.MEMORY_EMBEDDING_ADAPTERS);
|
|
1104
1104
|
return await IndexManager.open(openArgs);
|
|
1105
1105
|
},
|
|
1106
1106
|
/**
|
|
@@ -1111,7 +1111,7 @@ var Memory = {
|
|
|
1111
1111
|
*/
|
|
1112
1112
|
async runDreamingSweep(opts) {
|
|
1113
1113
|
const peer = await tryLoadSdkMemoryPeer();
|
|
1114
|
-
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS :
|
|
1114
|
+
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkLAZTNGNR_cjs.MEMORY_EMBEDDING_ADAPTERS;
|
|
1115
1115
|
const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
|
|
1116
1116
|
const result = peer !== null ? (
|
|
1117
1117
|
// biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
|
|
@@ -1722,7 +1722,7 @@ function guardSessionDestruction(sessionId, live) {
|
|
|
1722
1722
|
// src/session-messages.ts
|
|
1723
1723
|
async function readSessionMessages2(options) {
|
|
1724
1724
|
const cwd = options.cwd ?? process.cwd();
|
|
1725
|
-
const baseDir =
|
|
1725
|
+
const baseDir = chunkLAZTNGNR_cjs.resolveSessionDir({ sessionDir: options.sessionDir });
|
|
1726
1726
|
return chunkEOWIUDKG_cjs.readSessionMessages(new chunkN2ORTDSO_cjs.FsSessionStore({ baseDir, cwd }), options.sessionId);
|
|
1727
1727
|
}
|
|
1728
1728
|
|
|
@@ -1739,7 +1739,7 @@ function isBuiltAgent(m) {
|
|
|
1739
1739
|
return typeof m.send === "function";
|
|
1740
1740
|
}
|
|
1741
1741
|
async function materialize(def, index) {
|
|
1742
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1742
|
+
const { Agent: Agent2 } = await import('./agent-LTJYDRWI.cjs');
|
|
1743
1743
|
return Agent2.create({
|
|
1744
1744
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1745
1745
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -1881,7 +1881,7 @@ var FIXTURE_USER = {
|
|
|
1881
1881
|
};
|
|
1882
1882
|
var FIXTURE_MODELS = [
|
|
1883
1883
|
{
|
|
1884
|
-
id:
|
|
1884
|
+
id: chunkLAZTNGNR_cjs.DEFAULT_AGENTIC_MODEL_ID,
|
|
1885
1885
|
name: "Gemini 2.0 Flash",
|
|
1886
1886
|
displayName: "Gemini 2.0 Flash",
|
|
1887
1887
|
parameters: [
|
|
@@ -1957,7 +1957,7 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
|
|
|
1957
1957
|
try {
|
|
1958
1958
|
response = await fetch(url, { method: "GET" });
|
|
1959
1959
|
} catch (fetchErr) {
|
|
1960
|
-
const mapped =
|
|
1960
|
+
const mapped = chunk3ZRJ4RNB_cjs.mapOllamaTransportError({
|
|
1961
1961
|
providerId: "ollama",
|
|
1962
1962
|
cause: fetchErr,
|
|
1963
1963
|
endpoint: "/v1/models"
|
|
@@ -1969,8 +1969,8 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
|
|
|
1969
1969
|
);
|
|
1970
1970
|
}
|
|
1971
1971
|
if (!response.ok) {
|
|
1972
|
-
const body = await
|
|
1973
|
-
const mapped =
|
|
1972
|
+
const body = await chunk3ZRJ4RNB_cjs.readErrorResponseBody(response);
|
|
1973
|
+
const mapped = chunk3ZRJ4RNB_cjs.mapOllamaHttpError({
|
|
1974
1974
|
providerId: "ollama",
|
|
1975
1975
|
status: response.status,
|
|
1976
1976
|
body,
|
|
@@ -2084,7 +2084,7 @@ var Theokit = class {
|
|
|
2084
2084
|
envVars: p.envVars
|
|
2085
2085
|
}));
|
|
2086
2086
|
},
|
|
2087
|
-
embeddingAdapters: () => Object.entries(
|
|
2087
|
+
embeddingAdapters: () => Object.entries(chunkLAZTNGNR_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
|
|
2088
2088
|
id,
|
|
2089
2089
|
transport: adapter.transport,
|
|
2090
2090
|
defaultModel: adapter.defaultModel
|
|
@@ -2102,7 +2102,7 @@ var Theokit = class {
|
|
|
2102
2102
|
};
|
|
2103
2103
|
async function maybeListLocalModels(providerName) {
|
|
2104
2104
|
chunkZ5MB2HAN_cjs.registerBuiltins();
|
|
2105
|
-
await
|
|
2105
|
+
await chunk3ZRJ4RNB_cjs.discoverProviderPlugins();
|
|
2106
2106
|
const profile = chunkZ5MB2HAN_cjs.getProviderProfile(providerName);
|
|
2107
2107
|
if (profile === void 0) return void 0;
|
|
2108
2108
|
if (profile.authType !== "none") return void 0;
|
|
@@ -2120,13 +2120,13 @@ async function executeCatalogRequest(request) {
|
|
|
2120
2120
|
if (apiKey === void 0) {
|
|
2121
2121
|
throw new chunkCEGU5AVD_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
|
|
2122
2122
|
}
|
|
2123
|
-
if (
|
|
2123
|
+
if (chunk3ZRJ4RNB_cjs.shouldUseFixtureMode(apiKey)) {
|
|
2124
2124
|
return request.fixture;
|
|
2125
2125
|
}
|
|
2126
|
-
if (!
|
|
2126
|
+
if (!chunk3ZRJ4RNB_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
|
|
2127
2127
|
throw new chunkCEGU5AVD_cjs.AuthenticationError("Invalid API key", { code: "authentication_error" });
|
|
2128
2128
|
}
|
|
2129
|
-
return
|
|
2129
|
+
return chunk3ZRJ4RNB_cjs.httpRequest(request.path, { apiKey });
|
|
2130
2130
|
}
|
|
2131
2131
|
|
|
2132
2132
|
// src/tool-blast-radius.ts
|
|
@@ -2307,43 +2307,43 @@ Object.defineProperty(exports, "SqliteSessionStore", {
|
|
|
2307
2307
|
});
|
|
2308
2308
|
Object.defineProperty(exports, "Cron", {
|
|
2309
2309
|
enumerable: true,
|
|
2310
|
-
get: function () { return
|
|
2310
|
+
get: function () { return chunkRB3ZMMUU_cjs.Cron; }
|
|
2311
2311
|
});
|
|
2312
2312
|
Object.defineProperty(exports, "Agent", {
|
|
2313
2313
|
enumerable: true,
|
|
2314
|
-
get: function () { return
|
|
2314
|
+
get: function () { return chunkLAZTNGNR_cjs.Agent; }
|
|
2315
2315
|
});
|
|
2316
2316
|
Object.defineProperty(exports, "AgentBuilder", {
|
|
2317
2317
|
enumerable: true,
|
|
2318
|
-
get: function () { return
|
|
2318
|
+
get: function () { return chunkLAZTNGNR_cjs.AgentBuilder; }
|
|
2319
2319
|
});
|
|
2320
2320
|
Object.defineProperty(exports, "Tool", {
|
|
2321
2321
|
enumerable: true,
|
|
2322
|
-
get: function () { return
|
|
2322
|
+
get: function () { return chunkLAZTNGNR_cjs.Tool; }
|
|
2323
2323
|
});
|
|
2324
2324
|
Object.defineProperty(exports, "ToolError", {
|
|
2325
2325
|
enumerable: true,
|
|
2326
|
-
get: function () { return
|
|
2326
|
+
get: function () { return chunkLAZTNGNR_cjs.ToolError; }
|
|
2327
2327
|
});
|
|
2328
2328
|
Object.defineProperty(exports, "UsageAccumulator", {
|
|
2329
2329
|
enumerable: true,
|
|
2330
|
-
get: function () { return
|
|
2330
|
+
get: function () { return chunkLAZTNGNR_cjs.UsageAccumulator; }
|
|
2331
2331
|
});
|
|
2332
2332
|
Object.defineProperty(exports, "computeCost", {
|
|
2333
2333
|
enumerable: true,
|
|
2334
|
-
get: function () { return
|
|
2334
|
+
get: function () { return chunkLAZTNGNR_cjs.computeCost; }
|
|
2335
2335
|
});
|
|
2336
2336
|
Object.defineProperty(exports, "getPricingEntry", {
|
|
2337
2337
|
enumerable: true,
|
|
2338
|
-
get: function () { return
|
|
2338
|
+
get: function () { return chunkLAZTNGNR_cjs.getPricingEntry; }
|
|
2339
2339
|
});
|
|
2340
2340
|
Object.defineProperty(exports, "managedSettingsPathFor", {
|
|
2341
2341
|
enumerable: true,
|
|
2342
|
-
get: function () { return
|
|
2342
|
+
get: function () { return chunkLAZTNGNR_cjs.managedSettingsPathFor; }
|
|
2343
2343
|
});
|
|
2344
2344
|
Object.defineProperty(exports, "readManagedSettings", {
|
|
2345
2345
|
enumerable: true,
|
|
2346
|
-
get: function () { return
|
|
2346
|
+
get: function () { return chunkLAZTNGNR_cjs.readManagedSettings; }
|
|
2347
2347
|
});
|
|
2348
2348
|
Object.defineProperty(exports, "emitRunEvent", {
|
|
2349
2349
|
enumerable: true,
|
|
@@ -2351,11 +2351,11 @@ Object.defineProperty(exports, "emitRunEvent", {
|
|
|
2351
2351
|
});
|
|
2352
2352
|
Object.defineProperty(exports, "inferApiMode", {
|
|
2353
2353
|
enumerable: true,
|
|
2354
|
-
get: function () { return
|
|
2354
|
+
get: function () { return chunk3ZRJ4RNB_cjs.inferApiMode; }
|
|
2355
2355
|
});
|
|
2356
2356
|
Object.defineProperty(exports, "normalizeUsage", {
|
|
2357
2357
|
enumerable: true,
|
|
2358
|
-
get: function () { return
|
|
2358
|
+
get: function () { return chunk3ZRJ4RNB_cjs.normalizeUsage; }
|
|
2359
2359
|
});
|
|
2360
2360
|
Object.defineProperty(exports, "withCwdMutex", {
|
|
2361
2361
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -9,12 +9,12 @@ export { Workflow, agentStep, fn } from './chunk-4C37ELQL.js';
|
|
|
9
9
|
import './chunk-PCPYTBVV.js';
|
|
10
10
|
export { SqliteSessionStore } from './chunk-VFT63FJF.js';
|
|
11
11
|
import './chunk-HY66GLM6.js';
|
|
12
|
-
export { Cron } from './chunk-
|
|
13
|
-
import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-
|
|
14
|
-
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-
|
|
12
|
+
export { Cron } from './chunk-4TTR63O7.js';
|
|
13
|
+
import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-WAKGYSQ6.js';
|
|
14
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-WAKGYSQ6.js';
|
|
15
15
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-GEQLHBJM.js';
|
|
16
16
|
export { emitRunEvent } from './chunk-GEQLHBJM.js';
|
|
17
|
-
import './chunk-
|
|
17
|
+
import './chunk-4OMRDNPY.js';
|
|
18
18
|
import './chunk-3GQYMKVJ.js';
|
|
19
19
|
import './chunk-L5B7EWWH.js';
|
|
20
20
|
import './chunk-ZUWVO442.js';
|
|
@@ -24,8 +24,8 @@ import './chunk-H73MEMQB.js';
|
|
|
24
24
|
import './chunk-BH6M2DGV.js';
|
|
25
25
|
import { resolveMemoryRoot } from './chunk-DB5RYCXX.js';
|
|
26
26
|
import { FsSessionStore } from './chunk-P7B64NFK.js';
|
|
27
|
-
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-
|
|
28
|
-
export { inferApiMode, normalizeUsage } from './chunk-
|
|
27
|
+
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-HFEAU2L2.js';
|
|
28
|
+
export { inferApiMode, normalizeUsage } from './chunk-HFEAU2L2.js';
|
|
29
29
|
import './chunk-OIOSY5G6.js';
|
|
30
30
|
import './chunk-2XC6KDJM.js';
|
|
31
31
|
import './chunk-7ACS6P5Z.js';
|
|
@@ -1745,7 +1745,7 @@ function isBuiltAgent(m) {
|
|
|
1745
1745
|
return typeof m.send === "function";
|
|
1746
1746
|
}
|
|
1747
1747
|
async function materialize(def, index) {
|
|
1748
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1748
|
+
const { Agent: Agent2 } = await import('./agent-MOSFFVPU.js');
|
|
1749
1749
|
return Agent2.create({
|
|
1750
1750
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1751
1751
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { enqueueSessionWrite } from './chunk-
|
|
1
|
+
import { enqueueSessionWrite } from './chunk-4OMRDNPY.js';
|
|
2
2
|
import { invalidateSessionCache } from './chunk-2XC6KDJM.js';
|
|
3
3
|
import './chunk-4E4D6H77.js';
|
|
4
4
|
import { SessionTranscript } from './chunk-3VX7JHJI.js';
|
|
@@ -23,5 +23,5 @@ async function injectSessionTurn(opts) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { injectSessionTurn };
|
|
26
|
-
//# sourceMappingURL=inject-session-
|
|
27
|
-
//# sourceMappingURL=inject-session-
|
|
26
|
+
//# sourceMappingURL=inject-session-OMBJKMVD.js.map
|
|
27
|
+
//# sourceMappingURL=inject-session-OMBJKMVD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-OMBJKMVD.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQJVTDW3G_cjs = require('./chunk-QJVTDW3G.cjs');
|
|
4
4
|
var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
|
|
5
5
|
require('./chunk-EOWIUDKG.cjs');
|
|
6
6
|
var chunk6EHOJLJ3_cjs = require('./chunk-6EHOJLJ3.cjs');
|
|
@@ -10,7 +10,7 @@ require('./chunk-RNXXYF22.cjs');
|
|
|
10
10
|
|
|
11
11
|
// src/internal/session/inject-session.ts
|
|
12
12
|
async function injectSessionTurn(opts) {
|
|
13
|
-
await
|
|
13
|
+
await chunkQJVTDW3G_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
|
|
14
14
|
const prior = await opts.store.readRecords(opts.loc.agentId);
|
|
15
15
|
const transcript = chunk6EHOJLJ3_cjs.SessionTranscript.fromRecords(prior, {
|
|
16
16
|
cwd: opts.loc.cwd,
|
|
@@ -25,5 +25,5 @@ async function injectSessionTurn(opts) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
exports.injectSessionTurn = injectSessionTurn;
|
|
28
|
-
//# sourceMappingURL=inject-session-
|
|
29
|
-
//# sourceMappingURL=inject-session-
|
|
28
|
+
//# sourceMappingURL=inject-session-Z2HIB6P6.cjs.map
|
|
29
|
+
//# sourceMappingURL=inject-session-Z2HIB6P6.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-Z2HIB6P6.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
|
|
@@ -12,6 +12,8 @@ export interface OpenAIClientOptions {
|
|
|
12
12
|
baseUrl?: string;
|
|
13
13
|
organization?: string;
|
|
14
14
|
fetch?: typeof fetch;
|
|
15
|
+
/** Bound (ms) on the wait for response headers; default 30 000, `<= 0` disables. */
|
|
16
|
+
responseHeadersTimeoutMs?: number;
|
|
15
17
|
/**
|
|
16
18
|
* Provider name for error mapping dispatch (T1.1, ADR D185). When set
|
|
17
19
|
* to `"ollama"`, transport and HTTP errors go through `mapOllamaTransportError`
|
|
@@ -3,6 +3,8 @@ export interface ResponsesApiClientOptions {
|
|
|
3
3
|
apiKey: string;
|
|
4
4
|
/** e.g. `https://chatgpt.com/backend-api/codex`; the client POSTs `${baseUrl}/responses`. */
|
|
5
5
|
baseUrl?: string;
|
|
6
|
+
/** Bound (ms) on the wait for response headers; default 30 000, `<= 0` disables. */
|
|
7
|
+
responseHeadersTimeoutMs?: number;
|
|
6
8
|
/** Static headers the profile declares (e.g. `ChatGPT-Account-Id`, `originator`). */
|
|
7
9
|
extraHeaders?: Record<string, string>;
|
|
8
10
|
/** Injected fetch (refresh-aware / dynamic headers). Defaults to global `fetch`. */
|
|
@@ -18,4 +18,10 @@ export interface SseRecord {
|
|
|
18
18
|
* FallbackLlmClient / retry can route it. Pass `0` to disable.
|
|
19
19
|
*/
|
|
20
20
|
export declare const DEFAULT_SSE_IDLE_MS = 60000;
|
|
21
|
+
/**
|
|
22
|
+
* Default bound (ms) on the wait for a response's HEADERS. Without it that wait falls to undici's
|
|
23
|
+
* `headersTimeout` (300 s) and a request whose response never starts holds the turn with no retry.
|
|
24
|
+
* Pass `0` (or less) to disable.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_RESPONSE_HEADERS_MS = 30000;
|
|
21
27
|
export declare function parseSseStream(body: ReadableStream<Uint8Array> | null, signal: AbortSignal, idleTimeoutMs?: number): AsyncGenerator<SseRecord, void, void>;
|
package/docs/error-codes.md
CHANGED
|
@@ -6,7 +6,7 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
|
|
|
6
6
|
|
|
7
7
|
**Transport codes vs the rest.** `ErrorCode` in `errors.ts` is the small canonical union a provider failure maps onto — the codes marked *transport* below. Everything else is raised by a specific subsystem at a specific place, and a `catch` that only handles the union will meet them anyway.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
258 distinct code(s).
|
|
10
10
|
|
|
11
11
|
| Code | Kind | Raised by | Sites |
|
|
12
12
|
|---|---|---|---|
|
|
@@ -191,6 +191,7 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
|
|
|
191
191
|
| `redirect_blocked` | domain | — | `packages/sdk-tools/src/internal/network-guard.ts:38` |
|
|
192
192
|
| `repo_provision_failed` | domain | — | `packages/sdk/src/sandbox/provision.ts:33` |
|
|
193
193
|
| `reserved_env_prefix` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:110` |
|
|
194
|
+
| `response_headers_timeout` | domain | NetworkError | `packages/sdk/src/internal/llm/sse.ts:57` |
|
|
194
195
|
| `run_cancelled` | domain | — | `packages/sdk/src/errors.ts:656` |
|
|
195
196
|
| `run_not_found` | domain | UnknownAgentError | `packages/sdk/src/agent.ts:442` |
|
|
196
197
|
| `runtime_exclusive` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:90` |
|
|
@@ -207,9 +208,9 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
|
|
|
207
208
|
| `sse_http_error` | domain | SubscriptionError | `packages/sdk/src/subscription/theokit-subscribe.ts:147` |
|
|
208
209
|
| `sse_server_error` | domain | SubscriptionError | `packages/sdk/src/subscription/theokit-subscribe.ts:155` |
|
|
209
210
|
| `ssrf_blocked` | domain | — | `packages/sdk-tools/src/internal/network-guard.ts:23` |
|
|
210
|
-
| `stream_idle_timeout` | domain | NetworkError | `packages/sdk/src/internal/llm/sse.ts:
|
|
211
|
-
| `stream_malformed_frame` | domain | NetworkError | `packages/sdk/src/internal/llm/anthropic.ts:
|
|
212
|
-
| `stream_truncated` | domain | NetworkError | `packages/sdk/src/internal/llm/anthropic.ts:
|
|
211
|
+
| `stream_idle_timeout` | domain | NetworkError | `packages/sdk/src/internal/llm/sse.ts:145` |
|
|
212
|
+
| `stream_malformed_frame` | domain | NetworkError | `packages/sdk/src/internal/llm/anthropic.ts:234` |
|
|
213
|
+
| `stream_truncated` | domain | NetworkError | `packages/sdk/src/internal/llm/anthropic.ts:194` +1 |
|
|
213
214
|
| `subagent_foreign_runtime_field` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/skills/subagents-loader.ts:245` |
|
|
214
215
|
| `subagent_mcp_unsupported_local` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/skills/subagents-loader.ts:272` |
|
|
215
216
|
| `subagent_missing_description` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:166` |
|
package/package.json
CHANGED