@sweny-ai/core 0.1.177 → 0.1.179
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/agent-env.d.ts +5 -3
- package/dist/agent-env.js +12 -7
- package/dist/cli/config-file.d.ts +22 -1
- package/dist/cli/config-file.js +42 -0
- package/dist/cli/final-output.js +4 -1
- package/dist/cli/main.d.ts +2 -1
- package/dist/cli/main.js +7 -8
- package/dist/cli/resume.d.ts +10 -1
- package/dist/cli/resume.js +77 -7
- package/dist/cli/run-history.d.ts +3 -7
- package/dist/cli/run-history.js +1 -10
- package/dist/cli/run-output.d.ts +16 -10
- package/dist/cli/run-output.js +19 -13
- package/dist/cli/ticket.js +3 -2
- package/dist/decider.d.ts +176 -64
- package/dist/decider.js +475 -155
- package/dist/executor.d.ts +50 -7
- package/dist/executor.js +533 -93
- package/dist/harness/acp.js +2 -0
- package/dist/harness/claude-code.d.ts +18 -0
- package/dist/harness/claude-code.js +51 -6
- package/dist/harness/codex.js +2 -0
- package/dist/harness/pi.js +2 -0
- package/dist/harness/sandbox-wrapper.js +8 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/journal.d.ts +258 -74
- package/dist/journal.js +749 -208
- package/dist/schema.d.ts +189 -241
- package/dist/schema.js +56 -36
- package/dist/skills/github.js +39 -0
- package/dist/types.d.ts +55 -3
- package/dist/types.js +22 -0
- package/dist/when.d.ts +8 -1
- package/dist/when.js +8 -1
- package/dist/workflow-builder.js +3 -1
- package/dist/workflows/browser.js +2 -2
- package/dist/workflows/implement.yml +37 -5
- package/dist/workflows/triage.yml +40 -6
- package/package.json +1 -1
package/dist/executor.d.ts
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
*
|
|
13
13
|
* This replaces ~8k lines of engine + recipe step code.
|
|
14
14
|
*/
|
|
15
|
-
import type { Workflow, Skill, Tool, Claude, Observer, NodeResult, Logger, ExecutionResult } from "./types.js";
|
|
15
|
+
import type { Workflow, Node, Skill, Tool, Claude, Observer, NodeResult, Logger, ExecutionResult, JSONSchema } from "./types.js";
|
|
16
16
|
import type { HarnessPolicyMode } from "./harness/policy.js";
|
|
17
17
|
import type { AgentHarness } from "./harness/types.js";
|
|
18
|
-
import type {
|
|
18
|
+
import type { DeciderOperatorConfig } from "./decider.js";
|
|
19
19
|
import type { Budget } from "./budget.js";
|
|
20
20
|
import { type ActorInfo } from "./safe-outputs.js";
|
|
21
|
-
import type
|
|
21
|
+
import { type ExecutionJournal } from "./journal.js";
|
|
22
22
|
export interface ExecuteOptions {
|
|
23
23
|
/** Registered skills (id → Skill) */
|
|
24
24
|
skills: Map<string, Skill>;
|
|
@@ -106,11 +106,13 @@ export interface ExecuteOptions {
|
|
|
106
106
|
*/
|
|
107
107
|
harnessPolicy?: HarnessPolicyMode;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
109
|
+
* Operator config for the decision model (#357): where it lives and its
|
|
110
|
+
* key. Only nodes with `route_by: decider` consult it. `false` turns it off
|
|
111
|
+
* for this run (CLI `--no-decider`). Undefined: no decider (those nodes are
|
|
112
|
+
* routed by the agent and the receipt says why). Never read from the
|
|
113
|
+
* workflow; the CLI builds it from `.sweny.yml` and SWENY_DECIDER_* env.
|
|
112
114
|
*/
|
|
113
|
-
decider?:
|
|
115
|
+
decider?: DeciderOperatorConfig | false;
|
|
114
116
|
}
|
|
115
117
|
/**
|
|
116
118
|
* Default workflow-level step budget. Counts total node executions across the
|
|
@@ -138,12 +140,52 @@ export declare class RouteEvaluationError extends Error {
|
|
|
138
140
|
readonly node: string;
|
|
139
141
|
constructor(node: string, message: string);
|
|
140
142
|
}
|
|
143
|
+
/** A declared output field the decider may see: a number, an integer, a boolean or a string enum. */
|
|
144
|
+
type RoutableField = {
|
|
145
|
+
kind: "number" | "integer" | "boolean";
|
|
146
|
+
} | {
|
|
147
|
+
kind: "enum";
|
|
148
|
+
values: ReadonlySet<string>;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* The routable fields a node declares: `output.properties` entries typed
|
|
152
|
+
* number, integer or boolean, or a string `enum`. Free-text strings, arrays,
|
|
153
|
+
* objects and anything untyped are never routable.
|
|
154
|
+
*/
|
|
155
|
+
export declare function routableFields(node: Node | undefined): Map<string, RoutableField>;
|
|
156
|
+
/**
|
|
157
|
+
* The state the decision model sees (#357), or null when the decider must be
|
|
158
|
+
* skipped (`no_routable_state`): a condition reads `input.*` (never sent), the
|
|
159
|
+
* routed node declares no routable field, or a condition names a node that
|
|
160
|
+
* declares none. Otherwise: per prior node, its status, its routable declared
|
|
161
|
+
* fields projected to their declared types (successful nodes only) and its
|
|
162
|
+
* eval verdicts. Never the run input, free-text or undeclared data,
|
|
163
|
+
* summaries, tool calls, env or skill config. Redacted with the journal's
|
|
164
|
+
* redactor and fenced as untrusted data.
|
|
165
|
+
*/
|
|
166
|
+
export declare function deciderRoutingState(workflow: Workflow, current: string, results: Map<string, NodeResult>, conditions: string[], secrets: string[]): string | null;
|
|
141
167
|
/**
|
|
142
168
|
* The bounded prompt context for one node: `input` plus its dependencies' entries.
|
|
143
169
|
* Exported for the property tests only; not part of the package API (index.ts does not re-export it).
|
|
144
170
|
* @internal
|
|
145
171
|
*/
|
|
146
172
|
export declare function buildBoundedContext(workflow: Workflow, nodeId: string, results: Map<string, NodeResult>, input: unknown, instruction: string): Record<string, unknown>;
|
|
173
|
+
/** One way a node's emitted data breaks its declared output contract. */
|
|
174
|
+
export interface ContractProblem {
|
|
175
|
+
field: string;
|
|
176
|
+
kind: "missing" | "invalid";
|
|
177
|
+
problem: string;
|
|
178
|
+
}
|
|
179
|
+
/** Keyword on an integer output property: the count sweny cross-checks against an array in the same output. */
|
|
180
|
+
export declare const COUNT_OF_KEYWORD = "x-sweny-count-of";
|
|
181
|
+
/**
|
|
182
|
+
* Check emitted data against the declared output contract (#357): every
|
|
183
|
+
* `required` field present; every present top-level property of its declared
|
|
184
|
+
* `type` and inside its `enum`; and every `x-sweny-count-of` integer equal to
|
|
185
|
+
* the count it declares over its array. Not full JSON Schema: formats,
|
|
186
|
+
* nested shapes and additionalProperties stay the author's concern.
|
|
187
|
+
*/
|
|
188
|
+
export declare function outputContractProblems(data: unknown, output: JSONSchema | undefined): ContractProblem[];
|
|
147
189
|
/**
|
|
148
190
|
* Dry-run tool gate (#380). Only an explicit `access: "read"` passes; a tool
|
|
149
191
|
* with no `access` is treated as a write so new tools fail safe.
|
|
@@ -155,3 +197,4 @@ export declare function isReadTool(tool: Pick<Tool, "access">): boolean;
|
|
|
155
197
|
* any side effect.
|
|
156
198
|
*/
|
|
157
199
|
export declare function guardStagedWrite(tool: Pick<Tool, "name" | "access">, staged: boolean): void;
|
|
200
|
+
export {};
|