@agenttrail/guardrails 0.2.5 → 0.2.7

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.
@@ -1,5 +1,5 @@
1
- import { M as MatchCondition, F as Fixture, R as Rule } from './schema-B2pYoi9Z.cjs';
2
- export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-B2pYoi9Z.cjs';
1
+ import { M as MatchCondition, F as Fixture, R as Rule } from './schema-DmT-Vm1T.cjs';
2
+ export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-DmT-Vm1T.cjs';
3
3
  import 'zod';
4
4
 
5
5
  /**
@@ -360,7 +360,7 @@ declare function mentions(text: string): Fixture[];
360
360
  * Pinned to `package.json`'s `version` by `__tests__/stamp.test.ts` — this is a copy
361
361
  * of that value, not an independent one, and the test is what makes the copy safe.
362
362
  */
363
- declare const CATALOG_VERSION = "0.2.5";
363
+ declare const CATALOG_VERSION = "0.2.7";
364
364
  /**
365
365
  * When the guardrails in this catalog reached their current state, as an ISO-8601
366
366
  * instant. The question it answers is not "when did this reach a registry" but "how
@@ -370,7 +370,7 @@ declare const CATALOG_VERSION = "0.2.5";
370
370
  * the guard handles a missing date, and a wrong date that looks right is worse than
371
371
  * a missing one.
372
372
  */
373
- declare const CATALOG_PUBLISHED_AT = "2026-10-22T11:20:35Z";
373
+ declare const CATALOG_PUBLISHED_AT = "2026-11-06T07:10:34Z";
374
374
 
375
375
  /**
376
376
  * The corpus itself — guardrails only, and **deliberately free of zod**.
@@ -1,5 +1,5 @@
1
- import { M as MatchCondition, F as Fixture, R as Rule } from './schema-B2pYoi9Z.js';
2
- export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-B2pYoi9Z.js';
1
+ import { M as MatchCondition, F as Fixture, R as Rule } from './schema-DmT-Vm1T.js';
2
+ export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-DmT-Vm1T.js';
3
3
  import 'zod';
4
4
 
5
5
  /**
@@ -360,7 +360,7 @@ declare function mentions(text: string): Fixture[];
360
360
  * Pinned to `package.json`'s `version` by `__tests__/stamp.test.ts` — this is a copy
361
361
  * of that value, not an independent one, and the test is what makes the copy safe.
362
362
  */
363
- declare const CATALOG_VERSION = "0.2.5";
363
+ declare const CATALOG_VERSION = "0.2.7";
364
364
  /**
365
365
  * When the guardrails in this catalog reached their current state, as an ISO-8601
366
366
  * instant. The question it answers is not "when did this reach a registry" but "how
@@ -370,7 +370,7 @@ declare const CATALOG_VERSION = "0.2.5";
370
370
  * the guard handles a missing date, and a wrong date that looks right is worse than
371
371
  * a missing one.
372
372
  */
373
- declare const CATALOG_PUBLISHED_AT = "2026-10-22T11:20:35Z";
373
+ declare const CATALOG_PUBLISHED_AT = "2026-11-06T07:10:34Z";
374
374
 
375
375
  /**
376
376
  * The corpus itself — guardrails only, and **deliberately free of zod**.
@@ -23,7 +23,7 @@ import {
23
23
  mentions,
24
24
  pwsh,
25
25
  rulesForPack
26
- } from "./chunk-SLJLCAZK.js";
26
+ } from "./chunk-3BH4CH3D.js";
27
27
  import {
28
28
  OWASP_AGENTIC,
29
29
  OWASP_IDS,
package/dist/index.cjs CHANGED
@@ -24,6 +24,8 @@ __export(src_exports, {
24
24
  ActionSchema: () => ActionSchema,
25
25
  CATALOG_PUBLISHED_AT: () => CATALOG_PUBLISHED_AT,
26
26
  CATALOG_VERSION: () => CATALOG_VERSION,
27
+ CHANNELS: () => CHANNELS,
28
+ ChannelSchema: () => ChannelSchema,
27
29
  DETAIL_MATCHES_MAX_PATTERNS: () => DETAIL_MATCHES_MAX_PATTERNS,
28
30
  DETAIL_MATCHES_MAX_PATTERN_LENGTH: () => DETAIL_MATCHES_MAX_PATTERN_LENGTH,
29
31
  FixtureSchema: () => FixtureSchema,
@@ -4058,8 +4060,8 @@ function owaspTitle(id) {
4058
4060
  }
4059
4061
 
4060
4062
  // src/stamp.ts
4061
- var CATALOG_VERSION = "0.2.5";
4062
- var CATALOG_PUBLISHED_AT = "2026-10-22T11:20:35Z";
4063
+ var CATALOG_VERSION = "0.2.7";
4064
+ var CATALOG_PUBLISHED_AT = "2026-11-06T07:10:34Z";
4063
4065
 
4064
4066
  // src/rules.ts
4065
4067
  var RULES_BY_PACK = {
@@ -4166,14 +4168,23 @@ var DetailMatchPatternSchema = import_zod.z.string().min(1).max(DETAIL_MATCHES_M
4166
4168
  });
4167
4169
  }
4168
4170
  });
4171
+ var CHANNELS = ["command", "content"];
4172
+ var ChannelSchema = import_zod.z.enum(CHANNELS);
4169
4173
  var MatchConditionSchema = import_zod.z.object({
4170
4174
  kind: import_zod.z.string().min(1),
4171
4175
  label: import_zod.z.string().min(1).optional(),
4172
4176
  detail_contains: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
4173
4177
  detail_matches: import_zod.z.array(DetailMatchPatternSchema).min(1).max(DETAIL_MATCHES_MAX_PATTERNS).optional(),
4174
- file_glob: import_zod.z.string().min(1).optional()
4178
+ file_glob: import_zod.z.string().min(1).optional(),
4179
+ channel: ChannelSchema.optional()
4175
4180
  }).strict().superRefine((condition, ctx) => {
4176
4181
  const hasCommandMatcher = condition.detail_contains !== void 0 || condition.detail_matches !== void 0;
4182
+ if (condition.channel !== void 0 && !hasCommandMatcher) {
4183
+ ctx.addIssue({
4184
+ code: import_zod.z.ZodIssueCode.custom,
4185
+ message: "`channel` says which text detail_contains / detail_matches read, so a condition carrying it needs one of them"
4186
+ });
4187
+ }
4177
4188
  if (hasCommandMatcher && condition.file_glob !== void 0) {
4178
4189
  ctx.addIssue({
4179
4190
  code: import_zod.z.ZodIssueCode.custom,