@peasant-labs/schema 0.49.0 → 0.51.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 +2 -0
- package/dist/index.js +11 -4
- package/dist/internal/generated/contract/zod.gen.d.ts +198 -0
- package/dist/internal/generated/contract/zod.gen.js +66 -3
- package/dist/internal/generated/enums.gen.d.ts +35 -0
- package/dist/internal/generated/enums.gen.js +36 -0
- package/dist/internal/generated/kickstart-limits.gen.d.ts +1 -0
- package/dist/internal/generated/kickstart-limits.gen.js +2 -0
- package/dist/internal/generated/local-api.d.ts +327 -56
- 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/dist/local-api.d.ts +1 -1
- package/dist/local-api.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ export * from "./internal/generated/collective-compatibility.gen.js";
|
|
|
4
4
|
export * from "./internal/generated/redaction-categories.gen.js";
|
|
5
5
|
export * from "./internal/generated/content-capabilities.gen.js";
|
|
6
6
|
export * from "./internal/generated/versions.gen.js";
|
|
7
|
+
export * from "./internal/generated/kickstart-limits.gen.js";
|
|
7
8
|
export { reconcileVillageContributionAttempt, villageContributionAttemptActor, type VillageContributionAttemptReconciliation } from "./contribution-attempt.js";
|
|
8
9
|
export { normalizeCollectiveObservationScope, encodeContributionTraversalRevision, parseContributionTraversalRevision, validateContributionHistoryQuery, type ContributionTraversalIdentity, type LocalContributionHistoryQuery } from "./collective-validation.js";
|
|
9
10
|
export { collectiveFetchHTTPStatus } from "./collective-status.js";
|
|
11
|
+
export { isConversationTurn } from "./conversation-turn.js";
|
|
10
12
|
import { type ProjectHash } from "./internal/generated/contract/zod.gen.js";
|
|
11
13
|
export declare function isProjectHash(value: unknown): value is ProjectHash;
|
|
12
14
|
export declare function validateProjectHash(value: unknown): asserts value is ProjectHash;
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,11 @@ export * from "./internal/generated/collective-compatibility.gen.js";
|
|
|
4
4
|
export * from "./internal/generated/redaction-categories.gen.js";
|
|
5
5
|
export * from "./internal/generated/content-capabilities.gen.js";
|
|
6
6
|
export * from "./internal/generated/versions.gen.js";
|
|
7
|
+
export * from "./internal/generated/kickstart-limits.gen.js";
|
|
7
8
|
export { reconcileVillageContributionAttempt, villageContributionAttemptActor } from "./contribution-attempt.js";
|
|
8
9
|
export { normalizeCollectiveObservationScope, encodeContributionTraversalRevision, parseContributionTraversalRevision, validateContributionHistoryQuery } from "./collective-validation.js";
|
|
9
10
|
export { collectiveFetchHTTPStatus } from "./collective-status.js";
|
|
11
|
+
export { isConversationTurn } from "./conversation-turn.js";
|
|
10
12
|
import { requiredContentCapabilities, KnownContentCapability } from "./internal/generated/content-capabilities.gen.js";
|
|
11
13
|
import { zNativeMetadataRecord, zTurnDetail, zProjectHash, zServerMessage, zSessionDetailPayload, zSessionDetailReadPayload, zTranscriptContent } from "./internal/generated/contract/zod.gen.js";
|
|
12
14
|
import { maxNativeMetadataStringBytes } from "./internal/generated/metadata-limits.gen.js";
|
|
@@ -665,13 +667,18 @@ function validateMetadataValue(value, depth) {
|
|
|
665
667
|
}
|
|
666
668
|
}
|
|
667
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"];
|
|
668
672
|
function rejectExplicitNullEvidence(value) {
|
|
669
673
|
if (!isRecord(value))
|
|
670
674
|
return;
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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
|
+
}
|
|
675
682
|
for (const turn of Array.isArray(value.turns) ? value.turns : []) {
|
|
676
683
|
if (!isRecord(turn))
|
|
677
684
|
continue;
|