@cultured_computer/sight 0.3.0 → 0.3.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.
- package/dist/index.cjs +42 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -299,7 +299,7 @@ declare const ProbeConfigSchema: z.ZodObject<{
|
|
|
299
299
|
apiKey: z.ZodString;
|
|
300
300
|
/** Deployment slug registered in the Probe backend. Required. */
|
|
301
301
|
deployment: z.ZodString;
|
|
302
|
-
/** Ingest endpoint. Defaults to
|
|
302
|
+
/** Ingest endpoint. Defaults to the production ingest service. */
|
|
303
303
|
endpoint: z.ZodDefault<z.ZodString>;
|
|
304
304
|
/**
|
|
305
305
|
* Dashboard base URL used by the one-time first-capture announcement
|
package/dist/index.d.ts
CHANGED
|
@@ -299,7 +299,7 @@ declare const ProbeConfigSchema: z.ZodObject<{
|
|
|
299
299
|
apiKey: z.ZodString;
|
|
300
300
|
/** Deployment slug registered in the Probe backend. Required. */
|
|
301
301
|
deployment: z.ZodString;
|
|
302
|
-
/** Ingest endpoint. Defaults to
|
|
302
|
+
/** Ingest endpoint. Defaults to the production ingest service. */
|
|
303
303
|
endpoint: z.ZodDefault<z.ZodString>;
|
|
304
304
|
/**
|
|
305
305
|
* Dashboard base URL used by the one-time first-capture announcement
|
package/dist/index.js
CHANGED
|
@@ -290,8 +290,8 @@ var ProbeConfigSchema = z.object({
|
|
|
290
290
|
apiKey: z.string().min(1),
|
|
291
291
|
/** Deployment slug registered in the Probe backend. Required. */
|
|
292
292
|
deployment: z.string().min(1),
|
|
293
|
-
/** Ingest endpoint. Defaults to
|
|
294
|
-
endpoint: z.string().url().default("https://ingest.
|
|
293
|
+
/** Ingest endpoint. Defaults to the production ingest service. */
|
|
294
|
+
endpoint: z.string().url().default("https://fieldwork-ingest.fly.dev"),
|
|
295
295
|
/**
|
|
296
296
|
* Dashboard base URL used by the one-time first-capture announcement
|
|
297
297
|
* (the stderr permalink printed after the first successful send).
|
|
@@ -1214,6 +1214,45 @@ var EnvironmentEventsBatchSchema = z.object({
|
|
|
1214
1214
|
events: z.array(EnvironmentEventInputSchema).min(1).max(100),
|
|
1215
1215
|
alignment: AlignmentProvenanceSchema
|
|
1216
1216
|
});
|
|
1217
|
+
var DEFINITION_SLUG = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
1218
|
+
var DEFINITION_VALUE = z.string().trim().min(1).max(64);
|
|
1219
|
+
z.object({
|
|
1220
|
+
/** Measurement family the definition belongs to (e.g. 'voice-conformance'). */
|
|
1221
|
+
family: z.string().regex(DEFINITION_SLUG, "family must be a lowercase slug (a-z, 0-9, _-)."),
|
|
1222
|
+
/** Slug within the family. family+name identifies the definition across versions. */
|
|
1223
|
+
name: z.string().regex(DEFINITION_SLUG, "name must be a lowercase slug (a-z, 0-9, _-)."),
|
|
1224
|
+
/** The elicitation prompt — the queue row's plain-language question. */
|
|
1225
|
+
question: z.string().trim().min(1).max(280),
|
|
1226
|
+
/** Difference metric for α (Krippendorff). Elicit v1: nominal | ordinal. */
|
|
1227
|
+
metric: z.enum(["nominal", "ordinal"]),
|
|
1228
|
+
/** The chips (closed vocabulary the rater chooses from). */
|
|
1229
|
+
values: z.array(DEFINITION_VALUE).min(2, "A rubric needs at least two chips.").max(9, "The queue is keyboard-first \u2014 at most 9 chips."),
|
|
1230
|
+
/** Rank order (lowest first) — required iff metric is 'ordinal'. */
|
|
1231
|
+
ordinalScale: z.array(DEFINITION_VALUE).min(2).max(9).optional()
|
|
1232
|
+
}).refine((input) => new Set(input.values).size === input.values.length, {
|
|
1233
|
+
message: "Chips must be unique.",
|
|
1234
|
+
path: ["values"]
|
|
1235
|
+
}).superRefine((input, ctx) => {
|
|
1236
|
+
if (input.metric === "ordinal") {
|
|
1237
|
+
const scale = input.ordinalScale;
|
|
1238
|
+
if (!scale) {
|
|
1239
|
+
ctx.addIssue({
|
|
1240
|
+
code: z.ZodIssueCode.custom,
|
|
1241
|
+
message: "ordinalScale is required when metric is ordinal.",
|
|
1242
|
+
path: ["ordinalScale"]
|
|
1243
|
+
});
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
const same = scale.length === input.values.length && [...scale].sort().join("") === [...input.values].sort().join("");
|
|
1247
|
+
if (!same) {
|
|
1248
|
+
ctx.addIssue({
|
|
1249
|
+
code: z.ZodIssueCode.custom,
|
|
1250
|
+
message: "ordinalScale must be exactly the chips in rank order (lowest first).",
|
|
1251
|
+
path: ["ordinalScale"]
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1217
1256
|
z.object({
|
|
1218
1257
|
deploymentSlug: z.string().min(1),
|
|
1219
1258
|
sessionExternalId: z.string().min(1),
|
|
@@ -1572,7 +1611,7 @@ var Probe = class {
|
|
|
1572
1611
|
const contract = validatePropensityContract(propensity);
|
|
1573
1612
|
if (!contract.ok) {
|
|
1574
1613
|
console.warn(
|
|
1575
|
-
`[
|
|
1614
|
+
`[sight] propensity contract violation (${contract.class}): ${contract.reason}`
|
|
1576
1615
|
);
|
|
1577
1616
|
turn.payload.propensity = void 0;
|
|
1578
1617
|
validPropensity = void 0;
|