@theokit/sdk 4.17.1 → 4.18.1
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-B_vVYc-_.d.ts → cron-DOW3f-Xu.d.ts} +11 -3
- package/dist/{cron-Dj8FAU5V.d.cts → cron-DvP-E6Xx.d.cts} +11 -3
- package/dist/cron.cjs +84 -10
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +1 -1
- package/dist/cron.d.ts +1 -1
- package/dist/cron.js +84 -10
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +84 -10
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +84 -10
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +84 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +84 -10
- package/dist/index.js.map +1 -1
- package/dist/types/goal-events.d.ts +11 -3
- package/package.json +12 -13
|
@@ -49,7 +49,7 @@ export type GoalEvent = {
|
|
|
49
49
|
prompt: string;
|
|
50
50
|
} | {
|
|
51
51
|
type: "status_change";
|
|
52
|
-
status: "active" | "paused" | "completed" | "failed";
|
|
52
|
+
status: "active" | "paused" | "completed" | "failed" | "budget_limited" | "blocked";
|
|
53
53
|
reason: string;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
@@ -59,8 +59,10 @@ export type GoalEvent = {
|
|
|
59
59
|
* @public
|
|
60
60
|
*/
|
|
61
61
|
export interface GoalResult {
|
|
62
|
-
status: "completed" | "failed" | "paused";
|
|
62
|
+
status: "completed" | "failed" | "paused" | "budget_limited" | "blocked";
|
|
63
63
|
turnsUsed: number;
|
|
64
|
+
/** M55 — tokens somados ao longo do loop (0 quando `usage` esteve ausente — fail-open). */
|
|
65
|
+
tokensUsed: number;
|
|
64
66
|
finalResponse: string | undefined;
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
@@ -76,8 +78,14 @@ export type RunUntilIterator = AsyncGenerator<GoalEvent, GoalResult, void>;
|
|
|
76
78
|
* @public
|
|
77
79
|
*/
|
|
78
80
|
export interface GoalOptions {
|
|
79
|
-
/** Hard cap on iterations. Default `20`. */
|
|
81
|
+
/** Hard cap on iterations (safety net against runaway). Default `20`. */
|
|
80
82
|
maxTurns?: number;
|
|
83
|
+
/**
|
|
84
|
+
* M55 — token budget (Codex ext/goal parity, tool.rs:454-465). Soma `run.wait().usage.totalTokens`
|
|
85
|
+
* por turno; ao cruzar, o loop para com status `budget_limited`. Omitido ⇒ ilimitado (só maxTurns).
|
|
86
|
+
* `usage` ausente nunca estoura o budget (fail-open).
|
|
87
|
+
*/
|
|
88
|
+
tokenBudget?: number;
|
|
81
89
|
/** Bail after N consecutive judge parse failures. Default `3` (ADR D121). */
|
|
82
90
|
maxConsecutiveJudgeFailures?: number;
|
|
83
91
|
/** Judge model identifier. Default `"openai/gpt-4o-mini"` (ADR D119). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theokit/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.1",
|
|
4
4
|
"description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/usetheodev/theokit-sdk#readme",
|
|
@@ -319,17 +319,6 @@
|
|
|
319
319
|
"**/agent.js",
|
|
320
320
|
"**/agent.cjs"
|
|
321
321
|
],
|
|
322
|
-
"scripts": {
|
|
323
|
-
"build": "tsup && cp src/internal/providers/provider-catalog.json dist/provider-catalog.json && node scripts/copy-docs.mjs",
|
|
324
|
-
"test": "vitest run --no-file-parallelism",
|
|
325
|
-
"test:watch": "vitest",
|
|
326
|
-
"eval": "vitest run --no-file-parallelism tests/eval/suites",
|
|
327
|
-
"test:contract": "vitest run --no-file-parallelism tests/theokit-consumer-contract.test.ts",
|
|
328
|
-
"prepublishOnly": "pnpm build && pnpm test:contract",
|
|
329
|
-
"typecheck": "tsc --noEmit",
|
|
330
|
-
"clean": "rm -rf dist",
|
|
331
|
-
"docs:json": "typedoc --options typedoc.json"
|
|
332
|
-
},
|
|
333
322
|
"peerDependencies": {
|
|
334
323
|
"@lancedb/lancedb": "^0.30.0",
|
|
335
324
|
"@types/ws": ">=8.0.0",
|
|
@@ -397,5 +386,15 @@
|
|
|
397
386
|
"typedoc": "^0.28.19",
|
|
398
387
|
"ws": "^8.18.0",
|
|
399
388
|
"zod": "^4.0.0"
|
|
389
|
+
},
|
|
390
|
+
"scripts": {
|
|
391
|
+
"build": "tsup && cp src/internal/providers/provider-catalog.json dist/provider-catalog.json && node scripts/copy-docs.mjs",
|
|
392
|
+
"test": "vitest run --no-file-parallelism",
|
|
393
|
+
"test:watch": "vitest",
|
|
394
|
+
"eval": "vitest run --no-file-parallelism tests/eval/suites",
|
|
395
|
+
"test:contract": "vitest run --no-file-parallelism tests/theokit-consumer-contract.test.ts",
|
|
396
|
+
"typecheck": "tsc --noEmit",
|
|
397
|
+
"clean": "rm -rf dist",
|
|
398
|
+
"docs:json": "typedoc --options typedoc.json"
|
|
400
399
|
}
|
|
401
|
-
}
|
|
400
|
+
}
|