@holonograph/client 0.5.0 → 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/dist/index.js CHANGED
@@ -4010,6 +4010,7 @@ var ALL_SUBSTRATE_COLUMN_SEMANTICS = ["deployment-state", "diagnostic"];
4010
4010
  var SubstrateColumnSemanticSchema = external_exports.enum(ALL_SUBSTRATE_COLUMN_SEMANTICS);
4011
4011
  var ALL_EMISSION_EXPECTATIONS = ["always", "conditional"];
4012
4012
  var EmissionExpectationSchema = external_exports.enum(ALL_EMISSION_EXPECTATIONS);
4013
+ var SubstrateColumnStatusSchema = external_exports.enum(["active", "forward-declared", "deprecated"]);
4013
4014
  var SubstrateColumnSchema = external_exports.object({
4014
4015
  id: external_exports.string().min(1).max(128),
4015
4016
  control: ControlAttributeSchema,
@@ -4020,7 +4021,9 @@ var SubstrateColumnSchema = external_exports.object({
4020
4021
 
4021
4022
  values: external_exports.array(external_exports.string().min(1)).min(1).optional(),
4022
4023
 
4023
- emissionExpectation: EmissionExpectationSchema.optional()
4024
+ emissionExpectation: EmissionExpectationSchema.optional(),
4025
+
4026
+ status: SubstrateColumnStatusSchema.optional()
4024
4027
  });
4025
4028
  var SubstrateSnapshotSchema = external_exports.object({
4026
4029
  lensVersion: LensVersionIdSchema,
@@ -4094,6 +4097,34 @@ new Set(
4094
4097
  PLATFORM_SYSTEM_ROLE_SURFACES.map((s) => s.surfaceId)
4095
4098
  );
4096
4099
 
4100
+ var JUDGE_RUBRIC_HASH_COLUMN_ID = "judge.rubric_hash";
4101
+ var JUDGE_CONTEXT_SCOPE_COLUMN_ID = "judge.context_scope";
4102
+ var JUDGE_MODEL_COLUMN_ID = "judge.model";
4103
+ var JUDGE_RESERVED_COLUMN_NAMESPACE_PREFIX = "judge.";
4104
+ var JUDGE_CONTEXT_SCOPES = [
4105
+ "rubric_actual",
4106
+ "rubric_actual_expected",
4107
+ "rubric_actual_expected_toolaware",
4108
+ "full_generating_prompt"
4109
+ ];
4110
+ var JudgeContextScopeSchema = external_exports.enum(JUDGE_CONTEXT_SCOPES);
4111
+ external_exports.object({
4112
+
4113
+ rubricHash: external_exports.string().min(1).optional(),
4114
+
4115
+ contextScope: JudgeContextScopeSchema.optional(),
4116
+
4117
+ model: external_exports.string().min(1).optional()
4118
+ });
4119
+ function judgeIdentityColumns(identity) {
4120
+ const columns = {};
4121
+ if (identity.rubricHash !== void 0) columns[JUDGE_RUBRIC_HASH_COLUMN_ID] = identity.rubricHash;
4122
+ if (identity.contextScope !== void 0)
4123
+ columns[JUDGE_CONTEXT_SCOPE_COLUMN_ID] = identity.contextScope;
4124
+ if (identity.model !== void 0) columns[JUDGE_MODEL_COLUMN_ID] = identity.model;
4125
+ return columns;
4126
+ }
4127
+
4097
4128
  var CannedMessageRefSchema = external_exports.string().min(1).max(256);
4098
4129
  var ALL_GATE_FAILURE_ACTIONS = ["retry", "flag", "block"];
4099
4130
  var GateFailureActionSchema = external_exports.enum(ALL_GATE_FAILURE_ACTIONS);
@@ -4213,6 +4244,8 @@ var SurfaceDeclarationSchema = external_exports.object({
4213
4244
 
4214
4245
  status: SurfaceStatusSchema.default("active"),
4215
4246
 
4247
+ captureJudgedFailures: external_exports.boolean().optional(),
4248
+
4216
4249
  removedDimensions: external_exports.array(RemovedDimensionSchema).default([]),
4217
4250
 
4218
4251
  removedCohortTags: external_exports.array(RemovedCohortTagSchema).default([])
@@ -4257,6 +4290,7 @@ external_exports.object({
4257
4290
 
4258
4291
  systemSurfaces: SystemSurfacesSchema.optional()
4259
4292
  });
4293
+ var SERVED_MODEL_COLUMN_ID = "light_source_served_model";
4260
4294
 
4261
4295
  var LightSourceRoleSchema = external_exports.enum(["system", "user", "assistant", "tool"]);
4262
4296
  var LightSourceContentBlockSchema = external_exports.discriminatedUnion("kind", [
@@ -4360,6 +4394,8 @@ external_exports.discriminatedUnion("ok", [
4360
4394
 
4361
4395
  vendorMetadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
4362
4396
 
4397
+ servedModel: external_exports.string().optional(),
4398
+
4363
4399
  stopReason: external_exports.enum(["end_turn", "max_tokens", "tool_use", "stop_sequence", "refusal", "other"]).optional()
4364
4400
  }),
4365
4401
  external_exports.object({
@@ -4698,6 +4734,8 @@ var LightSnapshotSchema = external_exports.object({
4698
4734
 
4699
4735
  vendorMetadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
4700
4736
 
4737
+ servedModel: external_exports.string().optional(),
4738
+
4701
4739
  rawRequestOmitted: external_exports.boolean().optional(),
4702
4740
 
4703
4741
  rawResponsePresence: external_exports.enum(["present", "omitted-by-policy", "pending-attach", "failed-attach"]).optional()
@@ -6373,11 +6411,20 @@ var HolonographClient = class {
6373
6411
  return this.declaredColumns;
6374
6412
  }
6375
6413
 
6414
+ apparatusStampedColumns(light, judgeIdentity) {
6415
+ const columns = { ...this.substrate.columns };
6416
+ if (light.servedModel !== void 0) columns[SERVED_MODEL_COLUMN_ID] = light.servedModel;
6417
+ if (judgeIdentity !== void 0) Object.assign(columns, judgeIdentityColumns(judgeIdentity));
6418
+ return columns;
6419
+ }
6420
+
6376
6421
  async validateSubstrateColumns(columns) {
6377
6422
  if (columns === void 0 || this.onUnknownColumn === "ignore" || this.transport.getContract === void 0) {
6378
6423
  return;
6379
6424
  }
6380
- const keys = Object.keys(columns);
6425
+ const keys = Object.keys(columns).filter(
6426
+ (k) => k !== SERVED_MODEL_COLUMN_ID && !k.startsWith(JUDGE_RESERVED_COLUMN_NAMESPACE_PREFIX)
6427
+ );
6381
6428
  if (keys.length === 0) return;
6382
6429
  const declared = await this.fetchDeclaredColumns();
6383
6430
  if (declared === null || declared.size === 0) return;
@@ -6494,7 +6541,11 @@ var HolonographClient = class {
6494
6541
  lensVersion: this.lensVersion,
6495
6542
  light: callResult.record.light,
6496
6543
 
6497
- substrate: { ...this.substrate, lightSourceIdentifier: callResult.record.lightSourceId },
6544
+ substrate: {
6545
+ ...this.substrate,
6546
+ lightSourceIdentifier: callResult.record.lightSourceId,
6547
+ columns: this.apparatusStampedColumns(callResult.record.light, outcome.judgeIdentity)
6548
+ },
6498
6549
  surface
6499
6550
  });
6500
6551
  await this.validateSubstrateColumns(event.substrate?.columns);
@@ -6576,7 +6627,11 @@ var HolonographClient = class {
6576
6627
  lensVersion: this.lensVersion,
6577
6628
  light: record.light,
6578
6629
 
6579
- substrate: { ...this.substrate, lightSourceIdentifier: record.lightSourceId },
6630
+ substrate: {
6631
+ ...this.substrate,
6632
+ lightSourceIdentifier: record.lightSourceId,
6633
+ columns: this.apparatusStampedColumns(record.light)
6634
+ },
6580
6635
  surface: observerSurface
6581
6636
  });
6582
6637
  await this.transport.appendEvent(event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holonograph/client",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "TypeScript HTTP client for a Holonograph lens. Send messages through the lens and report scored outcomes back to it.",
5
5
  "license": "MIT",
6
6
  "type": "module",