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