@sweny-ai/core 0.1.102 → 0.1.103
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/browser.d.ts +3 -2
- package/dist/browser.js +6 -1
- package/dist/claude.d.ts +66 -3
- package/dist/claude.js +334 -29
- package/dist/cli/check.d.ts +7 -0
- package/dist/cli/check.js +91 -5
- package/dist/cli/config-file.js +5 -1
- package/dist/cli/config.d.ts +11 -0
- package/dist/cli/config.js +19 -1
- package/dist/cli/e2e.d.ts +14 -1
- package/dist/cli/e2e.js +40 -6
- package/dist/cli/main.d.ts +3 -1
- package/dist/cli/main.js +26 -16
- package/dist/cli/new.js +7 -0
- package/dist/eval/value.js +12 -1
- package/dist/executor.d.ts +16 -0
- package/dist/executor.js +81 -18
- package/dist/index.d.ts +8 -4
- package/dist/index.js +10 -2
- package/dist/inputs.js +18 -0
- package/dist/loader.js +15 -1
- package/dist/model.d.ts +11 -0
- package/dist/model.js +19 -0
- package/dist/retry.d.ts +5 -0
- package/dist/retry.js +2 -2
- package/dist/schema.d.ts +163 -6
- package/dist/schema.js +125 -10
- package/dist/skills/custom-loader.d.ts +3 -3
- package/dist/skills/custom-loader.js +50 -14
- package/dist/skills/github.js +8 -2
- package/dist/skills/linear.js +26 -0
- package/dist/skills/notification.d.ts +17 -0
- package/dist/skills/notification.js +67 -5
- package/dist/source-resolver.js +231 -6
- package/dist/sources.d.ts +33 -0
- package/dist/types.d.ts +29 -1
- package/dist/types.js +17 -0
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -275,6 +275,12 @@ export interface Node {
|
|
|
275
275
|
eval_policy?: EvalPolicy;
|
|
276
276
|
/** Default model for judge evaluators on this node. Overrides workflow-level `judge_model`. */
|
|
277
277
|
judge_model?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Execution model for this node's AI invocation. Resolves as
|
|
280
|
+
* `node.model ?? workflow.model ?? client default`. Free-text passthrough
|
|
281
|
+
* (no registry), consistent with `judge_model`.
|
|
282
|
+
*/
|
|
283
|
+
model?: string;
|
|
278
284
|
/** Machine-checked pre-conditions. Enforced by the executor before the LLM runs. */
|
|
279
285
|
requires?: NodeRequires;
|
|
280
286
|
/** Node-local retry on eval failure (with optional autonomous reflection). */
|
|
@@ -301,8 +307,14 @@ export interface Edge {
|
|
|
301
307
|
/**
|
|
302
308
|
* Workflow type discriminator. Cloud uses this to render runs in a
|
|
303
309
|
* type-specific way. Adding a value requires a corresponding renderer.
|
|
310
|
+
*
|
|
311
|
+
* Single source of truth: the Zod enum (`workflowTypeZ`), the published
|
|
312
|
+
* JSON-schema enum (`workflowJsonSchema.properties.workflow_type.enum`),
|
|
313
|
+
* and the `WorkflowType` TS type are all derived from this tuple. See the
|
|
314
|
+
* contract test in `__tests__/contract-tests.test.ts` asserting they agree.
|
|
304
315
|
*/
|
|
305
|
-
export
|
|
316
|
+
export declare const WORKFLOW_TYPES: readonly ["pr_review", "e2e_test", "content_generation", "monitor", "data_sync", "generic"];
|
|
317
|
+
export type WorkflowType = (typeof WORKFLOW_TYPES)[number];
|
|
306
318
|
/** A complete workflow definition. Pure data, fully serializable. */
|
|
307
319
|
export interface Workflow {
|
|
308
320
|
id: string;
|
|
@@ -320,6 +332,8 @@ export interface Workflow {
|
|
|
320
332
|
context?: _Source[];
|
|
321
333
|
/** Default model for judge evaluators across the workflow. Overridable per-node and per-evaluator. */
|
|
322
334
|
judge_model?: string;
|
|
335
|
+
/** Default execution model for every node. Overridable per-node. Free-text passthrough. */
|
|
336
|
+
model?: string;
|
|
323
337
|
/** Soft cap on expected judge calls per workflow run. Warning at load time when exceeded. */
|
|
324
338
|
judge_budget?: number;
|
|
325
339
|
/**
|
|
@@ -483,6 +497,12 @@ export interface Claude {
|
|
|
483
497
|
maxTurns?: number;
|
|
484
498
|
/** Built-in SDK tool names to disallow for this node (e.g. ["Bash"]). */
|
|
485
499
|
disallowedTools?: string[];
|
|
500
|
+
/** Per-node execution model. Overrides the client default when set. Absent = no SDK model option emitted. */
|
|
501
|
+
model?: string;
|
|
502
|
+
/** Abort the query after this many ms. Default: no timeout (back-compat). */
|
|
503
|
+
timeoutMs?: number;
|
|
504
|
+
/** Caller-supplied abort signal. Aborting it interrupts the query. */
|
|
505
|
+
signal?: AbortSignal;
|
|
486
506
|
}): Promise<NodeResult>;
|
|
487
507
|
/** Evaluate a routing condition — pick one of N choices */
|
|
488
508
|
evaluate(opts: {
|
|
@@ -492,6 +512,10 @@ export interface Claude {
|
|
|
492
512
|
id: string;
|
|
493
513
|
description: string;
|
|
494
514
|
}[];
|
|
515
|
+
/** Abort the query after this many ms. Default: no timeout (back-compat). */
|
|
516
|
+
timeoutMs?: number;
|
|
517
|
+
/** Caller-supplied abort signal. Aborting it interrupts the query. */
|
|
518
|
+
signal?: AbortSignal;
|
|
495
519
|
}): Promise<string>;
|
|
496
520
|
/**
|
|
497
521
|
* Single-completion free-text query. No tools, no output schema.
|
|
@@ -505,6 +529,10 @@ export interface Claude {
|
|
|
505
529
|
instruction: string;
|
|
506
530
|
context: Record<string, unknown>;
|
|
507
531
|
model?: string;
|
|
532
|
+
/** Abort the query after this many ms. Default: no timeout (back-compat). */
|
|
533
|
+
timeoutMs?: number;
|
|
534
|
+
/** Caller-supplied abort signal. Aborting it interrupts the query. */
|
|
535
|
+
signal?: AbortSignal;
|
|
508
536
|
}): Promise<string>;
|
|
509
537
|
}
|
|
510
538
|
export interface McpServerConfig {
|
package/dist/types.js
CHANGED
|
@@ -50,6 +50,23 @@ export const EVAL_POLICIES = ["all_pass", "any_pass", "weighted"];
|
|
|
50
50
|
export const REQUIRES_ON_FAIL = ["fail", "skip"];
|
|
51
51
|
/** MCP server transport type. Inferred from command/url when omitted. */
|
|
52
52
|
export const MCP_TRANSPORTS = ["stdio", "http"];
|
|
53
|
+
/**
|
|
54
|
+
* Workflow type discriminator. Cloud uses this to render runs in a
|
|
55
|
+
* type-specific way. Adding a value requires a corresponding renderer.
|
|
56
|
+
*
|
|
57
|
+
* Single source of truth: the Zod enum (`workflowTypeZ`), the published
|
|
58
|
+
* JSON-schema enum (`workflowJsonSchema.properties.workflow_type.enum`),
|
|
59
|
+
* and the `WorkflowType` TS type are all derived from this tuple. See the
|
|
60
|
+
* contract test in `__tests__/contract-tests.test.ts` asserting they agree.
|
|
61
|
+
*/
|
|
62
|
+
export const WORKFLOW_TYPES = [
|
|
63
|
+
"pr_review",
|
|
64
|
+
"e2e_test",
|
|
65
|
+
"content_generation",
|
|
66
|
+
"monitor",
|
|
67
|
+
"data_sync",
|
|
68
|
+
"generic",
|
|
69
|
+
];
|
|
53
70
|
export const consoleLogger = {
|
|
54
71
|
info: (msg, data) => console.log(`[info] ${msg}`, data ?? ""),
|
|
55
72
|
warn: (msg, data) => console.warn(`[warn] ${msg}`, data ?? ""),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sweny-ai/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.103",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sweny": "./dist/cli/main.js"
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"zod": "^3.25.76"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@anthropic-ai/claude-code": "^2.1.
|
|
65
|
-
"ajv": "^8.
|
|
64
|
+
"@anthropic-ai/claude-code": "^2.1.150",
|
|
65
|
+
"ajv": "^8.20.0",
|
|
66
66
|
"esbuild": "^0.28.0",
|
|
67
67
|
"prettier": "^3.8.3",
|
|
68
|
-
"vitest": "^4.1.
|
|
68
|
+
"vitest": "^4.1.7"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|