hivenet 0.4.1 → 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.
- package/README.md +75 -4
- package/dist/chunk-AK23JXBN.js +32 -0
- package/dist/{chunk-K4DIOYVH.js → chunk-DNR6HNJD.js} +607 -166
- package/dist/cli.js +358 -57
- package/dist/doctor-EA2GJRUS.js +210 -0
- package/dist/index.cjs +16771 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1053 -0
- package/dist/index.d.ts +1053 -0
- package/dist/index.js +16709 -0
- package/dist/index.js.map +1 -0
- package/dist/owner-ZWROA7AU.js +539 -0
- package/package.json +14 -1
- package/dist/owner-LAL5WKKW.js +0 -235
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1053 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const attachmentTargetSchema$1: z.ZodObject<{
|
|
4
|
+
type: z.ZodEnum<{
|
|
5
|
+
eval: "eval";
|
|
6
|
+
question: "question";
|
|
7
|
+
event: "event";
|
|
8
|
+
issue: "issue";
|
|
9
|
+
investigation: "investigation";
|
|
10
|
+
investigation_question: "investigation_question";
|
|
11
|
+
investigation_reply: "investigation_reply";
|
|
12
|
+
}>;
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
type AttachmentTarget$1 = z.infer<typeof attachmentTargetSchema$1>;
|
|
16
|
+
declare const attachmentSchema$1: z.ZodObject<{
|
|
17
|
+
filename: z.ZodString;
|
|
18
|
+
mediaType: z.ZodString;
|
|
19
|
+
size: z.ZodNumber;
|
|
20
|
+
sha256: z.ZodString;
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
source: z.ZodEnum<{
|
|
24
|
+
reporter: "reporter";
|
|
25
|
+
owner: "owner";
|
|
26
|
+
}>;
|
|
27
|
+
uploader: z.ZodNullable<z.ZodString>;
|
|
28
|
+
target: z.ZodObject<{
|
|
29
|
+
type: z.ZodEnum<{
|
|
30
|
+
eval: "eval";
|
|
31
|
+
question: "question";
|
|
32
|
+
event: "event";
|
|
33
|
+
issue: "issue";
|
|
34
|
+
investigation: "investigation";
|
|
35
|
+
investigation_question: "investigation_question";
|
|
36
|
+
investigation_reply: "investigation_reply";
|
|
37
|
+
}>;
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
description: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type Attachment$1 = z.infer<typeof attachmentSchema$1>;
|
|
43
|
+
/** Triage lifecycle of a single feedback event (owner plane). */
|
|
44
|
+
declare const EVENT_STATUSES: readonly ["new", "seen", "in_progress", "resolved", "wont_fix", "spam"];
|
|
45
|
+
type EventStatus = (typeof EVENT_STATUSES)[number];
|
|
46
|
+
/** Triage lifecycle of a clustered issue (owner plane). */
|
|
47
|
+
declare const ISSUE_STATUSES: readonly ["open", "in_progress", "needs_review", "resolved", "wont_fix", "spam"];
|
|
48
|
+
declare const issueStatusSchema: z.ZodEnum<{
|
|
49
|
+
in_progress: "in_progress";
|
|
50
|
+
resolved: "resolved";
|
|
51
|
+
wont_fix: "wont_fix";
|
|
52
|
+
spam: "spam";
|
|
53
|
+
open: "open";
|
|
54
|
+
needs_review: "needs_review";
|
|
55
|
+
}>;
|
|
56
|
+
type IssueStatus = z.infer<typeof issueStatusSchema>;
|
|
57
|
+
/** Eval curation states: promoted candidates → accepted corpus → archived. */
|
|
58
|
+
declare const EVAL_STATUSES: readonly ["proposed", "accepted", "archived"];
|
|
59
|
+
type EvalStatus = (typeof EVAL_STATUSES)[number];
|
|
60
|
+
declare const sentimentSchema$1: z.ZodEnum<{
|
|
61
|
+
positive: "positive";
|
|
62
|
+
negative: "negative";
|
|
63
|
+
neutral: "neutral";
|
|
64
|
+
}>;
|
|
65
|
+
type Sentiment$1 = z.infer<typeof sentimentSchema$1>;
|
|
66
|
+
/** Who authored the feedback text (cf. Arize Phoenix `annotator_kind`). */
|
|
67
|
+
declare const authorSchema$1: z.ZodEnum<{
|
|
68
|
+
agent: "agent";
|
|
69
|
+
human: "human";
|
|
70
|
+
hybrid: "hybrid";
|
|
71
|
+
}>;
|
|
72
|
+
type FeedbackAuthor$1 = z.infer<typeof authorSchema$1>;
|
|
73
|
+
/**
|
|
74
|
+
* Structured failed-task report. `category: "eval"` events carry one of these so the
|
|
75
|
+
* feedback stream doubles as a replayable eval-candidate corpus.
|
|
76
|
+
*/
|
|
77
|
+
declare const evalReportSchema$1: z.ZodObject<{
|
|
78
|
+
task: z.ZodString;
|
|
79
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
80
|
+
actual: z.ZodOptional<z.ZodString>;
|
|
81
|
+
mistake: z.ZodOptional<z.ZodString>;
|
|
82
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
type EvalReport$1 = z.infer<typeof evalReportSchema$1>;
|
|
85
|
+
/**
|
|
86
|
+
* Auto-detected context. Every block is optional and best-effort: a missing block means
|
|
87
|
+
* "not detected or telemetry declined", never an error.
|
|
88
|
+
*/
|
|
89
|
+
declare const feedbackContextSchema$1: z.ZodObject<{
|
|
90
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
name: z.ZodOptional<z.ZodString>;
|
|
93
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
94
|
+
model: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
id: z.ZodString;
|
|
98
|
+
name: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
ci: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
name: z.ZodNullable<z.ZodString>;
|
|
102
|
+
isPr: z.ZodNullable<z.ZodBoolean>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
platform: z.ZodString;
|
|
106
|
+
arch: z.ZodString;
|
|
107
|
+
node: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
project: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
110
|
+
session: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
111
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
id: z.ZodOptional<z.ZodString>;
|
|
113
|
+
authType: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type FeedbackContext$1 = z.infer<typeof feedbackContextSchema$1>;
|
|
117
|
+
/**
|
|
118
|
+
* Vendor-defined enrichment (sdk_version, plan tier, build number). Flat by
|
|
119
|
+
* design — values stay renderable as chips and queryable via json_extract.
|
|
120
|
+
* Distinct from `context`, which is what the client auto-detects.
|
|
121
|
+
*/
|
|
122
|
+
declare const metadataSchema$1: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
123
|
+
type FeedbackMetadata$1 = z.infer<typeof metadataSchema$1>;
|
|
124
|
+
declare const feedbackEventSchema$1: z.ZodObject<{
|
|
125
|
+
v: z.ZodLiteral<1>;
|
|
126
|
+
to: z.ZodOptional<z.ZodString>;
|
|
127
|
+
feedback: z.ZodString;
|
|
128
|
+
category: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
129
|
+
tool: "tool";
|
|
130
|
+
skill: "skill";
|
|
131
|
+
prompt: "prompt";
|
|
132
|
+
docs: "docs";
|
|
133
|
+
mcp: "mcp";
|
|
134
|
+
cli: "cli";
|
|
135
|
+
api: "api";
|
|
136
|
+
model: "model";
|
|
137
|
+
ux: "ux";
|
|
138
|
+
other: "other";
|
|
139
|
+
}>, z.ZodEnum<{
|
|
140
|
+
eval: "eval";
|
|
141
|
+
}>, z.ZodString]>>;
|
|
142
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
143
|
+
sentiment: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
positive: "positive";
|
|
145
|
+
negative: "negative";
|
|
146
|
+
neutral: "neutral";
|
|
147
|
+
}>>;
|
|
148
|
+
author: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
agent: "agent";
|
|
150
|
+
human: "human";
|
|
151
|
+
hybrid: "hybrid";
|
|
152
|
+
}>>;
|
|
153
|
+
thread: z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
eval: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
task: z.ZodString;
|
|
158
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
159
|
+
actual: z.ZodOptional<z.ZodString>;
|
|
160
|
+
mistake: z.ZodOptional<z.ZodString>;
|
|
161
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
question: z.ZodOptional<z.ZodString>;
|
|
164
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
token: z.ZodString;
|
|
167
|
+
description: z.ZodOptional<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>>>;
|
|
169
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
name: z.ZodOptional<z.ZodString>;
|
|
173
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
174
|
+
model: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>>;
|
|
176
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
name: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
ci: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
name: z.ZodNullable<z.ZodString>;
|
|
182
|
+
isPr: z.ZodNullable<z.ZodBoolean>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
platform: z.ZodString;
|
|
186
|
+
arch: z.ZodString;
|
|
187
|
+
node: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
project: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
190
|
+
session: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
191
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
id: z.ZodOptional<z.ZodString>;
|
|
193
|
+
authType: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
197
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
198
|
+
client: z.ZodObject<{
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
version: z.ZodString;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
consent: z.ZodObject<{
|
|
203
|
+
telemetry: z.ZodBoolean;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
type FeedbackEvent$1 = z.infer<typeof feedbackEventSchema$1>;
|
|
207
|
+
/** The existing owner SDK's issue projection; distinct from reporter-visible KnownIssue. */
|
|
208
|
+
declare const ownerIssueSchema: z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
title: z.ZodString;
|
|
211
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
212
|
+
status: z.ZodEnum<{
|
|
213
|
+
in_progress: "in_progress";
|
|
214
|
+
resolved: "resolved";
|
|
215
|
+
wont_fix: "wont_fix";
|
|
216
|
+
spam: "spam";
|
|
217
|
+
open: "open";
|
|
218
|
+
needs_review: "needs_review";
|
|
219
|
+
}>;
|
|
220
|
+
fingerprint: z.ZodNullable<z.ZodString>;
|
|
221
|
+
event_count: z.ZodNumber;
|
|
222
|
+
reopened_count: z.ZodNumber;
|
|
223
|
+
first_seen: z.ZodString;
|
|
224
|
+
last_seen: z.ZodString;
|
|
225
|
+
links_json: z.ZodString;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
type OwnerIssue = z.infer<typeof ownerIssueSchema>;
|
|
228
|
+
/** 202 body returned by every conforming ingest endpoint. */
|
|
229
|
+
declare const ingestResponseSchema$1: z.ZodObject<{
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
thread: z.ZodString;
|
|
232
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
233
|
+
guidance: z.ZodOptional<z.ZodString>;
|
|
234
|
+
known_issue: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
title: z.ZodString;
|
|
236
|
+
status: z.ZodEnum<{
|
|
237
|
+
wont_fix: "wont_fix";
|
|
238
|
+
open: "open";
|
|
239
|
+
}>;
|
|
240
|
+
reopened: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
+
reports: z.ZodNumber;
|
|
242
|
+
note: z.ZodOptional<z.ZodString>;
|
|
243
|
+
hint: z.ZodString;
|
|
244
|
+
}, z.core.$strip>>;
|
|
245
|
+
ask: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
id: z.ZodString;
|
|
247
|
+
prompt: z.ZodString;
|
|
248
|
+
command: z.ZodString;
|
|
249
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
250
|
+
filename: z.ZodString;
|
|
251
|
+
mediaType: z.ZodString;
|
|
252
|
+
size: z.ZodNumber;
|
|
253
|
+
sha256: z.ZodString;
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
createdAt: z.ZodString;
|
|
256
|
+
source: z.ZodEnum<{
|
|
257
|
+
reporter: "reporter";
|
|
258
|
+
owner: "owner";
|
|
259
|
+
}>;
|
|
260
|
+
uploader: z.ZodNullable<z.ZodString>;
|
|
261
|
+
target: z.ZodObject<{
|
|
262
|
+
type: z.ZodEnum<{
|
|
263
|
+
eval: "eval";
|
|
264
|
+
question: "question";
|
|
265
|
+
event: "event";
|
|
266
|
+
issue: "issue";
|
|
267
|
+
investigation: "investigation";
|
|
268
|
+
investigation_question: "investigation_question";
|
|
269
|
+
investigation_reply: "investigation_reply";
|
|
270
|
+
}>;
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
description: z.ZodOptional<z.ZodString>;
|
|
274
|
+
url: z.ZodURL;
|
|
275
|
+
expiresAt: z.ZodString;
|
|
276
|
+
}, z.core.$strip>>>;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
duplicate: z.ZodOptional<z.ZodBoolean>;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
type IngestResponse$1 = z.infer<typeof ingestResponseSchema$1>;
|
|
281
|
+
/**
|
|
282
|
+
* Tenant descriptor. Served identically by the hosted registry
|
|
283
|
+
* (`{registry}/v1/registry/{slug}`) and by self-published well-known files
|
|
284
|
+
* (`https://{domain}/.well-known/agent-feedback.json`).
|
|
285
|
+
*/
|
|
286
|
+
declare const descriptorSchema$1: z.ZodObject<{
|
|
287
|
+
v: z.ZodLiteral<1>;
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
290
|
+
endpoint: z.ZodURL;
|
|
291
|
+
writeKey: z.ZodOptional<z.ZodString>;
|
|
292
|
+
categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
293
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
294
|
+
description: z.ZodOptional<z.ZodString>;
|
|
295
|
+
}, z.core.$strip>>>;
|
|
296
|
+
jwks: z.ZodOptional<z.ZodURL>;
|
|
297
|
+
docs: z.ZodOptional<z.ZodURL>;
|
|
298
|
+
}, z.core.$strip>;
|
|
299
|
+
type Descriptor$1 = z.infer<typeof descriptorSchema$1>;
|
|
300
|
+
/**
|
|
301
|
+
* A codebase a project's feedback is about. Owner-plane wire contract: rides on
|
|
302
|
+
* every list/get response so a triage agent knows where to go fix things.
|
|
303
|
+
*/
|
|
304
|
+
declare const repoEntrySchema$1: z.ZodObject<{
|
|
305
|
+
url: z.ZodString;
|
|
306
|
+
label: z.ZodOptional<z.ZodString>;
|
|
307
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, z.core.$strip>;
|
|
309
|
+
type RepoEntry$1 = z.infer<typeof repoEntrySchema$1>;
|
|
310
|
+
|
|
311
|
+
/** Configuration or validation error — the caller can fix it. Network failures are not
|
|
312
|
+
* FeedbackErrors; they degrade to the outbox instead of throwing. */
|
|
313
|
+
declare class FeedbackError extends Error {
|
|
314
|
+
constructor(message: string);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
type LocalAttachmentInput = string | {
|
|
318
|
+
path: string;
|
|
319
|
+
description?: string;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
declare const DSN_ENV_VAR = "HIVENET_DSN";
|
|
323
|
+
declare const REGISTRY_ENV_VAR = "HIVENET_REGISTRY";
|
|
324
|
+
declare const HOME_ENV_VAR = "HIVENET_HOME";
|
|
325
|
+
declare const NO_TELEMETRY_ENV_VAR = "HIVENET_NO_TELEMETRY";
|
|
326
|
+
/** Minimal environment contract accepted by Node, Bun, Deno, and edge adapters. */
|
|
327
|
+
type EnvLike = Record<string, string | undefined>;
|
|
328
|
+
declare function feedbackHomeDir(env?: EnvLike): string;
|
|
329
|
+
declare function isTelemetryDisabled(extraOptOutEnvVars?: string[], env?: EnvLike): boolean;
|
|
330
|
+
|
|
331
|
+
/** A vendor-configured source for a product session ID. */
|
|
332
|
+
type SessionSource = {
|
|
333
|
+
key: string;
|
|
334
|
+
envVar: string;
|
|
335
|
+
} | {
|
|
336
|
+
key: string;
|
|
337
|
+
dotenvFile: string;
|
|
338
|
+
dotenvKey?: string;
|
|
339
|
+
};
|
|
340
|
+
type CollectContextOptions = {
|
|
341
|
+
projectRoot?: string;
|
|
342
|
+
sessions?: SessionSource[];
|
|
343
|
+
/** Vendor product fingerprint (versions, config). Never allowed to throw the pipeline. */
|
|
344
|
+
fingerprint?: () => Record<string, unknown> | undefined | Promise<Record<string, unknown> | undefined>;
|
|
345
|
+
extraOptOutEnvVars?: string[];
|
|
346
|
+
env?: EnvLike;
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* Assemble best-effort context. Returns undefined when telemetry is disabled.
|
|
350
|
+
* Never throws; every block is optional.
|
|
351
|
+
*/
|
|
352
|
+
declare function collectContext(options?: CollectContextOptions): Promise<FeedbackContext$1 | undefined>;
|
|
353
|
+
/** `agent` when an agent harness is detected, otherwise unknown (omitted). */
|
|
354
|
+
declare function inferAuthor(context: FeedbackContext$1 | undefined): 'agent' | undefined;
|
|
355
|
+
|
|
356
|
+
type Destination = {
|
|
357
|
+
endpoint: string;
|
|
358
|
+
writeKey?: string;
|
|
359
|
+
/** Tenant slug or domain, when known. */
|
|
360
|
+
to?: string;
|
|
361
|
+
descriptor?: Descriptor$1;
|
|
362
|
+
};
|
|
363
|
+
/** Shape of feedback.config.json — a local descriptor plus client-side settings. */
|
|
364
|
+
type FeedbackConfig = {
|
|
365
|
+
name?: string;
|
|
366
|
+
slug?: string;
|
|
367
|
+
endpoint?: string;
|
|
368
|
+
writeKey?: string;
|
|
369
|
+
categories?: Descriptor$1['categories'];
|
|
370
|
+
sessions?: SessionSource[];
|
|
371
|
+
telemetryOptOutEnv?: string[];
|
|
372
|
+
};
|
|
373
|
+
declare const CONFIG_FILE_NAME = "feedback.config.json";
|
|
374
|
+
type FetchLike = typeof fetch;
|
|
375
|
+
type ResolveDestinationOptions = {
|
|
376
|
+
to?: string;
|
|
377
|
+
dsn?: string;
|
|
378
|
+
cwd?: string;
|
|
379
|
+
env?: EnvLike;
|
|
380
|
+
fetchImpl?: FetchLike;
|
|
381
|
+
/** Directory for the descriptor cache; defaults to the hivenet home dir. */
|
|
382
|
+
cacheDir?: string;
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Parse a DSN: `https://hv_pub_KEY@host[/slug]`.
|
|
386
|
+
* One string carries endpoint + tenant + write key (the Sentry move).
|
|
387
|
+
*/
|
|
388
|
+
declare function parseDsn(dsn: string): Destination;
|
|
389
|
+
/** Walk up from `startDir` looking for feedback.config.json. */
|
|
390
|
+
declare function findConfigFile(startDir: string): {
|
|
391
|
+
config: FeedbackConfig;
|
|
392
|
+
path: string;
|
|
393
|
+
} | undefined;
|
|
394
|
+
declare function registryUrl(env?: EnvLike): string;
|
|
395
|
+
/**
|
|
396
|
+
* Resolve where feedback goes. Priority:
|
|
397
|
+
* explicit DSN → HIVENET_DSN → nearest feedback.config.json →
|
|
398
|
+
* --to slug (hosted registry) / --to domain (.well-known).
|
|
399
|
+
*/
|
|
400
|
+
declare function resolveDestination(options?: ResolveDestinationOptions): Promise<Destination>;
|
|
401
|
+
|
|
402
|
+
type OutboxEntry = {
|
|
403
|
+
endpoint: string;
|
|
404
|
+
writeKey?: string;
|
|
405
|
+
event: FeedbackEvent$1;
|
|
406
|
+
queuedAt: string;
|
|
407
|
+
};
|
|
408
|
+
declare function outboxPath(env?: EnvLike): string;
|
|
409
|
+
/** Queue an event that could not be delivered. Never throws — losing feedback is
|
|
410
|
+
* acceptable, breaking the host process is not. */
|
|
411
|
+
declare function appendToOutbox(entry: OutboxEntry, env?: EnvLike): boolean;
|
|
412
|
+
type FlushResult = {
|
|
413
|
+
delivered: number;
|
|
414
|
+
remaining: number;
|
|
415
|
+
};
|
|
416
|
+
/** Best-effort redelivery of queued events. Short timeout, never throws. */
|
|
417
|
+
declare function flushOutbox(options?: {
|
|
418
|
+
env?: EnvLike;
|
|
419
|
+
fetchImpl?: typeof fetch;
|
|
420
|
+
timeoutMs?: number;
|
|
421
|
+
}): Promise<FlushResult>;
|
|
422
|
+
|
|
423
|
+
type OwnerEvent = {
|
|
424
|
+
id: string;
|
|
425
|
+
received_at: string;
|
|
426
|
+
status: EventStatus;
|
|
427
|
+
category: string;
|
|
428
|
+
subject: string | null;
|
|
429
|
+
sentiment: string | null;
|
|
430
|
+
author: string | null;
|
|
431
|
+
feedback: string;
|
|
432
|
+
/** Detector slug of the reporting agent ('claude-code', 'codex'). */
|
|
433
|
+
agent: string | null;
|
|
434
|
+
agent_session: string | null;
|
|
435
|
+
thread_id: string;
|
|
436
|
+
consent_telemetry: number;
|
|
437
|
+
triage_note: string | null;
|
|
438
|
+
triaged_at: string | null;
|
|
439
|
+
issue_id: string | null;
|
|
440
|
+
links_json: string;
|
|
441
|
+
context_json: string;
|
|
442
|
+
metadata_json: string;
|
|
443
|
+
idempotency_key: string | null;
|
|
444
|
+
};
|
|
445
|
+
type OwnerQuestion = {
|
|
446
|
+
id: string;
|
|
447
|
+
prompt: string;
|
|
448
|
+
source: 'owner' | 'system';
|
|
449
|
+
kind: 'research' | 'verify_fix' | 'setup_request';
|
|
450
|
+
status: 'active' | 'closed';
|
|
451
|
+
created_at: string;
|
|
452
|
+
closed_at: string | null;
|
|
453
|
+
target: {
|
|
454
|
+
category?: string;
|
|
455
|
+
issue_id?: string;
|
|
456
|
+
eval_id?: string;
|
|
457
|
+
thread_id?: string;
|
|
458
|
+
};
|
|
459
|
+
answers: {
|
|
460
|
+
id: string;
|
|
461
|
+
feedback: string;
|
|
462
|
+
agent: string | null;
|
|
463
|
+
client_name: string | null;
|
|
464
|
+
received_at: string;
|
|
465
|
+
}[];
|
|
466
|
+
};
|
|
467
|
+
type OwnerEval = {
|
|
468
|
+
id: string;
|
|
469
|
+
title: string;
|
|
470
|
+
task: string;
|
|
471
|
+
expected: string | null;
|
|
472
|
+
setup: string | null;
|
|
473
|
+
status: EvalStatus;
|
|
474
|
+
note: string | null;
|
|
475
|
+
source_event_id: string | null;
|
|
476
|
+
created_at: string;
|
|
477
|
+
updated_at: string;
|
|
478
|
+
source: {
|
|
479
|
+
event_id: string;
|
|
480
|
+
feedback: string;
|
|
481
|
+
agent: string | null;
|
|
482
|
+
client_name: string | null;
|
|
483
|
+
thread_id: string;
|
|
484
|
+
actual: string | null;
|
|
485
|
+
mistake: string | null;
|
|
486
|
+
attempts: number | null;
|
|
487
|
+
} | null;
|
|
488
|
+
/** Active setup_request question id when reproduction state is still missing. */
|
|
489
|
+
setup_pending: string | null;
|
|
490
|
+
};
|
|
491
|
+
type OwnerFilters = {
|
|
492
|
+
status?: EventStatus;
|
|
493
|
+
category?: string;
|
|
494
|
+
thread?: string;
|
|
495
|
+
/** ISO timestamp — only events received at or after this moment ("what's new since my last run"). */
|
|
496
|
+
since?: string;
|
|
497
|
+
limit?: number;
|
|
498
|
+
};
|
|
499
|
+
type OwnerApiOptions = {
|
|
500
|
+
secretKey: string;
|
|
501
|
+
/** API origin, e.g. https://hivenet.app. */
|
|
502
|
+
apiOrigin?: string;
|
|
503
|
+
fetchImpl?: typeof fetch;
|
|
504
|
+
timeoutMs?: number;
|
|
505
|
+
};
|
|
506
|
+
/** Derive the owner API origin from a slug/domain/DSN (same host as the ingest endpoint). */
|
|
507
|
+
declare function resolveApiOrigin(options: {
|
|
508
|
+
to?: string;
|
|
509
|
+
dsn?: string;
|
|
510
|
+
env?: EnvLike;
|
|
511
|
+
fetchImpl?: typeof fetch;
|
|
512
|
+
}): Promise<string>;
|
|
513
|
+
declare function ownerApi(options: OwnerApiOptions): {
|
|
514
|
+
/** Upload local files and attach them to a record (at most 10 files per record). */
|
|
515
|
+
attachFiles(target: AttachmentTarget$1, paths: LocalAttachmentInput[], cwd?: string): Promise<{
|
|
516
|
+
attachments: Attachment$1[];
|
|
517
|
+
}>;
|
|
518
|
+
/** A record's files; issues and evals include their reports' files. */
|
|
519
|
+
listAttachments(target: AttachmentTarget$1, offset?: number): Promise<{
|
|
520
|
+
attachments: Attachment$1[];
|
|
521
|
+
nextOffset: number | null;
|
|
522
|
+
}>;
|
|
523
|
+
deleteAttachment(id: string): Promise<{
|
|
524
|
+
deleted: boolean;
|
|
525
|
+
}>;
|
|
526
|
+
listFeedback(filters?: OwnerFilters): Promise<{
|
|
527
|
+
project: string;
|
|
528
|
+
repos: RepoEntry$1[];
|
|
529
|
+
events: OwnerEvent[];
|
|
530
|
+
}>;
|
|
531
|
+
getFeedback(id: string): Promise<{
|
|
532
|
+
event: OwnerEvent;
|
|
533
|
+
}>;
|
|
534
|
+
setFeedbackStatus(id: string, status: EventStatus, note?: string): Promise<{
|
|
535
|
+
event: OwnerEvent;
|
|
536
|
+
}>;
|
|
537
|
+
listIssues(filters?: {
|
|
538
|
+
status?: IssueStatus;
|
|
539
|
+
since?: string;
|
|
540
|
+
limit?: number;
|
|
541
|
+
}): Promise<{
|
|
542
|
+
project: string;
|
|
543
|
+
repos: RepoEntry$1[];
|
|
544
|
+
issues: OwnerIssue[];
|
|
545
|
+
}>;
|
|
546
|
+
getIssue(id: string): Promise<{
|
|
547
|
+
issue: OwnerIssue;
|
|
548
|
+
repos: RepoEntry$1[];
|
|
549
|
+
events: OwnerEvent[];
|
|
550
|
+
}>;
|
|
551
|
+
setIssueStatus(id: string, status: IssueStatus, note?: string): Promise<{
|
|
552
|
+
issue: OwnerIssue;
|
|
553
|
+
}>;
|
|
554
|
+
listQuestions(filters?: {
|
|
555
|
+
status?: "active" | "closed";
|
|
556
|
+
}): Promise<{
|
|
557
|
+
questions: OwnerQuestion[];
|
|
558
|
+
/** True when the bounded answer window dropped older answers. */
|
|
559
|
+
answers_truncated: boolean;
|
|
560
|
+
}>;
|
|
561
|
+
/** Files are shared with every agent that receives the question. */
|
|
562
|
+
createQuestion(prompt: string, category?: string, options?: {
|
|
563
|
+
files?: LocalAttachmentInput[];
|
|
564
|
+
cwd?: string;
|
|
565
|
+
idempotencyKey?: string;
|
|
566
|
+
}): Promise<{
|
|
567
|
+
question: OwnerQuestion;
|
|
568
|
+
}>;
|
|
569
|
+
closeQuestion(id: string): Promise<{
|
|
570
|
+
closed: boolean;
|
|
571
|
+
id: string;
|
|
572
|
+
}>;
|
|
573
|
+
listEvals(filters?: {
|
|
574
|
+
status?: EvalStatus;
|
|
575
|
+
}): Promise<{
|
|
576
|
+
evals: OwnerEval[];
|
|
577
|
+
}>;
|
|
578
|
+
getEval(id: string): Promise<{
|
|
579
|
+
eval: OwnerEval;
|
|
580
|
+
}>;
|
|
581
|
+
/** Promote a failed-task report (category=eval event) into the eval corpus. */
|
|
582
|
+
promoteEval(eventId: string): Promise<{
|
|
583
|
+
eval: OwnerEval;
|
|
584
|
+
created: boolean;
|
|
585
|
+
}>;
|
|
586
|
+
setEvalStatus(id: string, status: EvalStatus, note?: string): Promise<{
|
|
587
|
+
eval: OwnerEval;
|
|
588
|
+
}>;
|
|
589
|
+
/** Attach an external link (Slack message, Linear/GitHub issue, PR) to evt_… or iss_…. */
|
|
590
|
+
addLink(id: string, url: string, label?: string): Promise<{
|
|
591
|
+
event?: OwnerEvent;
|
|
592
|
+
issue?: OwnerIssue;
|
|
593
|
+
}>;
|
|
594
|
+
};
|
|
595
|
+
type OwnerApi = ReturnType<typeof ownerApi>;
|
|
596
|
+
|
|
597
|
+
declare function generateThreadId(): string;
|
|
598
|
+
/** A valid resume ID continues its thread; anything else gets a fresh one. */
|
|
599
|
+
declare function resolveThreadId(resume?: string): {
|
|
600
|
+
id: string;
|
|
601
|
+
resumed: boolean;
|
|
602
|
+
};
|
|
603
|
+
type SendFeedbackOptions = {
|
|
604
|
+
feedback: string;
|
|
605
|
+
to?: string;
|
|
606
|
+
dsn?: string;
|
|
607
|
+
category?: string;
|
|
608
|
+
subject?: string;
|
|
609
|
+
sentiment?: Sentiment$1;
|
|
610
|
+
author?: FeedbackAuthor$1;
|
|
611
|
+
eval?: EvalReport$1;
|
|
612
|
+
/** Id of a question this submission answers (from a prior response's `ask`). */
|
|
613
|
+
question?: string;
|
|
614
|
+
/** Explicit paths with optional context. Paths stay local; basenames, bytes and descriptions are sent. */
|
|
615
|
+
attachments?: LocalAttachmentInput[];
|
|
616
|
+
/** Resume an existing feedback thread by ID. */
|
|
617
|
+
resume?: string;
|
|
618
|
+
/** Extra product session IDs, merged over detected ones. */
|
|
619
|
+
session?: Record<string, string>;
|
|
620
|
+
/** Vendor product fingerprint, merged into context.project. */
|
|
621
|
+
project?: Record<string, unknown>;
|
|
622
|
+
/** Vendor-defined enrichment (sdk_version, plan, build) — flat map, see spec metadataSchema. */
|
|
623
|
+
metadata?: FeedbackMetadata$1;
|
|
624
|
+
/** Override the auto-minted retry key (same key + project = same stored event). */
|
|
625
|
+
idempotencyKey?: string;
|
|
626
|
+
cwd?: string;
|
|
627
|
+
timeoutMs?: number;
|
|
628
|
+
/** Identify the embedding client (e.g. a vendor CLI) instead of the generic one. */
|
|
629
|
+
clientName?: string;
|
|
630
|
+
clientVersion?: string;
|
|
631
|
+
/** Set false to skip all context detection regardless of consent env vars. */
|
|
632
|
+
collectContext?: boolean;
|
|
633
|
+
/** Set false to fail without queueing when the endpoint is unreachable. */
|
|
634
|
+
outbox?: boolean;
|
|
635
|
+
contextOptions?: CollectContextOptions;
|
|
636
|
+
fetchImpl?: typeof fetch;
|
|
637
|
+
env?: EnvLike;
|
|
638
|
+
};
|
|
639
|
+
/** Files that could not be uploaded; the report went (or was queued) without them. */
|
|
640
|
+
type FilesNotAttached = {
|
|
641
|
+
files: string[];
|
|
642
|
+
reason: string;
|
|
643
|
+
};
|
|
644
|
+
type SendFeedbackResult = {
|
|
645
|
+
delivered: true;
|
|
646
|
+
response: IngestResponse$1;
|
|
647
|
+
event: FeedbackEvent$1;
|
|
648
|
+
destination: Destination;
|
|
649
|
+
resumed: boolean;
|
|
650
|
+
filesNotAttached?: FilesNotAttached;
|
|
651
|
+
} | {
|
|
652
|
+
delivered: false;
|
|
653
|
+
queued: boolean;
|
|
654
|
+
error: string;
|
|
655
|
+
event: FeedbackEvent$1;
|
|
656
|
+
destination: Destination;
|
|
657
|
+
resumed: boolean;
|
|
658
|
+
filesNotAttached?: FilesNotAttached;
|
|
659
|
+
};
|
|
660
|
+
/**
|
|
661
|
+
* Build, enrich, validate, and deliver one feedback event.
|
|
662
|
+
*
|
|
663
|
+
* Throws FeedbackError only for caller-fixable problems (no destination, invalid
|
|
664
|
+
* input, a file the server rejects). Network failures never throw: the event is
|
|
665
|
+
* queued to the outbox and `{ delivered: false, queued: true }` is returned.
|
|
666
|
+
* Selected files upload first; if they can't be (network, server busy, a server
|
|
667
|
+
* without file storage), the report still goes — or is queued — without them, and
|
|
668
|
+
* `filesNotAttached` says so.
|
|
669
|
+
*/
|
|
670
|
+
declare function sendFeedback(options: SendFeedbackOptions): Promise<SendFeedbackResult>;
|
|
671
|
+
|
|
672
|
+
type PostEventOptions = {
|
|
673
|
+
endpoint: string;
|
|
674
|
+
writeKey?: string;
|
|
675
|
+
event: FeedbackEvent$1;
|
|
676
|
+
timeoutMs: number;
|
|
677
|
+
fetchImpl?: typeof fetch;
|
|
678
|
+
};
|
|
679
|
+
type PostEventResult = {
|
|
680
|
+
kind: 'accepted';
|
|
681
|
+
response: IngestResponse$1;
|
|
682
|
+
} | {
|
|
683
|
+
kind: 'rejected';
|
|
684
|
+
status: number;
|
|
685
|
+
errors: string[];
|
|
686
|
+
} | {
|
|
687
|
+
kind: 'unreachable';
|
|
688
|
+
error: string;
|
|
689
|
+
};
|
|
690
|
+
/** One POST, bounded by timeout. 4xx = rejected (do not retry); network/5xx, 408 and 429 =
|
|
691
|
+
* unreachable (outbox-eligible). */
|
|
692
|
+
declare function postEvent(options: PostEventOptions): Promise<PostEventResult>;
|
|
693
|
+
|
|
694
|
+
declare const MAX_ATTACHMENT_BYTES: number;
|
|
695
|
+
declare const MAX_ATTACHMENTS = 10;
|
|
696
|
+
declare const attachmentTargetSchema: z.ZodObject<{
|
|
697
|
+
type: z.ZodEnum<{
|
|
698
|
+
eval: "eval";
|
|
699
|
+
question: "question";
|
|
700
|
+
event: "event";
|
|
701
|
+
issue: "issue";
|
|
702
|
+
investigation: "investigation";
|
|
703
|
+
investigation_question: "investigation_question";
|
|
704
|
+
investigation_reply: "investigation_reply";
|
|
705
|
+
}>;
|
|
706
|
+
id: z.ZodString;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
type AttachmentTarget = z.infer<typeof attachmentTargetSchema>;
|
|
709
|
+
declare const attachmentSchema: z.ZodObject<{
|
|
710
|
+
filename: z.ZodString;
|
|
711
|
+
mediaType: z.ZodString;
|
|
712
|
+
size: z.ZodNumber;
|
|
713
|
+
sha256: z.ZodString;
|
|
714
|
+
id: z.ZodString;
|
|
715
|
+
createdAt: z.ZodString;
|
|
716
|
+
source: z.ZodEnum<{
|
|
717
|
+
reporter: "reporter";
|
|
718
|
+
owner: "owner";
|
|
719
|
+
}>;
|
|
720
|
+
uploader: z.ZodNullable<z.ZodString>;
|
|
721
|
+
target: z.ZodObject<{
|
|
722
|
+
type: z.ZodEnum<{
|
|
723
|
+
eval: "eval";
|
|
724
|
+
question: "question";
|
|
725
|
+
event: "event";
|
|
726
|
+
issue: "issue";
|
|
727
|
+
investigation: "investigation";
|
|
728
|
+
investigation_question: "investigation_question";
|
|
729
|
+
investigation_reply: "investigation_reply";
|
|
730
|
+
}>;
|
|
731
|
+
id: z.ZodString;
|
|
732
|
+
}, z.core.$strip>;
|
|
733
|
+
description: z.ZodOptional<z.ZodString>;
|
|
734
|
+
}, z.core.$strip>;
|
|
735
|
+
type Attachment = z.infer<typeof attachmentSchema>;
|
|
736
|
+
/** Question files as delivered to reporting agents, with a short-lived read link. */
|
|
737
|
+
declare const deliveredAttachmentSchema: z.ZodObject<{
|
|
738
|
+
filename: z.ZodString;
|
|
739
|
+
mediaType: z.ZodString;
|
|
740
|
+
size: z.ZodNumber;
|
|
741
|
+
sha256: z.ZodString;
|
|
742
|
+
id: z.ZodString;
|
|
743
|
+
createdAt: z.ZodString;
|
|
744
|
+
source: z.ZodEnum<{
|
|
745
|
+
reporter: "reporter";
|
|
746
|
+
owner: "owner";
|
|
747
|
+
}>;
|
|
748
|
+
uploader: z.ZodNullable<z.ZodString>;
|
|
749
|
+
target: z.ZodObject<{
|
|
750
|
+
type: z.ZodEnum<{
|
|
751
|
+
eval: "eval";
|
|
752
|
+
question: "question";
|
|
753
|
+
event: "event";
|
|
754
|
+
issue: "issue";
|
|
755
|
+
investigation: "investigation";
|
|
756
|
+
investigation_question: "investigation_question";
|
|
757
|
+
investigation_reply: "investigation_reply";
|
|
758
|
+
}>;
|
|
759
|
+
id: z.ZodString;
|
|
760
|
+
}, z.core.$strip>;
|
|
761
|
+
description: z.ZodOptional<z.ZodString>;
|
|
762
|
+
url: z.ZodURL;
|
|
763
|
+
expiresAt: z.ZodString;
|
|
764
|
+
}, z.core.$strip>;
|
|
765
|
+
type DeliveredAttachment = z.infer<typeof deliveredAttachmentSchema>;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* hivenet protocol v1.
|
|
769
|
+
*
|
|
770
|
+
* Everything here is the wire contract shared by the CLI, embeddable SDK, MCP tool,
|
|
771
|
+
* and any ingest endpoint (hosted or self-hosted). See SPEC.md for prose.
|
|
772
|
+
*/
|
|
773
|
+
declare const PROTOCOL_VERSION: 1;
|
|
774
|
+
declare const MAX_FEEDBACK_LENGTH = 5000;
|
|
775
|
+
declare const MAX_SUBJECT_LENGTH = 500;
|
|
776
|
+
declare const MAX_GUIDANCE_LENGTH = 1000;
|
|
777
|
+
declare const WELL_KNOWN_PATH = "/.well-known/agent-feedback.json";
|
|
778
|
+
declare const DEFAULT_REGISTRY_URL = "https://hivenet.app";
|
|
779
|
+
declare const DEFAULT_INGEST_PATH = "/v1/feedback";
|
|
780
|
+
declare const WRITE_KEY_HEADER = "x-af-write-key";
|
|
781
|
+
declare const WRITE_KEY_PATTERN: RegExp;
|
|
782
|
+
declare const THREAD_ID_PATTERN: RegExp;
|
|
783
|
+
/**
|
|
784
|
+
* Component kinds of any agentic system's agent-facing surface area. Categories answer
|
|
785
|
+
* "what part of the product is this about?" — kinds of submission (failed-task reports,
|
|
786
|
+
* question answers) are orthogonal markers (`eval` block, `question` id), never categories.
|
|
787
|
+
*/
|
|
788
|
+
declare const FEEDBACK_CATEGORIES: readonly ["tool", "skill", "prompt", "docs", "mcp", "cli", "api", "model", "ux", "other"];
|
|
789
|
+
type FeedbackCategory = (typeof FEEDBACK_CATEGORIES)[number];
|
|
790
|
+
declare const categorySchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
791
|
+
tool: "tool";
|
|
792
|
+
skill: "skill";
|
|
793
|
+
prompt: "prompt";
|
|
794
|
+
docs: "docs";
|
|
795
|
+
mcp: "mcp";
|
|
796
|
+
cli: "cli";
|
|
797
|
+
api: "api";
|
|
798
|
+
model: "model";
|
|
799
|
+
ux: "ux";
|
|
800
|
+
other: "other";
|
|
801
|
+
}>, z.ZodEnum<{
|
|
802
|
+
eval: "eval";
|
|
803
|
+
}>, z.ZodString]>;
|
|
804
|
+
declare const sentimentSchema: z.ZodEnum<{
|
|
805
|
+
positive: "positive";
|
|
806
|
+
negative: "negative";
|
|
807
|
+
neutral: "neutral";
|
|
808
|
+
}>;
|
|
809
|
+
type Sentiment = z.infer<typeof sentimentSchema>;
|
|
810
|
+
/** Who authored the feedback text (cf. Arize Phoenix `annotator_kind`). */
|
|
811
|
+
declare const authorSchema: z.ZodEnum<{
|
|
812
|
+
agent: "agent";
|
|
813
|
+
human: "human";
|
|
814
|
+
hybrid: "hybrid";
|
|
815
|
+
}>;
|
|
816
|
+
type FeedbackAuthor = z.infer<typeof authorSchema>;
|
|
817
|
+
/**
|
|
818
|
+
* Structured failed-task report. `category: "eval"` events carry one of these so the
|
|
819
|
+
* feedback stream doubles as a replayable eval-candidate corpus.
|
|
820
|
+
*/
|
|
821
|
+
declare const evalReportSchema: z.ZodObject<{
|
|
822
|
+
task: z.ZodString;
|
|
823
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
824
|
+
actual: z.ZodOptional<z.ZodString>;
|
|
825
|
+
mistake: z.ZodOptional<z.ZodString>;
|
|
826
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
827
|
+
}, z.core.$strip>;
|
|
828
|
+
type EvalReport = z.infer<typeof evalReportSchema>;
|
|
829
|
+
/**
|
|
830
|
+
* Auto-detected context. Every block is optional and best-effort: a missing block means
|
|
831
|
+
* "not detected or telemetry declined", never an error.
|
|
832
|
+
*/
|
|
833
|
+
declare const feedbackContextSchema: z.ZodObject<{
|
|
834
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
835
|
+
id: z.ZodString;
|
|
836
|
+
name: z.ZodOptional<z.ZodString>;
|
|
837
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
838
|
+
model: z.ZodOptional<z.ZodString>;
|
|
839
|
+
}, z.core.$strip>>;
|
|
840
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
841
|
+
id: z.ZodString;
|
|
842
|
+
name: z.ZodOptional<z.ZodString>;
|
|
843
|
+
}, z.core.$strip>>;
|
|
844
|
+
ci: z.ZodOptional<z.ZodObject<{
|
|
845
|
+
name: z.ZodNullable<z.ZodString>;
|
|
846
|
+
isPr: z.ZodNullable<z.ZodBoolean>;
|
|
847
|
+
}, z.core.$strip>>;
|
|
848
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
849
|
+
platform: z.ZodString;
|
|
850
|
+
arch: z.ZodString;
|
|
851
|
+
node: z.ZodOptional<z.ZodString>;
|
|
852
|
+
}, z.core.$strip>>;
|
|
853
|
+
project: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
854
|
+
session: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
855
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
856
|
+
id: z.ZodOptional<z.ZodString>;
|
|
857
|
+
authType: z.ZodOptional<z.ZodString>;
|
|
858
|
+
}, z.core.$strip>>;
|
|
859
|
+
}, z.core.$strip>;
|
|
860
|
+
type FeedbackContext = z.infer<typeof feedbackContextSchema>;
|
|
861
|
+
/**
|
|
862
|
+
* Vendor-defined enrichment (sdk_version, plan tier, build number). Flat by
|
|
863
|
+
* design — values stay renderable as chips and queryable via json_extract.
|
|
864
|
+
* Distinct from `context`, which is what the client auto-detects.
|
|
865
|
+
*/
|
|
866
|
+
declare const metadataSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
867
|
+
type FeedbackMetadata = z.infer<typeof metadataSchema>;
|
|
868
|
+
declare const feedbackEventSchema: z.ZodObject<{
|
|
869
|
+
v: z.ZodLiteral<1>;
|
|
870
|
+
to: z.ZodOptional<z.ZodString>;
|
|
871
|
+
feedback: z.ZodString;
|
|
872
|
+
category: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
873
|
+
tool: "tool";
|
|
874
|
+
skill: "skill";
|
|
875
|
+
prompt: "prompt";
|
|
876
|
+
docs: "docs";
|
|
877
|
+
mcp: "mcp";
|
|
878
|
+
cli: "cli";
|
|
879
|
+
api: "api";
|
|
880
|
+
model: "model";
|
|
881
|
+
ux: "ux";
|
|
882
|
+
other: "other";
|
|
883
|
+
}>, z.ZodEnum<{
|
|
884
|
+
eval: "eval";
|
|
885
|
+
}>, z.ZodString]>>;
|
|
886
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
887
|
+
sentiment: z.ZodOptional<z.ZodEnum<{
|
|
888
|
+
positive: "positive";
|
|
889
|
+
negative: "negative";
|
|
890
|
+
neutral: "neutral";
|
|
891
|
+
}>>;
|
|
892
|
+
author: z.ZodOptional<z.ZodEnum<{
|
|
893
|
+
agent: "agent";
|
|
894
|
+
human: "human";
|
|
895
|
+
hybrid: "hybrid";
|
|
896
|
+
}>>;
|
|
897
|
+
thread: z.ZodObject<{
|
|
898
|
+
id: z.ZodString;
|
|
899
|
+
}, z.core.$strip>;
|
|
900
|
+
eval: z.ZodOptional<z.ZodObject<{
|
|
901
|
+
task: z.ZodString;
|
|
902
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
903
|
+
actual: z.ZodOptional<z.ZodString>;
|
|
904
|
+
mistake: z.ZodOptional<z.ZodString>;
|
|
905
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
906
|
+
}, z.core.$strip>>;
|
|
907
|
+
question: z.ZodOptional<z.ZodString>;
|
|
908
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
909
|
+
id: z.ZodString;
|
|
910
|
+
token: z.ZodString;
|
|
911
|
+
description: z.ZodOptional<z.ZodString>;
|
|
912
|
+
}, z.core.$strip>>>;
|
|
913
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
914
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
915
|
+
id: z.ZodString;
|
|
916
|
+
name: z.ZodOptional<z.ZodString>;
|
|
917
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
918
|
+
model: z.ZodOptional<z.ZodString>;
|
|
919
|
+
}, z.core.$strip>>;
|
|
920
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
921
|
+
id: z.ZodString;
|
|
922
|
+
name: z.ZodOptional<z.ZodString>;
|
|
923
|
+
}, z.core.$strip>>;
|
|
924
|
+
ci: z.ZodOptional<z.ZodObject<{
|
|
925
|
+
name: z.ZodNullable<z.ZodString>;
|
|
926
|
+
isPr: z.ZodNullable<z.ZodBoolean>;
|
|
927
|
+
}, z.core.$strip>>;
|
|
928
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
929
|
+
platform: z.ZodString;
|
|
930
|
+
arch: z.ZodString;
|
|
931
|
+
node: z.ZodOptional<z.ZodString>;
|
|
932
|
+
}, z.core.$strip>>;
|
|
933
|
+
project: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
934
|
+
session: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
935
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
936
|
+
id: z.ZodOptional<z.ZodString>;
|
|
937
|
+
authType: z.ZodOptional<z.ZodString>;
|
|
938
|
+
}, z.core.$strip>>;
|
|
939
|
+
}, z.core.$strip>>;
|
|
940
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
941
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
942
|
+
client: z.ZodObject<{
|
|
943
|
+
name: z.ZodString;
|
|
944
|
+
version: z.ZodString;
|
|
945
|
+
}, z.core.$strip>;
|
|
946
|
+
consent: z.ZodObject<{
|
|
947
|
+
telemetry: z.ZodBoolean;
|
|
948
|
+
}, z.core.$strip>;
|
|
949
|
+
}, z.core.$strip>;
|
|
950
|
+
type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
|
|
951
|
+
type FeedbackEventInput = z.input<typeof feedbackEventSchema>;
|
|
952
|
+
/** 202 body returned by every conforming ingest endpoint. */
|
|
953
|
+
declare const ingestResponseSchema: z.ZodObject<{
|
|
954
|
+
id: z.ZodString;
|
|
955
|
+
thread: z.ZodString;
|
|
956
|
+
resume: z.ZodOptional<z.ZodString>;
|
|
957
|
+
guidance: z.ZodOptional<z.ZodString>;
|
|
958
|
+
known_issue: z.ZodOptional<z.ZodObject<{
|
|
959
|
+
title: z.ZodString;
|
|
960
|
+
status: z.ZodEnum<{
|
|
961
|
+
wont_fix: "wont_fix";
|
|
962
|
+
open: "open";
|
|
963
|
+
}>;
|
|
964
|
+
reopened: z.ZodOptional<z.ZodBoolean>;
|
|
965
|
+
reports: z.ZodNumber;
|
|
966
|
+
note: z.ZodOptional<z.ZodString>;
|
|
967
|
+
hint: z.ZodString;
|
|
968
|
+
}, z.core.$strip>>;
|
|
969
|
+
ask: z.ZodOptional<z.ZodObject<{
|
|
970
|
+
id: z.ZodString;
|
|
971
|
+
prompt: z.ZodString;
|
|
972
|
+
command: z.ZodString;
|
|
973
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
974
|
+
filename: z.ZodString;
|
|
975
|
+
mediaType: z.ZodString;
|
|
976
|
+
size: z.ZodNumber;
|
|
977
|
+
sha256: z.ZodString;
|
|
978
|
+
id: z.ZodString;
|
|
979
|
+
createdAt: z.ZodString;
|
|
980
|
+
source: z.ZodEnum<{
|
|
981
|
+
reporter: "reporter";
|
|
982
|
+
owner: "owner";
|
|
983
|
+
}>;
|
|
984
|
+
uploader: z.ZodNullable<z.ZodString>;
|
|
985
|
+
target: z.ZodObject<{
|
|
986
|
+
type: z.ZodEnum<{
|
|
987
|
+
eval: "eval";
|
|
988
|
+
question: "question";
|
|
989
|
+
event: "event";
|
|
990
|
+
issue: "issue";
|
|
991
|
+
investigation: "investigation";
|
|
992
|
+
investigation_question: "investigation_question";
|
|
993
|
+
investigation_reply: "investigation_reply";
|
|
994
|
+
}>;
|
|
995
|
+
id: z.ZodString;
|
|
996
|
+
}, z.core.$strip>;
|
|
997
|
+
description: z.ZodOptional<z.ZodString>;
|
|
998
|
+
url: z.ZodURL;
|
|
999
|
+
expiresAt: z.ZodString;
|
|
1000
|
+
}, z.core.$strip>>>;
|
|
1001
|
+
}, z.core.$strip>>;
|
|
1002
|
+
duplicate: z.ZodOptional<z.ZodBoolean>;
|
|
1003
|
+
}, z.core.$strip>;
|
|
1004
|
+
type IngestResponse = z.infer<typeof ingestResponseSchema>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Tenant descriptor. Served identically by the hosted registry
|
|
1007
|
+
* (`{registry}/v1/registry/{slug}`) and by self-published well-known files
|
|
1008
|
+
* (`https://{domain}/.well-known/agent-feedback.json`).
|
|
1009
|
+
*/
|
|
1010
|
+
declare const descriptorSchema: z.ZodObject<{
|
|
1011
|
+
v: z.ZodLiteral<1>;
|
|
1012
|
+
name: z.ZodString;
|
|
1013
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
1014
|
+
endpoint: z.ZodURL;
|
|
1015
|
+
writeKey: z.ZodOptional<z.ZodString>;
|
|
1016
|
+
categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1017
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
1018
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1019
|
+
}, z.core.$strip>>>;
|
|
1020
|
+
jwks: z.ZodOptional<z.ZodURL>;
|
|
1021
|
+
docs: z.ZodOptional<z.ZodURL>;
|
|
1022
|
+
}, z.core.$strip>;
|
|
1023
|
+
type Descriptor = z.infer<typeof descriptorSchema>;
|
|
1024
|
+
/**
|
|
1025
|
+
* A codebase a project's feedback is about. Owner-plane wire contract: rides on
|
|
1026
|
+
* every list/get response so a triage agent knows where to go fix things.
|
|
1027
|
+
*/
|
|
1028
|
+
declare const repoEntrySchema: z.ZodObject<{
|
|
1029
|
+
url: z.ZodString;
|
|
1030
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1031
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
1032
|
+
}, z.core.$strip>;
|
|
1033
|
+
type RepoEntry = z.infer<typeof repoEntrySchema>;
|
|
1034
|
+
declare const repoListSchema: z.ZodArray<z.ZodObject<{
|
|
1035
|
+
url: z.ZodString;
|
|
1036
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1037
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
1038
|
+
}, z.core.$strip>>;
|
|
1039
|
+
type ValidationResult<T> = {
|
|
1040
|
+
ok: true;
|
|
1041
|
+
data: T;
|
|
1042
|
+
} | {
|
|
1043
|
+
ok: false;
|
|
1044
|
+
errors: string[];
|
|
1045
|
+
};
|
|
1046
|
+
declare function validateFeedbackEvent(input: unknown): ValidationResult<FeedbackEvent>;
|
|
1047
|
+
declare function validateDescriptor(input: unknown): ValidationResult<Descriptor>;
|
|
1048
|
+
declare function validateIngestResponse(input: unknown): ValidationResult<IngestResponse>;
|
|
1049
|
+
/** JSON Schema exports for non-TypeScript implementers. */
|
|
1050
|
+
declare function feedbackEventJsonSchema(): Record<string, unknown>;
|
|
1051
|
+
declare function descriptorJsonSchema(): Record<string, unknown>;
|
|
1052
|
+
|
|
1053
|
+
export { type Attachment, type AttachmentTarget, CONFIG_FILE_NAME, type CollectContextOptions, DEFAULT_INGEST_PATH, DEFAULT_REGISTRY_URL, DSN_ENV_VAR, type DeliveredAttachment, type Descriptor, type Destination, EVENT_STATUSES, type EnvLike, type EvalReport, type EventStatus, FEEDBACK_CATEGORIES, type FeedbackAuthor, type FeedbackCategory, type FeedbackConfig, type FeedbackContext, FeedbackError, type FeedbackEvent, type FeedbackEventInput, type FeedbackMetadata, type FilesNotAttached, type FlushResult, HOME_ENV_VAR, ISSUE_STATUSES, type IngestResponse, type IssueStatus, type LocalAttachmentInput, MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, MAX_FEEDBACK_LENGTH, MAX_GUIDANCE_LENGTH, MAX_SUBJECT_LENGTH, NO_TELEMETRY_ENV_VAR, type OutboxEntry, type OwnerApi, type OwnerApiOptions, type OwnerEvent, type OwnerFilters, type OwnerIssue, PROTOCOL_VERSION, type PostEventOptions, type PostEventResult, REGISTRY_ENV_VAR, type RepoEntry, type ResolveDestinationOptions, type SendFeedbackOptions, type SendFeedbackResult, type Sentiment, type SessionSource, THREAD_ID_PATTERN, type ValidationResult, WELL_KNOWN_PATH, WRITE_KEY_HEADER, WRITE_KEY_PATTERN, appendToOutbox, authorSchema, categorySchema, collectContext, descriptorJsonSchema, descriptorSchema, evalReportSchema, feedbackContextSchema, feedbackEventJsonSchema, feedbackEventSchema, feedbackHomeDir, findConfigFile, flushOutbox, generateThreadId, inferAuthor, ingestResponseSchema, isTelemetryDisabled, metadataSchema, outboxPath, ownerApi, parseDsn, postEvent, registryUrl, repoEntrySchema, repoListSchema, resolveApiOrigin, resolveDestination, resolveThreadId, sendFeedback, sentimentSchema, validateDescriptor, validateFeedbackEvent, validateIngestResponse };
|