sfscanner 0.2.0 → 0.2.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.
Files changed (55) hide show
  1. package/README.md +13 -3
  2. package/THIRD_PARTY_NOTICES.md +385 -48
  3. package/dist/_types/contracts/preflight-prerequisite-types.d.ts +73 -0
  4. package/dist/_types/packages/scanner-cli/src/index.d.ts +6 -0
  5. package/dist/_types/packages/scanner-cli/src/v2/arguments.d.ts +102 -0
  6. package/dist/_types/packages/scanner-cli/src/v2/cli-runner.d.ts +22 -0
  7. package/dist/{v2 → _types/packages/scanner-cli/src/v2}/commands.d.ts +6 -2
  8. package/dist/{v2 → _types/packages/scanner-cli/src/v2}/contracts.d.ts +34 -7
  9. package/dist/_types/packages/scanner-cli/src/v2/help.d.ts +64 -0
  10. package/dist/_types/packages/scanner-cli/src/v2/metadata-output.d.ts +37 -0
  11. package/dist/_types/packages/scanner-cli/src/v2/preflight-readiness.d.ts +108 -0
  12. package/dist/_types/packages/scanner-cli/src/v2/privacy-prepare.d.ts +39 -0
  13. package/dist/index.d.ts +1 -4
  14. package/dist/index.js +17285 -1922
  15. package/dist/index.js.map +4 -4
  16. package/dist/main.js +25308 -8016
  17. package/dist/main.js.map +4 -4
  18. package/dist/mcp.js +16987 -1870
  19. package/dist/mcp.js.map +4 -4
  20. package/dist/scan-worker.js +20064 -3162
  21. package/dist/scan-worker.js.map +4 -4
  22. package/dist/v2/arguments.d.ts +1 -87
  23. package/dist/v2/arguments.js +96 -6
  24. package/dist/v2/arguments.js.map +2 -2
  25. package/dist/v2/cli-runner.d.ts +1 -22
  26. package/dist/v2/cli-runner.js +16813 -1772
  27. package/dist/v2/cli-runner.js.map +4 -4
  28. package/dist/v2/help.d.ts +1 -33
  29. package/dist/v2/help.js +28 -7
  30. package/dist/v2/help.js.map +2 -2
  31. package/dist/v2/metadata-output.d.ts +1 -37
  32. package/dist/v2/metadata-output.js +15405 -1469
  33. package/dist/v2/metadata-output.js.map +4 -4
  34. package/dist/v2/preflight-readiness.d.ts +1 -0
  35. package/dist/v2/preflight-readiness.js +447 -0
  36. package/dist/v2/preflight-readiness.js.map +7 -0
  37. package/dist/v2/privacy-prepare.d.ts +1 -0
  38. package/dist/v2/privacy-prepare.js +232 -0
  39. package/dist/v2/privacy-prepare.js.map +7 -0
  40. package/package.json +12 -4
  41. package/dist/v2/atomic-output.d.ts +0 -34
  42. package/dist/v2/batch-runner.d.ts +0 -50
  43. package/dist/v2/cli-runner-internal.d.ts +0 -28
  44. package/dist/v2/config.d.ts +0 -16
  45. package/dist/v2/exit-reducer.d.ts +0 -23
  46. package/dist/v2/input-read.d.ts +0 -26
  47. package/dist/v2/input-selection.d.ts +0 -38
  48. package/dist/v2/json-output.d.ts +0 -97
  49. package/dist/v2/metadata-validation.d.ts +0 -4
  50. package/dist/v2/ndjson-output.d.ts +0 -3
  51. package/dist/v2/path-admission.d.ts +0 -8
  52. package/dist/v2/scan-config-load.d.ts +0 -21
  53. package/dist/v2/scan-worker-host.d.ts +0 -29
  54. package/dist/v2/table-output.d.ts +0 -2
  55. package/dist/v2/worker-host.d.ts +0 -24
@@ -0,0 +1,102 @@
1
+ import { ADMITTED_PROFILE_V2, type ScanConfigV2, type ScanSeverityV2 } from "./contracts.js";
2
+ import type { V2CommandName } from "./help.js";
3
+ export type CliFormatV2 = 'json' | 'ndjson' | 'sarif' | 'table';
4
+ export type CliProfileV2 = typeof ADMITTED_PROFILE_V2.id;
5
+ export type CliTargetEnumV2 = 'UNKNOWN' | 'COMMUNITY' | 'ENTERPRISE' | 'CLOUD' | 'SELF_HOSTED' | 'OWNER' | 'ADMIN' | 'MEMBER' | 'LEGACY' | 'NATIVE';
6
+ export type CliParseErrorCodeV2 = 'NO_COMMAND' | 'UNKNOWN_COMMAND' | 'UNKNOWN_OPTION' | 'MISSING_VALUE' | 'INVALID_VALUE' | 'DUPLICATE_OPTION' | 'UNEXPECTED_ARGUMENT' | 'REMOTE_PATH' | 'RULE_PACK_INVALID' | 'SEMANTIC_CATALOGUE_INVALID' | 'PROFILE_NOT_ADMITTED';
7
+ export type CliParseErrorV2 = Readonly<{
8
+ code: CliParseErrorCodeV2;
9
+ message: string;
10
+ argument?: string;
11
+ }>;
12
+ type ScanCommandV2 = Readonly<{
13
+ kind: 'scan';
14
+ schema: 'v2';
15
+ inputs: readonly string[];
16
+ format: CliFormatV2;
17
+ profile: CliProfileV2;
18
+ failOn: ScanSeverityV2;
19
+ requireComplete: boolean;
20
+ concurrency: number;
21
+ timeoutMs?: number;
22
+ output?: string;
23
+ configPath?: string;
24
+ rules: 'builtin';
25
+ catalogue: 'builtin';
26
+ limits: string;
27
+ target?: string;
28
+ n8nVersion?: string;
29
+ edition: 'COMMUNITY' | 'ENTERPRISE' | 'CLOUD' | 'UNKNOWN';
30
+ deployment: 'SELF_HOSTED' | 'CLOUD' | 'UNKNOWN';
31
+ role: 'OWNER' | 'ADMIN' | 'MEMBER' | 'UNKNOWN';
32
+ taskRunner: 'LEGACY' | 'NATIVE' | 'UNKNOWN';
33
+ communityPackages: readonly string[];
34
+ configuration: readonly string[];
35
+ approvedDomains: readonly string[];
36
+ include: readonly string[];
37
+ exclude: readonly string[];
38
+ allowUnsignedDevelopmentRules: boolean;
39
+ noColor: boolean;
40
+ auditSupplyChain: boolean;
41
+ includeReadiness: boolean;
42
+ cliOverrides: Readonly<Partial<ScanConfigV2>>;
43
+ }>;
44
+ export type CliHelpCommandV2 = Readonly<{
45
+ kind: 'help';
46
+ schema: 'v2';
47
+ command?: V2CommandName;
48
+ }>;
49
+ /** Fix output is JSON-only; the fixed `format` keeps downstream command reducers total. */
50
+ export type CliFixCommandV2 = Readonly<{
51
+ kind: 'fix';
52
+ schema: 'v2';
53
+ action: 'suggest' | 'apply';
54
+ format: 'json';
55
+ root: string;
56
+ input: string;
57
+ fix?: string;
58
+ mapping?: string;
59
+ endpointReceipt?: string;
60
+ confirm: boolean;
61
+ }>;
62
+ export type CliCommandV2 = ScanCommandV2 | CliFixCommandV2 | Readonly<{
63
+ kind: 'rules';
64
+ schema: 'v2';
65
+ format: 'json' | 'table';
66
+ }> | Readonly<{
67
+ kind: 'explain';
68
+ schema: 'v2';
69
+ format: 'json' | 'table';
70
+ ruleId: string;
71
+ }> | Readonly<{
72
+ kind: 'profiles';
73
+ schema: 'v2';
74
+ format: 'json' | 'table';
75
+ }> | Readonly<{
76
+ kind: 'validate-config';
77
+ schema: 'v2';
78
+ format: 'json' | 'table';
79
+ path: string;
80
+ }> | Readonly<{
81
+ kind: 'version';
82
+ schema: 'v2';
83
+ format: 'json' | 'table';
84
+ }>;
85
+ type ParsedCommandV2 = CliCommandV2 | CliHelpCommandV2;
86
+ export type CliParseResultV2 = Readonly<{
87
+ ok: true;
88
+ command: ParsedCommandV2;
89
+ } | {
90
+ ok: false;
91
+ error: CliParseErrorV2;
92
+ }>;
93
+ export type CliArgumentDispatch = Readonly<{
94
+ mode: 'v1';
95
+ argv: readonly string[];
96
+ } | {
97
+ mode: 'v2';
98
+ result: CliParseResultV2;
99
+ }>;
100
+ export declare function parseArgumentsV2(argv: readonly string[]): CliParseResultV2;
101
+ export declare function parseCliArguments(argv: readonly string[]): CliArgumentDispatch;
102
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { CliCommandV2 } from "./arguments.js";
2
+ /** The scan member only: the internal runner does not dispatch metadata commands. */
3
+ export type PublicScanCommandV2 = Extract<CliCommandV2, {
4
+ kind: 'scan';
5
+ }>;
6
+ export type PublicRunOptionsV2 = Readonly<{
7
+ cwd?: string;
8
+ stdin?: string | Uint8Array | AsyncIterable<Uint8Array | string>;
9
+ signal?: AbortSignal;
10
+ }>;
11
+ export type PublicRunResultV2 = Readonly<{
12
+ exitCode: number;
13
+ stdout: string;
14
+ stderr: string;
15
+ document?: unknown;
16
+ }>;
17
+ /**
18
+ * Library entry. The `sfscanner` bin remains the side-effecting CLI; this wrapper forwards only
19
+ * the three consumer options, so an internal read/scan/selection hook is never part of the
20
+ * published surface.
21
+ */
22
+ export declare function runCliV2(command: PublicScanCommandV2, options?: PublicRunOptionsV2): Promise<PublicRunResultV2>;
@@ -1,4 +1,4 @@
1
- import type { CliCommandV2 } from './arguments.js';
1
+ import type { CliCommandV2 } from "./arguments.js";
2
2
  type CliSeverityV2 = 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | 'INFO';
3
3
  type CliConfidenceV2 = 'LOW' | 'MEDIUM' | 'HIGH';
4
4
  export type CliRuleSummaryV2 = Readonly<{
@@ -30,6 +30,7 @@ export type CliArtifactIdentityV2 = Readonly<{
30
30
  digest: string;
31
31
  };
32
32
  target: {
33
+ schemaVersion: 'scanner-target-v3';
33
34
  edition: 'UNKNOWN';
34
35
  deployment: 'UNKNOWN';
35
36
  role: 'UNKNOWN';
@@ -84,7 +85,10 @@ export type CliVersionDocumentV2 = Readonly<{
84
85
  version: '2.0.0';
85
86
  buildDigest: string;
86
87
  };
87
- resultSchemas: readonly ['scanner-result-v1', 'scanner-result-v2'];
88
+ resultSchemas: readonly [
89
+ 'scanner-result-v1',
90
+ 'scanner-result-v2'
91
+ ];
88
92
  configSchema: 'n8n-scan-config-v2';
89
93
  rulesetDigest: string;
90
94
  semanticsDigest: string;
@@ -43,13 +43,13 @@ export declare const BUILTIN_AUTHORITIES_V2: Readonly<{
43
43
  rules: Readonly<{
44
44
  id: "scanner-core-builtins";
45
45
  version: "2.0.0";
46
- digest: "a36d00564bbf8e8c38f05820480782cdc53fdbd3712558850066c4e3f5c3413d";
46
+ digest: "30bdc8343582b6a4efc13538d3475db87d07fa28bea4027f9e93b813213fd510";
47
47
  signatureStatus: "VERIFIED";
48
48
  }>;
49
49
  semantics: Readonly<{
50
50
  id: "scanner-core-builtins";
51
51
  version: "2.2.0";
52
- digest: "bc6fdecc34e460b5b01973ef7a8ce06b27b9b100ae03b480110f11f2a63ac328";
52
+ digest: "58419339dcf99ed398d2955282662e6f6d37208f62393cafb56818d4a38182d7";
53
53
  }>;
54
54
  limits: Readonly<{
55
55
  schemaVersion: "scanner-limits-v2";
@@ -60,20 +60,28 @@ export declare const PROFILE_MANIFEST_DIGEST_V2: "3ca5d69db2554383e22c44afe507cc
60
60
  export declare const BUILTIN_RULESET_AUTHORITY_V2: Readonly<{
61
61
  id: "scanner-core-builtins";
62
62
  version: "2.0.0";
63
- digest: "a36d00564bbf8e8c38f05820480782cdc53fdbd3712558850066c4e3f5c3413d";
63
+ digest: "30bdc8343582b6a4efc13538d3475db87d07fa28bea4027f9e93b813213fd510";
64
64
  signatureStatus: "VERIFIED";
65
65
  }>;
66
66
  export declare const BUILTIN_SEMANTICS_AUTHORITY_V2: Readonly<{
67
67
  id: "scanner-core-builtins";
68
68
  version: "2.2.0";
69
- digest: "bc6fdecc34e460b5b01973ef7a8ce06b27b9b100ae03b480110f11f2a63ac328";
69
+ digest: "58419339dcf99ed398d2955282662e6f6d37208f62393cafb56818d4a38182d7";
70
70
  }>;
71
71
  export declare const BUILTIN_LIMITS_AUTHORITY_V2: Readonly<{
72
72
  schemaVersion: "scanner-limits-v2";
73
73
  digest: "fca787753ca88f71cf0d174427f4ac730a7aef1c823aaf73aa1ea72af92b4077";
74
74
  }>;
75
- export declare const RULE_PACK_DIGEST_V2: "a36d00564bbf8e8c38f05820480782cdc53fdbd3712558850066c4e3f5c3413d";
76
- export declare const SEMANTIC_CATALOGUE_DIGEST_V2: "bc6fdecc34e460b5b01973ef7a8ce06b27b9b100ae03b480110f11f2a63ac328";
75
+ export declare const RULE_PACK_DIGEST_V2: "30bdc8343582b6a4efc13538d3475db87d07fa28bea4027f9e93b813213fd510";
76
+ export declare const SEMANTIC_CATALOGUE_DIGEST_V2: "58419339dcf99ed398d2955282662e6f6d37208f62393cafb56818d4a38182d7";
77
+ /** Detached literals: parity checks must detect drift rather than importing live core pins. */
78
+ export declare const BUILTIN_SCOPED_SEMANTICS_AUTHORITY_V2: Readonly<{
79
+ id: "reviewed-gmail-message-v1";
80
+ version: "1";
81
+ digest: "2b21f771d2cf172e33e8f78e5d1deaaefc0a5e8ff45f7d9f252cb8ec321ad56a";
82
+ sourceReceiptSha256: "2e8b7a2666cfc07c7609fdc9a2bdf01be291195a8b7da0af0f69836a180f8685";
83
+ sourceReceiptCanonicalDigest: "965de9fabde482dd5a6bcc67299fce8c33232e78c9fdc70053ad588b0f62ba2a";
84
+ }>;
77
85
  /**
78
86
  * One tool identity for every machine surface: the JSON/NDJSON scan envelopes and the
79
87
  * rules/explain/profiles metadata documents. The digest folds the admitted engine, profile,
@@ -88,7 +96,26 @@ export type CliToolIdentityV2 = Readonly<{
88
96
  }>;
89
97
  export declare const CLI_TOOL_V2: CliToolIdentityV2;
90
98
  export declare const DEFAULT_SCAN_CONFIG_V2: ScanConfigV2;
91
- export declare const SCAN_CONFIG_V2_FIELDS: readonly ["schemaVersion", "format", "profile", "output", "inputs", "configPath", "failOn", "requireComplete", "concurrency", "rules", "catalogue", "limits", "target", "include", "exclude", "approvedDomains", "allowUnsignedDevelopmentRules", "noColor"];
99
+ export declare const SCAN_CONFIG_V2_FIELDS: readonly [
100
+ "schemaVersion",
101
+ "format",
102
+ "profile",
103
+ "output",
104
+ "inputs",
105
+ "configPath",
106
+ "failOn",
107
+ "requireComplete",
108
+ "concurrency",
109
+ "rules",
110
+ "catalogue",
111
+ "limits",
112
+ "target",
113
+ "include",
114
+ "exclude",
115
+ "approvedDomains",
116
+ "allowUnsignedDevelopmentRules",
117
+ "noColor"
118
+ ];
92
119
  export declare const SCAN_CONFIG_V2_MAX_STRING = 4096;
93
120
  export declare const SCAN_CONFIG_V2_MAX_PATTERNS = 1024;
94
121
  export declare const SCAN_CONFIG_V2_MAX_CONCURRENCY = 16;
@@ -0,0 +1,64 @@
1
+ export declare const V2_COMMANDS: readonly [
2
+ "scan",
3
+ "fix",
4
+ "rules",
5
+ "explain",
6
+ "profiles",
7
+ "validate-config",
8
+ "version"
9
+ ];
10
+ export type V2CommandName = (typeof V2_COMMANDS)[number];
11
+ export type V2OptionName = '--help' | '--schema' | '--format' | '--profile' | '--fail-on' | '--require-complete' | '--audit-supply-chain' | '--include-readiness' | '--max-concurrency' | '--concurrency' | '--timeout' | '--output' | '--config' | '--rules' | '--catalogue' | '--limits' | '--target' | '--n8n-version' | '--edition' | '--deployment' | '--role' | '--task-runner' | '--community-package' | '--configuration' | '--approved-domain' | '--include' | '--exclude' | '--allow-unsigned-development-rules' | '--no-color' | '--root' | '--input' | '--fix' | '--mapping' | '--endpoint-receipt' | '--confirm';
12
+ export type V2HelpOption = Readonly<{
13
+ name: V2OptionName;
14
+ value: string;
15
+ commands: readonly V2CommandName[];
16
+ description: string;
17
+ default?: string;
18
+ }>;
19
+ export declare const V2_OPTIONS: readonly V2HelpOption[];
20
+ /**
21
+ * The published limit vocabulary, restated because a shipped declaration must not name the private,
22
+ * unpublished contracts workspace: a strict NodeNext consumer of the packed package fails `TS2307`
23
+ * on that import. The values below still come from the contract, and the two vocabularies stay
24
+ * exhaustive against each other at compile time.
25
+ */
26
+ export type V2LimitName = 'maxBytes' | 'maxNodes' | 'maxEdges' | 'maxConnectionDepth' | 'maxParameterDepth' | 'maxParameterLeaves' | 'workerDeadlineMs' | 'maxSyntaxNodes' | 'maxDocumentDepth' | 'maxMembersAndElements' | 'maxRawEdges' | 'maxDuplicateKeys' | 'maxDiagnostics' | 'maxStoredSourceSpans' | 'maxSourceWork' | 'maxExpressionTokens' | 'maxCodeSyntaxNodes' | 'maxGraphOperations' | 'maxTaintStates' | 'maxTraceStepsPerFinding' | 'maxFindings' | 'maxRedactionPatches' | 'maxRedactedArtifactBytes' | 'maxEvidenceBytes' | 'maxSerializedResultBytes' | 'maxRuleOperations';
27
+ export declare const V2_LIMITS: Readonly<Record<V2LimitName, number>>;
28
+ export declare const V2_EXIT_CODES: readonly [
29
+ 0,
30
+ 1,
31
+ 2,
32
+ 3,
33
+ 4,
34
+ 130
35
+ ];
36
+ export type V2ExitCode = (typeof V2_EXIT_CODES)[number];
37
+ export declare const V2_EXIT_REASONS: readonly [
38
+ "CANCELLED",
39
+ "INTERNAL",
40
+ "USAGE",
41
+ "FINDING_THRESHOLD",
42
+ "REQUIRE_COMPLETE",
43
+ "ITEM_FAILURE",
44
+ "UNDER_THRESHOLD"
45
+ ];
46
+ export type V2ExitReason = (typeof V2_EXIT_REASONS)[number];
47
+ export declare const V2_CANONICAL_CLAIMS: readonly [
48
+ "v2 is offline and never initiates network requests (HTTP, DNS, sockets, telemetry, or remote imports).",
49
+ "Labels and output identities never contain absolute paths or workflow source content.",
50
+ "File output uses a same-directory temporary file and atomic replace; failures and cancellation preserve the prior file.",
51
+ "beta-default@2.0.0 is admitted; beta-hardened@2.0.0 is defined but not admitted or selectable.",
52
+ "No shipped path produces a redacted artifact: maxRedactionPatches and maxRedactedArtifactBytes bound redaction-v2, which is development-only and unwired.",
53
+ "No shipped path admits an external rule pack: --rules and --catalogue accept only builtin, and --allow-unsigned-development-rules is refused because Ed25519 trust-store admission is deferred.",
54
+ "Published on npm as sfscanner."
55
+ ];
56
+ export type V2CommandHelp = Readonly<{
57
+ command: V2CommandName;
58
+ usage: readonly string[];
59
+ text: string;
60
+ }>;
61
+ export declare const COMMAND_HELP_V2: Readonly<Record<V2CommandName, string>>;
62
+ export declare const GENERAL_HELP_V2: string;
63
+ export declare const HELP_TEXT_V2: string;
64
+ export declare function getHelpV2(command?: V2CommandName): string;
@@ -0,0 +1,37 @@
1
+ import type { CliMetadataDocumentV2 } from "./commands.js";
2
+ import type { CliCommandV2 } from "./arguments.js";
3
+ export type MetadataFormatV2 = 'json' | 'table';
4
+ export type MetadataOutputOptionsV2 = Readonly<{
5
+ color?: boolean;
6
+ configDirectory?: string;
7
+ }>;
8
+ export declare function renderMetadataTableV2(document: CliMetadataDocumentV2, _options?: MetadataOutputOptionsV2): string;
9
+ export declare function serializeMetadataJsonV2(document: CliMetadataDocumentV2): string;
10
+ export declare function serializeMetadataV2(document: CliMetadataDocumentV2, format?: MetadataFormatV2, options?: MetadataOutputOptionsV2): string;
11
+ export declare function emitRulesDocumentV2(format?: MetadataFormatV2, options?: MetadataOutputOptionsV2): string;
12
+ export declare function emitExplainDocumentV2(ruleId: string, format?: MetadataFormatV2, options?: MetadataOutputOptionsV2): Readonly<{
13
+ ok: true;
14
+ output: string;
15
+ } | {
16
+ ok: false;
17
+ code: 'USAGE';
18
+ message: string;
19
+ }>;
20
+ export declare function emitProfilesDocumentV2(format?: MetadataFormatV2, options?: MetadataOutputOptionsV2): string;
21
+ export declare function emitVersionDocumentV2(format?: MetadataFormatV2, options?: MetadataOutputOptionsV2): string;
22
+ export declare function emitConfigValidationDocumentV2(input: unknown, format?: MetadataFormatV2, options?: MetadataOutputOptionsV2): Readonly<{
23
+ ok: true;
24
+ output: string;
25
+ } | {
26
+ ok: false;
27
+ code: 'USAGE';
28
+ message: string;
29
+ }>;
30
+ export declare function emitMetadataCommandResultV2(command: CliCommandV2, configInput?: unknown, options?: MetadataOutputOptionsV2): Readonly<{
31
+ ok: true;
32
+ output: string;
33
+ } | {
34
+ ok: false;
35
+ code: 'USAGE';
36
+ message: string;
37
+ }>;
@@ -0,0 +1,108 @@
1
+ import type { PreflightPrerequisitesV1 } from "../../../../contracts/preflight-prerequisite-types.js";
2
+ export type { PreflightCommunityNodeV1, PreflightCredentialV1, PreflightEnvironmentV1, PreflightIntegrationV1, PreflightNodeEvidenceV1, PreflightPrerequisitesV1, PreflightProvenanceV1, PreflightSubworkflowV1, } from "../../../../contracts/preflight-prerequisite-types.js";
3
+ export declare const PREFLIGHT_READINESS_SCHEMA_V1: "n8n-preflight-readiness-v1";
4
+ export declare const PREFLIGHT_SEVERITIES_V1: readonly [
5
+ "critical",
6
+ "high",
7
+ "medium",
8
+ "low",
9
+ "info"
10
+ ];
11
+ export type PreflightSeverityV1 = (typeof PREFLIGHT_SEVERITIES_V1)[number];
12
+ export type PreflightCompletenessV1 = 'COMPLETE' | 'DEGRADED' | 'INDETERMINATE';
13
+ export type N8nTargetV1 = '1.x' | '2.x';
14
+ export type PreflightCompletenessCodeV1 = 'ANALYSIS_NOT_REPORTED' | 'MALFORMED_NODE_ENTRY' | 'UNKNOWN_NODE_TYPE' | 'UNSUPPORTED_NODE' | 'UNRESOLVED_EDGE' | 'AMBIGUITY' | 'TRUNCATED_ANALYSIS' | 'DYNAMIC_PREREQUISITE_VALUE' | 'PREREQUISITE_INVENTORY_LIMIT' | 'DYNAMIC_ENVIRONMENT_ACCESS' | 'ENVIRONMENT_EVIDENCE_OMITTED';
15
+ export type PreflightTargetCodeV1 = 'FEATURE_NOT_SUPPORTED_BY_TARGET' | 'TYPE_VERSION_NOT_SUPPORTED_BY_TARGET' | 'TYPE_VERSION_UNKNOWN' | 'DEFAULT_NODE_EXCLUSION_CONFIGURATION_UNKNOWN';
16
+ export declare const PREFLIGHT_DISCLAIMER_V1: Readonly<{
17
+ id: "NOT_SAFETY_CLEARANCE";
18
+ text: "A clean or low-severity scan is not safety clearance: it does not prove the workflow is bug-free, secure, fully analyzed or runnable, and it does not replace an import, execution, deployment or credential check on the declared target.";
19
+ }>;
20
+ export type PreflightFindingInputV1 = Readonly<{
21
+ ruleId: string;
22
+ severity: string;
23
+ node?: string | null;
24
+ message?: string | null;
25
+ }>;
26
+ export type PreflightFindingV1 = Readonly<{
27
+ ruleId: string;
28
+ severity: PreflightSeverityV1;
29
+ node: string | null;
30
+ message: string | null;
31
+ }>;
32
+ export type PreflightAnalysisSignalsV1 = Readonly<{
33
+ supportedNodes?: number;
34
+ unsupportedNodes?: number;
35
+ unresolvedEdges?: number;
36
+ ambiguities?: number;
37
+ truncated?: boolean;
38
+ }>;
39
+ export type PreflightCompletenessReasonV1 = Readonly<{
40
+ code: PreflightCompletenessCodeV1;
41
+ count: number;
42
+ detail: string;
43
+ }>;
44
+ export type PlatformCompatibilityFactV1 = Readonly<{
45
+ featureId: string;
46
+ description: string;
47
+ nodeTypes: readonly string[];
48
+ supportedTargets: readonly N8nTargetV1[];
49
+ maxTypeVersionByTarget?: Readonly<Partial<Record<N8nTargetV1, string>>>;
50
+ source: string;
51
+ }>;
52
+ export type PreflightTargetSourceEvidenceV1 = Readonly<{
53
+ kind: 'PINNED_SOURCE';
54
+ tag: string;
55
+ commit: string;
56
+ path: string;
57
+ startLine: number;
58
+ endLine: number;
59
+ sha256: string;
60
+ }>;
61
+ export type PreflightTargetFindingV1 = Readonly<{
62
+ code: PreflightTargetCodeV1;
63
+ featureId: string;
64
+ subject: string;
65
+ nodeType: string | null;
66
+ typeVersion: string | null;
67
+ source: string;
68
+ detail: string;
69
+ pointer?: string;
70
+ sourceEvidence?: PreflightTargetSourceEvidenceV1;
71
+ }>;
72
+ export type PreflightReadinessOptionsV1 = Readonly<{
73
+ workflow: unknown;
74
+ n8nTarget?: N8nTargetV1 | 'UNKNOWN' | null;
75
+ platformFacts?: readonly PlatformCompatibilityFactV1[];
76
+ requiredPlatformFeatures?: readonly string[];
77
+ analysis?: PreflightAnalysisSignalsV1;
78
+ findings?: readonly PreflightFindingInputV1[];
79
+ n8nVersion?: string | null;
80
+ }>;
81
+ export type PreflightReadinessReportV1 = Readonly<{
82
+ schemaVersion: typeof PREFLIGHT_READINESS_SCHEMA_V1;
83
+ safetyClearance: 'NOT_PROVIDED';
84
+ disclaimer: typeof PREFLIGHT_DISCLAIMER_V1;
85
+ completeness: Readonly<{
86
+ status: PreflightCompletenessV1;
87
+ reasons: readonly PreflightCompletenessReasonV1[];
88
+ }>;
89
+ findings: Readonly<{
90
+ total: number;
91
+ bySeverity: Readonly<Record<PreflightSeverityV1, number>>;
92
+ highestSeverity: PreflightSeverityV1 | null;
93
+ items: readonly PreflightFindingV1[];
94
+ }>;
95
+ prerequisites: PreflightPrerequisitesV1;
96
+ target: Readonly<{
97
+ declared: N8nTargetV1 | null;
98
+ declaredVersion?: string | null;
99
+ status: 'INDETERMINATE' | 'NO_RECOGNIZED_CHANGE' | 'INCOMPATIBLE' | 'UNKNOWN';
100
+ migrationTested: false;
101
+ findings: readonly PreflightTargetFindingV1[];
102
+ notes: readonly string[];
103
+ }>;
104
+ }>;
105
+ /** No pinned platform fact is admitted yet, so every compatibility fact must arrive with its own source (B3). */
106
+ export declare const DEFAULT_PLATFORM_FACTS_V1: readonly PlatformCompatibilityFactV1[];
107
+ /** Builds the offline readiness report; the input workflow is never mutated and nothing is executed. */
108
+ export declare function buildPreflightReadinessReport(options: PreflightReadinessOptionsV1): PreflightReadinessReportV1;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Opt-in workflow privacy preparation (PD-03): replaces credential references, sensitive
3
+ * authorization headers, internal endpoints, webhook paths and embedded tokens with safe
4
+ * placeholders before an export leaves the operator's machine. The result is a fresh copy plus an
5
+ * exact change list and a reviewable diff; structure is preserved and the input is never mutated.
6
+ * Redaction is heuristic and rule-bounded, so it never guarantees complete secret or PII removal.
7
+ * Pure, deterministic and free of host APIs so the browser worker and CLI share one contract.
8
+ */
9
+ export declare const PRIVACY_PREPARE_SCHEMA_V1: "n8n-workflow-privacy-prepare-v1";
10
+ export declare const PRIVACY_PREPARE_DISCLAIMER_V1: "Heuristic and rule-bounded privacy preparation. Does NOT guarantee complete secret or PII removal. The raw diff and change excerpts contain the original removed values and are sensitive local review material; never share or upload them.";
11
+ export declare const CREDENTIAL_ID_PLACEHOLDER: "[REDACTED_CREDENTIAL_ID]";
12
+ export declare const CREDENTIAL_NAME_PLACEHOLDER: "[REDACTED_CREDENTIAL_NAME]";
13
+ export declare const HEADER_VALUE_PLACEHOLDER: "[REDACTED_HEADER_VALUE]";
14
+ export declare const INTERNAL_URL_PLACEHOLDER: "https://internal.example.invalid/...";
15
+ export declare const TOKEN_PLACEHOLDER: "[REDACTED_TOKEN]";
16
+ export declare const WEBHOOK_PATH_PLACEHOLDER: "[REDACTED_WEBHOOK_PATH]";
17
+ export declare const WEBHOOK_ID_PLACEHOLDER: "[REDACTED_WEBHOOK_ID]";
18
+ export type PrivacyChangeKind = 'CREDENTIAL' | 'HEADER' | 'INTERNAL_URL' | 'TOKEN';
19
+ export type PrivacyChange = Readonly<{
20
+ path: string;
21
+ kind: PrivacyChangeKind;
22
+ originalExcerpt: string;
23
+ replacement: string;
24
+ }>;
25
+ export type PrivacyPrepareOptions = Readonly<{
26
+ internalUrlPlaceholder?: string;
27
+ internalHostSuffixes?: readonly string[];
28
+ }>;
29
+ export type PrivacyPrepareResult = Readonly<{
30
+ schemaVersion: typeof PRIVACY_PREPARE_SCHEMA_V1;
31
+ workflow: Readonly<Record<string, unknown>>;
32
+ changed: boolean;
33
+ changes: readonly PrivacyChange[];
34
+ diff: string;
35
+ completeRedactionGuaranteed: false;
36
+ disclaimer: typeof PRIVACY_PREPARE_DISCLAIMER_V1;
37
+ }>;
38
+ /** Returns a scrubbed deep copy plus the change list and diff; the input workflow is never mutated. */
39
+ export declare function prepareWorkflowPrivacy(workflow: unknown, options?: PrivacyPrepareOptions): PrivacyPrepareResult;
package/dist/index.d.ts CHANGED
@@ -1,4 +1 @@
1
- export { parseCliArguments } from './v2/arguments.js';
2
- export { runCliV2, type PublicRunOptionsV2, type PublicRunResultV2, type PublicScanCommandV2, } from './v2/cli-runner.js';
3
- export { getHelpV2 } from './v2/help.js';
4
- export { emitMetadataCommandResultV2 } from './v2/metadata-output.js';
1
+ export * from "./_types/packages/scanner-cli/src/index.js";