@sweny-ai/core 0.1.199 → 0.1.201
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/budget.d.ts +77 -11
- package/dist/budget.js +132 -16
- package/dist/cli/config.js +5 -2
- package/dist/cli/deprecated-flags.d.ts +35 -0
- package/dist/cli/deprecated-flags.js +44 -0
- package/dist/cli/renderer.js +5 -0
- package/dist/cli/run-history.d.ts +12 -0
- package/dist/cli/run-history.js +16 -0
- package/dist/cli/run-output.d.ts +16 -1
- package/dist/cli/run-output.js +46 -4
- package/dist/cli/runs.js +38 -1
- package/dist/cli/ticket.js +7 -2
- package/dist/eval/index.d.ts +10 -0
- package/dist/eval/index.js +27 -6
- package/dist/eval/judge.d.ts +3 -0
- package/dist/eval/judge.js +12 -2
- package/dist/executor.js +276 -31
- package/dist/harness/acp.js +4 -1
- package/dist/harness/claude-code.d.ts +3 -1
- package/dist/harness/claude-code.js +4 -1
- package/dist/harness/codex.js +3 -1
- package/dist/harness/compat.js +1 -0
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/harness/pi.js +3 -1
- package/dist/harness/prompts.d.ts +11 -1
- package/dist/harness/prompts.js +21 -2
- package/dist/harness/types.d.ts +9 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/journal.d.ts +48 -10
- package/dist/journal.js +164 -16
- package/dist/safe-outputs.d.ts +9 -0
- package/dist/safe-outputs.js +41 -26
- package/dist/skills/linear.js +3 -1
- package/dist/studio.js +2 -1
- package/dist/types.d.ts +34 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { WorkflowInputs, WorkflowInputField, WorkflowInputType, InputValida
|
|
|
3
3
|
export { WORKFLOW_INPUT_TYPES } from "./inputs.js";
|
|
4
4
|
import type { Source as _Source, ResolvedSource as _ResolvedSource } from "./sources.js";
|
|
5
5
|
import type { ToolClass } from "./harness/types.js";
|
|
6
|
-
import type { Budget, BudgetOverrun } from "./budget.js";
|
|
6
|
+
import type { Budget, BudgetOverrun, SpendBreakdown } from "./budget.js";
|
|
7
7
|
import type { DeciderConfig, DeciderRecord } from "./decider.js";
|
|
8
8
|
export type JSONSchema = Record<string, unknown>;
|
|
9
9
|
/** Context passed to tool handlers at execution time */
|
|
@@ -873,6 +873,16 @@ export type ExecutionEvent = {
|
|
|
873
873
|
type: "node:exit";
|
|
874
874
|
node: string;
|
|
875
875
|
result: NodeResult;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* A finished node's result changed after its `node:exit` (a budget stop at
|
|
879
|
+
* the route that followed it). Not a second exit: consumers that keep each
|
|
880
|
+
* node's final result replace it; timers and step printers ignore it.
|
|
881
|
+
*/
|
|
882
|
+
| {
|
|
883
|
+
type: "node:amended";
|
|
884
|
+
node: string;
|
|
885
|
+
result: NodeResult;
|
|
876
886
|
} | {
|
|
877
887
|
type: "node:progress";
|
|
878
888
|
node: string;
|
|
@@ -951,6 +961,13 @@ export interface ExecutionTrace {
|
|
|
951
961
|
* URL, an open breaker or a spent call cap. Absent when nothing turned it off.
|
|
952
962
|
*/
|
|
953
963
|
deciderOff?: string;
|
|
964
|
+
/**
|
|
965
|
+
* Model spend by kind: agent `node` runs and the executor's own `judge`,
|
|
966
|
+
* `route`, `reflect` (retry reflection) and `screen` completions. Absent
|
|
967
|
+
* unless one of those own completions reported usage. The run budget is
|
|
968
|
+
* over the sum. `node` covers every attempt of every visit.
|
|
969
|
+
*/
|
|
970
|
+
spend?: SpendBreakdown;
|
|
954
971
|
}
|
|
955
972
|
/** Result of execute() — final node results + full execution trace */
|
|
956
973
|
export interface ExecutionResult {
|
|
@@ -1047,6 +1064,14 @@ export interface Claude {
|
|
|
1047
1064
|
timeoutMs?: number;
|
|
1048
1065
|
/** Caller-supplied abort signal. Aborting it interrupts the query. */
|
|
1049
1066
|
signal?: AbortSignal;
|
|
1067
|
+
/**
|
|
1068
|
+
* Called once with the completion's total usage, when the harness reports
|
|
1069
|
+
* it, before the outcome is known (a failed completion was still billed).
|
|
1070
|
+
* Unlike `run`'s `onUsage`, which streams cumulative reports while a node
|
|
1071
|
+
* runs, this is one report per completion. The executor counts it against
|
|
1072
|
+
* the run budget. A hook that throws never changes the result.
|
|
1073
|
+
*/
|
|
1074
|
+
onUsage?: (usage: NodeUsage) => void;
|
|
1050
1075
|
}): Promise<string | null>;
|
|
1051
1076
|
/**
|
|
1052
1077
|
* Single-completion free-text query. No tools, no output schema.
|
|
@@ -1064,6 +1089,14 @@ export interface Claude {
|
|
|
1064
1089
|
timeoutMs?: number;
|
|
1065
1090
|
/** Caller-supplied abort signal. Aborting it interrupts the query. */
|
|
1066
1091
|
signal?: AbortSignal;
|
|
1092
|
+
/**
|
|
1093
|
+
* Called once with the completion's total usage, when the harness reports
|
|
1094
|
+
* it, before the outcome is known (a failed completion was still billed).
|
|
1095
|
+
* Unlike `run`'s `onUsage`, which streams cumulative reports while a node
|
|
1096
|
+
* runs, this is one report per completion. The executor counts it against
|
|
1097
|
+
* the run budget. A hook that throws never changes the result.
|
|
1098
|
+
*/
|
|
1099
|
+
onUsage?: (usage: NodeUsage) => void;
|
|
1067
1100
|
}): Promise<string>;
|
|
1068
1101
|
}
|
|
1069
1102
|
export interface McpServerConfig {
|