@webpieces/rules-sdk 0.4.847 → 0.4.848

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/rules-sdk",
3
- "version": "0.4.847",
3
+ "version": "0.4.848",
4
4
  "description": "Pure schema and rule pack value contracts.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
package/src/index.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  export { FieldDef } from './field-def';
2
2
  export type { SchemaShape } from './field-def';
3
3
  export { BaseRuleConfig, BASE_RULE_SCHEMA } from './base-rule-config';
4
- export { RULE_PACK_API_VERSION, RULE_SCHEMA_API_VERSION, ConfigObject, OwnedRuleDefinition, RuleContribution, RulePackManifest, RulePackDeclaration } from './rule-pack';
4
+ export { RULE_PACK_API_VERSION, RULE_SCHEMA_API_VERSION, ConfigObject, RuleHelp, OwnedRuleDefinition, RuleContribution, RulePackManifest, RulePackDeclaration, } from './rule-pack';
5
5
  export type { ExecutionKind, ConfigValue } from './rule-pack';
6
6
  export { FILE_LIMIT_MODES, MODIFIED_CODE_MODES, ON_OFF_MODES } from './scope-modes';
7
7
  export type { FileLimitMode, ModifiedCodeMode, OnOffMode } from './scope-modes';
8
8
  export { RetiredConfigKey, SafeguardDefinition } from './rule-pack';
9
9
  export type { RuleConfigSection } from './rule-pack';
10
+ export { PolicyRuntimeRequest, BuildPolicyResult } from './rule-runtime';
11
+ export type { BuildPolicy, BuildRuleRuntime } from './rule-runtime';
12
+ export { PolicyDebugSelection, BuildDebugRequest } from './rule-runtime';
13
+ export type { BuildDebugRuntime } from './rule-runtime';
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SafeguardDefinition = exports.RetiredConfigKey = exports.ON_OFF_MODES = exports.MODIFIED_CODE_MODES = exports.FILE_LIMIT_MODES = exports.RulePackDeclaration = exports.RulePackManifest = exports.RuleContribution = exports.OwnedRuleDefinition = exports.ConfigObject = exports.RULE_SCHEMA_API_VERSION = exports.RULE_PACK_API_VERSION = exports.BASE_RULE_SCHEMA = exports.BaseRuleConfig = exports.FieldDef = void 0;
3
+ exports.BuildDebugRequest = exports.PolicyDebugSelection = exports.BuildPolicyResult = exports.PolicyRuntimeRequest = exports.SafeguardDefinition = exports.RetiredConfigKey = exports.ON_OFF_MODES = exports.MODIFIED_CODE_MODES = exports.FILE_LIMIT_MODES = exports.RulePackDeclaration = exports.RulePackManifest = exports.RuleContribution = exports.OwnedRuleDefinition = exports.RuleHelp = exports.ConfigObject = exports.RULE_SCHEMA_API_VERSION = exports.RULE_PACK_API_VERSION = exports.BASE_RULE_SCHEMA = exports.BaseRuleConfig = exports.FieldDef = void 0;
4
4
  var field_def_1 = require("./field-def");
5
5
  Object.defineProperty(exports, "FieldDef", { enumerable: true, get: function () { return field_def_1.FieldDef; } });
6
6
  var base_rule_config_1 = require("./base-rule-config");
@@ -10,6 +10,7 @@ var rule_pack_1 = require("./rule-pack");
10
10
  Object.defineProperty(exports, "RULE_PACK_API_VERSION", { enumerable: true, get: function () { return rule_pack_1.RULE_PACK_API_VERSION; } });
11
11
  Object.defineProperty(exports, "RULE_SCHEMA_API_VERSION", { enumerable: true, get: function () { return rule_pack_1.RULE_SCHEMA_API_VERSION; } });
12
12
  Object.defineProperty(exports, "ConfigObject", { enumerable: true, get: function () { return rule_pack_1.ConfigObject; } });
13
+ Object.defineProperty(exports, "RuleHelp", { enumerable: true, get: function () { return rule_pack_1.RuleHelp; } });
13
14
  Object.defineProperty(exports, "OwnedRuleDefinition", { enumerable: true, get: function () { return rule_pack_1.OwnedRuleDefinition; } });
14
15
  Object.defineProperty(exports, "RuleContribution", { enumerable: true, get: function () { return rule_pack_1.RuleContribution; } });
15
16
  Object.defineProperty(exports, "RulePackManifest", { enumerable: true, get: function () { return rule_pack_1.RulePackManifest; } });
@@ -21,4 +22,10 @@ Object.defineProperty(exports, "ON_OFF_MODES", { enumerable: true, get: function
21
22
  var rule_pack_2 = require("./rule-pack");
22
23
  Object.defineProperty(exports, "RetiredConfigKey", { enumerable: true, get: function () { return rule_pack_2.RetiredConfigKey; } });
23
24
  Object.defineProperty(exports, "SafeguardDefinition", { enumerable: true, get: function () { return rule_pack_2.SafeguardDefinition; } });
25
+ var rule_runtime_1 = require("./rule-runtime");
26
+ Object.defineProperty(exports, "PolicyRuntimeRequest", { enumerable: true, get: function () { return rule_runtime_1.PolicyRuntimeRequest; } });
27
+ Object.defineProperty(exports, "BuildPolicyResult", { enumerable: true, get: function () { return rule_runtime_1.BuildPolicyResult; } });
28
+ var rule_runtime_2 = require("./rule-runtime");
29
+ Object.defineProperty(exports, "PolicyDebugSelection", { enumerable: true, get: function () { return rule_runtime_2.PolicyDebugSelection; } });
30
+ Object.defineProperty(exports, "BuildDebugRequest", { enumerable: true, get: function () { return rule_runtime_2.BuildDebugRequest; } });
24
31
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-sdk/src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAEjB,uDAAsE;AAA7D,kHAAA,cAAc,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AACzC,yCAAyK;AAAhK,kHAAA,qBAAqB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAEnJ,6CAAoF;AAA3E,+GAAA,gBAAgB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAAE,2GAAA,YAAY,OAAA;AAG5D,yCAAoE;AAA3D,6GAAA,gBAAgB,OAAA;AAAE,gHAAA,mBAAmB,OAAA","sourcesContent":["export { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { BaseRuleConfig, BASE_RULE_SCHEMA } from './base-rule-config';\nexport { RULE_PACK_API_VERSION, RULE_SCHEMA_API_VERSION, ConfigObject, OwnedRuleDefinition, RuleContribution, RulePackManifest, RulePackDeclaration } from './rule-pack';\nexport type { ExecutionKind, ConfigValue } from './rule-pack';\nexport { FILE_LIMIT_MODES, MODIFIED_CODE_MODES, ON_OFF_MODES } from './scope-modes';\nexport type { FileLimitMode, ModifiedCodeMode, OnOffMode } from './scope-modes';\n\nexport { RetiredConfigKey, SafeguardDefinition } from './rule-pack';\nexport type { RuleConfigSection } from './rule-pack';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-sdk/src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAEjB,uDAAsE;AAA7D,kHAAA,cAAc,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AACzC,yCASqB;AARjB,kHAAA,qBAAqB,OAAA;AACrB,oHAAA,uBAAuB,OAAA;AACvB,yGAAA,YAAY,OAAA;AACZ,qGAAA,QAAQ,OAAA;AACR,gHAAA,mBAAmB,OAAA;AACnB,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AAGvB,6CAAoF;AAA3E,+GAAA,gBAAgB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAAE,2GAAA,YAAY,OAAA;AAG5D,yCAAoE;AAA3D,6GAAA,gBAAgB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAE9C,+CAAyE;AAAhE,oHAAA,oBAAoB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAEhD,+CAAyE;AAAhE,oHAAA,oBAAoB,OAAA;AAAE,iHAAA,iBAAiB,OAAA","sourcesContent":["export { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { BaseRuleConfig, BASE_RULE_SCHEMA } from './base-rule-config';\nexport {\n RULE_PACK_API_VERSION,\n RULE_SCHEMA_API_VERSION,\n ConfigObject,\n RuleHelp,\n OwnedRuleDefinition,\n RuleContribution,\n RulePackManifest,\n RulePackDeclaration,\n} from './rule-pack';\nexport type { ExecutionKind, ConfigValue } from './rule-pack';\nexport { FILE_LIMIT_MODES, MODIFIED_CODE_MODES, ON_OFF_MODES } from './scope-modes';\nexport type { FileLimitMode, ModifiedCodeMode, OnOffMode } from './scope-modes';\n\nexport { RetiredConfigKey, SafeguardDefinition } from './rule-pack';\nexport type { RuleConfigSection } from './rule-pack';\nexport { PolicyRuntimeRequest, BuildPolicyResult } from './rule-runtime';\nexport type { BuildPolicy, BuildRuleRuntime } from './rule-runtime';\nexport { PolicyDebugSelection, BuildDebugRequest } from './rule-runtime';\nexport type { BuildDebugRuntime } from './rule-runtime';\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Compiled with the SDK: debug selection cannot accept an absent rule. */
4
+ class PolicyDebugSelectionTypeCheck {
5
+ requireRule() {
6
+ const acceptsUndefined = false;
7
+ void acceptsUndefined;
8
+ }
9
+ }
10
+ new PolicyDebugSelectionTypeCheck().requireRule();
11
+ //# sourceMappingURL=policy-debug-selection.typecheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy-debug-selection.typecheck.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-sdk/src/policy-debug-selection.typecheck.ts"],"names":[],"mappings":";;AAEA,2EAA2E;AAC3E,MAAM,6BAA6B;IAC/B,WAAW;QACP,MAAM,gBAAgB,GAIR,KAAK,CAAC;QACpB,KAAK,gBAAgB,CAAC;IAC1B,CAAC;CACJ;AAED,IAAI,6BAA6B,EAAE,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { PolicyDebugSelection } from './rule-runtime';\n\n/** Compiled with the SDK: debug selection cannot accept an absent rule. */\nclass PolicyDebugSelectionTypeCheck {\n requireRule(): void {\n const acceptsUndefined: undefined extends ConstructorParameters<\n typeof PolicyDebugSelection\n >[0]\n ? true\n : false = false;\n void acceptsUndefined;\n }\n}\n\nnew PolicyDebugSelectionTypeCheck().requireRule();\n"]}
@@ -1,12 +1,18 @@
1
1
  import { FieldDef } from './field-def';
2
2
  /** Versioned independently from npm releases: incompatible contracts require an explicit bump. */
3
- export declare const RULE_PACK_API_VERSION = 2;
3
+ export declare const RULE_PACK_API_VERSION = 3;
4
4
  export declare const RULE_SCHEMA_API_VERSION = 1;
5
5
  export type ExecutionKind = 'build' | 'source-hook' | 'workflow-guard' | 'lint';
6
6
  export type ConfigValue = string | number | boolean | null | ConfigValue[] | ConfigObject;
7
7
  export declare class ConfigObject {
8
8
  [key: string]: ConfigValue;
9
9
  }
10
+ /** Owner-authored catalog guidance; {configFile} is replaced by the client's exact declaration. */
11
+ export declare class RuleHelp {
12
+ readonly description: string;
13
+ readonly remediation: string;
14
+ constructor(description: string, remediation: string);
15
+ }
10
16
  /** The single owner supplies the configuration schema, regardless of implementation count. */
11
17
  export declare class OwnedRuleDefinition {
12
18
  readonly id: string;
@@ -15,14 +21,16 @@ export declare class OwnedRuleDefinition {
15
21
  readonly optionalTuning: ConfigObject;
16
22
  readonly recommendedSeed: ConfigObject;
17
23
  readonly section: RuleConfigSection;
18
- constructor(id: string, schema: Readonly<Record<string, FieldDef>>, schemaApiVersion: number, optionalTuning: ConfigObject, recommendedSeed: ConfigObject, section: RuleConfigSection);
24
+ readonly help: RuleHelp;
25
+ constructor(id: string, schema: Readonly<Record<string, FieldDef>>, schemaApiVersion: number, optionalTuning: ConfigObject, recommendedSeed: ConfigObject, section: RuleConfigSection, help: RuleHelp);
19
26
  }
20
27
  /** Each pack may implement an owned rule or contribute an execution kind to another owner. */
21
28
  export declare class RuleContribution {
22
29
  readonly ruleId: string;
23
30
  readonly ownerPack: string;
24
31
  readonly executionKind: ExecutionKind;
25
- constructor(ruleId: string, ownerPack: string, executionKind: ExecutionKind);
32
+ readonly implementationModule: string;
33
+ constructor(ruleId: string, ownerPack: string, executionKind: ExecutionKind, implementationModule: string);
26
34
  }
27
35
  export declare class RulePackManifest {
28
36
  readonly packageName: string;
package/src/rule-pack.js CHANGED
@@ -1,12 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RetiredConfigKey = exports.SafeguardDefinition = exports.RulePackDeclaration = exports.RulePackManifest = exports.RuleContribution = exports.OwnedRuleDefinition = exports.ConfigObject = exports.RULE_SCHEMA_API_VERSION = exports.RULE_PACK_API_VERSION = void 0;
3
+ exports.RetiredConfigKey = exports.SafeguardDefinition = exports.RulePackDeclaration = exports.RulePackManifest = exports.RuleContribution = exports.OwnedRuleDefinition = exports.RuleHelp = exports.ConfigObject = exports.RULE_SCHEMA_API_VERSION = exports.RULE_PACK_API_VERSION = void 0;
4
4
  /** Versioned independently from npm releases: incompatible contracts require an explicit bump. */
5
- exports.RULE_PACK_API_VERSION = 2;
5
+ exports.RULE_PACK_API_VERSION = 3;
6
6
  exports.RULE_SCHEMA_API_VERSION = 1;
7
7
  class ConfigObject {
8
8
  }
9
9
  exports.ConfigObject = ConfigObject;
10
+ /** Owner-authored catalog guidance; {configFile} is replaced by the client's exact declaration. */
11
+ class RuleHelp {
12
+ description;
13
+ remediation;
14
+ constructor(description, remediation) {
15
+ this.description = description;
16
+ this.remediation = remediation;
17
+ }
18
+ }
19
+ exports.RuleHelp = RuleHelp;
10
20
  /** The single owner supplies the configuration schema, regardless of implementation count. */
11
21
  class OwnedRuleDefinition {
12
22
  id;
@@ -15,14 +25,16 @@ class OwnedRuleDefinition {
15
25
  optionalTuning;
16
26
  recommendedSeed;
17
27
  section;
28
+ help;
18
29
  // eslint-disable-next-line @typescript-eslint/max-params
19
- constructor(id, schema, schemaApiVersion, optionalTuning, recommendedSeed, section) {
30
+ constructor(id, schema, schemaApiVersion, optionalTuning, recommendedSeed, section, help) {
20
31
  this.id = id;
21
32
  this.schema = schema;
22
33
  this.schemaApiVersion = schemaApiVersion;
23
34
  this.optionalTuning = optionalTuning;
24
35
  this.recommendedSeed = recommendedSeed;
25
36
  this.section = section;
37
+ this.help = help;
26
38
  }
27
39
  }
28
40
  exports.OwnedRuleDefinition = OwnedRuleDefinition;
@@ -31,10 +43,12 @@ class RuleContribution {
31
43
  ruleId;
32
44
  ownerPack;
33
45
  executionKind;
34
- constructor(ruleId, ownerPack, executionKind) {
46
+ implementationModule;
47
+ constructor(ruleId, ownerPack, executionKind, implementationModule) {
35
48
  this.ruleId = ruleId;
36
49
  this.ownerPack = ownerPack;
37
50
  this.executionKind = executionKind;
51
+ this.implementationModule = implementationModule;
38
52
  }
39
53
  }
40
54
  exports.RuleContribution = RuleContribution;
@@ -1 +1 @@
1
- {"version":3,"file":"rule-pack.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-sdk/src/rule-pack.ts"],"names":[],"mappings":";;;AAEA,kGAAkG;AACrF,QAAA,qBAAqB,GAAG,CAAC,CAAC;AAC1B,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAGzC,MAAa,YAAY;CAExB;AAFD,oCAEC;AAED,8FAA8F;AAC9F,MAAa,mBAAmB;IAGf;IACA;IACA;IACA;IACA;IACA;IAPb,yDAAyD;IACzD,YACa,EAAU,EACV,MAA0C,EAC1C,gBAAwB,EACxB,cAA4B,EAC5B,eAA6B,EAC7B,OAA0B;QAL1B,OAAE,GAAF,EAAE,CAAQ;QACV,WAAM,GAAN,MAAM,CAAoC;QAC1C,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,mBAAc,GAAd,cAAc,CAAc;QAC5B,oBAAe,GAAf,eAAe,CAAc;QAC7B,YAAO,GAAP,OAAO,CAAmB;IACpC,CAAC;CACP;AAVD,kDAUC;AAED,8FAA8F;AAC9F,MAAa,gBAAgB;IAEZ;IACA;IACA;IAHb,YACa,MAAc,EACd,SAAiB,EACjB,aAA4B;QAF5B,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAQ;QACjB,kBAAa,GAAb,aAAa,CAAe;IACtC,CAAC;CACP;AAND,4CAMC;AAED,MAAa,gBAAgB;IAGZ;IACA;IACA;IACA;IACA;IACA;IACA;IARb,yDAAyD;IACzD,YACa,WAAmB,EACnB,cAAsB,EACtB,UAAkB,EAClB,UAA0C,EAC1C,aAA0C,EAC1C,UAAuC,EACvC,UAA0C;QAN1C,gBAAW,GAAX,WAAW,CAAQ;QACnB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAgC;QAC1C,kBAAa,GAAb,aAAa,CAA6B;QAC1C,eAAU,GAAV,UAAU,CAA6B;QACvC,eAAU,GAAV,UAAU,CAAgC;IACpD,CAAC;CACP;AAXD,4CAWC;AAED,mGAAmG;AACnG,MAAa,mBAAmB;IACP;IAArB,YAAqB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;CAC1C;AAFD,kDAEC;AAID,0GAA0G;AAC1G,MAAa,mBAAmB;IACP;IAAqB;IAA+C;IAAzF,YAAqB,EAAU,EAAW,UAAoC,EAAW,WAAmB;QAAvF,OAAE,GAAF,EAAE,CAAQ;QAAW,eAAU,GAAV,UAAU,CAA0B;QAAW,gBAAW,GAAX,WAAW,CAAQ;IAAG,CAAC;CACnH;AAFD,kDAEC;AAED,8GAA8G;AAC9G,MAAa,gBAAgB;IAGZ;IAAwB;IAAsB;IAC9C;IAA8B;IAAwB;IAHnE,yDAAyD;IACzD,YACa,KAAa,EAAW,GAAW,EAAW,OAAe,EAC7D,WAAmB,EAAW,KAAa,EAAW,QAAiB;QADvE,UAAK,GAAL,KAAK,CAAQ;QAAW,QAAG,GAAH,GAAG,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAQ;QAC7D,gBAAW,GAAX,WAAW,CAAQ;QAAW,UAAK,GAAL,KAAK,CAAQ;QAAW,aAAQ,GAAR,QAAQ,CAAS;IACjF,CAAC;CACP;AAND,4CAMC","sourcesContent":["import { FieldDef } from './field-def';\n\n/** Versioned independently from npm releases: incompatible contracts require an explicit bump. */\nexport const RULE_PACK_API_VERSION = 2;\nexport const RULE_SCHEMA_API_VERSION = 1;\nexport type ExecutionKind = 'build' | 'source-hook' | 'workflow-guard' | 'lint';\nexport type ConfigValue = string | number | boolean | null | ConfigValue[] | ConfigObject;\nexport class ConfigObject {\n [key: string]: ConfigValue;\n}\n\n/** The single owner supplies the configuration schema, regardless of implementation count. */\nexport class OwnedRuleDefinition {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly id: string,\n readonly schema: Readonly<Record<string, FieldDef>>,\n readonly schemaApiVersion: number,\n readonly optionalTuning: ConfigObject,\n readonly recommendedSeed: ConfigObject,\n readonly section: RuleConfigSection,\n ) {}\n}\n\n/** Each pack may implement an owned rule or contribute an execution kind to another owner. */\nexport class RuleContribution {\n constructor(\n readonly ruleId: string,\n readonly ownerPack: string,\n readonly executionKind: ExecutionKind,\n ) {}\n}\n\nexport class RulePackManifest {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly packageName: string,\n readonly packageVersion: string,\n readonly apiVersion: number,\n readonly ownedRules: readonly OwnedRuleDefinition[],\n readonly contributions: readonly RuleContribution[],\n readonly migrations: readonly RetiredConfigKey[],\n readonly safeguards: readonly SafeguardDefinition[],\n ) {}\n}\n\n/** Explicit module declarations let a client add packs without a central built-in package list. */\nexport class RulePackDeclaration {\n constructor(readonly module: string) {}\n}\n\nexport type RuleConfigSection = 'rules' | 'hookGuards' | 'lint';\n\n/** A fixed invariant has no config switch; experimental safeguards require a separate explicit opt-in. */\nexport class SafeguardDefinition {\n constructor(readonly id: string, readonly activation: 'fixed' | 'experimental', readonly description: string) {}\n}\n\n/** Owner-provided migration instructions are data; the framework rejects rather than aliases retired keys. */\nexport class RetiredConfigKey {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly scope: string, readonly key: string, readonly movedTo: string,\n readonly instruction: string, readonly label: string, readonly prunable: boolean,\n ) {}\n}\n"]}
1
+ {"version":3,"file":"rule-pack.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-sdk/src/rule-pack.ts"],"names":[],"mappings":";;;AAEA,kGAAkG;AACrF,QAAA,qBAAqB,GAAG,CAAC,CAAC;AAC1B,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAGzC,MAAa,YAAY;CAExB;AAFD,oCAEC;AAED,mGAAmG;AACnG,MAAa,QAAQ;IAEJ;IACA;IAFb,YACa,WAAmB,EACnB,WAAmB;QADnB,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAQ;IAC7B,CAAC;CACP;AALD,4BAKC;AAED,8FAA8F;AAC9F,MAAa,mBAAmB;IAGf;IACA;IACA;IACA;IACA;IACA;IACA;IARb,yDAAyD;IACzD,YACa,EAAU,EACV,MAA0C,EAC1C,gBAAwB,EACxB,cAA4B,EAC5B,eAA6B,EAC7B,OAA0B,EAC1B,IAAc;QANd,OAAE,GAAF,EAAE,CAAQ;QACV,WAAM,GAAN,MAAM,CAAoC;QAC1C,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,mBAAc,GAAd,cAAc,CAAc;QAC5B,oBAAe,GAAf,eAAe,CAAc;QAC7B,YAAO,GAAP,OAAO,CAAmB;QAC1B,SAAI,GAAJ,IAAI,CAAU;IACxB,CAAC;CACP;AAXD,kDAWC;AAED,8FAA8F;AAC9F,MAAa,gBAAgB;IAEZ;IACA;IACA;IACA;IAJb,YACa,MAAc,EACd,SAAiB,EACjB,aAA4B,EAC5B,oBAA4B;QAH5B,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAQ;QACjB,kBAAa,GAAb,aAAa,CAAe;QAC5B,yBAAoB,GAApB,oBAAoB,CAAQ;IACtC,CAAC;CACP;AAPD,4CAOC;AAED,MAAa,gBAAgB;IAGZ;IACA;IACA;IACA;IACA;IACA;IACA;IARb,yDAAyD;IACzD,YACa,WAAmB,EACnB,cAAsB,EACtB,UAAkB,EAClB,UAA0C,EAC1C,aAA0C,EAC1C,UAAuC,EACvC,UAA0C;QAN1C,gBAAW,GAAX,WAAW,CAAQ;QACnB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAgC;QAC1C,kBAAa,GAAb,aAAa,CAA6B;QAC1C,eAAU,GAAV,UAAU,CAA6B;QACvC,eAAU,GAAV,UAAU,CAAgC;IACpD,CAAC;CACP;AAXD,4CAWC;AAED,mGAAmG;AACnG,MAAa,mBAAmB;IACP;IAArB,YAAqB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;CAC1C;AAFD,kDAEC;AAID,0GAA0G;AAC1G,MAAa,mBAAmB;IAEf;IACA;IACA;IAHb,YACa,EAAU,EACV,UAAoC,EACpC,WAAmB;QAFnB,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAAQ;IAC7B,CAAC;CACP;AAND,kDAMC;AAED,8GAA8G;AAC9G,MAAa,gBAAgB;IAGZ;IACA;IACA;IACA;IACA;IACA;IAPb,yDAAyD;IACzD,YACa,KAAa,EACb,GAAW,EACX,OAAe,EACf,WAAmB,EACnB,KAAa,EACb,QAAiB;QALjB,UAAK,GAAL,KAAK,CAAQ;QACb,QAAG,GAAH,GAAG,CAAQ;QACX,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAQ;QACb,aAAQ,GAAR,QAAQ,CAAS;IAC3B,CAAC;CACP;AAVD,4CAUC","sourcesContent":["import { FieldDef } from './field-def';\n\n/** Versioned independently from npm releases: incompatible contracts require an explicit bump. */\nexport const RULE_PACK_API_VERSION = 3;\nexport const RULE_SCHEMA_API_VERSION = 1;\nexport type ExecutionKind = 'build' | 'source-hook' | 'workflow-guard' | 'lint';\nexport type ConfigValue = string | number | boolean | null | ConfigValue[] | ConfigObject;\nexport class ConfigObject {\n [key: string]: ConfigValue;\n}\n\n/** Owner-authored catalog guidance; {configFile} is replaced by the client's exact declaration. */\nexport class RuleHelp {\n constructor(\n readonly description: string,\n readonly remediation: string,\n ) {}\n}\n\n/** The single owner supplies the configuration schema, regardless of implementation count. */\nexport class OwnedRuleDefinition {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly id: string,\n readonly schema: Readonly<Record<string, FieldDef>>,\n readonly schemaApiVersion: number,\n readonly optionalTuning: ConfigObject,\n readonly recommendedSeed: ConfigObject,\n readonly section: RuleConfigSection,\n readonly help: RuleHelp,\n ) {}\n}\n\n/** Each pack may implement an owned rule or contribute an execution kind to another owner. */\nexport class RuleContribution {\n constructor(\n readonly ruleId: string,\n readonly ownerPack: string,\n readonly executionKind: ExecutionKind,\n readonly implementationModule: string,\n ) {}\n}\n\nexport class RulePackManifest {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly packageName: string,\n readonly packageVersion: string,\n readonly apiVersion: number,\n readonly ownedRules: readonly OwnedRuleDefinition[],\n readonly contributions: readonly RuleContribution[],\n readonly migrations: readonly RetiredConfigKey[],\n readonly safeguards: readonly SafeguardDefinition[],\n ) {}\n}\n\n/** Explicit module declarations let a client add packs without a central built-in package list. */\nexport class RulePackDeclaration {\n constructor(readonly module: string) {}\n}\n\nexport type RuleConfigSection = 'rules' | 'hookGuards' | 'lint';\n\n/** A fixed invariant has no config switch; experimental safeguards require a separate explicit opt-in. */\nexport class SafeguardDefinition {\n constructor(\n readonly id: string,\n readonly activation: 'fixed' | 'experimental',\n readonly description: string,\n ) {}\n}\n\n/** Owner-provided migration instructions are data; the framework rejects rather than aliases retired keys. */\nexport class RetiredConfigKey {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly scope: string,\n readonly key: string,\n readonly movedTo: string,\n readonly instruction: string,\n readonly label: string,\n readonly prunable: boolean,\n ) {}\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { ConfigObject } from './rule-pack';
2
+ /** Validated owner settings, restricted to the policies supplied by this runtime module. */
3
+ export declare class PolicyRuntimeRequest {
4
+ readonly workspaceRoot: string;
5
+ readonly configs: Readonly<Record<string, ConfigObject>>;
6
+ readonly ruleIds: readonly string[];
7
+ constructor(workspaceRoot: string, configs: Readonly<Record<string, ConfigObject>>, ruleIds: readonly string[]);
8
+ }
9
+ export declare class BuildPolicyResult {
10
+ readonly success: boolean;
11
+ constructor(success: boolean);
12
+ }
13
+ /** A runtime may supply multiple named checks for one configured policy. */
14
+ export interface BuildPolicy {
15
+ readonly name: string;
16
+ readonly configKey: string;
17
+ shouldRun(): boolean;
18
+ run(workspaceRoot: string): Promise<BuildPolicyResult>;
19
+ }
20
+ export interface BuildRuleRuntime {
21
+ create(request: PolicyRuntimeRequest): Promise<readonly BuildPolicy[]>;
22
+ }
23
+ export declare class PolicyDebugSelection {
24
+ readonly rule: string;
25
+ readonly mode: string | undefined;
26
+ readonly projects: string | readonly string[] | undefined;
27
+ constructor(rule: string, mode: string | undefined, projects: string | readonly string[] | undefined);
28
+ }
29
+ export declare class BuildDebugRequest {
30
+ readonly workspaceRoot: string;
31
+ readonly selection: PolicyDebugSelection;
32
+ constructor(workspaceRoot: string, selection: PolicyDebugSelection);
33
+ }
34
+ export interface BuildDebugRuntime {
35
+ run(request: BuildDebugRequest): Promise<BuildPolicyResult>;
36
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildDebugRequest = exports.PolicyDebugSelection = exports.BuildPolicyResult = exports.PolicyRuntimeRequest = void 0;
4
+ /** Validated owner settings, restricted to the policies supplied by this runtime module. */
5
+ class PolicyRuntimeRequest {
6
+ workspaceRoot;
7
+ configs;
8
+ ruleIds;
9
+ constructor(workspaceRoot, configs, ruleIds) {
10
+ this.workspaceRoot = workspaceRoot;
11
+ this.configs = configs;
12
+ this.ruleIds = ruleIds;
13
+ }
14
+ }
15
+ exports.PolicyRuntimeRequest = PolicyRuntimeRequest;
16
+ class BuildPolicyResult {
17
+ success;
18
+ constructor(success) {
19
+ this.success = success;
20
+ }
21
+ }
22
+ exports.BuildPolicyResult = BuildPolicyResult;
23
+ class PolicyDebugSelection {
24
+ rule;
25
+ mode;
26
+ projects;
27
+ constructor(rule, mode, projects) {
28
+ this.rule = rule;
29
+ this.mode = mode;
30
+ this.projects = projects;
31
+ }
32
+ }
33
+ exports.PolicyDebugSelection = PolicyDebugSelection;
34
+ class BuildDebugRequest {
35
+ workspaceRoot;
36
+ selection;
37
+ constructor(workspaceRoot, selection) {
38
+ this.workspaceRoot = workspaceRoot;
39
+ this.selection = selection;
40
+ }
41
+ }
42
+ exports.BuildDebugRequest = BuildDebugRequest;
43
+ //# sourceMappingURL=rule-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-runtime.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-sdk/src/rule-runtime.ts"],"names":[],"mappings":";;;AAEA,4FAA4F;AAC5F,MAAa,oBAAoB;IAEhB;IACA;IACA;IAHb,YACa,aAAqB,EACrB,OAA+C,EAC/C,OAA0B;QAF1B,kBAAa,GAAb,aAAa,CAAQ;QACrB,YAAO,GAAP,OAAO,CAAwC;QAC/C,YAAO,GAAP,OAAO,CAAmB;IACpC,CAAC;CACP;AAND,oDAMC;AAED,MAAa,iBAAiB;IACL;IAArB,YAAqB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;CAC5C;AAFD,8CAEC;AAcD,MAAa,oBAAoB;IAEhB;IACA;IACA;IAHb,YACa,IAAY,EACZ,IAAwB,EACxB,QAAgD;QAFhD,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAoB;QACxB,aAAQ,GAAR,QAAQ,CAAwC;IAC1D,CAAC;CACP;AAND,oDAMC;AAED,MAAa,iBAAiB;IAEb;IACA;IAFb,YACa,aAAqB,EACrB,SAA+B;QAD/B,kBAAa,GAAb,aAAa,CAAQ;QACrB,cAAS,GAAT,SAAS,CAAsB;IACzC,CAAC;CACP;AALD,8CAKC","sourcesContent":["import { ConfigObject } from './rule-pack';\n\n/** Validated owner settings, restricted to the policies supplied by this runtime module. */\nexport class PolicyRuntimeRequest {\n constructor(\n readonly workspaceRoot: string,\n readonly configs: Readonly<Record<string, ConfigObject>>,\n readonly ruleIds: readonly string[],\n ) {}\n}\n\nexport class BuildPolicyResult {\n constructor(readonly success: boolean) {}\n}\n\n/** A runtime may supply multiple named checks for one configured policy. */\nexport interface BuildPolicy {\n readonly name: string;\n readonly configKey: string;\n shouldRun(): boolean;\n run(workspaceRoot: string): Promise<BuildPolicyResult>;\n}\n\nexport interface BuildRuleRuntime {\n create(request: PolicyRuntimeRequest): Promise<readonly BuildPolicy[]>;\n}\n\nexport class PolicyDebugSelection {\n constructor(\n readonly rule: string,\n readonly mode: string | undefined,\n readonly projects: string | readonly string[] | undefined,\n ) {}\n}\n\nexport class BuildDebugRequest {\n constructor(\n readonly workspaceRoot: string,\n readonly selection: PolicyDebugSelection,\n ) {}\n}\n\nexport interface BuildDebugRuntime {\n run(request: BuildDebugRequest): Promise<BuildPolicyResult>;\n}\n"]}