@kairos-sdk/core 0.5.1 → 0.6.0
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/README.md +121 -15
- package/dist/{chunk-VPPWTMRJ.js → chunk-2ZHNO37N.js} +48 -4
- package/dist/chunk-2ZHNO37N.js.map +1 -0
- package/dist/chunk-GG4B4TYG.js +153 -0
- package/dist/chunk-GG4B4TYG.js.map +1 -0
- package/dist/{chunk-MYAGTDQ2.js → chunk-PCNW5ZUD.js} +2 -2
- package/dist/chunk-SC6CLQZB.js +144 -0
- package/dist/chunk-SC6CLQZB.js.map +1 -0
- package/dist/chunk-SQS4QHDH.js +44 -0
- package/dist/chunk-SQS4QHDH.js.map +1 -0
- package/dist/{chunk-V2IZBZGB.js → chunk-STG7Z2SS.js} +2 -2
- package/dist/{chunk-GVZKMS53.js → chunk-YOQTEVDB.js} +4 -4
- package/dist/cli.cjs +647 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +239 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +385 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -3
- package/dist/index.d.ts +86 -3
- package/dist/index.js +19 -5
- package/dist/mcp-server.cjs +47 -3
- package/dist/mcp-server.cjs.map +1 -1
- package/dist/mcp-server.js +2 -2
- package/dist/pack-builder-RTQWXGIS.js +9 -0
- package/dist/pack-builder-RTQWXGIS.js.map +1 -0
- package/dist/pack-exporter-KFNLSP5V.js +7 -0
- package/dist/pack-exporter-KFNLSP5V.js.map +1 -0
- package/dist/pack-validator-HZPB2XJ3.js +7 -0
- package/dist/pack-validator-HZPB2XJ3.js.map +1 -0
- package/dist/{reader-B5mV20H6.d.ts → reader-CfWGpL4V.d.cts} +2 -1
- package/dist/{reader-B5mV20H6.d.cts → reader-CfWGpL4V.d.ts} +2 -1
- package/dist/standalone.cjs +43 -3
- package/dist/standalone.cjs.map +1 -1
- package/dist/standalone.d.cts +1 -1
- package/dist/standalone.d.ts +1 -1
- package/dist/standalone.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-VPPWTMRJ.js.map +0 -1
- /package/dist/{chunk-MYAGTDQ2.js.map → chunk-PCNW5ZUD.js.map} +0 -0
- /package/dist/{chunk-V2IZBZGB.js.map → chunk-STG7Z2SS.js.map} +0 -0
- /package/dist/{chunk-GVZKMS53.js.map → chunk-YOQTEVDB.js.map} +0 -0
package/dist/mcp-server.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PromptBuilder,
|
|
4
4
|
inferWorkflowType
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-STG7Z2SS.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_REGISTRY,
|
|
8
8
|
FileLibrary,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
TelemetryReader,
|
|
17
17
|
generateUUID,
|
|
18
18
|
nullLogger
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2ZHNO37N.js";
|
|
20
20
|
|
|
21
21
|
// src/mcp-server.ts
|
|
22
22
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -489,6 +489,7 @@ declare class N8nValidator {
|
|
|
489
489
|
private checkRule31;
|
|
490
490
|
private checkRule32;
|
|
491
491
|
private checkRule33;
|
|
492
|
+
private checkRule35;
|
|
492
493
|
private checkRule34;
|
|
493
494
|
}
|
|
494
495
|
|
|
@@ -593,4 +594,4 @@ declare class TelemetryReader {
|
|
|
593
594
|
private readRecentEvents;
|
|
594
595
|
}
|
|
595
596
|
|
|
596
|
-
export {
|
|
597
|
+
export { type WorkflowMetadataInput as $, ApiError as A, type BuildOptions as B, type ClientOptions as C, DEFAULT_REGISTRY as D, type ExecutionDetail as E, type FailurePattern as F, GenerationError as G, type SyncProgress as H, type ILogger as I, TelemetryCollector as J, KairosError as K, type TelemetryEvent as L, TelemetryReader as M, N8nApiClient as N, type OutcomeData as O, ProviderError as P, TemplateSyncer as Q, ResponseParseError as R, type ScoredEntry as S, type Tag as T, type TrustLevel as U, ValidationError as V, type ValidationIssue as W, type ValidationResult as X, type WorkflowCluster as Y, type WorkflowListItem as Z, type WorkflowMatch as _, type AttemptMetadata as a, buildSearchCorpus as a0, clusterWorkflows as a1, hybridScore as a2, nullLogger as a3, rerank as a4, tokenize as a5, type BuildResult as b, type CredentialRequirement as c, type DeleteOptions as d, type DeployResult as e, type ExecutionFilter as f, type ExecutionSummary as g, FileLibrary as h, GuardError as i, type IProvider as j, type IWorkflowLibrary as k, type N8nConnections as l, N8nFieldStripper as m, type N8nNode as n, N8nProvider as o, type N8nSettings as p, N8nValidator as q, type N8nWorkflow as r, NodeRegistry as s, NullLibrary as t, type OutcomeStats as u, type RuleFailureRate as v, type SmokeTestResult as w, type SmokeTestStatus as x, type SourceKind as y, type StoredWorkflow as z };
|
|
@@ -489,6 +489,7 @@ declare class N8nValidator {
|
|
|
489
489
|
private checkRule31;
|
|
490
490
|
private checkRule32;
|
|
491
491
|
private checkRule33;
|
|
492
|
+
private checkRule35;
|
|
492
493
|
private checkRule34;
|
|
493
494
|
}
|
|
494
495
|
|
|
@@ -593,4 +594,4 @@ declare class TelemetryReader {
|
|
|
593
594
|
private readRecentEvents;
|
|
594
595
|
}
|
|
595
596
|
|
|
596
|
-
export {
|
|
597
|
+
export { type WorkflowMetadataInput as $, ApiError as A, type BuildOptions as B, type ClientOptions as C, DEFAULT_REGISTRY as D, type ExecutionDetail as E, type FailurePattern as F, GenerationError as G, type SyncProgress as H, type ILogger as I, TelemetryCollector as J, KairosError as K, type TelemetryEvent as L, TelemetryReader as M, N8nApiClient as N, type OutcomeData as O, ProviderError as P, TemplateSyncer as Q, ResponseParseError as R, type ScoredEntry as S, type Tag as T, type TrustLevel as U, ValidationError as V, type ValidationIssue as W, type ValidationResult as X, type WorkflowCluster as Y, type WorkflowListItem as Z, type WorkflowMatch as _, type AttemptMetadata as a, buildSearchCorpus as a0, clusterWorkflows as a1, hybridScore as a2, nullLogger as a3, rerank as a4, tokenize as a5, type BuildResult as b, type CredentialRequirement as c, type DeleteOptions as d, type DeployResult as e, type ExecutionFilter as f, type ExecutionSummary as g, FileLibrary as h, GuardError as i, type IProvider as j, type IWorkflowLibrary as k, type N8nConnections as l, N8nFieldStripper as m, type N8nNode as n, N8nProvider as o, type N8nSettings as p, N8nValidator as q, type N8nWorkflow as r, NodeRegistry as s, NullLibrary as t, type OutcomeStats as u, type RuleFailureRate as v, type SmokeTestResult as w, type SmokeTestStatus as x, type SourceKind as y, type StoredWorkflow as z };
|
package/dist/standalone.cjs
CHANGED
|
@@ -1388,6 +1388,7 @@ var N8nValidator = class {
|
|
|
1388
1388
|
this.checkRule32(workflow, issues);
|
|
1389
1389
|
this.checkRule33(workflow, issues);
|
|
1390
1390
|
this.checkRule34(workflow, issues);
|
|
1391
|
+
this.checkRule35(workflow, issues);
|
|
1391
1392
|
if (Array.isArray(workflow.nodes)) {
|
|
1392
1393
|
const nodeById = new Map(workflow.nodes.map((n) => [n.id, n.type]));
|
|
1393
1394
|
for (const issue of issues) {
|
|
@@ -1960,6 +1961,43 @@ var N8nValidator = class {
|
|
|
1960
1961
|
}
|
|
1961
1962
|
}
|
|
1962
1963
|
}
|
|
1964
|
+
// Rule 35 (WARN): email-sending node with no duplicate-prevention signal
|
|
1965
|
+
checkRule35(w, issues) {
|
|
1966
|
+
if (!Array.isArray(w.nodes)) return;
|
|
1967
|
+
const sendNodes = w.nodes.filter((node) => {
|
|
1968
|
+
if (node.type === "n8n-nodes-base.gmail") {
|
|
1969
|
+
const op = node.parameters?.["operation"];
|
|
1970
|
+
return !op || op === "send" || op === "sendEmail" || op === "reply";
|
|
1971
|
+
}
|
|
1972
|
+
return node.type === "n8n-nodes-base.emailSend" || node.type === "n8n-nodes-base.sendEmail";
|
|
1973
|
+
});
|
|
1974
|
+
if (sendNodes.length === 0) return;
|
|
1975
|
+
const workflowText = JSON.stringify(w).toLowerCase();
|
|
1976
|
+
const IDEMPOTENCY_SIGNALS = [
|
|
1977
|
+
"sent_at",
|
|
1978
|
+
"last_sent",
|
|
1979
|
+
"last_reminder",
|
|
1980
|
+
"processed_at",
|
|
1981
|
+
"already_sent",
|
|
1982
|
+
"email_sent",
|
|
1983
|
+
"notified_at",
|
|
1984
|
+
"reminder_sent",
|
|
1985
|
+
"contacted_at",
|
|
1986
|
+
"dedupe",
|
|
1987
|
+
"idempotent"
|
|
1988
|
+
];
|
|
1989
|
+
const hasIdempotencySignal = IDEMPOTENCY_SIGNALS.some((s) => workflowText.includes(s));
|
|
1990
|
+
if (!hasIdempotencySignal) {
|
|
1991
|
+
for (const node of sendNodes) {
|
|
1992
|
+
this.warn(
|
|
1993
|
+
issues,
|
|
1994
|
+
35,
|
|
1995
|
+
`Node "${node.name}" sends email but no duplicate-prevention signal detected \u2014 add a sent_at timestamp field, a prior-send IF check, or a deduplication key to avoid repeat sends`,
|
|
1996
|
+
node.id
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
1963
2001
|
// Rule 34 (WARN): webhook path contains spaces, starts with slash, or looks like a full URL
|
|
1964
2002
|
checkRule34(w, issues) {
|
|
1965
2003
|
if (!Array.isArray(w.nodes)) return;
|
|
@@ -2394,7 +2432,7 @@ var import_node_path5 = require("path");
|
|
|
2394
2432
|
var import_node_os4 = require("os");
|
|
2395
2433
|
|
|
2396
2434
|
// src/validation/rule-metadata.ts
|
|
2397
|
-
var VALIDATOR_RULE_IDS = Array.from({ length:
|
|
2435
|
+
var VALIDATOR_RULE_IDS = Array.from({ length: 35 }, (_, i) => i + 1);
|
|
2398
2436
|
var RULE_PIPELINE_STAGES = {
|
|
2399
2437
|
1: "node_generation",
|
|
2400
2438
|
2: "node_generation",
|
|
@@ -2429,7 +2467,8 @@ var RULE_PIPELINE_STAGES = {
|
|
|
2429
2467
|
31: "node_generation",
|
|
2430
2468
|
32: "node_generation",
|
|
2431
2469
|
33: "node_generation",
|
|
2432
|
-
34: "node_generation"
|
|
2470
|
+
34: "node_generation",
|
|
2471
|
+
35: "node_generation"
|
|
2433
2472
|
};
|
|
2434
2473
|
var RULE_MITIGATIONS = {
|
|
2435
2474
|
1: "Provide a non-empty workflow name string",
|
|
@@ -2465,7 +2504,8 @@ var RULE_MITIGATIONS = {
|
|
|
2465
2504
|
31: "Add at least one condition to the if node \u2014 conditions.conditions array must be non-empty",
|
|
2466
2505
|
32: "Add field assignments to the set node \u2014 assignments.assignments array must be non-empty for typeVersion 3.x",
|
|
2467
2506
|
33: "Add at least one schedule rule to scheduleTrigger \u2014 rule.interval array must have at least one entry",
|
|
2468
|
-
34: 'Webhook path must be a relative path without spaces, leading slashes, or protocol prefixes (e.g. "my-hook")'
|
|
2507
|
+
34: 'Webhook path must be a relative path without spaces, leading slashes, or protocol prefixes (e.g. "my-hook")',
|
|
2508
|
+
35: "Add duplicate-prevention to email-sending workflows: a sent_at timestamp field updated after each send, or an IF node that checks prior-send status before sending"
|
|
2469
2509
|
};
|
|
2470
2510
|
|
|
2471
2511
|
// src/telemetry/pattern-analyzer.ts
|