@red-codes/agentguard 1.0.0 → 1.1.2
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/README.md +179 -298
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js.map +1 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +29185 -0
- package/dist/bin.js.map +7 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js.map +1 -0
- package/dist/commands/adoption.d.ts +2 -0
- package/dist/commands/adoption.d.ts.map +1 -0
- package/dist/commands/adoption.js +172 -0
- package/dist/commands/adoption.js.map +1 -0
- package/dist/commands/analytics.d.ts +3 -0
- package/dist/commands/analytics.d.ts.map +1 -0
- package/dist/commands/analytics.js +7 -0
- package/dist/commands/analytics.js.map +1 -0
- package/dist/commands/audit-verify.d.ts +3 -0
- package/dist/commands/audit-verify.d.ts.map +1 -0
- package/dist/commands/audit-verify.js +94 -0
- package/dist/commands/audit-verify.js.map +1 -0
- package/dist/commands/auto-setup.d.ts +28 -0
- package/dist/commands/auto-setup.d.ts.map +1 -0
- package/dist/commands/auto-setup.js +146 -0
- package/dist/commands/auto-setup.js.map +1 -0
- package/dist/commands/ci-check.d.ts +13 -0
- package/dist/commands/ci-check.d.ts.map +1 -0
- package/dist/commands/ci-check.js +286 -0
- package/dist/commands/ci-check.js.map +1 -0
- package/dist/commands/claude-hook.d.ts +2 -0
- package/dist/commands/claude-hook.d.ts.map +1 -0
- package/dist/commands/claude-hook.js +254 -0
- package/dist/commands/claude-hook.js.map +1 -0
- package/dist/commands/claude-init.d.ts.map +1 -0
- package/dist/commands/claude-init.js +401 -0
- package/dist/commands/claude-init.js.map +1 -0
- package/dist/commands/config.d.ts +39 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +368 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/demo.d.ts +2 -0
- package/dist/commands/demo.d.ts.map +1 -0
- package/dist/commands/demo.js +100 -0
- package/dist/commands/demo.js.map +1 -0
- package/dist/commands/diff.d.ts +3 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +364 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/evidence-pr.d.ts +3 -0
- package/dist/commands/evidence-pr.d.ts.map +1 -0
- package/dist/commands/evidence-pr.js +162 -0
- package/dist/commands/evidence-pr.js.map +1 -0
- package/dist/commands/export.d.ts +22 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +92 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/guard.d.ts +21 -0
- package/dist/commands/guard.d.ts.map +1 -0
- package/dist/commands/guard.js +272 -0
- package/dist/commands/guard.js.map +1 -0
- package/dist/commands/import.d.ts +3 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/{cli/commands → commands}/import.js +25 -26
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1288 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/inspect.d.ts +4 -0
- package/dist/commands/inspect.d.ts.map +1 -0
- package/dist/{cli/commands → commands}/inspect.js +97 -70
- package/dist/commands/inspect.js.map +1 -0
- package/dist/commands/learn.d.ts +2 -0
- package/dist/commands/learn.d.ts.map +1 -0
- package/dist/commands/learn.js +264 -0
- package/dist/commands/learn.js.map +1 -0
- package/dist/commands/migrate.d.ts +3 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +270 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/plugin.d.ts.map +1 -0
- package/dist/{cli/commands → commands}/plugin.js +2 -2
- package/dist/commands/plugin.js.map +1 -0
- package/dist/commands/policy-verify.d.ts +46 -0
- package/dist/commands/policy-verify.d.ts.map +1 -0
- package/dist/commands/policy-verify.js +173 -0
- package/dist/commands/policy-verify.js.map +1 -0
- package/dist/commands/policy.d.ts +27 -0
- package/dist/commands/policy.d.ts.map +1 -0
- package/dist/commands/policy.js +590 -0
- package/dist/commands/policy.js.map +1 -0
- package/dist/{cli/commands → commands}/replay.d.ts +2 -1
- package/dist/commands/replay.d.ts.map +1 -0
- package/dist/{cli/commands → commands}/replay.js +78 -12
- package/dist/commands/replay.js.map +1 -0
- package/dist/commands/session-viewer.d.ts +5 -0
- package/dist/commands/session-viewer.d.ts.map +1 -0
- package/dist/commands/session-viewer.js +462 -0
- package/dist/commands/session-viewer.js.map +1 -0
- package/dist/commands/simulate.d.ts +7 -0
- package/dist/commands/simulate.d.ts.map +1 -0
- package/dist/commands/simulate.js +505 -0
- package/dist/commands/simulate.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +212 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/traces.d.ts +24 -0
- package/dist/commands/traces.d.ts.map +1 -0
- package/dist/commands/traces.js +282 -0
- package/dist/commands/traces.js.map +1 -0
- package/dist/commands/trust.d.ts +6 -0
- package/dist/commands/trust.d.ts.map +1 -0
- package/dist/commands/trust.js +129 -0
- package/dist/commands/trust.js.map +1 -0
- package/dist/evidence-summary.d.ts +35 -0
- package/dist/evidence-summary.d.ts.map +1 -0
- package/dist/evidence-summary.js +202 -0
- package/dist/evidence-summary.js.map +1 -0
- package/dist/{cli/file-event-store.d.ts → file-event-store.d.ts} +1 -1
- package/dist/file-event-store.d.ts.map +1 -0
- package/dist/{cli/file-event-store.js → file-event-store.js} +1 -1
- package/dist/file-event-store.js.map +1 -0
- package/{hooks → dist/hooks}/post-commit +3 -1
- package/{hooks → dist/hooks}/post-merge +3 -1
- package/dist/hooks/pre-commit +29 -0
- package/dist/policy-resolver.d.ts +32 -0
- package/dist/policy-resolver.d.ts.map +1 -0
- package/dist/policy-resolver.js +171 -0
- package/dist/policy-resolver.js.map +1 -0
- package/dist/{cli/recorder.d.ts → recorder.d.ts} +1 -1
- package/dist/recorder.d.ts.map +1 -0
- package/dist/{cli/recorder.js → recorder.js} +1 -1
- package/dist/recorder.js.map +1 -0
- package/dist/replay-timeline-html.d.ts +21 -0
- package/dist/replay-timeline-html.d.ts.map +1 -0
- package/dist/replay-timeline-html.js +414 -0
- package/dist/replay-timeline-html.js.map +1 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/{cli/replay.js → replay.js} +92 -1
- package/dist/replay.js.map +1 -0
- package/dist/{cli/session-store.d.ts → session-store.d.ts} +5 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/{cli/session-store.js → session-store.js} +1 -0
- package/dist/session-store.js.map +1 -0
- package/dist/session-viewer-html.d.ts +10 -0
- package/dist/session-viewer-html.d.ts.map +1 -0
- package/dist/session-viewer-html.js +737 -0
- package/dist/session-viewer-html.js.map +1 -0
- package/dist/templates/ci-only.yaml +103 -0
- package/dist/templates/development.yaml +107 -0
- package/dist/templates/permissive.yaml +87 -0
- package/dist/templates/strict.yaml +112 -0
- package/dist/tui.d.ts +3 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +2 -0
- package/dist/tui.js.map +1 -0
- package/package.json +42 -53
- package/dist/adapters/claude-code.d.ts +0 -24
- package/dist/adapters/claude-code.d.ts.map +0 -1
- package/dist/adapters/claude-code.js +0 -99
- package/dist/adapters/claude-code.js.map +0 -1
- package/dist/adapters/file.d.ts +0 -3
- package/dist/adapters/file.d.ts.map +0 -1
- package/dist/adapters/file.js +0 -35
- package/dist/adapters/file.js.map +0 -1
- package/dist/adapters/git.d.ts +0 -3
- package/dist/adapters/git.d.ts.map +0 -1
- package/dist/adapters/git.js +0 -61
- package/dist/adapters/git.js.map +0 -1
- package/dist/adapters/registry.d.ts +0 -5
- package/dist/adapters/registry.d.ts.map +0 -1
- package/dist/adapters/registry.js +0 -15
- package/dist/adapters/registry.js.map +0 -1
- package/dist/adapters/shell.d.ts +0 -8
- package/dist/adapters/shell.d.ts.map +0 -1
- package/dist/adapters/shell.js +0 -27
- package/dist/adapters/shell.js.map +0 -1
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/bin.d.ts.map +0 -1
- package/dist/cli/bin.js +0 -5769
- package/dist/cli/bin.js.map +0 -7
- package/dist/cli/colors.d.ts.map +0 -1
- package/dist/cli/colors.js.map +0 -1
- package/dist/cli/commands/claude-hook.d.ts +0 -2
- package/dist/cli/commands/claude-hook.d.ts.map +0 -1
- package/dist/cli/commands/claude-hook.js +0 -110
- package/dist/cli/commands/claude-hook.js.map +0 -1
- package/dist/cli/commands/claude-init.d.ts.map +0 -1
- package/dist/cli/commands/claude-init.js +0 -150
- package/dist/cli/commands/claude-init.js.map +0 -1
- package/dist/cli/commands/export.d.ts +0 -11
- package/dist/cli/commands/export.d.ts.map +0 -1
- package/dist/cli/commands/export.js +0 -113
- package/dist/cli/commands/export.js.map +0 -1
- package/dist/cli/commands/guard.d.ts +0 -12
- package/dist/cli/commands/guard.d.ts.map +0 -1
- package/dist/cli/commands/guard.js +0 -145
- package/dist/cli/commands/guard.js.map +0 -1
- package/dist/cli/commands/import.d.ts +0 -2
- package/dist/cli/commands/import.d.ts.map +0 -1
- package/dist/cli/commands/import.js.map +0 -1
- package/dist/cli/commands/inspect.d.ts +0 -3
- package/dist/cli/commands/inspect.d.ts.map +0 -1
- package/dist/cli/commands/inspect.js.map +0 -1
- package/dist/cli/commands/plugin.d.ts.map +0 -1
- package/dist/cli/commands/plugin.js.map +0 -1
- package/dist/cli/commands/replay.d.ts.map +0 -1
- package/dist/cli/commands/replay.js.map +0 -1
- package/dist/cli/file-event-store.d.ts.map +0 -1
- package/dist/cli/file-event-store.js.map +0 -1
- package/dist/cli/policy-resolver.d.ts +0 -4
- package/dist/cli/policy-resolver.d.ts.map +0 -1
- package/dist/cli/policy-resolver.js +0 -62
- package/dist/cli/policy-resolver.js.map +0 -1
- package/dist/cli/recorder.d.ts.map +0 -1
- package/dist/cli/recorder.js.map +0 -1
- package/dist/cli/replay.d.ts.map +0 -1
- package/dist/cli/replay.js.map +0 -1
- package/dist/cli/session-store.d.ts.map +0 -1
- package/dist/cli/session-store.js.map +0 -1
- package/dist/cli/tui.d.ts +0 -24
- package/dist/cli/tui.d.ts.map +0 -1
- package/dist/cli/tui.js +0 -197
- package/dist/cli/tui.js.map +0 -1
- package/dist/core/actions.d.ts +0 -11
- package/dist/core/actions.d.ts.map +0 -1
- package/dist/core/actions.js +0 -112
- package/dist/core/actions.js.map +0 -1
- package/dist/core/adapters.d.ts +0 -19
- package/dist/core/adapters.d.ts.map +0 -1
- package/dist/core/adapters.js +0 -85
- package/dist/core/adapters.js.map +0 -1
- package/dist/core/execution-log/bridge.d.ts +0 -12
- package/dist/core/execution-log/bridge.d.ts.map +0 -1
- package/dist/core/execution-log/bridge.js +0 -112
- package/dist/core/execution-log/bridge.js.map +0 -1
- package/dist/core/execution-log/event-log.d.ts +0 -7
- package/dist/core/execution-log/event-log.d.ts.map +0 -1
- package/dist/core/execution-log/event-log.js +0 -103
- package/dist/core/execution-log/event-log.js.map +0 -1
- package/dist/core/execution-log/event-projections.d.ts +0 -28
- package/dist/core/execution-log/event-projections.d.ts.map +0 -1
- package/dist/core/execution-log/event-projections.js +0 -272
- package/dist/core/execution-log/event-projections.js.map +0 -1
- package/dist/core/execution-log/event-schema.d.ts +0 -56
- package/dist/core/execution-log/event-schema.d.ts.map +0 -1
- package/dist/core/execution-log/event-schema.js +0 -160
- package/dist/core/execution-log/event-schema.js.map +0 -1
- package/dist/core/execution-log/index.d.ts +0 -7
- package/dist/core/execution-log/index.d.ts.map +0 -1
- package/dist/core/execution-log/index.js +0 -13
- package/dist/core/execution-log/index.js.map +0 -1
- package/dist/core/hash.d.ts +0 -5
- package/dist/core/hash.d.ts.map +0 -1
- package/dist/core/hash.js +0 -13
- package/dist/core/hash.js.map +0 -1
- package/dist/core/rng.d.ts +0 -29
- package/dist/core/rng.d.ts.map +0 -1
- package/dist/core/rng.js +0 -48
- package/dist/core/rng.js.map +0 -1
- package/dist/core/types.d.ts +0 -746
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -8
- package/dist/core/types.js.map +0 -1
- package/dist/events/bus.d.ts +0 -24
- package/dist/events/bus.d.ts.map +0 -1
- package/dist/events/bus.js +0 -64
- package/dist/events/bus.js.map +0 -1
- package/dist/events/decision-jsonl.d.ts +0 -8
- package/dist/events/decision-jsonl.d.ts.map +0 -1
- package/dist/events/decision-jsonl.js +0 -44
- package/dist/events/decision-jsonl.js.map +0 -1
- package/dist/events/jsonl.d.ts +0 -8
- package/dist/events/jsonl.d.ts.map +0 -1
- package/dist/events/jsonl.js +0 -46
- package/dist/events/jsonl.js.map +0 -1
- package/dist/events/schema.d.ts +0 -59
- package/dist/events/schema.d.ts.map +0 -1
- package/dist/events/schema.js +0 -296
- package/dist/events/schema.js.map +0 -1
- package/dist/events/store.d.ts +0 -7
- package/dist/events/store.d.ts.map +0 -1
- package/dist/events/store.js +0 -64
- package/dist/events/store.js.map +0 -1
- package/dist/invariants/checker.d.ts +0 -15
- package/dist/invariants/checker.d.ts.map +0 -1
- package/dist/invariants/checker.js +0 -52
- package/dist/invariants/checker.js.map +0 -1
- package/dist/invariants/definitions.d.ts +0 -33
- package/dist/invariants/definitions.d.ts.map +0 -1
- package/dist/invariants/definitions.js +0 -168
- package/dist/invariants/definitions.js.map +0 -1
- package/dist/kernel/aab.d.ts +0 -26
- package/dist/kernel/aab.d.ts.map +0 -1
- package/dist/kernel/aab.js +0 -149
- package/dist/kernel/aab.js.map +0 -1
- package/dist/kernel/blast-radius.d.ts +0 -60
- package/dist/kernel/blast-radius.d.ts.map +0 -1
- package/dist/kernel/blast-radius.js +0 -146
- package/dist/kernel/blast-radius.js.map +0 -1
- package/dist/kernel/decision.d.ts +0 -40
- package/dist/kernel/decision.d.ts.map +0 -1
- package/dist/kernel/decision.js +0 -92
- package/dist/kernel/decision.js.map +0 -1
- package/dist/kernel/decisions/factory.d.ts +0 -12
- package/dist/kernel/decisions/factory.d.ts.map +0 -1
- package/dist/kernel/decisions/factory.js +0 -56
- package/dist/kernel/decisions/factory.js.map +0 -1
- package/dist/kernel/decisions/types.d.ts +0 -70
- package/dist/kernel/decisions/types.d.ts.map +0 -1
- package/dist/kernel/decisions/types.js +0 -5
- package/dist/kernel/decisions/types.js.map +0 -1
- package/dist/kernel/evidence.d.ts +0 -29
- package/dist/kernel/evidence.d.ts.map +0 -1
- package/dist/kernel/evidence.js +0 -61
- package/dist/kernel/evidence.js.map +0 -1
- package/dist/kernel/kernel.d.ts +0 -47
- package/dist/kernel/kernel.d.ts.map +0 -1
- package/dist/kernel/kernel.js +0 -377
- package/dist/kernel/kernel.js.map +0 -1
- package/dist/kernel/monitor.d.ts +0 -35
- package/dist/kernel/monitor.d.ts.map +0 -1
- package/dist/kernel/monitor.js +0 -144
- package/dist/kernel/monitor.js.map +0 -1
- package/dist/kernel/replay-comparator.d.ts +0 -72
- package/dist/kernel/replay-comparator.d.ts.map +0 -1
- package/dist/kernel/replay-comparator.js +0 -251
- package/dist/kernel/replay-comparator.js.map +0 -1
- package/dist/kernel/replay-engine.d.ts +0 -108
- package/dist/kernel/replay-engine.d.ts.map +0 -1
- package/dist/kernel/replay-engine.js +0 -241
- package/dist/kernel/replay-engine.js.map +0 -1
- package/dist/kernel/replay-processor.d.ts +0 -109
- package/dist/kernel/replay-processor.d.ts.map +0 -1
- package/dist/kernel/replay-processor.js +0 -118
- package/dist/kernel/replay-processor.js.map +0 -1
- package/dist/kernel/simulation/filesystem-simulator.d.ts +0 -3
- package/dist/kernel/simulation/filesystem-simulator.d.ts.map +0 -1
- package/dist/kernel/simulation/filesystem-simulator.js +0 -81
- package/dist/kernel/simulation/filesystem-simulator.js.map +0 -1
- package/dist/kernel/simulation/git-simulator.d.ts +0 -5
- package/dist/kernel/simulation/git-simulator.d.ts.map +0 -1
- package/dist/kernel/simulation/git-simulator.js +0 -115
- package/dist/kernel/simulation/git-simulator.js.map +0 -1
- package/dist/kernel/simulation/package-simulator.d.ts +0 -5
- package/dist/kernel/simulation/package-simulator.d.ts.map +0 -1
- package/dist/kernel/simulation/package-simulator.js +0 -164
- package/dist/kernel/simulation/package-simulator.js.map +0 -1
- package/dist/kernel/simulation/registry.d.ts +0 -3
- package/dist/kernel/simulation/registry.d.ts.map +0 -1
- package/dist/kernel/simulation/registry.js +0 -24
- package/dist/kernel/simulation/registry.js.map +0 -1
- package/dist/kernel/simulation/types.d.ts +0 -35
- package/dist/kernel/simulation/types.d.ts.map +0 -1
- package/dist/kernel/simulation/types.js +0 -4
- package/dist/kernel/simulation/types.js.map +0 -1
- package/dist/plugins/discovery.d.ts +0 -45
- package/dist/plugins/discovery.d.ts.map +0 -1
- package/dist/plugins/discovery.js +0 -89
- package/dist/plugins/discovery.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -10
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -7
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/registry.d.ts +0 -52
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -148
- package/dist/plugins/registry.js.map +0 -1
- package/dist/plugins/sandbox.d.ts +0 -87
- package/dist/plugins/sandbox.d.ts.map +0 -1
- package/dist/plugins/sandbox.js +0 -122
- package/dist/plugins/sandbox.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -61
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -16
- package/dist/plugins/types.js.map +0 -1
- package/dist/plugins/validator.d.ts +0 -36
- package/dist/plugins/validator.d.ts.map +0 -1
- package/dist/plugins/validator.js +0 -276
- package/dist/plugins/validator.js.map +0 -1
- package/dist/policy/evaluator.d.ts +0 -41
- package/dist/policy/evaluator.d.ts.map +0 -1
- package/dist/policy/evaluator.js +0 -111
- package/dist/policy/evaluator.js.map +0 -1
- package/dist/policy/loader.d.ts +0 -13
- package/dist/policy/loader.d.ts.map +0 -1
- package/dist/policy/loader.js +0 -118
- package/dist/policy/loader.js.map +0 -1
- package/dist/policy/pack-loader.d.ts +0 -40
- package/dist/policy/pack-loader.d.ts.map +0 -1
- package/dist/policy/pack-loader.js +0 -138
- package/dist/policy/pack-loader.js.map +0 -1
- package/dist/policy/yaml-loader.d.ts +0 -23
- package/dist/policy/yaml-loader.d.ts.map +0 -1
- package/dist/policy/yaml-loader.js +0 -222
- package/dist/policy/yaml-loader.js.map +0 -1
- package/dist/renderers/index.d.ts +0 -6
- package/dist/renderers/index.d.ts.map +0 -1
- package/dist/renderers/index.js +0 -4
- package/dist/renderers/index.js.map +0 -1
- package/dist/renderers/registry.d.ts +0 -39
- package/dist/renderers/registry.d.ts.map +0 -1
- package/dist/renderers/registry.js +0 -97
- package/dist/renderers/registry.js.map +0 -1
- package/dist/renderers/tui-renderer.d.ts +0 -18
- package/dist/renderers/tui-renderer.d.ts.map +0 -1
- package/dist/renderers/tui-renderer.js +0 -57
- package/dist/renderers/tui-renderer.js.map +0 -1
- package/dist/renderers/types.d.ts +0 -52
- package/dist/renderers/types.d.ts.map +0 -1
- package/dist/renderers/types.js +0 -4
- package/dist/renderers/types.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -3
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -2
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/runtimeLogger.d.ts +0 -9
- package/dist/telemetry/runtimeLogger.d.ts.map +0 -1
- package/dist/telemetry/runtimeLogger.js +0 -68
- package/dist/telemetry/runtimeLogger.js.map +0 -1
- package/dist/telemetry/types.d.ts +0 -22
- package/dist/telemetry/types.d.ts.map +0 -1
- package/dist/telemetry/types.js +0 -4
- package/dist/telemetry/types.js.map +0 -1
- package/hooks/pre-commit +0 -28
- /package/dist/{cli/args.d.ts → args.d.ts} +0 -0
- /package/dist/{cli/args.js → args.js} +0 -0
- /package/dist/{cli/bin.d.ts → bin.d.ts} +0 -0
- /package/dist/{cli/colors.d.ts → colors.d.ts} +0 -0
- /package/dist/{cli/colors.js → colors.js} +0 -0
- /package/dist/{cli/commands → commands}/claude-init.d.ts +0 -0
- /package/dist/{cli/commands → commands}/plugin.d.ts +0 -0
- /package/dist/{cli/replay.d.ts → replay.d.ts} +0 -0
package/dist/plugins/registry.js
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
// Plugin registry — tracks installed plugins with metadata and persistence.
|
|
2
|
-
//
|
|
3
|
-
// The registry is the lifecycle manager for plugins. It validates manifests
|
|
4
|
-
// at install time, persists the registry to disk (.agentguard/plugins.json),
|
|
5
|
-
// and provides lookup/listing for the CLI and kernel.
|
|
6
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
7
|
-
import { join, dirname } from 'node:path';
|
|
8
|
-
import { validatePlugin } from './validator.js';
|
|
9
|
-
const DEFAULT_HOST_VERSION = '1.0.0';
|
|
10
|
-
const REGISTRY_FILENAME = 'plugins.json';
|
|
11
|
-
/**
|
|
12
|
-
* Create a plugin registry backed by a JSON file.
|
|
13
|
-
*
|
|
14
|
-
* The registry validates manifests at install time using the existing
|
|
15
|
-
* plugin validator and persists the installed plugin list to disk.
|
|
16
|
-
*/
|
|
17
|
-
export function createPluginRegistry(options) {
|
|
18
|
-
const storageDir = options?.storageDir ?? '.agentguard';
|
|
19
|
-
const hostVersion = options?.hostVersion ?? DEFAULT_HOST_VERSION;
|
|
20
|
-
const registryPath = join(storageDir, REGISTRY_FILENAME);
|
|
21
|
-
const plugins = new Map();
|
|
22
|
-
// Load existing registry from disk if present
|
|
23
|
-
loadFromDisk();
|
|
24
|
-
function loadFromDisk() {
|
|
25
|
-
if (!existsSync(registryPath))
|
|
26
|
-
return;
|
|
27
|
-
try {
|
|
28
|
-
const raw = readFileSync(registryPath, 'utf8');
|
|
29
|
-
const data = JSON.parse(raw);
|
|
30
|
-
if (data.version === 1 && data.plugins) {
|
|
31
|
-
plugins.clear();
|
|
32
|
-
for (const [id, entry] of Object.entries(data.plugins)) {
|
|
33
|
-
plugins.set(id, entry);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
// Corrupt or missing file — start fresh
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function saveToDisk() {
|
|
42
|
-
const data = {
|
|
43
|
-
version: 1,
|
|
44
|
-
plugins: Object.fromEntries(plugins),
|
|
45
|
-
};
|
|
46
|
-
mkdirSync(dirname(registryPath), { recursive: true });
|
|
47
|
-
writeFileSync(registryPath, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
install(manifest, source) {
|
|
51
|
-
const result = validatePlugin(manifest, hostVersion);
|
|
52
|
-
if (!result.valid) {
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
if (plugins.has(manifest.id)) {
|
|
56
|
-
return {
|
|
57
|
-
valid: false,
|
|
58
|
-
pluginId: manifest.id,
|
|
59
|
-
errors: [
|
|
60
|
-
{
|
|
61
|
-
field: 'id',
|
|
62
|
-
message: `Plugin "${manifest.id}" is already installed. Remove it first to reinstall.`,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
// Check dependencies are satisfied
|
|
68
|
-
if (manifest.dependencies) {
|
|
69
|
-
for (const dep of manifest.dependencies) {
|
|
70
|
-
if (!plugins.has(dep)) {
|
|
71
|
-
return {
|
|
72
|
-
valid: false,
|
|
73
|
-
pluginId: manifest.id,
|
|
74
|
-
errors: [
|
|
75
|
-
{
|
|
76
|
-
field: 'dependencies',
|
|
77
|
-
message: `Missing dependency: "${dep}" must be installed first`,
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const entry = {
|
|
85
|
-
manifest,
|
|
86
|
-
source,
|
|
87
|
-
installedAt: new Date().toISOString(),
|
|
88
|
-
enabled: true,
|
|
89
|
-
};
|
|
90
|
-
plugins.set(manifest.id, entry);
|
|
91
|
-
saveToDisk();
|
|
92
|
-
return result;
|
|
93
|
-
},
|
|
94
|
-
remove(pluginId) {
|
|
95
|
-
// Check if any other plugin depends on this one
|
|
96
|
-
for (const [id, entry] of plugins) {
|
|
97
|
-
if (id === pluginId)
|
|
98
|
-
continue;
|
|
99
|
-
if (entry.manifest.dependencies?.includes(pluginId)) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
const removed = plugins.delete(pluginId);
|
|
104
|
-
if (removed) {
|
|
105
|
-
saveToDisk();
|
|
106
|
-
}
|
|
107
|
-
return removed;
|
|
108
|
-
},
|
|
109
|
-
get(pluginId) {
|
|
110
|
-
return plugins.get(pluginId);
|
|
111
|
-
},
|
|
112
|
-
has(pluginId) {
|
|
113
|
-
return plugins.has(pluginId);
|
|
114
|
-
},
|
|
115
|
-
enable(pluginId) {
|
|
116
|
-
const entry = plugins.get(pluginId);
|
|
117
|
-
if (!entry)
|
|
118
|
-
return false;
|
|
119
|
-
plugins.set(pluginId, { ...entry, enabled: true });
|
|
120
|
-
saveToDisk();
|
|
121
|
-
return true;
|
|
122
|
-
},
|
|
123
|
-
disable(pluginId) {
|
|
124
|
-
const entry = plugins.get(pluginId);
|
|
125
|
-
if (!entry)
|
|
126
|
-
return false;
|
|
127
|
-
plugins.set(pluginId, { ...entry, enabled: false });
|
|
128
|
-
saveToDisk();
|
|
129
|
-
return true;
|
|
130
|
-
},
|
|
131
|
-
list() {
|
|
132
|
-
return [...plugins.values()];
|
|
133
|
-
},
|
|
134
|
-
listByType(type) {
|
|
135
|
-
return [...plugins.values()].filter((p) => p.manifest.type === type);
|
|
136
|
-
},
|
|
137
|
-
count() {
|
|
138
|
-
return plugins.size;
|
|
139
|
-
},
|
|
140
|
-
save() {
|
|
141
|
-
saveToDisk();
|
|
142
|
-
},
|
|
143
|
-
reload() {
|
|
144
|
-
loadFromDisk();
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-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C;YACpC,IAAI,CAAC,KAAK;gBAAE,OAAO,KAAK,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,UAAU,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CAAC,QAAQ;YACd,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,CAAC,KAAK;gBAAE,OAAO,KAAK,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YACpD,UAAU,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI;YACF,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/B,CAAC;QAED,UAAU,CAAC,IAAI;YACb,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACvE,CAAC;QAED,KAAK;YACH,OAAO,OAAO,CAAC,IAAI,CAAC;QACtB,CAAC;QAED,IAAI;YACF,UAAU,EAAE,CAAC;QACf,CAAC;QAED,MAAM;YACJ,YAAY,EAAE,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { PluginManifest, PluginCapability, SandboxViolation, SandboxConfig } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* PluginSandbox — enforces capability boundaries for a single plugin.
|
|
4
|
-
*
|
|
5
|
-
* Created per-plugin at registration time. Tracks granted capabilities
|
|
6
|
-
* and records any violations when a plugin attempts undeclared access.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* ```ts
|
|
10
|
-
* const sandbox = createPluginSandbox(manifest);
|
|
11
|
-
* if (sandbox.hasCapability('filesystem:read')) {
|
|
12
|
-
* // safe to proceed
|
|
13
|
-
* }
|
|
14
|
-
* const result = sandbox.execute(() => plugin.onEvent(event));
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export interface PluginSandbox {
|
|
18
|
-
/** The plugin this sandbox wraps */
|
|
19
|
-
readonly pluginId: string;
|
|
20
|
-
/** Check if the plugin has declared a specific capability */
|
|
21
|
-
hasCapability(capability: PluginCapability): boolean;
|
|
22
|
-
/** Get all granted capabilities */
|
|
23
|
-
getCapabilities(): readonly PluginCapability[];
|
|
24
|
-
/**
|
|
25
|
-
* Assert that the plugin has a capability. Records a violation if not.
|
|
26
|
-
* Returns true if the capability is granted, false if denied.
|
|
27
|
-
*/
|
|
28
|
-
assertCapability(capability: PluginCapability): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Execute a plugin callback with error isolation.
|
|
31
|
-
* Catches any thrown errors and returns a structured result.
|
|
32
|
-
* In strict mode, capability violations throw instead of returning.
|
|
33
|
-
*/
|
|
34
|
-
execute<T>(fn: () => T): SandboxExecutionResult<T>;
|
|
35
|
-
/**
|
|
36
|
-
* Execute an async plugin callback with error isolation.
|
|
37
|
-
*/
|
|
38
|
-
executeAsync<T>(fn: () => Promise<T>): Promise<SandboxExecutionResult<T>>;
|
|
39
|
-
/** Get all recorded violations for this plugin */
|
|
40
|
-
getViolations(): readonly SandboxViolation[];
|
|
41
|
-
/** Number of violations recorded */
|
|
42
|
-
violationCount(): number;
|
|
43
|
-
}
|
|
44
|
-
/** Result of a sandboxed execution */
|
|
45
|
-
export interface SandboxExecutionResult<T> {
|
|
46
|
-
readonly success: boolean;
|
|
47
|
-
readonly value?: T;
|
|
48
|
-
readonly error?: string;
|
|
49
|
-
readonly durationMs: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Create a sandbox for a plugin based on its manifest.
|
|
53
|
-
*
|
|
54
|
-
* The sandbox:
|
|
55
|
-
* - Grants only capabilities declared in the manifest
|
|
56
|
-
* - Records violations when undeclared capabilities are asserted
|
|
57
|
-
* - Wraps execution with error isolation (try/catch)
|
|
58
|
-
* - Tracks timing for each execution
|
|
59
|
-
*/
|
|
60
|
-
export declare function createPluginSandbox(manifest: PluginManifest, config?: SandboxConfig): PluginSandbox;
|
|
61
|
-
/**
|
|
62
|
-
* SandboxRegistry — manages sandboxes for all loaded plugins.
|
|
63
|
-
*
|
|
64
|
-
* Provides centralized access to per-plugin sandboxes and aggregated
|
|
65
|
-
* violation reporting for audit trails.
|
|
66
|
-
*/
|
|
67
|
-
export interface SandboxRegistry {
|
|
68
|
-
/** Create and register a sandbox for a plugin */
|
|
69
|
-
register(manifest: PluginManifest): PluginSandbox;
|
|
70
|
-
/** Get the sandbox for a registered plugin */
|
|
71
|
-
get(pluginId: string): PluginSandbox | undefined;
|
|
72
|
-
/** Check if a plugin has a sandbox */
|
|
73
|
-
has(pluginId: string): boolean;
|
|
74
|
-
/** Remove a plugin's sandbox */
|
|
75
|
-
unregister(pluginId: string): boolean;
|
|
76
|
-
/** Get all violations across all plugins */
|
|
77
|
-
getAllViolations(): readonly SandboxViolation[];
|
|
78
|
-
/** Number of registered sandboxes */
|
|
79
|
-
count(): number;
|
|
80
|
-
/** List all registered plugin IDs */
|
|
81
|
-
list(): string[];
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Create a sandbox registry for managing per-plugin sandboxes.
|
|
85
|
-
*/
|
|
86
|
-
export declare function createSandboxRegistry(config?: SandboxConfig): SandboxRegistry;
|
|
87
|
-
//# sourceMappingURL=sandbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/plugins/sandbox.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAA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AAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAEjD,sCAAsC;IACtC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAE/B,gCAAgC;IAChC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC,4CAA4C;IAC5C,gBAAgB,IAAI,SAAS,gBAAgB,EAAE,CAAC;IAEhD,qCAAqC;IACrC,KAAK,IAAI,MAAM,CAAC;IAEhB,qCAAqC;IACrC,IAAI,IAAI,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,eAAe,CAyC7E"}
|
package/dist/plugins/sandbox.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// Plugin sandbox — runtime capability enforcement for third-party plugins.
|
|
2
|
-
//
|
|
3
|
-
// Wraps plugin execution with capability checks and error isolation.
|
|
4
|
-
// Plugins can only access capabilities they declared in their manifest.
|
|
5
|
-
// Undeclared capability usage is denied and recorded as a violation.
|
|
6
|
-
/** Default sandbox configuration */
|
|
7
|
-
const DEFAULT_CONFIG = {
|
|
8
|
-
timeoutMs: 5000,
|
|
9
|
-
strict: false,
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Create a sandbox for a plugin based on its manifest.
|
|
13
|
-
*
|
|
14
|
-
* The sandbox:
|
|
15
|
-
* - Grants only capabilities declared in the manifest
|
|
16
|
-
* - Records violations when undeclared capabilities are asserted
|
|
17
|
-
* - Wraps execution with error isolation (try/catch)
|
|
18
|
-
* - Tracks timing for each execution
|
|
19
|
-
*/
|
|
20
|
-
export function createPluginSandbox(manifest, config) {
|
|
21
|
-
const resolvedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
22
|
-
const grantedCapabilities = new Set(manifest.capabilities ?? []);
|
|
23
|
-
const violations = [];
|
|
24
|
-
return {
|
|
25
|
-
pluginId: manifest.id,
|
|
26
|
-
hasCapability(capability) {
|
|
27
|
-
return grantedCapabilities.has(capability);
|
|
28
|
-
},
|
|
29
|
-
getCapabilities() {
|
|
30
|
-
return [...grantedCapabilities];
|
|
31
|
-
},
|
|
32
|
-
assertCapability(capability) {
|
|
33
|
-
if (grantedCapabilities.has(capability)) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
const violation = {
|
|
37
|
-
pluginId: manifest.id,
|
|
38
|
-
capability,
|
|
39
|
-
message: `Plugin "${manifest.id}" attempted to use undeclared capability "${capability}"`,
|
|
40
|
-
timestamp: Date.now(),
|
|
41
|
-
};
|
|
42
|
-
violations.push(violation);
|
|
43
|
-
if (resolvedConfig.strict) {
|
|
44
|
-
throw new Error(violation.message);
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
},
|
|
48
|
-
execute(fn) {
|
|
49
|
-
const start = Date.now();
|
|
50
|
-
try {
|
|
51
|
-
const value = fn();
|
|
52
|
-
return { success: true, value, durationMs: Date.now() - start };
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
return {
|
|
56
|
-
success: false,
|
|
57
|
-
error: err instanceof Error ? err.message : String(err),
|
|
58
|
-
durationMs: Date.now() - start,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
async executeAsync(fn) {
|
|
63
|
-
const start = Date.now();
|
|
64
|
-
try {
|
|
65
|
-
const value = await fn();
|
|
66
|
-
return { success: true, value, durationMs: Date.now() - start };
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
return {
|
|
70
|
-
success: false,
|
|
71
|
-
error: err instanceof Error ? err.message : String(err),
|
|
72
|
-
durationMs: Date.now() - start,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
getViolations() {
|
|
77
|
-
return [...violations];
|
|
78
|
-
},
|
|
79
|
-
violationCount() {
|
|
80
|
-
return violations.length;
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Create a sandbox registry for managing per-plugin sandboxes.
|
|
86
|
-
*/
|
|
87
|
-
export function createSandboxRegistry(config) {
|
|
88
|
-
const sandboxes = new Map();
|
|
89
|
-
return {
|
|
90
|
-
register(manifest) {
|
|
91
|
-
if (sandboxes.has(manifest.id)) {
|
|
92
|
-
throw new Error(`Sandbox already registered for plugin: "${manifest.id}"`);
|
|
93
|
-
}
|
|
94
|
-
const sandbox = createPluginSandbox(manifest, config);
|
|
95
|
-
sandboxes.set(manifest.id, sandbox);
|
|
96
|
-
return sandbox;
|
|
97
|
-
},
|
|
98
|
-
get(pluginId) {
|
|
99
|
-
return sandboxes.get(pluginId);
|
|
100
|
-
},
|
|
101
|
-
has(pluginId) {
|
|
102
|
-
return sandboxes.has(pluginId);
|
|
103
|
-
},
|
|
104
|
-
unregister(pluginId) {
|
|
105
|
-
return sandboxes.delete(pluginId);
|
|
106
|
-
},
|
|
107
|
-
getAllViolations() {
|
|
108
|
-
const allViolations = [];
|
|
109
|
-
for (const sandbox of sandboxes.values()) {
|
|
110
|
-
allViolations.push(...sandbox.getViolations());
|
|
111
|
-
}
|
|
112
|
-
return allViolations.sort((a, b) => a.timestamp - b.timestamp);
|
|
113
|
-
},
|
|
114
|
-
count() {
|
|
115
|
-
return sandboxes.size;
|
|
116
|
-
},
|
|
117
|
-
list() {
|
|
118
|
-
return [...sandboxes.keys()];
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=sandbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/plugins/sandbox.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,qEAAqE;AAIrE,oCAAoC;AACpC,MAAM,cAAc,GAA4B;IAC9C,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;CACd,CAAC;AA4DF;;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MAAM,IAAI,KAAK,CAAC,2CAA2C,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;YAC7E,CAAC;YACD,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACtD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,GAAG,CAAC,QAAgB;YAClB,OAAO,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,GAAG,CAAC,QAAgB;YAClB,OAAO,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,UAAU,CAAC,QAAgB;YACzB,OAAO,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAED,gBAAgB;YACd,MAAM,aAAa,GAAuB,EAAE,CAAC;YAC7C,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;gBACzC,aAAa,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;YACjD,CAAC;YACD,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QACjE,CAAC;QAED,KAAK;YACH,OAAO,SAAS,CAAC,IAAI,CAAC;QACxB,CAAC;QAED,IAAI;YACF,OAAO,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/plugins/types.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/** Supported plugin types in the AgentGuard ecosystem */
|
|
2
|
-
export type PluginType = 'renderer' | 'replay-processor' | 'policy-pack';
|
|
3
|
-
/**
|
|
4
|
-
* Capabilities a plugin may request.
|
|
5
|
-
*
|
|
6
|
-
* Plugins declare required capabilities in their manifest. The sandbox
|
|
7
|
-
* grants only declared capabilities — any undeclared access is denied.
|
|
8
|
-
*/
|
|
9
|
-
export type PluginCapability = 'filesystem:read' | 'filesystem:write' | 'network' | 'process:spawn' | 'events:emit' | 'events:subscribe';
|
|
10
|
-
/** All known capabilities for validation */
|
|
11
|
-
export declare const VALID_CAPABILITIES: readonly PluginCapability[];
|
|
12
|
-
/**
|
|
13
|
-
* Plugin manifest — the metadata every plugin must provide.
|
|
14
|
-
*
|
|
15
|
-
* This is validated at load time before the plugin is registered.
|
|
16
|
-
* Think of it as the plugin's "package.json" for AgentGuard.
|
|
17
|
-
*/
|
|
18
|
-
export interface PluginManifest {
|
|
19
|
-
/** Unique identifier (e.g., "agentguard-renderer-json") */
|
|
20
|
-
readonly id: string;
|
|
21
|
-
/** Human-readable display name */
|
|
22
|
-
readonly name: string;
|
|
23
|
-
/** Plugin version (semver, e.g., "1.2.0") */
|
|
24
|
-
readonly version: string;
|
|
25
|
-
/** Brief description of what the plugin does */
|
|
26
|
-
readonly description?: string;
|
|
27
|
-
/** The type of plugin */
|
|
28
|
-
readonly type: PluginType;
|
|
29
|
-
/** Required AgentGuard API version (semver range, e.g., "^1.0.0" or ">=1.0.0") */
|
|
30
|
-
readonly apiVersion: string;
|
|
31
|
-
/** Capabilities this plugin requires at runtime */
|
|
32
|
-
readonly capabilities?: readonly PluginCapability[];
|
|
33
|
-
/** Other plugin IDs this plugin depends on */
|
|
34
|
-
readonly dependencies?: readonly string[];
|
|
35
|
-
}
|
|
36
|
-
/** Individual validation error with a field path and message */
|
|
37
|
-
export interface PluginValidationError {
|
|
38
|
-
readonly field: string;
|
|
39
|
-
readonly message: string;
|
|
40
|
-
}
|
|
41
|
-
/** Result of validating a plugin manifest */
|
|
42
|
-
export interface PluginValidationResult {
|
|
43
|
-
readonly valid: boolean;
|
|
44
|
-
readonly pluginId: string | undefined;
|
|
45
|
-
readonly errors: readonly PluginValidationError[];
|
|
46
|
-
}
|
|
47
|
-
/** Result of a sandbox capability check */
|
|
48
|
-
export interface SandboxViolation {
|
|
49
|
-
readonly pluginId: string;
|
|
50
|
-
readonly capability: string;
|
|
51
|
-
readonly message: string;
|
|
52
|
-
readonly timestamp: number;
|
|
53
|
-
}
|
|
54
|
-
/** Configuration for the plugin sandbox */
|
|
55
|
-
export interface SandboxConfig {
|
|
56
|
-
/** Maximum execution time per callback in milliseconds (default: 5000) */
|
|
57
|
-
readonly timeoutMs?: number;
|
|
58
|
-
/** Whether to throw on violation or silently deny (default: false = silent) */
|
|
59
|
-
readonly strict?: boolean;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAOA,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GACxB,iBAAiB,GACjB,kBAAkB,GAClB,SAAS,GACT,eAAe,GACf,aAAa,GACb,kBAAkB,CAAC;AAEvB,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAOzD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB;IACzB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpD,8CAA8C;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACnD;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
package/dist/plugins/types.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Plugin system type definitions — manifest schema, capabilities, and validation results.
|
|
2
|
-
//
|
|
3
|
-
// All third-party plugins (renderers, replay processors, policy packs) must provide
|
|
4
|
-
// a PluginManifest describing their metadata, required capabilities, and API version
|
|
5
|
-
// compatibility. The validation and sandboxing layer uses these declarations to
|
|
6
|
-
// enforce security boundaries at load time and runtime.
|
|
7
|
-
/** All known capabilities for validation */
|
|
8
|
-
export const VALID_CAPABILITIES = [
|
|
9
|
-
'filesystem:read',
|
|
10
|
-
'filesystem:write',
|
|
11
|
-
'network',
|
|
12
|
-
'process:spawn',
|
|
13
|
-
'events:emit',
|
|
14
|
-
'events:subscribe',
|
|
15
|
-
];
|
|
16
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,EAAE;AACF,oFAAoF;AACpF,qFAAqF;AACrF,gFAAgF;AAChF,wDAAwD;AAmBxD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,kBAAkB,GAAgC;IAC7D,iBAAiB;IACjB,kBAAkB;IAClB,SAAS;IACT,eAAe;IACf,aAAa;IACb,kBAAkB;CACnB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { PluginValidationResult } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Validate a plugin manifest for structural correctness.
|
|
4
|
-
*
|
|
5
|
-
* Checks:
|
|
6
|
-
* - Required fields: id, name, version, type, apiVersion
|
|
7
|
-
* - String format: non-empty strings, valid semver
|
|
8
|
-
* - Plugin type: must be a known PluginType
|
|
9
|
-
* - Capabilities: all entries must be known PluginCapability values
|
|
10
|
-
* - Dependencies: must be non-empty strings if provided
|
|
11
|
-
*/
|
|
12
|
-
export declare function validateManifest(manifest: unknown): PluginValidationResult;
|
|
13
|
-
/**
|
|
14
|
-
* Check if a plugin's declared apiVersion is compatible with the host API version.
|
|
15
|
-
*
|
|
16
|
-
* Supports simple semver range operators:
|
|
17
|
-
* - `^1.0.0` — compatible with 1.x.x (major must match, minor/patch >= specified)
|
|
18
|
-
* - `~1.2.0` — compatible with 1.2.x (major+minor must match, patch >= specified)
|
|
19
|
-
* - `>=1.0.0` — any version >= 1.0.0
|
|
20
|
-
* - `1.0.0` — exact match (treated as ^1.0.0 for convenience)
|
|
21
|
-
*/
|
|
22
|
-
export declare function checkApiVersionCompatibility(pluginApiVersion: string, hostVersion: string): {
|
|
23
|
-
compatible: boolean;
|
|
24
|
-
reason?: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Fully validate a plugin manifest including API version compatibility.
|
|
28
|
-
*
|
|
29
|
-
* This is the main entry point for plugin validation. It runs:
|
|
30
|
-
* 1. Structural validation (validateManifest)
|
|
31
|
-
* 2. API version compatibility check (checkApiVersionCompatibility)
|
|
32
|
-
*
|
|
33
|
-
* Returns a combined result with all errors.
|
|
34
|
-
*/
|
|
35
|
-
export declare function validatePlugin(manifest: unknown, hostVersion: string): PluginValidationResult;
|
|
36
|
-
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/plugins/validator.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAIV,sBAAsB,EAEvB,MAAM,YAAY,CAAC;AAYpB;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB,CA4G1E;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CA2G1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,sBAAsB,CAyB7F"}
|