@peasant-labs/schema 0.50.0 → 0.52.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/conversation-turn.d.ts +6 -0
- package/dist/conversation-turn.js +18 -0
- package/dist/fixtures/session-graph.d.ts +767 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -4
- package/dist/internal/generated/contract/zod.gen.d.ts +245 -0
- package/dist/internal/generated/contract/zod.gen.js +28 -4
- package/dist/internal/generated/enums.gen.d.ts +20 -17
- package/dist/internal/generated/enums.gen.js +6 -3
- package/dist/internal/generated/local-api.d.ts +4 -3
- package/dist/internal/generated/public-contract.gen.d.ts +2 -2
- package/dist/internal/generated/public-contract.gen.js +1 -1
- package/dist/internal/generated/session-graph-fixtures.gen.d.ts +767 -2
- package/dist/internal/generated/session-graph-fixtures.gen.js +858 -12
- package/dist/internal/generated/versions.gen.d.ts +3 -3
- package/dist/internal/generated/versions.gen.js +3 -3
- package/dist/internal/generated/village-api.d.ts +251 -0
- package/dist/internal/generated/wire-alias-shapes.gen.d.ts +1 -0
- package/dist/internal/generated/wire-alias-shapes.gen.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./internal/generated/kickstart-limits.gen.js";
|
|
|
8
8
|
export { reconcileVillageContributionAttempt, villageContributionAttemptActor, type VillageContributionAttemptReconciliation } from "./contribution-attempt.js";
|
|
9
9
|
export { normalizeCollectiveObservationScope, encodeContributionTraversalRevision, parseContributionTraversalRevision, validateContributionHistoryQuery, type ContributionTraversalIdentity, type LocalContributionHistoryQuery } from "./collective-validation.js";
|
|
10
10
|
export { collectiveFetchHTTPStatus } from "./collective-status.js";
|
|
11
|
+
export { isConversationTurn } from "./conversation-turn.js";
|
|
11
12
|
import { type ProjectHash } from "./internal/generated/contract/zod.gen.js";
|
|
12
13
|
export declare function isProjectHash(value: unknown): value is ProjectHash;
|
|
13
14
|
export declare function validateProjectHash(value: unknown): asserts value is ProjectHash;
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./internal/generated/kickstart-limits.gen.js";
|
|
|
8
8
|
export { reconcileVillageContributionAttempt, villageContributionAttemptActor } from "./contribution-attempt.js";
|
|
9
9
|
export { normalizeCollectiveObservationScope, encodeContributionTraversalRevision, parseContributionTraversalRevision, validateContributionHistoryQuery } from "./collective-validation.js";
|
|
10
10
|
export { collectiveFetchHTTPStatus } from "./collective-status.js";
|
|
11
|
+
export { isConversationTurn } from "./conversation-turn.js";
|
|
11
12
|
import { requiredContentCapabilities, KnownContentCapability } from "./internal/generated/content-capabilities.gen.js";
|
|
12
13
|
import { zNativeMetadataRecord, zTurnDetail, zProjectHash, zServerMessage, zSessionDetailPayload, zSessionDetailReadPayload, zTranscriptContent } from "./internal/generated/contract/zod.gen.js";
|
|
13
14
|
import { maxNativeMetadataStringBytes } from "./internal/generated/metadata-limits.gen.js";
|
|
@@ -666,13 +667,18 @@ function validateMetadataValue(value, depth) {
|
|
|
666
667
|
}
|
|
667
668
|
}
|
|
668
669
|
function isRecord(value) { return typeof value === "object" && value !== null && !Array.isArray(value); }
|
|
670
|
+
/** Optional session counts: absent means unmeasured, so null and unsafe values are refused. */
|
|
671
|
+
const optionalCountFields = ["inputSubmissionCount", "conversationTurnCount"];
|
|
669
672
|
function rejectExplicitNullEvidence(value) {
|
|
670
673
|
if (!isRecord(value))
|
|
671
674
|
return;
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
for (const field of optionalCountFields) {
|
|
676
|
+
const count = value[field];
|
|
677
|
+
if (count === null)
|
|
678
|
+
failSemantic(`${field} is explicitly null`);
|
|
679
|
+
if (count !== undefined && (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0))
|
|
680
|
+
failSemantic(`${field} is outside 0..9007199254740991`);
|
|
681
|
+
}
|
|
676
682
|
for (const turn of Array.isArray(value.turns) ? value.turns : []) {
|
|
677
683
|
if (!isRecord(turn))
|
|
678
684
|
continue;
|