@intutic/shared-types 1.10.0 → 2.0.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.
Files changed (122) hide show
  1. package/README.md +1 -1
  2. package/dist/anomaly.d.ts +11 -0
  3. package/dist/anomaly.d.ts.map +1 -1
  4. package/dist/api-contracts.d.ts +97 -9
  5. package/dist/api-contracts.d.ts.map +1 -1
  6. package/dist/api-contracts.js +9 -0
  7. package/dist/api-contracts.js.map +1 -1
  8. package/dist/auth.d.ts +164 -1
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +39 -1
  11. package/dist/auth.js.map +1 -1
  12. package/dist/billing.d.ts +2 -99
  13. package/dist/billing.d.ts.map +1 -1
  14. package/dist/billing.js +2 -17
  15. package/dist/billing.js.map +1 -1
  16. package/dist/enums.d.ts +341 -4
  17. package/dist/enums.d.ts.map +1 -1
  18. package/dist/enums.js +369 -6
  19. package/dist/enums.js.map +1 -1
  20. package/dist/errors.d.ts +20 -1
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +20 -1
  23. package/dist/errors.js.map +1 -1
  24. package/dist/finops.d.ts +97 -1
  25. package/dist/finops.d.ts.map +1 -1
  26. package/dist/governanceCoverage.d.ts +82 -0
  27. package/dist/governanceCoverage.d.ts.map +1 -0
  28. package/dist/governanceCoverage.js +72 -0
  29. package/dist/governanceCoverage.js.map +1 -0
  30. package/dist/guardrailIr.d.ts +287 -0
  31. package/dist/guardrailIr.d.ts.map +1 -0
  32. package/dist/guardrailIr.js +301 -0
  33. package/dist/guardrailIr.js.map +1 -0
  34. package/dist/guardrailRender.d.ts +154 -0
  35. package/dist/guardrailRender.d.ts.map +1 -0
  36. package/dist/guardrailRender.js +440 -0
  37. package/dist/guardrailRender.js.map +1 -0
  38. package/dist/identity.d.ts +75 -0
  39. package/dist/identity.d.ts.map +1 -1
  40. package/dist/identity.js +5 -1
  41. package/dist/identity.js.map +1 -1
  42. package/dist/index.d.ts +34 -14
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +124 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/intelligence.d.ts +37 -11
  47. package/dist/intelligence.d.ts.map +1 -1
  48. package/dist/intelligence.js.map +1 -1
  49. package/dist/modelCatalog.d.ts +89 -0
  50. package/dist/modelCatalog.d.ts.map +1 -0
  51. package/dist/modelCatalog.generated.d.ts +7217 -0
  52. package/dist/modelCatalog.generated.d.ts.map +1 -0
  53. package/dist/modelCatalog.generated.js +577 -0
  54. package/dist/modelCatalog.generated.js.map +1 -0
  55. package/dist/modelCatalog.js +112 -0
  56. package/dist/modelCatalog.js.map +1 -0
  57. package/dist/notifications.d.ts +134 -2
  58. package/dist/notifications.d.ts.map +1 -1
  59. package/dist/observability.d.ts +4 -0
  60. package/dist/observability.d.ts.map +1 -1
  61. package/dist/policyGuardrails.d.ts +433 -0
  62. package/dist/policyGuardrails.d.ts.map +1 -0
  63. package/dist/policyGuardrails.js +91 -0
  64. package/dist/policyGuardrails.js.map +1 -0
  65. package/dist/posturePresets.d.ts +74 -0
  66. package/dist/posturePresets.d.ts.map +1 -0
  67. package/dist/posturePresets.js +139 -0
  68. package/dist/posturePresets.js.map +1 -0
  69. package/dist/providerVerification.d.ts +64 -0
  70. package/dist/providerVerification.d.ts.map +1 -0
  71. package/dist/providerVerification.js +184 -0
  72. package/dist/providerVerification.js.map +1 -0
  73. package/dist/providers.d.ts +93 -0
  74. package/dist/providers.d.ts.map +1 -0
  75. package/dist/providers.js +176 -0
  76. package/dist/providers.js.map +1 -0
  77. package/dist/rulePredicateDsl.d.ts +101 -0
  78. package/dist/rulePredicateDsl.d.ts.map +1 -0
  79. package/dist/rulePredicateDsl.js +263 -0
  80. package/dist/rulePredicateDsl.js.map +1 -0
  81. package/dist/rulePredicateEval.d.ts +38 -0
  82. package/dist/rulePredicateEval.d.ts.map +1 -0
  83. package/dist/rulePredicateEval.js +124 -0
  84. package/dist/rulePredicateEval.js.map +1 -0
  85. package/dist/scriptScan.d.ts +162 -0
  86. package/dist/scriptScan.d.ts.map +1 -0
  87. package/dist/scriptScan.js +362 -0
  88. package/dist/scriptScan.js.map +1 -0
  89. package/dist/secretPatterns.d.ts +43 -0
  90. package/dist/secretPatterns.d.ts.map +1 -0
  91. package/dist/secretPatterns.js +73 -0
  92. package/dist/secretPatterns.js.map +1 -0
  93. package/dist/skillScan.d.ts +166 -0
  94. package/dist/skillScan.d.ts.map +1 -0
  95. package/dist/skillScan.js +398 -0
  96. package/dist/skillScan.js.map +1 -0
  97. package/dist/sop.d.ts +188 -9
  98. package/dist/sop.d.ts.map +1 -1
  99. package/dist/sop.js +54 -2
  100. package/dist/sop.js.map +1 -1
  101. package/dist/sourceProviders.d.ts +41 -0
  102. package/dist/sourceProviders.d.ts.map +1 -0
  103. package/dist/sourceProviders.js +48 -0
  104. package/dist/sourceProviders.js.map +1 -0
  105. package/dist/sync.d.ts +98 -8
  106. package/dist/sync.d.ts.map +1 -1
  107. package/dist/sync.js.map +1 -1
  108. package/dist/toon.d.ts +80 -0
  109. package/dist/toon.d.ts.map +1 -0
  110. package/dist/toon.js +278 -0
  111. package/dist/toon.js.map +1 -0
  112. package/dist/usage.d.ts +23 -0
  113. package/dist/usage.d.ts.map +1 -1
  114. package/dist/wasmHost.d.ts +58 -0
  115. package/dist/wasmHost.d.ts.map +1 -0
  116. package/dist/wasmHost.js +80 -0
  117. package/dist/wasmHost.js.map +1 -0
  118. package/dist/workspaceSettings.d.ts +463 -21
  119. package/dist/workspaceSettings.d.ts.map +1 -1
  120. package/dist/workspaceSettings.js +86 -1
  121. package/dist/workspaceSettings.js.map +1 -1
  122. package/package.json +4 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptScan.js","sourceRoot":"","sources":["../src/scriptScan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;;;AAoIH,oDAaC;AAyOD,8CAeC;AAvY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;;;;GAiBG;AACH,SAAgB,iBAAiB,CAAC,OAAe,EAAE,QAAwB;IACzE,MAAM,QAAQ,GAAwB,EAAE,CAAA;IACxC,KAAK,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,QAAQ,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,SAAQ;QACxE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC1B,IAAI,CAAC,EAAE,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC;gBACZ,SAAS,EAAE,OAAO,CAAC,EAAE;gBACrB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,IAAA,yBAAU,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBAClD,MAAM,EAAE,QAAQ;aACjB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAA;AACxF,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Credential-VALUE patterns, declared once.
3
+ *
4
+ * Three consumers, three engines, one source:
5
+ * - the hook gate's static floor (`protectedPaths.ts` → emitted JS gates and
6
+ * bash gates via `grep -E`) — refuses a Write/Edit whose CONTENT carries a
7
+ * credential-shaped string, before the file exists;
8
+ * - the pre-commit scan (`tools/cli/src/lib/gitHooks.ts`, `grep -E` over the
9
+ * staged diff) — the last line before a secret enters git history;
10
+ * - tests in both packages.
11
+ *
12
+ * Hand-copying these between the gate and the git hook is how the two would
13
+ * drift into enforcing different notions of "credential" — the exact
14
+ * two-copies failure the WASM host-import list had. So the dialect here is
15
+ * the gate table's portable subset (see `assertPortableEre`): JS `RegExp` ∩
16
+ * POSIX ERE, with no `\b`, no lookaround, no `\d`/`\s` — and no interval
17
+ * quantifiers, which that checker forbids because `{n}` behaviour differs
18
+ * across greps. Repetition is therefore EXPANDED (`[A-Z2-7]` sixteen times),
19
+ * built by `.repeat()` below so the count is stated once, not typed sixteen
20
+ * times wrongly.
21
+ *
22
+ * Only HIGH-PRECISION shapes belong here: every pattern gates at `block`, and
23
+ * a false positive teaches the developer to disable the hook — the bypass the
24
+ * rest of the gate exists to stop. Prefixed formats (AKIA…, sk-ant-…, gh?_…,
25
+ * PEM armor) essentially never occur in benign prose in real format; the
26
+ * generic shapes (high-entropy hex, bare base64 runs) deliberately stay out,
27
+ * in the proxy's DLP where redaction — not refusal — is the response.
28
+ */
29
+ export interface SecretValuePattern {
30
+ /** Stable id, `secrets.*` family. Appears in block messages and audit lines. */
31
+ id: string;
32
+ /** JS RegExp ∩ POSIX ERE source, portable-subset clean. */
33
+ source: string;
34
+ /** Shown to the developer the moment they are blocked. */
35
+ description: string;
36
+ }
37
+ export declare const SECRET_VALUE_PATTERNS: readonly SecretValuePattern[];
38
+ /**
39
+ * The alternation of every pattern, for consumers that make one pass —
40
+ * the pre-commit hook's single `grep -E` over the staged diff.
41
+ */
42
+ export declare function secretPatternAlternation(): string;
43
+ //# sourceMappingURL=secretPatterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secretPatterns.d.ts","sourceRoot":"","sources":["../src/secretPatterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAA;IACV,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAA;IACd,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAA;CACpB;AAKD,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EA0D9D,CAAA;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SECRET_VALUE_PATTERNS = void 0;
4
+ exports.secretPatternAlternation = secretPatternAlternation;
5
+ /** `cls` repeated `n` times — interval quantifiers are not in the portable subset. */
6
+ const rep = (cls, n) => cls.repeat(n);
7
+ exports.SECRET_VALUE_PATTERNS = [
8
+ {
9
+ id: 'secrets.aws_access_key',
10
+ // AKIA long-lived, ASIA temporary, ABIA/ACCA/A3T* other classes; base32
11
+ // alphabet [A-Z2-7] per gitleaks — 0,1,8,9 never appear. Same shape the
12
+ // Rust proxy's dlp.rs and the MCP proxy's scanner pin.
13
+ source: '(A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)' + rep('[A-Z2-7]', 16),
14
+ description: 'AWS access key ID',
15
+ },
16
+ {
17
+ id: 'secrets.anthropic_api_key',
18
+ // 20 required tail characters, then any more — the portable spelling of {20,}.
19
+ source: 'sk-ant-' + rep('[A-Za-z0-9_-]', 20) + '[A-Za-z0-9_-]*',
20
+ description: 'Anthropic API key',
21
+ },
22
+ {
23
+ id: 'secrets.github_token',
24
+ // All five classic prefixes: PAT (ghp), OAuth (gho), App-user (ghu),
25
+ // App-server (ghs), refresh (ghr).
26
+ source: 'gh[pousr]_' + rep('[A-Za-z0-9]', 36),
27
+ description: 'GitHub token',
28
+ },
29
+ {
30
+ id: 'secrets.private_key_pem',
31
+ source: '-----BEGIN [A-Z ]*PRIVATE KEY-----',
32
+ description: 'PEM private key material',
33
+ },
34
+ {
35
+ id: 'secrets.openrouter_api_key',
36
+ // sk-or-v1- + a long hex tail. The default workhorse alias
37
+ // (infra/kubernetes/base/litellm/config.yaml) routes through this key —
38
+ // the one credential a default, non-BYOK Intutic deployment actually
39
+ // depends on, and it was absent from this table.
40
+ source: 'sk-or-v1-' + rep('[A-Za-z0-9]', 20) + '[A-Za-z0-9]*',
41
+ description: 'OpenRouter API key',
42
+ },
43
+ {
44
+ id: 'secrets.intutic_virtual_key',
45
+ // `vk_${randomBytes(16).toString('hex')}_${workspaceId}` —
46
+ // apiKeyService.ts's createApiKey. Exactly 32 lowercase hex chars after
47
+ // the prefix; the trailing `_<workspaceId>` is left unanchored since its
48
+ // own prefix is a plain implementation detail, not part of the secret.
49
+ source: 'vk_' + rep('[a-f0-9]', 32),
50
+ description: 'Intutic virtual key',
51
+ },
52
+ {
53
+ id: 'secrets.intutic_gateway_token',
54
+ // `gwk_${randomBytes(32).toString('hex')}` — routes/gateways.ts. Exactly
55
+ // 64 lowercase hex chars; this is the cell/gateway registration
56
+ // credential, gatewayAuth.ts's sole accepted token shape.
57
+ source: 'gwk_' + rep('[a-f0-9]', 64),
58
+ description: 'Intutic gateway token',
59
+ },
60
+ {
61
+ id: 'secrets.stripe_secret_key',
62
+ source: 'sk_live_' + rep('[A-Za-z0-9]', 24),
63
+ description: 'Stripe live secret key',
64
+ },
65
+ ];
66
+ /**
67
+ * The alternation of every pattern, for consumers that make one pass —
68
+ * the pre-commit hook's single `grep -E` over the staged diff.
69
+ */
70
+ function secretPatternAlternation() {
71
+ return exports.SECRET_VALUE_PATTERNS.map((p) => `(${p.source})`).join('|');
72
+ }
73
+ //# sourceMappingURL=secretPatterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secretPatterns.js","sourceRoot":"","sources":["../src/secretPatterns.ts"],"names":[],"mappings":";;;AAwGA,4DAEC;AArED,sFAAsF;AACtF,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,CAAS,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAEhD,QAAA,qBAAqB,GAAkC;IAClE;QACE,EAAE,EAAE,wBAAwB;QAC5B,wEAAwE;QACxE,wEAAwE;QACxE,uDAAuD;QACvD,MAAM,EAAE,mCAAmC,GAAG,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;QACjE,WAAW,EAAE,mBAAmB;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AC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Skill-content scanning — pattern table and scan function for AGENT SKILL
3
+ * markdown (`SKILL.md`), not tool descriptions.
4
+ *
5
+ * # Where these patterns came from, and what changed in the port
6
+ *
7
+ * No component in this codebase read skill content before this file. The
8
+ * closest existing detector is `packages/proxy/src/tool_poison.rs`, which
9
+ * scans TOOL DESCRIPTIONS for the same threat genre — prose an agent treats
10
+ * as authoritative instruction, published by a party the user never
11
+ * reviewed. Its own module doc comment records the reason that detector
12
+ * exists rather than reusing `injection.rs`: `injection.rs`'s five
13
+ * conversational-jailbreak patterns ("ignore previous instructions", "you
14
+ * are now", "DAN mode") were tested against the same poisoning corpus this
15
+ * module's seed patterns were validated on and matched **zero** payloads.
16
+ * A poisoned instruction document does not read like a jailbreak; it reads
17
+ * like documentation. Skill markdown is that same genre — prose the agent
18
+ * loads and treats as authoritative, not a conversational turn — so this
19
+ * module ports `tool_poison.rs`'s seven patterns' underlying INTENT (read
20
+ * the Rust source for the reasoning behind each one; this file adapts the
21
+ * detection logic to markdown/skill-file context, not JSON tool-description
22
+ * context — "tool" becomes "tool or skill" throughout, since a skill's prose
23
+ * can just as easily try to redirect which tool or which skill the agent
24
+ * uses), plus three additions for markdown's own attack surface: hidden HTML
25
+ * comments, markdown-link/image exfiltration, and an obfuscated
26
+ * decode-then-execute instruction shape that has no equivalent in a tool
27
+ * description (a tool description is not somewhere an agent expects to find
28
+ * executable-code instructions; a skill file is exactly that).
29
+ *
30
+ * # CRITICAL: what the 0-false-positive figure does and does NOT cover
31
+ *
32
+ * `tool_poison.rs`'s patterns are measured at 0 false positives on 10,753
33
+ * real tool and parameter descriptions (`packages/proxy/tests/corpus/tooldesc/`,
34
+ * BFCL v3). That figure is about TOOL DESCRIPTIONS. It says nothing about
35
+ * this file. Skill markdown is longer, more discursive, written for a human
36
+ * reader as much as an agent, and routinely contains the exact imperative
37
+ * security language ("block any call that…", "never embed secrets", "do
38
+ * not allow…") that a tool description never does — precisely the shape
39
+ * this module's patterns key on. The false-positive rate of THESE patterns
40
+ * on a corpus of REAL, BENIGN skill files is UNMEASURED. One known-benign
41
+ * fixture is checked here (see the sync-daemon test referenced below), but
42
+ * one fixture is not a corpus, and a corpus of skill markdown comparable in
43
+ * size and provenance to `tooldesc.jsonl` does not exist yet.
44
+ *
45
+ * Because of that gap, this phase is deliberately REPORT-ONLY. Nothing in
46
+ * this codebase blocks, refuses, or auto-deletes a skill on the strength of
47
+ * a finding from this module. `enableLocalSkillAuditDelete` (the existing
48
+ * workspace setting `tools/cli/src/commands/skill.ts` already consumes for
49
+ * the legacy rule-file audit) is extended to cover these findings too, but
50
+ * that is an explicit opt-in a workspace operator chooses, not a default —
51
+ * see the CLI command for the exact gate. Building enforcement on top of
52
+ * these patterns is follow-up work, gated on first measuring the
53
+ * false-positive rate against a real benign-skill corpus the way
54
+ * `tool_poison.rs` was. See `docs/TECH_DEBT.md` for the tracking entries.
55
+ *
56
+ * # Fixture discipline
57
+ *
58
+ * Every pattern below carries a `matches` array of at least one string that
59
+ * MUST trigger it, and a `notMatches` array of at least three strings that
60
+ * MUST NOT — the same discipline `services/sync-daemon/src/harness/protectedPaths.ts`
61
+ * enforces for its `GuardPattern` table (`assertGuardTableSane`), for the
62
+ * same reason: a pattern with no false-positive contract is a pattern nobody
63
+ * has thought about failing, and a pattern that has never been checked to
64
+ * fire at all can pass every other check while matching nothing. Both are
65
+ * asserted at import time (`assertSkillScanTableSane`, below), not from a
66
+ * test someone could skip — a broken pattern breaks the import for every
67
+ * consumer immediately.
68
+ *
69
+ * The single most load-bearing fixture in this codebase for this module is
70
+ * NOT here, deliberately: `services/sync-daemon/src/skillWriter.ts`'s
71
+ * `RULE_AUTHOR_SKILL` constant is full of the exact imperative security
72
+ * prose ("block any agent call that…", "Never embed secrets…") most likely
73
+ * to trip an overzealous pattern, and it is a real skill this codebase
74
+ * already ships. Asserting `scanSkillContent(RULE_AUTHOR_SKILL).clean` is
75
+ * done in `services/sync-daemon/__tests__/skillWriter.test.ts` rather than
76
+ * in this package's own test suite, because `packages/shared-types` is a
77
+ * leaf package `sync-daemon` depends on — importing sync-daemon's source
78
+ * from here would invert that dependency. The assertion still exists; it
79
+ * just lives at the one point in the dependency graph where both pieces are
80
+ * available without a layering violation.
81
+ *
82
+ * @module
83
+ */
84
+ /** The three threat categories this module scans for, borrowed from Cisco's
85
+ * open-source `skill-scanner` taxonomy (not its implementation — see the
86
+ * module doc comment for why this is a native TypeScript port instead). */
87
+ export type SkillScanCategory = 'prompt_injection' | 'data_exfiltration' | 'malicious_code';
88
+ /**
89
+ * Which engine produced a finding. `'native'` is this module's own regex
90
+ * scanner (and `scriptScan.ts`'s, which reuses this union);
91
+ * `'cisco-skill-scanner'` is the separate, opt-in Cisco `skill-scanner`
92
+ * integration (Phase S3, `tools/cli/src/lib/ciscoScanner.ts`) — the
93
+ * genuinely deeper AST/dataflow analysis TD-356 named as the eventual
94
+ * follow-up to this phase's pattern matching. Optional, not required: a
95
+ * finding from before this field existed has no engine tag, which is fine —
96
+ * absence has always meant "this codebase's own scanner," now made explicit.
97
+ */
98
+ export type SkillScanEngine = 'native' | 'cisco-skill-scanner';
99
+ /** One scan pattern, self-tested at import time. */
100
+ export interface SkillScanPattern {
101
+ /** Stable id. Appears in findings and audit lines — never renumber one. */
102
+ id: string;
103
+ category: SkillScanCategory;
104
+ /** JS `RegExp` source. Matched case-insensitively; see {@link scanSkillContent}. */
105
+ source: string;
106
+ /** What this pattern catches and why — shown to whoever reviews a finding. */
107
+ description: string;
108
+ /** Strings that MUST match. At least one, checked at import time. */
109
+ matches: readonly string[];
110
+ /** Strings that MUST NOT match — the false-positive contract. At least
111
+ * three, checked at import time. */
112
+ notMatches: readonly string[];
113
+ }
114
+ /** One finding from {@link scanSkillContent}. Never carries full skill
115
+ * content — {@link excerptFor} bounds any excerpt to a short window around
116
+ * the match, the same idea `tool_poison.rs`'s redaction placeholder serves
117
+ * (replace/bound the payload, never log it whole), sized to the {0,40}–
118
+ * {0,80} windows the patterns themselves already use for context. */
119
+ export interface SkillScanFinding {
120
+ patternId: string;
121
+ category: SkillScanCategory;
122
+ /** Bounded context around the match. Omitted only if excerpting somehow
123
+ * fails; never the full file. */
124
+ excerpt?: string;
125
+ /** Which engine produced this finding. See {@link SkillScanEngine}. */
126
+ engine?: SkillScanEngine;
127
+ }
128
+ export interface SkillScanResult {
129
+ /** True only when `findings` is empty. */
130
+ clean: boolean;
131
+ findings: SkillScanFinding[];
132
+ /** ISO-8601 timestamp of when this scan ran. */
133
+ scannedAt: string;
134
+ }
135
+ /** Longest excerpt this module will ever surface, in characters, centered on
136
+ * a match. Bounded, not full-content — see the module doc comment.
137
+ * Exported so `scriptScan.ts` (the bundled-script scanner, Phase S2) can
138
+ * reuse the exact same bounding rather than growing a second, easily
139
+ * drifting copy of "how big is too big for an excerpt". */
140
+ export declare const EXCERPT_RADIUS = 40;
141
+ /** Bounds a match to a short window of surrounding context. Exported for
142
+ * `scriptScan.ts` to reuse verbatim — see {@link EXCERPT_RADIUS}. */
143
+ export declare function excerptFor(content: string, index: number, length: number): string;
144
+ /**
145
+ * The pattern table.
146
+ *
147
+ * Ported from `tool_poison.rs`'s seven patterns (intent preserved, "tool"
148
+ * generalised to "tool or skill" throughout since skill prose routinely
149
+ * talks about which tool to use), plus three additions for markdown's own
150
+ * surface: hidden HTML comments, markdown-link exfiltration, and an
151
+ * obfuscated decode-then-execute instruction shape.
152
+ */
153
+ export declare const SKILL_SCAN_PATTERNS: readonly SkillScanPattern[];
154
+ /**
155
+ * Scan skill markdown content for the patterns above.
156
+ *
157
+ * Report-only: returning findings is the entire effect of this function. It
158
+ * does not redact, block, or mutate `content` in any way — see the module
159
+ * doc comment for why enforcement is deliberately not built in this phase.
160
+ *
161
+ * Findings never carry the full skill content, only a bounded excerpt (see
162
+ * {@link excerptFor}) around each match, so a findings payload is safe to
163
+ * log or display without becoming a second copy of the skill.
164
+ */
165
+ export declare function scanSkillContent(content: string): SkillScanResult;
166
+ //# sourceMappingURL=skillScan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillScan.d.ts","sourceRoot":"","sources":["../src/skillScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AAEH;;4EAE4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,gBAAgB,CAAA;AAE3F;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,qBAAqB,CAAA;AAE9D,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAA;IACnB,qEAAqE;IACrE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B;yCACqC;IACrC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B;AAED;;;;sEAIsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;sCACkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uEAAuE;IACvE,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,gBAAgB,EAAE,CAAA;IAC5B,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;4DAI4D;AAC5D,eAAO,MAAM,cAAc,KAAK,CAAA;AAEhC;s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