solidity-argus 0.5.9 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/AGENTS.md +9 -2
  2. package/README.md +28 -21
  3. package/package.json +2 -2
  4. package/skills/INVENTORY.md +14 -1
  5. package/skills/README.md +4 -2
  6. package/skills/references/attack-vector-deck/SKILL.md +62 -0
  7. package/skills/specialist-profiles/access-control-specialist/SKILL.md +31 -0
  8. package/skills/specialist-profiles/economic-security/SKILL.md +31 -0
  9. package/skills/specialist-profiles/execution-trace/SKILL.md +31 -0
  10. package/skills/specialist-profiles/first-principles/SKILL.md +31 -0
  11. package/skills/specialist-profiles/invariant/SKILL.md +31 -0
  12. package/skills/specialist-profiles/math-precision/SKILL.md +31 -0
  13. package/skills/specialist-profiles/periphery/SKILL.md +31 -0
  14. package/skills/specialist-profiles/vector-scan/SKILL.md +28 -0
  15. package/src/agents/argus-prompt.ts +48 -7
  16. package/src/agents/audit-specialist-prompt.ts +76 -0
  17. package/src/agents/pythia-prompt.ts +1 -1
  18. package/src/agents/scribe-prompt.ts +5 -0
  19. package/src/agents/sentinel-prompt.ts +5 -0
  20. package/src/agents/themis-prompt.ts +3 -0
  21. package/src/config/schema.ts +2 -0
  22. package/src/constants/defaults.ts +1 -0
  23. package/src/create-hooks.ts +18 -8
  24. package/src/create-tools.ts +2 -0
  25. package/src/features/audit-enforcer/audit-enforcer.ts +2 -16
  26. package/src/features/persistent-state/run-finalizer.ts +94 -1
  27. package/src/hooks/config-handler.ts +23 -0
  28. package/src/hooks/system-prompt-hook.ts +56 -2
  29. package/src/hooks/tool-tracking-hook.ts +75 -6
  30. package/src/shared/agent-names.ts +1 -0
  31. package/src/shared/key-tools.ts +9 -2
  32. package/src/state/adapters.ts +1 -1
  33. package/src/state/projectors.ts +50 -0
  34. package/src/state/schemas.ts +86 -1
  35. package/src/state/types.ts +24 -1
  36. package/src/tools/forge-coverage-tool.ts +31 -1
  37. package/src/tools/record-finding-tool.ts +7 -1
  38. package/src/tools/report-generator-tool.ts +28 -2
  39. package/src/tools/slither-tool.ts +6 -22
  40. package/src/tools/themis-disposition-tool.ts +46 -0
@@ -0,0 +1,46 @@
1
+ import { type ToolContext, tool } from "@opencode-ai/plugin"
2
+
3
+ type ThemisDispositionStatus = "approved" | "remediated" | "overridden"
4
+
5
+ type ThemisDispositionArgs = {
6
+ status: ThemisDispositionStatus
7
+ verdict_json: string
8
+ notes?: string
9
+ justification?: string
10
+ }
11
+
12
+ function parseVerdict(verdictJson: string): unknown {
13
+ try {
14
+ return JSON.parse(verdictJson)
15
+ } catch (error) {
16
+ const message = error instanceof Error ? error.message : String(error)
17
+ throw new Error(`Invalid Themis verdict JSON: ${message}`)
18
+ }
19
+ }
20
+
21
+ export function executeThemisDisposition(args: ThemisDispositionArgs, context: ToolContext) {
22
+ context.metadata({ title: `Themis disposition: ${args.status}` })
23
+ return {
24
+ success: true,
25
+ themisDisposition: {
26
+ status: args.status,
27
+ verdict: parseVerdict(args.verdict_json),
28
+ ...(args.notes ? { notes: args.notes } : {}),
29
+ ...(args.justification ? { justification: args.justification } : {}),
30
+ },
31
+ }
32
+ }
33
+
34
+ export const themisDispositionTool = tool({
35
+ description:
36
+ "Record Argus' resolved disposition for a Themis quality-gate verdict: approved, remediated, or overridden.",
37
+ args: {
38
+ status: tool.schema.enum(["approved", "remediated", "overridden"]),
39
+ verdict_json: tool.schema.string(),
40
+ notes: tool.schema.string().optional(),
41
+ justification: tool.schema.string().optional(),
42
+ },
43
+ async execute(args, context) {
44
+ return JSON.stringify(executeThemisDisposition(args, context))
45
+ },
46
+ })