@payconductor/houndsman 0.1.3 → 0.2.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.
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Ícones SVG inline (traço = `currentColor`) — sem dependência e sem requisição
3
+ * externa; o cliente é servido localmente a partir de um bundle em memória.
4
+ */
5
+
6
+ import type { ComponentChildren } from "preact";
7
+
8
+ export type IconProps = { size?: number; class?: string };
9
+
10
+ function Svg({
11
+ size = 16,
12
+ class: cls,
13
+ children,
14
+ }: IconProps & { children: ComponentChildren }) {
15
+ return (
16
+ <svg
17
+ width={size}
18
+ height={size}
19
+ viewBox="0 0 24 24"
20
+ fill="none"
21
+ stroke="currentColor"
22
+ stroke-width="1.8"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ class={cls}
26
+ aria-hidden="true"
27
+ >
28
+ {children}
29
+ </svg>
30
+ );
31
+ }
32
+
33
+ export const ChevronRight = (p: IconProps) => (
34
+ <Svg {...p}>
35
+ <path d="m9 18 6-6-6-6" />
36
+ </Svg>
37
+ );
38
+
39
+ export const CodeIcon = (p: IconProps) => (
40
+ <Svg {...p}>
41
+ <path d="m16 18 6-6-6-6" />
42
+ <path d="m8 6-6 6 6 6" />
43
+ </Svg>
44
+ );
45
+
46
+ export const ExternalLink = (p: IconProps) => (
47
+ <Svg {...p}>
48
+ <path d="M15 3h6v6" />
49
+ <path d="M10 14 21 3" />
50
+ <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
51
+ </Svg>
52
+ );
53
+
54
+ export const Sparkles = (p: IconProps) => (
55
+ <Svg {...p}>
56
+ <path d="M11 3.5l1.7 4.3 4.3 1.7-4.3 1.7L11 15.5 9.3 11.2 5 9.5l4.3-1.7z" />
57
+ <path d="M18.5 14.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z" />
58
+ </Svg>
59
+ );
60
+
61
+ export const Refresh = (p: IconProps) => (
62
+ <Svg {...p}>
63
+ <path d="M3.2 12a8.8 8.8 0 0 1 15-6.2L21 8" />
64
+ <path d="M21 3.5V8h-4.5" />
65
+ <path d="M20.8 12a8.8 8.8 0 0 1-15 6.2L3 16" />
66
+ <path d="M3 20.5V16h4.5" />
67
+ </Svg>
68
+ );
69
+
70
+ export const Clock = (p: IconProps) => (
71
+ <Svg {...p}>
72
+ <circle cx="12" cy="12" r="9" />
73
+ <path d="M12 7.5V12l3 1.8" />
74
+ </Svg>
75
+ );
76
+
77
+ export const Check = (p: IconProps) => (
78
+ <Svg {...p}>
79
+ <path d="m20 6.5-11 11-5-5" />
80
+ </Svg>
81
+ );
82
+
83
+ /** Arco (não círculo fechado) — usado com `animation: spin` no fundo. */
84
+ export const Spinner = (p: IconProps) => (
85
+ <Svg {...p}>
86
+ <path d="M12 3.5a8.5 8.5 0 1 0 8.5 8.5" />
87
+ </Svg>
88
+ );
89
+
90
+ export const Search = (p: IconProps) => (
91
+ <Svg {...p}>
92
+ <circle cx="11" cy="11" r="7" />
93
+ <path d="m20 20-3.6-3.6" />
94
+ </Svg>
95
+ );
96
+
97
+ export const BranchIcon = (p: IconProps) => (
98
+ <Svg {...p}>
99
+ <circle cx="6" cy="5" r="2.4" />
100
+ <circle cx="6" cy="19" r="2.4" />
101
+ <circle cx="18" cy="8" r="2.4" />
102
+ <path d="M6 7.4v9.2" />
103
+ <path d="M18 10.4c0 3.8-4 3.4-6.5 5.4" />
104
+ </Svg>
105
+ );
106
+
107
+ export const Alert = (p: IconProps) => (
108
+ <Svg {...p}>
109
+ <circle cx="12" cy="12" r="9" />
110
+ <path d="M12 7.5V13" />
111
+ <path d="M12 16.5h.01" />
112
+ </Svg>
113
+ );
114
+
115
+ export const ListIcon = (p: IconProps) => (
116
+ <Svg {...p}>
117
+ <path d="M9 6h12M9 12h12M9 18h12" />
118
+ <path d="M3.5 6h.01M3.5 12h.01M3.5 18h.01" />
119
+ </Svg>
120
+ );
121
+
122
+ export const Layers = (p: IconProps) => (
123
+ <Svg {...p}>
124
+ <path d="m12 3 9 5-9 5-9-5z" />
125
+ <path d="m3 13 9 5 9-5" />
126
+ </Svg>
127
+ );
128
+
129
+ /** Olho — "quem auditou o trecho" (watchdogs envolvidos). */
130
+ export const Watch = (p: IconProps) => (
131
+ <Svg {...p}>
132
+ <path d="M2.5 12S6 6.5 12 6.5 21.5 12 21.5 12 18 17.5 12 17.5 2.5 12 2.5 12z" />
133
+ <circle cx="12" cy="12" r="2.6" />
134
+ </Svg>
135
+ );
136
+
137
+ /** Avião de papel — "enviar revisão". */
138
+ export const Send = (p: IconProps) => (
139
+ <Svg {...p}>
140
+ <path d="M22 2 11 13" />
141
+ <path d="M22 2 15 22l-4-9-9-4z" />
142
+ </Svg>
143
+ );
@@ -12,12 +12,23 @@ export type ExecState = "pending" | "in_progress" | "done" | "stale";
12
12
  /** Estados de execução de uma run (espelham `core/run-status.ts`). */
13
13
  export type RunStatus = "reviewing" | "review_done" | "fixing" | "fix_done";
14
14
 
15
+ /** Vínculo com o comentário remoto no GitHub (envio da revisão). */
16
+ export type GitHubLink = {
17
+ commentId: number;
18
+ url?: string;
19
+ kind: "line" | "file" | "comment";
20
+ pr: number;
21
+ at: string;
22
+ };
23
+
15
24
  export type Finding = {
16
25
  id: string;
17
26
  rule: string;
18
27
  severity: Severity;
19
28
  file: string;
20
29
  line: number | null;
30
+ /** Caminho absoluto resolvido pelo servidor — base do link `vscode://file/…`. */
31
+ absFile?: string;
21
32
  message: string;
22
33
  action: string;
23
34
  evidence?: string;
@@ -27,6 +38,8 @@ export type Finding = {
27
38
  comment?: string;
28
39
  execState: ExecState;
29
40
  watchdogIds: string[];
41
+ /** Comentário remoto no GitHub, quando já enviado. */
42
+ github?: GitHubLink;
30
43
  };
31
44
 
32
45
  export type Summary = {
@@ -50,3 +63,59 @@ export type FindingsResponse = {
50
63
  findings: Finding[];
51
64
  summary: Summary;
52
65
  };
66
+
67
+ /** Candidato ao envio da revisão (espelha `core/github-review.ts`). */
68
+ export type SubmitCandidate = {
69
+ id: string;
70
+ file: string;
71
+ line: number | null;
72
+ severity: Severity;
73
+ execState: ExecState;
74
+ rule: string;
75
+ message: string;
76
+ /** Onde o comentário será ancorado: na linha do diff ou no arquivo. */
77
+ kind: "line" | "file";
78
+ sent: boolean;
79
+ sentUrl?: string;
80
+ skip: boolean;
81
+ };
82
+
83
+ export type PrTarget = {
84
+ number: number;
85
+ repo: string;
86
+ headSha?: string;
87
+ url?: string;
88
+ };
89
+
90
+ export type SubmitPreview = {
91
+ available: boolean;
92
+ reason?: string;
93
+ target?: PrTarget;
94
+ candidates: SubmitCandidate[];
95
+ totals: {
96
+ candidates: number;
97
+ toSend: number;
98
+ line: number;
99
+ file: number;
100
+ sent: number;
101
+ };
102
+ };
103
+
104
+ export type SubmitOutcome = {
105
+ posted: {
106
+ id: string;
107
+ kind: "line" | "file" | "comment";
108
+ commentId: number;
109
+ url?: string;
110
+ }[];
111
+ failed: { id: string; reason: string }[];
112
+ skipped: { id: string; reason: string }[];
113
+ general?: { commentId: number; url?: string; ids: string[] };
114
+ };
115
+
116
+ export type SubmitResponse = {
117
+ available: boolean;
118
+ reason?: string;
119
+ target?: PrTarget;
120
+ outcome?: SubmitOutcome;
121
+ };