@vibesdotdev/security 0.0.0-stage → 1.0.0-rc.4
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/LICENSE +18 -0
- package/README.md +109 -2
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/plugin.d.ts +15 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +25 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/read-lockfile.d.ts +4 -0
- package/dist/cli/read-lockfile.d.ts.map +1 -0
- package/dist/cli/read-lockfile.js +74 -0
- package/dist/cli/read-lockfile.js.map +1 -0
- package/dist/cli/report-output.d.ts +20 -0
- package/dist/cli/report-output.d.ts.map +1 -0
- package/dist/cli/report-output.js +27 -0
- package/dist/cli/report-output.js.map +1 -0
- package/dist/cli/shield.cli-group.descriptor.d.ts +9 -0
- package/dist/cli/shield.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/shield.cli-group.descriptor.js +16 -0
- package/dist/cli/shield.cli-group.descriptor.js.map +1 -0
- package/dist/cli/shield.deps.cli-group.descriptor.d.ts +9 -0
- package/dist/cli/shield.deps.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/shield.deps.cli-group.descriptor.js +17 -0
- package/dist/cli/shield.deps.cli-group.descriptor.js.map +1 -0
- package/dist/cli/shield.deps.gate.descriptor.d.ts +10 -0
- package/dist/cli/shield.deps.gate.descriptor.d.ts.map +1 -0
- package/dist/cli/shield.deps.gate.descriptor.js +25 -0
- package/dist/cli/shield.deps.gate.descriptor.js.map +1 -0
- package/dist/cli/shield.deps.gate.impl.consumer.d.ts +18 -0
- package/dist/cli/shield.deps.gate.impl.consumer.d.ts.map +1 -0
- package/dist/cli/shield.deps.gate.impl.consumer.js +42 -0
- package/dist/cli/shield.deps.gate.impl.consumer.js.map +1 -0
- package/dist/cli/shield.deps.scan.descriptor.d.ts +10 -0
- package/dist/cli/shield.deps.scan.descriptor.d.ts.map +1 -0
- package/dist/cli/shield.deps.scan.descriptor.js +25 -0
- package/dist/cli/shield.deps.scan.descriptor.js.map +1 -0
- package/dist/cli/shield.deps.scan.impl.consumer.d.ts +16 -0
- package/dist/cli/shield.deps.scan.impl.consumer.d.ts.map +1 -0
- package/dist/cli/shield.deps.scan.impl.consumer.js +35 -0
- package/dist/cli/shield.deps.scan.impl.consumer.js.map +1 -0
- package/dist/helpers/constant-time.d.ts +18 -0
- package/dist/helpers/constant-time.d.ts.map +1 -0
- package/dist/helpers/constant-time.js +49 -0
- package/dist/helpers/constant-time.js.map +1 -0
- package/dist/helpers/filename-sanitizer.d.ts +2 -0
- package/dist/helpers/filename-sanitizer.d.ts.map +1 -0
- package/dist/helpers/filename-sanitizer.js +18 -0
- package/dist/helpers/filename-sanitizer.js.map +1 -0
- package/dist/helpers/forwardable-auth-headers.d.ts +8 -0
- package/dist/helpers/forwardable-auth-headers.d.ts.map +1 -0
- package/dist/helpers/forwardable-auth-headers.js +44 -0
- package/dist/helpers/forwardable-auth-headers.js.map +1 -0
- package/dist/helpers/index.d.ts +7 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +7 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/ip-range.d.ts +3 -0
- package/dist/helpers/ip-range.d.ts.map +1 -0
- package/dist/helpers/ip-range.js +55 -0
- package/dist/helpers/ip-range.js.map +1 -0
- package/dist/helpers/mime-classifier.d.ts +3 -0
- package/dist/helpers/mime-classifier.d.ts.map +1 -0
- package/dist/helpers/mime-classifier.js +29 -0
- package/dist/helpers/mime-classifier.js.map +1 -0
- package/dist/helpers/pattern-matcher.d.ts +13 -0
- package/dist/helpers/pattern-matcher.d.ts.map +1 -0
- package/dist/helpers/pattern-matcher.js +29 -0
- package/dist/helpers/pattern-matcher.js.map +1 -0
- package/dist/implementations/cli-types.d.ts +2 -0
- package/dist/implementations/cli-types.d.ts.map +1 -0
- package/dist/implementations/cli-types.js +2 -0
- package/dist/implementations/cli-types.js.map +1 -0
- package/dist/implementations/encryption.d.ts +21 -0
- package/dist/implementations/encryption.d.ts.map +1 -0
- package/dist/implementations/encryption.js +154 -0
- package/dist/implementations/encryption.js.map +1 -0
- package/dist/implementations/errors.d.ts +17 -0
- package/dist/implementations/errors.d.ts.map +1 -0
- package/dist/implementations/errors.js +23 -0
- package/dist/implementations/errors.js.map +1 -0
- package/dist/implementations/keys.d.ts +24 -0
- package/dist/implementations/keys.d.ts.map +1 -0
- package/dist/implementations/keys.js +114 -0
- package/dist/implementations/keys.js.map +1 -0
- package/dist/implementations/redaction-admission.d.ts +24 -0
- package/dist/implementations/redaction-admission.d.ts.map +1 -0
- package/dist/implementations/redaction-admission.js +44 -0
- package/dist/implementations/redaction-admission.js.map +1 -0
- package/dist/implementations/redaction.d.ts +32 -0
- package/dist/implementations/redaction.d.ts.map +1 -0
- package/dist/implementations/redaction.js +47 -0
- package/dist/implementations/redaction.js.map +1 -0
- package/dist/implementations/redactor.inprocess.impl.d.ts +30 -0
- package/dist/implementations/redactor.inprocess.impl.d.ts.map +1 -0
- package/dist/implementations/redactor.inprocess.impl.js +26 -0
- package/dist/implementations/redactor.inprocess.impl.js.map +1 -0
- package/dist/implementations/redactor.subprocess.impl.d.ts +25 -0
- package/dist/implementations/redactor.subprocess.impl.d.ts.map +1 -0
- package/dist/implementations/redactor.subprocess.impl.js +42 -0
- package/dist/implementations/redactor.subprocess.impl.js.map +1 -0
- package/dist/implementations/scanner.impl.d.ts +7 -0
- package/dist/implementations/scanner.impl.d.ts.map +1 -0
- package/dist/implementations/scanner.impl.js +166 -0
- package/dist/implementations/scanner.impl.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/kinds/auditor.kind.d.ts +31 -0
- package/dist/kinds/auditor.kind.d.ts.map +1 -0
- package/dist/kinds/auditor.kind.js +48 -0
- package/dist/kinds/auditor.kind.js.map +1 -0
- package/dist/kinds/dep-scanner.kind.d.ts +27 -0
- package/dist/kinds/dep-scanner.kind.d.ts.map +1 -0
- package/dist/kinds/dep-scanner.kind.js +29 -0
- package/dist/kinds/dep-scanner.kind.js.map +1 -0
- package/dist/kinds/freshness-policy.kind.d.ts +34 -0
- package/dist/kinds/freshness-policy.kind.d.ts.map +1 -0
- package/dist/kinds/freshness-policy.kind.js +47 -0
- package/dist/kinds/freshness-policy.kind.js.map +1 -0
- package/dist/kinds/index.d.ts +9 -0
- package/dist/kinds/index.d.ts.map +1 -0
- package/dist/kinds/index.js +9 -0
- package/dist/kinds/index.js.map +1 -0
- package/dist/kinds/ioc-feed.kind.d.ts +35 -0
- package/dist/kinds/ioc-feed.kind.d.ts.map +1 -0
- package/dist/kinds/ioc-feed.kind.js +36 -0
- package/dist/kinds/ioc-feed.kind.js.map +1 -0
- package/dist/kinds/policy.kind.d.ts +42 -0
- package/dist/kinds/policy.kind.d.ts.map +1 -0
- package/dist/kinds/policy.kind.js +23 -0
- package/dist/kinds/policy.kind.js.map +1 -0
- package/dist/kinds/redactor.kind.d.ts +30 -0
- package/dist/kinds/redactor.kind.d.ts.map +1 -0
- package/dist/kinds/redactor.kind.js +25 -0
- package/dist/kinds/redactor.kind.js.map +1 -0
- package/dist/kinds/scanner.kind.d.ts +35 -0
- package/dist/kinds/scanner.kind.d.ts.map +1 -0
- package/dist/kinds/scanner.kind.js +26 -0
- package/dist/kinds/scanner.kind.js.map +1 -0
- package/dist/schemas/AuditEvent.d.ts +30 -0
- package/dist/schemas/AuditEvent.d.ts.map +1 -0
- package/dist/schemas/AuditEvent.js +17 -0
- package/dist/schemas/AuditEvent.js.map +1 -0
- package/dist/schemas/RedactionRule.d.ts +16 -0
- package/dist/schemas/RedactionRule.d.ts.map +1 -0
- package/dist/schemas/RedactionRule.js +10 -0
- package/dist/schemas/RedactionRule.js.map +1 -0
- package/dist/schemas/SecurityPolicy.d.ts +21 -0
- package/dist/schemas/SecurityPolicy.d.ts.map +1 -0
- package/dist/schemas/SecurityPolicy.js +9 -0
- package/dist/schemas/SecurityPolicy.js.map +1 -0
- package/dist/schemas/ThreatReport.d.ts +25 -0
- package/dist/schemas/ThreatReport.d.ts.map +1 -0
- package/dist/schemas/ThreatReport.js +14 -0
- package/dist/schemas/ThreatReport.js.map +1 -0
- package/dist/schemas/contracts/auditor.d.ts +68 -0
- package/dist/schemas/contracts/auditor.d.ts.map +1 -0
- package/dist/schemas/contracts/auditor.js +13 -0
- package/dist/schemas/contracts/auditor.js.map +1 -0
- package/dist/schemas/contracts/card.d.ts +106 -0
- package/dist/schemas/contracts/card.d.ts.map +1 -0
- package/dist/schemas/contracts/card.js +73 -0
- package/dist/schemas/contracts/card.js.map +1 -0
- package/dist/schemas/contracts/dep-scanner.d.ts +91 -0
- package/dist/schemas/contracts/dep-scanner.d.ts.map +1 -0
- package/dist/schemas/contracts/dep-scanner.js +27 -0
- package/dist/schemas/contracts/dep-scanner.js.map +1 -0
- package/dist/schemas/contracts/freshness-policy.d.ts +99 -0
- package/dist/schemas/contracts/freshness-policy.d.ts.map +1 -0
- package/dist/schemas/contracts/freshness-policy.js +31 -0
- package/dist/schemas/contracts/freshness-policy.js.map +1 -0
- package/dist/schemas/contracts/ioc-feed.d.ts +85 -0
- package/dist/schemas/contracts/ioc-feed.d.ts.map +1 -0
- package/dist/schemas/contracts/ioc-feed.js +28 -0
- package/dist/schemas/contracts/ioc-feed.js.map +1 -0
- package/dist/schemas/contracts/misc.d.ts +11 -0
- package/dist/schemas/contracts/misc.d.ts.map +1 -0
- package/dist/schemas/contracts/misc.js +4 -0
- package/dist/schemas/contracts/misc.js.map +1 -0
- package/dist/schemas/contracts/policy.d.ts +93 -0
- package/dist/schemas/contracts/policy.d.ts.map +1 -0
- package/dist/schemas/contracts/policy.js +25 -0
- package/dist/schemas/contracts/policy.js.map +1 -0
- package/dist/schemas/contracts/redactor.d.ts +99 -0
- package/dist/schemas/contracts/redactor.d.ts.map +1 -0
- package/dist/schemas/contracts/redactor.js +34 -0
- package/dist/schemas/contracts/redactor.js.map +1 -0
- package/dist/schemas/contracts/scanner.d.ts +112 -0
- package/dist/schemas/contracts/scanner.d.ts.map +1 -0
- package/dist/schemas/contracts/scanner.js +40 -0
- package/dist/schemas/contracts/scanner.js.map +1 -0
- package/dist/schemas/contracts/widget.d.ts +19 -0
- package/dist/schemas/contracts/widget.d.ts.map +1 -0
- package/dist/schemas/contracts/widget.js +10 -0
- package/dist/schemas/contracts/widget.js.map +1 -0
- package/dist/schemas/encryption.d.ts +25 -0
- package/dist/schemas/encryption.d.ts.map +1 -0
- package/dist/schemas/encryption.js +35 -0
- package/dist/schemas/encryption.js.map +1 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +6 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/policy.d.ts +2 -0
- package/dist/schemas/policy.d.ts.map +1 -0
- package/dist/schemas/policy.js +2 -0
- package/dist/schemas/policy.js.map +1 -0
- package/dist/schemas/redactor.d.ts +2 -0
- package/dist/schemas/redactor.d.ts.map +1 -0
- package/dist/schemas/redactor.js +2 -0
- package/dist/schemas/redactor.js.map +1 -0
- package/dist/schemas/report-event.d.ts +29 -0
- package/dist/schemas/report-event.d.ts.map +1 -0
- package/dist/schemas/report-event.js +19 -0
- package/dist/schemas/report-event.js.map +1 -0
- package/dist/schemas/scanner.d.ts +2 -0
- package/dist/schemas/scanner.d.ts.map +1 -0
- package/dist/schemas/scanner.js +2 -0
- package/dist/schemas/scanner.js.map +1 -0
- package/dist/security-client/index.d.ts +3 -0
- package/dist/security-client/index.d.ts.map +1 -0
- package/dist/security-client/index.js +2 -0
- package/dist/security-client/index.js.map +1 -0
- package/dist/security-client/security-client.d.ts +34 -0
- package/dist/security-client/security-client.d.ts.map +1 -0
- package/dist/security-client/security-client.js +54 -0
- package/dist/security-client/security-client.js.map +1 -0
- package/dist/security.consumer.plugin.d.ts +3 -0
- package/dist/security.consumer.plugin.d.ts.map +1 -0
- package/dist/security.consumer.plugin.js +28 -0
- package/dist/security.consumer.plugin.js.map +1 -0
- package/dist/security.plugin.d.ts +16 -0
- package/dist/security.plugin.d.ts.map +1 -0
- package/dist/security.plugin.js +78 -0
- package/dist/security.plugin.js.map +1 -0
- package/dist/svelte/index.d.ts +3 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +2 -0
- package/dist/svelte/security-svelte.plugin.d.ts +3 -0
- package/dist/svelte/security-svelte.plugin.d.ts.map +1 -0
- package/dist/svelte/security-svelte.plugin.js +38 -0
- package/dist/svelte/styles.css +8 -0
- package/dist/svelte/tool-widgets/SecurityToolCard.svelte +140 -0
- package/dist/svelte/tool-widgets/SecurityToolCard.svelte.d.ts +5 -0
- package/dist/svelte/tool-widgets/SecurityToolCard.svelte.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/index.d.ts +2 -0
- package/dist/svelte/tool-widgets/index.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/index.js +6 -0
- package/dist/tools/check-policy/check-policy.descriptor.d.ts +37 -0
- package/dist/tools/check-policy/check-policy.descriptor.d.ts.map +1 -0
- package/dist/tools/check-policy/check-policy.descriptor.js +21 -0
- package/dist/tools/check-policy/check-policy.descriptor.js.map +1 -0
- package/dist/tools/check-policy/check-policy.impl.consumer.d.ts +7 -0
- package/dist/tools/check-policy/check-policy.impl.consumer.d.ts.map +1 -0
- package/dist/tools/check-policy/check-policy.impl.consumer.js +21 -0
- package/dist/tools/check-policy/check-policy.impl.consumer.js.map +1 -0
- package/dist/tools/check-policy/index.d.ts +3 -0
- package/dist/tools/check-policy/index.d.ts.map +1 -0
- package/dist/tools/check-policy/index.js +2 -0
- package/dist/tools/check-policy/index.js.map +1 -0
- package/dist/tools/check-policy/schemas.d.ts +23 -0
- package/dist/tools/check-policy/schemas.d.ts.map +1 -0
- package/dist/tools/check-policy/schemas.js +13 -0
- package/dist/tools/check-policy/schemas.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/redact-output/index.d.ts +3 -0
- package/dist/tools/redact-output/index.d.ts.map +1 -0
- package/dist/tools/redact-output/index.js +2 -0
- package/dist/tools/redact-output/index.js.map +1 -0
- package/dist/tools/redact-output/redact-output.descriptor.d.ts +42 -0
- package/dist/tools/redact-output/redact-output.descriptor.d.ts.map +1 -0
- package/dist/tools/redact-output/redact-output.descriptor.js +21 -0
- package/dist/tools/redact-output/redact-output.descriptor.js.map +1 -0
- package/dist/tools/redact-output/redact-output.impl.consumer.d.ts +7 -0
- package/dist/tools/redact-output/redact-output.impl.consumer.d.ts.map +1 -0
- package/dist/tools/redact-output/redact-output.impl.consumer.js +18 -0
- package/dist/tools/redact-output/redact-output.impl.consumer.js.map +1 -0
- package/dist/tools/redact-output/schemas.d.ts +28 -0
- package/dist/tools/redact-output/schemas.d.ts.map +1 -0
- package/dist/tools/redact-output/schemas.js +13 -0
- package/dist/tools/redact-output/schemas.js.map +1 -0
- package/dist/tools/report-event/index.d.ts +3 -0
- package/dist/tools/report-event/index.d.ts.map +1 -0
- package/dist/tools/report-event/index.js +2 -0
- package/dist/tools/report-event/index.js.map +1 -0
- package/dist/tools/report-event/report-event.descriptor.d.ts +43 -0
- package/dist/tools/report-event/report-event.descriptor.d.ts.map +1 -0
- package/dist/tools/report-event/report-event.descriptor.js +21 -0
- package/dist/tools/report-event/report-event.descriptor.js.map +1 -0
- package/dist/tools/report-event/report-event.impl.consumer.d.ts +24 -0
- package/dist/tools/report-event/report-event.impl.consumer.d.ts.map +1 -0
- package/dist/tools/report-event/report-event.impl.consumer.js +61 -0
- package/dist/tools/report-event/report-event.impl.consumer.js.map +1 -0
- package/dist/tools/report-event/schemas.d.ts +2 -0
- package/dist/tools/report-event/schemas.d.ts.map +1 -0
- package/dist/tools/report-event/schemas.js +3 -0
- package/dist/tools/report-event/schemas.js.map +1 -0
- package/dist/tools/scan-input/index.d.ts +3 -0
- package/dist/tools/scan-input/index.d.ts.map +1 -0
- package/dist/tools/scan-input/index.js +2 -0
- package/dist/tools/scan-input/index.js.map +1 -0
- package/dist/tools/scan-input/scan-input.descriptor.d.ts +49 -0
- package/dist/tools/scan-input/scan-input.descriptor.d.ts.map +1 -0
- package/dist/tools/scan-input/scan-input.descriptor.js +21 -0
- package/dist/tools/scan-input/scan-input.descriptor.js.map +1 -0
- package/dist/tools/scan-input/scan-input.impl.consumer.d.ts +7 -0
- package/dist/tools/scan-input/scan-input.impl.consumer.d.ts.map +1 -0
- package/dist/tools/scan-input/scan-input.impl.consumer.js +22 -0
- package/dist/tools/scan-input/scan-input.impl.consumer.js.map +1 -0
- package/dist/tools/scan-input/schemas.d.ts +36 -0
- package/dist/tools/scan-input/schemas.d.ts.map +1 -0
- package/dist/tools/scan-input/schemas.js +15 -0
- package/dist/tools/scan-input/schemas.js.map +1 -0
- package/dist/tools/security-tool-card.d.ts +13 -0
- package/dist/tools/security-tool-card.d.ts.map +1 -0
- package/dist/tools/security-tool-card.js +171 -0
- package/dist/tools/security-tool-card.js.map +1 -0
- package/dist/tools/security.docs.descriptor.d.ts +17 -0
- package/dist/tools/security.docs.descriptor.d.ts.map +1 -0
- package/dist/tools/security.docs.descriptor.js +49 -0
- package/dist/tools/security.docs.descriptor.js.map +1 -0
- package/dist/tui/index.d.ts +2 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +2 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/security-tui.plugin.d.ts +3 -0
- package/dist/tui/security-tui.plugin.d.ts.map +1 -0
- package/dist/tui/security-tui.plugin.js +31 -0
- package/dist/tui/security-tui.plugin.js.map +1 -0
- package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.d.ts +5 -0
- package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.d.ts.map +1 -0
- package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.js +37 -0
- package/dist/tui/tool-widgets/SecurityToolWidget.impl.consumer.js.map +1 -0
- package/docs/host-boundary.md +186 -0
- package/docs/scanner-work.md +29 -0
- package/package.json +245 -4
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AuditEventSchema, AuditQueryOptionsSchema } from "../schemas/AuditEvent.js";
|
|
2
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
3
|
+
import { BaseRuntimeClient } from '@vibesdotdev/kernel/client';
|
|
4
|
+
/**
|
|
5
|
+
* The semantic security client: audit emission and querying through the
|
|
6
|
+
* runtime-selected `security/auditor`.
|
|
7
|
+
*
|
|
8
|
+
* The client owns no audit state and no second store — every operation
|
|
9
|
+
* resolves the selected auditor through `runtime.query('security/auditor')`,
|
|
10
|
+
* so descriptor selection, the in-memory default and composed sinks keep
|
|
11
|
+
* their existing ownership. Resolve it through the kernel client owner:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { getVibesClient } from '@vibesdotdev/kernel/client';
|
|
15
|
+
* const security = await getVibesClient<SecurityClient>('security', runtime);
|
|
16
|
+
* await security.emit(event);
|
|
17
|
+
* const events = await security.queryAuditEvents({ actor: 'agent' });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Absence is a typed refusal, not a silent skip: when no auditor is
|
|
21
|
+
* registered, `emit` and `queryAuditEvents` fail with CapabilityError code
|
|
22
|
+
* `UNAVAILABLE` and reason `security-auditor-unavailable`.
|
|
23
|
+
*/
|
|
24
|
+
export class SecurityClient extends BaseRuntimeClient {
|
|
25
|
+
constructor(descriptor = { id: 'security', kind: 'runtime/client' }, context, runtime) {
|
|
26
|
+
super(descriptor, context, runtime);
|
|
27
|
+
}
|
|
28
|
+
async auditor() {
|
|
29
|
+
const selected = await this.runtime
|
|
30
|
+
.query('security/auditor')
|
|
31
|
+
.enabled()
|
|
32
|
+
.select();
|
|
33
|
+
if (!selected) {
|
|
34
|
+
throw new CapabilityError('No security auditor is registered.', 'UNAVAILABLE', {
|
|
35
|
+
reason: 'security-auditor-unavailable'
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return selected.impl;
|
|
39
|
+
}
|
|
40
|
+
/** Record one audit event with the selected security/auditor. */
|
|
41
|
+
async emit(event) {
|
|
42
|
+
const admitted = AuditEventSchema.parse(event);
|
|
43
|
+
const auditor = await this.auditor();
|
|
44
|
+
await auditor.emit(admitted);
|
|
45
|
+
}
|
|
46
|
+
/** Query recorded audit events with the selected security/auditor. */
|
|
47
|
+
async queryAuditEvents(options = {}) {
|
|
48
|
+
const admitted = AuditQueryOptionsSchema.parse(options);
|
|
49
|
+
const auditor = await this.auditor();
|
|
50
|
+
return auditor.query(admitted);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export default SecurityClient;
|
|
54
|
+
//# sourceMappingURL=security-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-client.js","sourceRoot":"","sources":["../../src/security-client/security-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAgC,MAAM,4BAA4B,CAAC;AAS7F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IACpD,YACC,aAAsC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAChF,OAAqB,EACrB,OAAsB;QAEtB,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAEO,KAAK,CAAC,OAAO;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO;aACjC,KAAK,CAAoD,kBAAkB,CAAC;aAC5E,OAAO,EAAE;aACT,MAAM,EAAE,CAAC;QAEX,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,oCAAoC,EAAE,aAAa,EAAE;gBAC9E,MAAM,EAAE,8BAA8B;aACtC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,iEAAiE;IACjE,KAAK,CAAC,IAAI,CAAC,KAAiB;QAC3B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,sEAAsE;IACtE,KAAK,CAAC,gBAAgB,CAAC,UAA6B,EAAE;QACrD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;CACD;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.consumer.plugin.d.ts","sourceRoot":"","sources":["../src/security.consumer.plugin.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,sBAAsB,6CAoBjC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
|
|
2
|
+
/**
|
|
3
|
+
* The security consumer plugin: the four AI tool implementations
|
|
4
|
+
* (`security.scan-input`, `security.redact-output`, `security.check-policy`,
|
|
5
|
+
* `security.report-event`) as `tools/tool` loaders.
|
|
6
|
+
*
|
|
7
|
+
* Compose this beside `securityPlugin` (from `@vibesdotdev/security/plugin`)
|
|
8
|
+
* on consumer surfaces that expose the Tools owner. It must never be imported
|
|
9
|
+
* by the universal plugin: a runtime `scope` tag stops runtime resolution but
|
|
10
|
+
* not static bundler traversal, so an inline consumer loader would ship this
|
|
11
|
+
* code into every cloud Worker and browser bundle that composes security.
|
|
12
|
+
* Cloud and browser hosts compose the universal plugin alone.
|
|
13
|
+
*/
|
|
14
|
+
const SECURITY_TOOL_CONSUMER = { kind: 'tools/tool', scope: 'consumer' };
|
|
15
|
+
export const securityConsumerPlugin = createRuntimePlugin({
|
|
16
|
+
id: 'security.consumer',
|
|
17
|
+
name: 'Security — consumer tools',
|
|
18
|
+
description: 'Consumer-scope implementations for the four security AI tools. Compose beside the universal security plugin on consumer surfaces; cloud and browser bundles never import this slice.',
|
|
19
|
+
dependencies: ['security'],
|
|
20
|
+
loaders: [
|
|
21
|
+
loader('security.scan-input', SECURITY_TOOL_CONSUMER, () => import("./tools/scan-input/scan-input.impl.consumer.js")),
|
|
22
|
+
loader('security.redact-output', SECURITY_TOOL_CONSUMER, () => import("./tools/redact-output/redact-output.impl.consumer.js")),
|
|
23
|
+
loader('security.check-policy', SECURITY_TOOL_CONSUMER, () => import("./tools/check-policy/check-policy.impl.consumer.js")),
|
|
24
|
+
loader('security.report-event', SECURITY_TOOL_CONSUMER, () => import("./tools/report-event/report-event.impl.consumer.js")),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
export default securityConsumerPlugin;
|
|
28
|
+
//# sourceMappingURL=security.consumer.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.consumer.plugin.js","sourceRoot":"","sources":["../src/security.consumer.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAW,CAAC;AAElF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;IACzD,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACV,sLAAsL;IACvL,YAAY,EAAE,CAAC,UAAU,CAAC;IAC1B,OAAO,EAAE;QACR,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC1D,MAAM,CAAC,gDAAgD,CAAC,CACxD;QACD,MAAM,CAAC,wBAAwB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC7D,MAAM,CAAC,sDAAsD,CAAC,CAC9D;QACD,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,oDAAoD,CAAC,CAC5D;QACD,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,GAAG,EAAE,CAC5D,MAAM,CAAC,oDAAoD,CAAC,CAC5D;KACD;CACD,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The universal security plugin: kinds, tool and Shield descriptors, the
|
|
3
|
+
* semantic SecurityClient and the lazy built-in scanner/redactor loaders.
|
|
4
|
+
*
|
|
5
|
+
* Scope purity: this plugin is composed into cloud workers and browsers, so it
|
|
6
|
+
* carries no `*.impl.consumer.*` or CLI implementation loader inline — a
|
|
7
|
+
* runtime `scope` tag does not stop static bundler traversal. The four
|
|
8
|
+
* consumer tool implementations live in `./consumer.plugin.ts`
|
|
9
|
+
* (`securityConsumerPlugin`), and the Shield command implementations live in
|
|
10
|
+
* `./cli/plugin` (`securityCliPlugin`). Hosts compose those slices for the
|
|
11
|
+
* surfaces their scope supports. The universal plugin does not load Svelte or
|
|
12
|
+
* TUI either; those are separate surface plugins.
|
|
13
|
+
*/
|
|
14
|
+
export declare const securityPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
|
|
15
|
+
export default securityPlugin;
|
|
16
|
+
//# sourceMappingURL=security.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.plugin.d.ts","sourceRoot":"","sources":["../src/security.plugin.ts"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,6CAqCzB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import securityDocsDescriptor from "./tools/security.docs.descriptor.js";
|
|
2
|
+
import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
|
|
3
|
+
import { securityScannerKind, securityRedactorKind, securityPolicyKind, securityAuditorKind, securityDepScannerKind, securityIOCFeedKind, securityFreshnessPolicyKind, } from "./kinds/index.js";
|
|
4
|
+
import { scanInputDescriptor, redactOutputDescriptor, checkPolicyDescriptor, reportEventDescriptor, } from "./tools/index.js";
|
|
5
|
+
import shieldGroupDescriptor from "./cli/shield.cli-group.descriptor.js";
|
|
6
|
+
import shieldDepsGroupDescriptor from "./cli/shield.deps.cli-group.descriptor.js";
|
|
7
|
+
import shieldDepsScanDescriptor from "./cli/shield.deps.scan.descriptor.js";
|
|
8
|
+
import shieldDepsGateDescriptor from "./cli/shield.deps.gate.descriptor.js";
|
|
9
|
+
/**
|
|
10
|
+
* Built-in dep-scanner descriptor.
|
|
11
|
+
*
|
|
12
|
+
* Registered by securityPlugin so that `runtime.query('security/dep-scanner').resolve()`
|
|
13
|
+
* succeeds and the CLI commands in `./cli` can operate. The kind's `defaultImplementation`
|
|
14
|
+
* (DefaultDepScannerService) handles resolution; it returns `verdict: 'unknown'` when no
|
|
15
|
+
* real scanner is wired — an honest response that the gate command treats as non-clean.
|
|
16
|
+
*
|
|
17
|
+
* Migration debt: replace with a real impl (e.g. wrapping `bun audit`) once available.
|
|
18
|
+
*/
|
|
19
|
+
const builtinDepScannerDescriptor = {
|
|
20
|
+
kind: 'security/dep-scanner',
|
|
21
|
+
id: 'security.dep-scanner.builtin',
|
|
22
|
+
name: 'Built-in Dependency Scanner (stub)',
|
|
23
|
+
description: 'Default dep-scanner — returns verdict:unknown until a real impl is registered.',
|
|
24
|
+
enabled: true,
|
|
25
|
+
tags: ['builtin', 'stub'],
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The universal security plugin: kinds, tool and Shield descriptors, the
|
|
29
|
+
* semantic SecurityClient and the lazy built-in scanner/redactor loaders.
|
|
30
|
+
*
|
|
31
|
+
* Scope purity: this plugin is composed into cloud workers and browsers, so it
|
|
32
|
+
* carries no `*.impl.consumer.*` or CLI implementation loader inline — a
|
|
33
|
+
* runtime `scope` tag does not stop static bundler traversal. The four
|
|
34
|
+
* consumer tool implementations live in `./consumer.plugin.ts`
|
|
35
|
+
* (`securityConsumerPlugin`), and the Shield command implementations live in
|
|
36
|
+
* `./cli/plugin` (`securityCliPlugin`). Hosts compose those slices for the
|
|
37
|
+
* surfaces their scope supports. The universal plugin does not load Svelte or
|
|
38
|
+
* TUI either; those are separate surface plugins.
|
|
39
|
+
*/
|
|
40
|
+
export const securityPlugin = createRuntimePlugin({
|
|
41
|
+
id: 'security',
|
|
42
|
+
name: 'Security',
|
|
43
|
+
description: 'Security domain runtime — kinds: security/scanner, security/redactor, security/policy, security/auditor, security/dep-scanner, security/ioc-feed, security/freshness-policy. Registers the semantic SecurityClient; ships AI tool descriptors; built-in scanner and redactor are lazy implementations; policies and auditors are composed by consumers. Consumer tool and Shield CLI implementations live in the ./consumer.plugin and ./cli/plugin slices.',
|
|
44
|
+
dependencies: [],
|
|
45
|
+
kinds: [securityScannerKind, securityRedactorKind, securityPolicyKind, securityAuditorKind, securityDepScannerKind, securityIOCFeedKind, securityFreshnessPolicyKind],
|
|
46
|
+
descriptors: [
|
|
47
|
+
securityDocsDescriptor,
|
|
48
|
+
scanInputDescriptor,
|
|
49
|
+
redactOutputDescriptor,
|
|
50
|
+
checkPolicyDescriptor,
|
|
51
|
+
reportEventDescriptor,
|
|
52
|
+
builtinDepScannerDescriptor,
|
|
53
|
+
{ kind: 'security/scanner', id: 'security.scanner.builtin', name: 'Built-in Scanner', enabled: true },
|
|
54
|
+
{ kind: 'security/redactor', id: 'security.redactor.builtin', name: 'Built-in Redactor', enabled: true, tags: ['builtin'] },
|
|
55
|
+
shieldGroupDescriptor,
|
|
56
|
+
shieldDepsGroupDescriptor,
|
|
57
|
+
shieldDepsScanDescriptor,
|
|
58
|
+
shieldDepsGateDescriptor,
|
|
59
|
+
// The runtime-owned semantic security client, resolved through the
|
|
60
|
+
// kernel client APIs as id `security`.
|
|
61
|
+
{ kind: 'runtime/client', id: 'security', name: 'Security Client', description: 'Semantic security client: audit emission and querying through the selected security/auditor' }
|
|
62
|
+
],
|
|
63
|
+
loaders: [
|
|
64
|
+
loader('security.scanner.builtin', { kind: 'security/scanner' }, () => import("./implementations/scanner.impl.js")),
|
|
65
|
+
// One built-in redactor, two hardware implementations chosen by the
|
|
66
|
+
// kernel's scope resolution: the in-process redactor serves every
|
|
67
|
+
// runtime (cloud Workers, browsers, undeclared hardware); on consumer
|
|
68
|
+
// hardware the more specific subprocess redactor wins, adding a
|
|
69
|
+
// preemptive deadline for caller-supplied patterns.
|
|
70
|
+
loader('security.redactor.builtin', { kind: 'security/redactor' }, () => import("./implementations/redactor.inprocess.impl.js")),
|
|
71
|
+
loader('security.redactor.builtin', { kind: 'security/redactor', scope: 'consumer' }, () => import("./implementations/redactor.subprocess.impl.js")),
|
|
72
|
+
loader('security', { kind: 'runtime/client' }, async () => ({
|
|
73
|
+
impl: (await import("./security-client/security-client.js")).SecurityClient
|
|
74
|
+
}))
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
export default securityPlugin;
|
|
78
|
+
//# sourceMappingURL=security.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.plugin.js","sourceRoot":"","sources":["../src/security.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AACzE,OAAO,yBAAyB,MAAM,2CAA2C,CAAC;AAClF,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,2BAA2B,GAAG;IACnC,IAAI,EAAE,sBAA+B;IACrC,EAAE,EAAE,8BAA8B;IAClC,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,gFAAgF;IAC7F,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;IACjD,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,WAAW,EACV,6bAA6b;IAC9b,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;IACrK,WAAW,EAAE;QACZ,sBAAsB;QACtB,mBAAmB;QACnB,sBAAsB;QACtB,qBAAqB;QACrB,qBAAqB;QACrB,2BAA2B;QAC3B,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE;QACrG,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,2BAA2B,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;QAC3H,qBAAqB;QACrB,yBAAyB;QACzB,wBAAwB;QACxB,wBAAwB;QACxB,mEAAmE;QACnE,uCAAuC;QACvC,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,6FAA6F,EAAE;KAC/K;IACD,OAAO,EAAE;QACR,MAAM,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;QACnH,oEAAoE;QACpE,kEAAkE;QAClE,sEAAsE;QACtE,gEAAgE;QAChE,oDAAoD;QACpD,MAAM,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAC;QAChI,MAAM,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,+CAA+C,CAAC,CAAC;QACpJ,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAC3D,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,sCAAsC,CAAC,CAAC,CAAC,cAAc;SAC3E,CAAC,CAAC;KACH;CACD,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-svelte.plugin.d.ts","sourceRoot":"","sources":["../../src/svelte/security-svelte.plugin.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,oBAAoB,6CAiB/B,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRuntimeImplementation, createRuntimePlugin, loader, settle } from '@vibesdotdev/kernel';
|
|
2
|
+
import { SECURITY_TOOL_IDS } from "../tools/index.js";
|
|
3
|
+
const loadSecurityToolCard = () => import('./tool-widgets/SecurityToolCard.svelte');
|
|
4
|
+
const widgets = SECURITY_TOOL_IDS.map((toolId) => ({
|
|
5
|
+
id: `${toolId}.svelte-widget`,
|
|
6
|
+
kind: 'tools/ui',
|
|
7
|
+
name: `${toolId} Svelte Widget`,
|
|
8
|
+
description: `Designed Kit card for ${toolId} (policy name, allow/deny, event type).`,
|
|
9
|
+
surfaces: ['web'],
|
|
10
|
+
role: 'widget',
|
|
11
|
+
targetToolId: toolId,
|
|
12
|
+
tags: ['security', 'widget'],
|
|
13
|
+
enabled: true
|
|
14
|
+
}));
|
|
15
|
+
const kitToolWidgets = await settle(() => import('@vibesdotdev/kit/components/tool-widgets'));
|
|
16
|
+
const registerKitToolWidget = kitToolWidgets.ok ? kitToolWidgets.value.registerToolWidget : undefined;
|
|
17
|
+
if (registerKitToolWidget) {
|
|
18
|
+
for (const toolId of SECURITY_TOOL_IDS) {
|
|
19
|
+
registerKitToolWidget(toolId, loadSecurityToolCard);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export const securitySveltePlugin = createRuntimePlugin({
|
|
23
|
+
id: '@vibesdotdev/security/svelte',
|
|
24
|
+
name: 'Security Svelte',
|
|
25
|
+
description: 'Security-owned Svelte tool-result cards registered as tools/ui.',
|
|
26
|
+
dependencies: [],
|
|
27
|
+
descriptors: widgets,
|
|
28
|
+
loaders: widgets.map((descriptor) => loader(descriptor.id, { kind: 'tools/ui', scope: 'browser' }, async () => {
|
|
29
|
+
registerKitToolWidget?.(descriptor.targetToolId, loadSecurityToolCard);
|
|
30
|
+
const module = await loadSecurityToolCard();
|
|
31
|
+
return createRuntimeImplementation({
|
|
32
|
+
kind: 'tools/ui',
|
|
33
|
+
id: descriptor.id,
|
|
34
|
+
implementation: { web: { component: module.default } }
|
|
35
|
+
});
|
|
36
|
+
}))
|
|
37
|
+
});
|
|
38
|
+
export default securitySveltePlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Tailwind v4 source declaration for consumers — mirrors @vibesdotdev/kit's
|
|
3
|
+
* styles.css pattern. Apps that @import this file get this package's
|
|
4
|
+
* components scanned by their Tailwind build, so utility classes used only
|
|
5
|
+
* inside these components are emitted in the app's CSS bundle (Tailwind
|
|
6
|
+
* never scans node_modules). Paths resolve relative to this file.
|
|
7
|
+
*/
|
|
8
|
+
@source "./";
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Family card for security.check-policy, security.scan-input,
|
|
4
|
+
* security.redact-output, and security.report-event. Surfaces policy name,
|
|
5
|
+
* allow/deny, and event type from the live tool schemas.
|
|
6
|
+
*/
|
|
7
|
+
import { Badge } from '@vibesdotdev/kit/components/ui/badge';
|
|
8
|
+
import { Icon } from '@vibesdotdev/kit/components/icon';
|
|
9
|
+
import {
|
|
10
|
+
ToolCard,
|
|
11
|
+
ToolCardBody,
|
|
12
|
+
type ToolWidgetProps
|
|
13
|
+
} from '@vibesdotdev/kit/components/tool-widgets';
|
|
14
|
+
import {
|
|
15
|
+
decisionTone,
|
|
16
|
+
securityToolCardModel,
|
|
17
|
+
securityToolCardRows,
|
|
18
|
+
type SecurityToolCardTone
|
|
19
|
+
} from '@vibesdotdev/security/tools';
|
|
20
|
+
|
|
21
|
+
let { tool, compact = false }: ToolWidgetProps = $props();
|
|
22
|
+
|
|
23
|
+
const model = $derived(
|
|
24
|
+
securityToolCardModel({
|
|
25
|
+
name: tool.name,
|
|
26
|
+
input: tool.input,
|
|
27
|
+
output: tool.output,
|
|
28
|
+
error: tool.error
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
const rows = $derived(securityToolCardRows(model));
|
|
32
|
+
|
|
33
|
+
const BADGE_VARIANT = {
|
|
34
|
+
default: 'secondary',
|
|
35
|
+
success: 'success',
|
|
36
|
+
danger: 'destructive',
|
|
37
|
+
warning: 'warning',
|
|
38
|
+
muted: 'outline'
|
|
39
|
+
} satisfies Record<
|
|
40
|
+
SecurityToolCardTone,
|
|
41
|
+
'secondary' | 'destructive' | 'success' | 'warning' | 'outline'
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
function severityVariant(severity: string): 'outline' | 'warning' | 'destructive' {
|
|
45
|
+
switch (severity) {
|
|
46
|
+
case 'critical':
|
|
47
|
+
case 'high':
|
|
48
|
+
return 'destructive';
|
|
49
|
+
case 'medium':
|
|
50
|
+
return 'warning';
|
|
51
|
+
default:
|
|
52
|
+
return 'outline';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<ToolCard {tool} {compact} title={model.title} icon={model.icon} defaultOpen={model.defaultOpen}>
|
|
58
|
+
{#snippet children()}
|
|
59
|
+
<ToolCardBody {compact}>
|
|
60
|
+
<div class="flex flex-wrap items-center gap-1.5">
|
|
61
|
+
{#if model.decisionLabel}
|
|
62
|
+
<Badge variant={BADGE_VARIANT[decisionTone(model.decision)]} class="text-caption">
|
|
63
|
+
{model.decisionLabel}
|
|
64
|
+
</Badge>
|
|
65
|
+
{/if}
|
|
66
|
+
{#if model.policyName}
|
|
67
|
+
<span class="truncate font-mono text-caption text-muted-foreground"
|
|
68
|
+
>{model.policyName}</span
|
|
69
|
+
>
|
|
70
|
+
{/if}
|
|
71
|
+
{#if model.eventType}
|
|
72
|
+
<Badge variant="secondary" class="text-caption">{model.eventType}</Badge>
|
|
73
|
+
{/if}
|
|
74
|
+
{#if model.recorded !== null}
|
|
75
|
+
<Badge variant={model.recorded ? 'success' : 'destructive'} class="text-caption">
|
|
76
|
+
{model.recorded ? 'Recorded' : 'Not recorded'}
|
|
77
|
+
</Badge>
|
|
78
|
+
{/if}
|
|
79
|
+
{#if model.matchCount !== null}
|
|
80
|
+
<Badge variant="outline" class="text-caption">
|
|
81
|
+
{model.matchCount === 1 ? '1 match' : `${model.matchCount} matches`}
|
|
82
|
+
</Badge>
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
{#if rows.length}
|
|
87
|
+
<dl class="space-y-0.5">
|
|
88
|
+
{#each rows as row (row.label)}
|
|
89
|
+
<div class="flex min-w-0 items-baseline gap-2">
|
|
90
|
+
<dt class="shrink-0 text-caption text-muted-foreground">{row.label}</dt>
|
|
91
|
+
<dd
|
|
92
|
+
class={[
|
|
93
|
+
'min-w-0 truncate',
|
|
94
|
+
row.tone === 'danger' && 'text-destructive',
|
|
95
|
+
row.tone === 'muted' && 'text-muted-foreground'
|
|
96
|
+
]}
|
|
97
|
+
>
|
|
98
|
+
{row.value}
|
|
99
|
+
</dd>
|
|
100
|
+
</div>
|
|
101
|
+
{/each}
|
|
102
|
+
</dl>
|
|
103
|
+
{/if}
|
|
104
|
+
|
|
105
|
+
{#if model.threats.length}
|
|
106
|
+
<ul class="space-y-1">
|
|
107
|
+
{#each model.threats.slice(0, 5) as threat, index (`${threat.kind}-${index}`)}
|
|
108
|
+
<li class="flex min-w-0 items-start gap-1.5">
|
|
109
|
+
<Badge
|
|
110
|
+
variant={severityVariant(threat.severity)}
|
|
111
|
+
class="mt-0.5 shrink-0 text-caption"
|
|
112
|
+
>
|
|
113
|
+
{threat.severity}
|
|
114
|
+
</Badge>
|
|
115
|
+
<div class="min-w-0">
|
|
116
|
+
<span class="font-medium">{threat.kind.replaceAll('_', ' ')}</span>
|
|
117
|
+
{#if threat.description}
|
|
118
|
+
<span class="block text-caption text-muted-foreground">{threat.description}</span>
|
|
119
|
+
{/if}
|
|
120
|
+
</div>
|
|
121
|
+
</li>
|
|
122
|
+
{/each}
|
|
123
|
+
</ul>
|
|
124
|
+
{/if}
|
|
125
|
+
|
|
126
|
+
{#if model.redactedPreview}
|
|
127
|
+
<p class="line-clamp-4 whitespace-pre-wrap text-muted-foreground">
|
|
128
|
+
{model.redactedPreview}
|
|
129
|
+
</p>
|
|
130
|
+
{/if}
|
|
131
|
+
|
|
132
|
+
{#if !rows.length && !model.threats.length && !model.redactedPreview && !tool.error}
|
|
133
|
+
<p class="flex items-center gap-1.5 text-muted-foreground italic">
|
|
134
|
+
<Icon icon="lucide:loader-circle" class="size-3" />
|
|
135
|
+
Waiting for result…
|
|
136
|
+
</p>
|
|
137
|
+
{/if}
|
|
138
|
+
</ToolCardBody>
|
|
139
|
+
{/snippet}
|
|
140
|
+
</ToolCard>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ToolWidgetProps } from '@vibesdotdev/kit/components/tool-widgets';
|
|
2
|
+
declare const SecurityToolCard: import("svelte").Component<ToolWidgetProps, {}, "">;
|
|
3
|
+
type SecurityToolCard = ReturnType<typeof SecurityToolCard>;
|
|
4
|
+
export default SecurityToolCard;
|
|
5
|
+
//# sourceMappingURL=SecurityToolCard.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityToolCard.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/tool-widgets/SecurityToolCard.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,eAAe,EACpB,MAAM,0CAA0C,CAAC;AAmInD,QAAA,MAAM,gBAAgB,qDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/svelte/tool-widgets/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { registerToolWidget } from '@vibesdotdev/kit/components/tool-widgets';
|
|
2
|
+
import { SECURITY_TOOL_IDS } from '@vibesdotdev/security/tools';
|
|
3
|
+
for (const toolId of SECURITY_TOOL_IDS) {
|
|
4
|
+
registerToolWidget(toolId, () => import('./SecurityToolCard.svelte'));
|
|
5
|
+
}
|
|
6
|
+
export { default as SecurityToolCard } from './SecurityToolCard.svelte';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
kind: "tools/tool";
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mcpDescription: string;
|
|
7
|
+
category: string;
|
|
8
|
+
subcategory: string;
|
|
9
|
+
hardware: string[];
|
|
10
|
+
purpose: string[];
|
|
11
|
+
tags: string[];
|
|
12
|
+
safety: string;
|
|
13
|
+
requiresApproval: boolean;
|
|
14
|
+
schemas: {
|
|
15
|
+
input: import("zod/v4").ZodObject<{
|
|
16
|
+
policyId: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
17
|
+
context: import("zod/v4").ZodOptional<import("zod/v4").ZodObject<{
|
|
18
|
+
actor: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
19
|
+
action: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
20
|
+
resource: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
21
|
+
metadata: import("zod/v4").ZodOptional<import("zod/v4").ZodRecord<import("zod/v4").ZodString, import("zod/v4").ZodUnknown>>;
|
|
22
|
+
}, import("zod/v4/core").$strip>>;
|
|
23
|
+
}, import("zod/v4/core").$strip>;
|
|
24
|
+
output: import("zod/v4").ZodObject<{
|
|
25
|
+
outcome: import("zod/v4").ZodEnum<{
|
|
26
|
+
allow: "allow";
|
|
27
|
+
deny: "deny";
|
|
28
|
+
review: "review";
|
|
29
|
+
}>;
|
|
30
|
+
policyId: import("zod/v4").ZodString;
|
|
31
|
+
reason: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
|
|
32
|
+
engineAvailable: import("zod/v4").ZodBoolean;
|
|
33
|
+
}, import("zod/v4/core").$strip>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=check-policy.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-policy.descriptor.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAkBG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel/factory';
|
|
2
|
+
import { CheckPolicyInputSchema, CheckPolicyOutputSchema } from "./schemas.js";
|
|
3
|
+
export default createRuntimeAsset({
|
|
4
|
+
kind: 'tools/tool',
|
|
5
|
+
id: 'security.check-policy',
|
|
6
|
+
name: 'Check Security Policy',
|
|
7
|
+
description: 'Evaluate a context against registered security policies to determine if an action is allowed, denied, or requires review.',
|
|
8
|
+
mcpDescription: 'Check security policy. Ex: {policyId,context}; returns allow, deny, or review.',
|
|
9
|
+
category: 'security',
|
|
10
|
+
subcategory: 'policy',
|
|
11
|
+
hardware: ['consumer', 'cloud'],
|
|
12
|
+
purpose: ['direct', 'worker', 'agent'],
|
|
13
|
+
tags: ['security', 'policy', 'evaluation', 'access-control'],
|
|
14
|
+
safety: 'read',
|
|
15
|
+
requiresApproval: false,
|
|
16
|
+
schemas: {
|
|
17
|
+
input: CheckPolicyInputSchema,
|
|
18
|
+
output: CheckPolicyOutputSchema,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=check-policy.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-policy.descriptor.js","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE/E,eAAe,kBAAkB,CAAC;IACjC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,uBAAuB;IAC3B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,2HAA2H;IACxI,cAAc,EACb,gFAAgF;IACjF,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;IACtC,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAAC;IAC5D,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE;QACR,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,uBAAuB;KAC/B;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ToolCallContext, VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
import { type CheckPolicyInput, type CheckPolicyOutput } from './schemas.ts';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
execute(input: CheckPolicyInput, runtime: VibesRuntime, _ctx: ToolCallContext): Promise<CheckPolicyOutput>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=check-policy.impl.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-policy.impl.consumer.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.impl.consumer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAA0B,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;;mBAG/E,gBAAgB,WAAW,YAAY,QAAQ,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;;AADjH,wBAeE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PolicyOutcomeSchema } from "../../schemas/contracts/policy.js";
|
|
2
|
+
import { CheckPolicyInputSchema } from "./schemas.js";
|
|
3
|
+
export default {
|
|
4
|
+
async execute(input, runtime, _ctx) {
|
|
5
|
+
const parsed = CheckPolicyInputSchema.parse(input);
|
|
6
|
+
const absent = {
|
|
7
|
+
outcome: 'deny', policyId: parsed.policyId ?? 'default',
|
|
8
|
+
reason: 'No policy implementation registered — fail-closed behavior', engineAvailable: false
|
|
9
|
+
};
|
|
10
|
+
if (!runtime.hasKind('security/policy'))
|
|
11
|
+
return absent;
|
|
12
|
+
let query = runtime.query('security/policy').enabled();
|
|
13
|
+
if (parsed.policyId !== undefined)
|
|
14
|
+
query = query.withId(parsed.policyId);
|
|
15
|
+
if (query.descriptors().length === 0)
|
|
16
|
+
return absent;
|
|
17
|
+
const policy = await query.resolve();
|
|
18
|
+
return { outcome: PolicyOutcomeSchema.parse(await policy.evaluate(parsed.context ?? {})), policyId: policy.descriptor.id, engineAvailable: true };
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=check-policy.impl.consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-policy.impl.consumer.js","sourceRoot":"","sources":["../../../src/tools/check-policy/check-policy.impl.consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,EAAE,sBAAsB,EAAiD,MAAM,cAAc,CAAC;AAErG,eAAe;IACd,KAAK,CAAC,OAAO,CAAC,KAAuB,EAAE,OAAqB,EAAE,IAAqB;QAClF,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,MAAM,GAAsB;YACjC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,SAAS;YACvD,MAAM,EAAE,4DAA4D,EAAE,eAAe,EAAE,KAAK;SAC5F,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC;YAAE,OAAO,MAAM,CAAC;QACvD,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAkD,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC;QACxG,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;YAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzE,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC;QAEpD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IACnJ,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/check-policy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const CheckPolicyInputSchema: z.ZodObject<{
|
|
3
|
+
policyId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
6
|
+
action: z.ZodOptional<z.ZodString>;
|
|
7
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
8
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type CheckPolicyInput = z.infer<typeof CheckPolicyInputSchema>;
|
|
12
|
+
export declare const CheckPolicyOutputSchema: z.ZodObject<{
|
|
13
|
+
outcome: z.ZodEnum<{
|
|
14
|
+
allow: "allow";
|
|
15
|
+
deny: "deny";
|
|
16
|
+
review: "review";
|
|
17
|
+
}>;
|
|
18
|
+
policyId: z.ZodString;
|
|
19
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
20
|
+
engineAvailable: z.ZodBoolean;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type CheckPolicyOutput = z.infer<typeof CheckPolicyOutputSchema>;
|
|
23
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tools/check-policy/schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,sBAAsB;;;;;;;;iBAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;iBAKlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PolicyEvaluationContextSchema, PolicyOutcomeSchema } from "../../schemas/policy.js";
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
export const CheckPolicyInputSchema = z.object({
|
|
4
|
+
policyId: z.string().optional().describe('Policy ID to check against (optional — uses default if not provided)'),
|
|
5
|
+
context: PolicyEvaluationContextSchema.optional(),
|
|
6
|
+
});
|
|
7
|
+
export const CheckPolicyOutputSchema = z.object({
|
|
8
|
+
outcome: PolicyOutcomeSchema.describe('Policy evaluation outcome'),
|
|
9
|
+
policyId: z.string().describe('ID of the policy that produced this outcome'),
|
|
10
|
+
reason: z.string().optional().describe('Human-readable reason for the outcome'),
|
|
11
|
+
engineAvailable: z.boolean().describe('Whether a policy engine is actually registered (if false, this is fail-closed behavior)'),
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/tools/check-policy/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;IAChH,OAAO,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAC5E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAC/E,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,yFAAyF,CAAC;CAChI,CAAC,CAAC"}
|