@a3s-lab/code 3.1.0 → 3.2.1

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,56 @@
1
+ /**
2
+ * Hand-authored type declarations that complement the auto-generated
3
+ * `generated.d.ts`. These describe shapes that cross the SDK boundary as
4
+ * JSON (e.g. payloads inside `runs()`, `verificationReports()`,
5
+ * `errorKindJson` strings), not napi-bound objects.
6
+ *
7
+ * Keep field names matching the actual JSON wire format (snake_case where
8
+ * the Rust core serializes that way). Do not move these into Rust source —
9
+ * napi-derive would camelCase them and break consumers parsing the JSON.
10
+ */
11
+
12
+ /**
13
+ * Parsed shape of `ToolResult.errorKindJson` / `AgentEvent.errorKindJson`.
14
+ *
15
+ * Use a discriminated union on the `type` field; new variants may be
16
+ * added in future minor releases — callers should match exhaustively on
17
+ * the kinds they care about and fall through to a default branch for
18
+ * unknown ones.
19
+ */
20
+ export type ToolErrorKind =
21
+ | { type: 'version_conflict'; path: string; expected: string; actual: string | null }
22
+ | { type: 'remote_git_conflict'; code: string; message: string }
23
+ | { type: 'not_found'; path: string }
24
+ | { type: 'invalid_argument'; message: string }
25
+ | { type: 'unsupported'; message: string }
26
+ | { type: 'timeout'; op: string; duration_ms: number }
27
+
28
+ export type VerificationStatus = 'passed' | 'failed' | 'needs_review' | 'skipped'
29
+
30
+ export interface VerificationCheck {
31
+ id: string
32
+ kind: string
33
+ description: string
34
+ status: VerificationStatus
35
+ required?: boolean
36
+ suggested_tools?: Array<string>
37
+ evidence_uris?: Array<string>
38
+ residual_risk?: string
39
+ }
40
+
41
+ export interface VerificationReport {
42
+ schema: string
43
+ subject: string
44
+ status: VerificationStatus
45
+ checks: Array<VerificationCheck>
46
+ residual_risks?: Array<string>
47
+ }
48
+
49
+ export interface ToolArtifact {
50
+ artifact_id: string
51
+ artifact_uri: string
52
+ tool_name: string
53
+ content: string
54
+ original_bytes: number
55
+ shown_bytes: number
56
+ }