@plasius/learning 0.2.20 → 0.2.21
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/README.md +31 -0
- package/dist/index.cjs +178 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +168 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -429,6 +429,109 @@ declare const JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1: LearningPathVersionV1;
|
|
|
429
429
|
/** Current pilot catalog for server adapters that intentionally follow releases. */
|
|
430
430
|
declare const JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT: LearningPathVersionV1;
|
|
431
431
|
|
|
432
|
+
/** Additive contract version for touch-first and spoken contextual help. */
|
|
433
|
+
declare const CONTEXTUAL_HELP_CONTRACT_VERSION_V1: "1.0.0";
|
|
434
|
+
declare const CONTEXTUAL_HELP_KINDS_V1: readonly ["command", "visual-block", "generated-code", "assessment-diagnostic"];
|
|
435
|
+
type ContextualHelpKindV1 = (typeof CONTEXTUAL_HELP_KINDS_V1)[number];
|
|
436
|
+
/**
|
|
437
|
+
* Opaque, manifest-bound identifier. It contains no source, transcript,
|
|
438
|
+
* learner identity or arbitrary synthesis text.
|
|
439
|
+
*/
|
|
440
|
+
interface ContextualHelpIdentifierV1 {
|
|
441
|
+
readonly schemaVersion: "1";
|
|
442
|
+
readonly contractVersion: typeof CONTEXTUAL_HELP_CONTRACT_VERSION_V1;
|
|
443
|
+
readonly kind: ContextualHelpKindV1;
|
|
444
|
+
readonly moduleId: string;
|
|
445
|
+
readonly moduleVersion: string;
|
|
446
|
+
readonly manifestVersion: string;
|
|
447
|
+
readonly helpId: string;
|
|
448
|
+
}
|
|
449
|
+
type GuardianVoiceConsentStateV1 = "granted" | "withdrawn";
|
|
450
|
+
type GuardianVoiceProcessingRouteV1 = "private-edge-only";
|
|
451
|
+
/** Voice consent is deliberately separate from general AI consent. */
|
|
452
|
+
interface GuardianVoiceConsentV1 {
|
|
453
|
+
readonly schemaVersion: "1";
|
|
454
|
+
readonly actorAccountId: string;
|
|
455
|
+
readonly subjectAccountId: string;
|
|
456
|
+
readonly policyVersion: string;
|
|
457
|
+
readonly state: GuardianVoiceConsentStateV1;
|
|
458
|
+
readonly permittedProcessingRoute: GuardianVoiceProcessingRouteV1;
|
|
459
|
+
readonly recordedAt: string;
|
|
460
|
+
}
|
|
461
|
+
type VoiceHelpAvailabilityReasonV1 = "available" | "module-access-required" | "guardian-consent-required" | "guardian-consent-withdrawn" | "age-or-safeguarding-gate" | "capability-disabled" | "rollout-disabled" | "private-edge-unavailable";
|
|
462
|
+
/** Read-aloud and microphone availability are evaluated independently. */
|
|
463
|
+
interface VoiceHelpAvailabilityV1 {
|
|
464
|
+
readonly schemaVersion: "1";
|
|
465
|
+
readonly readAloudAvailable: boolean;
|
|
466
|
+
readonly microphoneAvailable: boolean;
|
|
467
|
+
readonly microphoneReason: VoiceHelpAvailabilityReasonV1;
|
|
468
|
+
readonly questionProcessingRoute: GuardianVoiceProcessingRouteV1;
|
|
469
|
+
readonly guardianVoiceConsentRequired: true;
|
|
470
|
+
readonly maximumRecordingDurationMs: 10_000;
|
|
471
|
+
readonly maximumAudioBytes: 2_097_152;
|
|
472
|
+
readonly rawAudioRetention: "request-memory-only";
|
|
473
|
+
readonly transcriptRetention: "request-memory-only";
|
|
474
|
+
}
|
|
475
|
+
/** Metadata accepted beside an authenticated multipart audio upload. */
|
|
476
|
+
interface ContextualVoiceQuestionMetadataV1 {
|
|
477
|
+
readonly schemaVersion: "1";
|
|
478
|
+
readonly help: ContextualHelpIdentifierV1;
|
|
479
|
+
readonly locale: string;
|
|
480
|
+
readonly mediaType: string;
|
|
481
|
+
readonly durationMs: number;
|
|
482
|
+
readonly audioBytes: number;
|
|
483
|
+
readonly assessmentEvidenceId?: string;
|
|
484
|
+
}
|
|
485
|
+
declare const CONTEXTUAL_VOICE_INTENTS_V1: readonly ["describe-command", "describe-inputs", "show-example", "explain-assessment-failure", "suggest-next-experiment", "repeat", "stop", "unresolved"];
|
|
486
|
+
type ContextualVoiceIntentV1 = (typeof CONTEXTUAL_VOICE_INTENTS_V1)[number];
|
|
487
|
+
type ContextualVoiceSuggestedActionV1 = "open-help" | "insert-example" | "show-inputs" | "show-assessment-evidence" | "try-next-experiment" | "repeat" | "stop" | "type-question";
|
|
488
|
+
declare const CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1: readonly ["open-help", "insert-example", "show-inputs", "show-assessment-evidence", "try-next-experiment", "repeat", "stop", "type-question"];
|
|
489
|
+
interface ContextualVoiceAnswerV1 {
|
|
490
|
+
readonly helpId: string;
|
|
491
|
+
readonly source: "module-documentation" | "assessment-evidence" | "authored-fallback";
|
|
492
|
+
/** Server-resolved visible answer; never a model-authored open response. */
|
|
493
|
+
readonly text: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The transcript is returned only so the learner can verify recognition. The
|
|
497
|
+
* request boundary must use no-store and discard it after the current view.
|
|
498
|
+
*/
|
|
499
|
+
interface ContextualVoiceQuestionResultV1 {
|
|
500
|
+
readonly schemaVersion: "1";
|
|
501
|
+
readonly help: ContextualHelpIdentifierV1;
|
|
502
|
+
readonly intent: ContextualVoiceIntentV1;
|
|
503
|
+
readonly status: "resolved" | "suggestions" | "stopped";
|
|
504
|
+
readonly transientTranscript: string;
|
|
505
|
+
readonly transcriptRetention: "request-memory-only";
|
|
506
|
+
readonly answer?: ContextualVoiceAnswerV1;
|
|
507
|
+
readonly suggestedActions: ContextualVoiceSuggestedActionV1[];
|
|
508
|
+
readonly mayAssignScore: false;
|
|
509
|
+
readonly mayAwardReward: false;
|
|
510
|
+
readonly mayPublish: false;
|
|
511
|
+
readonly mayControlHardware: false;
|
|
512
|
+
}
|
|
513
|
+
/** Canonical audio lookup metadata. Authoritative speech text stays server-side. */
|
|
514
|
+
interface CanonicalSpokenHelpDescriptorV1 {
|
|
515
|
+
readonly schemaVersion: "1";
|
|
516
|
+
readonly help: ContextualHelpIdentifierV1;
|
|
517
|
+
readonly canonicalTextId: string;
|
|
518
|
+
readonly authoritativeTextDigest: `sha256:${string}`;
|
|
519
|
+
readonly locale: string;
|
|
520
|
+
readonly voiceProfile: string;
|
|
521
|
+
readonly pronunciationVersion: string;
|
|
522
|
+
readonly utteranceClass: "system-generic";
|
|
523
|
+
readonly sharingScope: "global";
|
|
524
|
+
readonly reuse: "exact-only";
|
|
525
|
+
readonly containsPersonalData: false;
|
|
526
|
+
readonly containsLearnerContent: false;
|
|
527
|
+
}
|
|
528
|
+
declare function assertValidContextualHelpIdentifier(value: ContextualHelpIdentifierV1): void;
|
|
529
|
+
declare function assertValidGuardianVoiceConsent(value: GuardianVoiceConsentV1): void;
|
|
530
|
+
declare function assertValidContextualVoiceQuestionMetadata(value: ContextualVoiceQuestionMetadataV1): void;
|
|
531
|
+
declare function assertValidVoiceHelpAvailability(value: VoiceHelpAvailabilityV1): void;
|
|
532
|
+
declare function assertValidCanonicalSpokenHelpDescriptor(value: CanonicalSpokenHelpDescriptorV1): void;
|
|
533
|
+
declare function assertValidContextualVoiceQuestionResult(value: ContextualVoiceQuestionResultV1): void;
|
|
534
|
+
|
|
432
535
|
/** Versioned, infrastructure-neutral contracts for Guardian-approved static projects. */
|
|
433
536
|
declare const STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1: "1.0.0";
|
|
434
537
|
declare const STATIC_PROJECT_SCANNER_VERSION_V1: "junior-coder-static-scan-v1";
|
|
@@ -630,4 +733,4 @@ declare function validateLearningPath(path: LearningPathVersionV1): LearningVali
|
|
|
630
733
|
/** Fail fast when a path is not safe to publish or consume. */
|
|
631
734
|
declare function assertValidLearningPath(path: LearningPathVersionV1): void;
|
|
632
735
|
|
|
633
|
-
export { ADVENTURE_MISSION_PLANNER_MISSION_ONE_AUTHORING_V1, type AdventureMissionPlannerSafeRenderV1, type AssessmentCheckResultV1, type AssessmentCriterionV1, type AssessmentDimensionV1, type AssessmentResultV1, type AssessmentRubricV1, type AttemptEvidenceV1, BEACON_BOT_MISSION_ONE_AUTHORING_V1, type BadgeDefinitionV1, CREATURE_CARE_DASHBOARD_MISSION_ONE_AUTHORING_V1, type CommercialStateV1, type CourseMaterialAudienceV1, type CourseMaterialKindV1, type CourseMaterialV1, type CourseMaterialsManifestV1, type CreatureCareDashboardSafeRenderV1, DANCE_ROVER_MISSION_ONE_AUTHORING_V1, type FacilitatorMissionAuthoringV1, type GuardianAiConsentV1, type HardwareItemV1, type HardwareModeV1, type HardwareRequirementManifestV1, type HardwareVerificationStatusV1, JUNIOR_CODER_MISSION_STAGE_ORDER_V1, JUNIOR_CODER_MODULE_PRICE_V1_1, JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1, type LearnerMissionAuthoringV1, type LearningGoalV1, type LearningModuleVersionV1, type LearningPathVersionV1, type LearningValidationIssueV1, METEOR_SHIELD_MISSION_ONE_AUTHORING_V1, MISSION_AUTHORING_CONTRACT_VERSION_V1, type MissionAccessibilityAlternativeV1, type MissionArtifactKindV1, type MissionArtifactReferenceV1, type MissionAuthoringBundleV1, type MissionAuthoringGoalV1, type MissionAuthoringValidationIssueV1, type MissionBoundedSuggestionV1, type MissionEvidenceKindV1, type MissionEvidenceRequirementV1, type MissionEvidenceRetentionV1, type MissionFunctionParameterV1, type MissionFunctionReferenceV1, type MissionHardwareAcquisitionScopeV1, type MissionHardwareComponentDisclosureV1, type MissionHardwareDisclosureV1, type MissionInteractionModeV1, type MissionInteractionRequirementV1, type MissionPhysicalSafeguardsV1, type MissionReadinessCheckV1, type MissionRewardBindingV1, type MissionSideAdventureV1, type MissionStageCardV1, type MissionStageKindV1, type MissionV1, type ModuleAgentDefinitionV1, type ModuleAgentFeedbackV1, type ModuleAgentRoleV1, type ModuleCategoryV1, type ModuleEntitlementV1, type ModulePricingV1, type ModuleReferencePriceV1, OBSTACLE_EXPLORER_MISSION_ONE_AUTHORING_V1, PADDLE_PULSE_MISSION_ONE_AUTHORING_V1, PIXEL_TRAIL_CHALLENGE_MISSION_ONE_AUTHORING_V1, type PublishedStaticProjectSnapshotV1, RAINBOW_RESCUE_ROVER_MISSION_ONE_AUTHORING_V1, RESCUE_CREW_COMMANDER_MISSION_ONE_AUTHORING_V1, ROAD_HOPPER_RALLY_MISSION_ONE_AUTHORING_V1, ROBOT_MAZE_DASH_MISSION_ONE_AUTHORING_V1, ROBOT_MISSION_CONTROL_MISSION_ONE_AUTHORING_V1, type RobotMissionControlSafeRenderV1, SERVO_CREATURE_MISSION_ONE_AUTHORING_V1, SKYWING_SPRINT_MISSION_ONE_AUTHORING_V1, STAR_DEFENDER_SQUADRON_MISSION_ONE_AUTHORING_V1, STATIC_PROJECT_APPROVAL_STATEMENT_VERSION_V1, STATIC_PROJECT_DEFAULT_LIFETIME_DAYS_V1, STATIC_PROJECT_MAX_SOURCE_CHARACTERS_V1, STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1, STATIC_PROJECT_SAFETY_CHECK_IDS_V1, STATIC_PROJECT_SCANNER_VERSION_V1, type ScoreBandV1, type StaticProjectContractIssueV1, type StaticProjectGuardianApprovalV1, type StaticProjectModuleSlugV1, type StaticProjectPublicationV1, type StaticProjectSafeRenderV1, type StaticProjectSafetyCheckIdV1, type StaticProjectSafetyCheckV1, type StaticProjectSafetyScanV1, type StaticProjectSnapshotV1, VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1, VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1, VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1, assertValidLearningPath, assertValidMissionAuthoringBundle, assertValidStaticProjectGuardianApproval, assertValidStaticProjectPublication, assertValidStaticProjectSnapshot, calculateAssessment, validateAssessmentRubric, validateLearningPath, validateMissionAuthoringBundle, validateStaticProjectGuardianApproval, validateStaticProjectPublication, validateStaticProjectSnapshot };
|
|
736
|
+
export { ADVENTURE_MISSION_PLANNER_MISSION_ONE_AUTHORING_V1, type AdventureMissionPlannerSafeRenderV1, type AssessmentCheckResultV1, type AssessmentCriterionV1, type AssessmentDimensionV1, type AssessmentResultV1, type AssessmentRubricV1, type AttemptEvidenceV1, BEACON_BOT_MISSION_ONE_AUTHORING_V1, type BadgeDefinitionV1, CONTEXTUAL_HELP_CONTRACT_VERSION_V1, CONTEXTUAL_HELP_KINDS_V1, CONTEXTUAL_VOICE_INTENTS_V1, CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1, CREATURE_CARE_DASHBOARD_MISSION_ONE_AUTHORING_V1, type CanonicalSpokenHelpDescriptorV1, type CommercialStateV1, type ContextualHelpIdentifierV1, type ContextualHelpKindV1, type ContextualVoiceAnswerV1, type ContextualVoiceIntentV1, type ContextualVoiceQuestionMetadataV1, type ContextualVoiceQuestionResultV1, type ContextualVoiceSuggestedActionV1, type CourseMaterialAudienceV1, type CourseMaterialKindV1, type CourseMaterialV1, type CourseMaterialsManifestV1, type CreatureCareDashboardSafeRenderV1, DANCE_ROVER_MISSION_ONE_AUTHORING_V1, type FacilitatorMissionAuthoringV1, type GuardianAiConsentV1, type GuardianVoiceConsentStateV1, type GuardianVoiceConsentV1, type GuardianVoiceProcessingRouteV1, type HardwareItemV1, type HardwareModeV1, type HardwareRequirementManifestV1, type HardwareVerificationStatusV1, JUNIOR_CODER_MISSION_STAGE_ORDER_V1, JUNIOR_CODER_MODULE_PRICE_V1_1, JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1, type LearnerMissionAuthoringV1, type LearningGoalV1, type LearningModuleVersionV1, type LearningPathVersionV1, type LearningValidationIssueV1, METEOR_SHIELD_MISSION_ONE_AUTHORING_V1, MISSION_AUTHORING_CONTRACT_VERSION_V1, type MissionAccessibilityAlternativeV1, type MissionArtifactKindV1, type MissionArtifactReferenceV1, type MissionAuthoringBundleV1, type MissionAuthoringGoalV1, type MissionAuthoringValidationIssueV1, type MissionBoundedSuggestionV1, type MissionEvidenceKindV1, type MissionEvidenceRequirementV1, type MissionEvidenceRetentionV1, type MissionFunctionParameterV1, type MissionFunctionReferenceV1, type MissionHardwareAcquisitionScopeV1, type MissionHardwareComponentDisclosureV1, type MissionHardwareDisclosureV1, type MissionInteractionModeV1, type MissionInteractionRequirementV1, type MissionPhysicalSafeguardsV1, type MissionReadinessCheckV1, type MissionRewardBindingV1, type MissionSideAdventureV1, type MissionStageCardV1, type MissionStageKindV1, type MissionV1, type ModuleAgentDefinitionV1, type ModuleAgentFeedbackV1, type ModuleAgentRoleV1, type ModuleCategoryV1, type ModuleEntitlementV1, type ModulePricingV1, type ModuleReferencePriceV1, OBSTACLE_EXPLORER_MISSION_ONE_AUTHORING_V1, PADDLE_PULSE_MISSION_ONE_AUTHORING_V1, PIXEL_TRAIL_CHALLENGE_MISSION_ONE_AUTHORING_V1, type PublishedStaticProjectSnapshotV1, RAINBOW_RESCUE_ROVER_MISSION_ONE_AUTHORING_V1, RESCUE_CREW_COMMANDER_MISSION_ONE_AUTHORING_V1, ROAD_HOPPER_RALLY_MISSION_ONE_AUTHORING_V1, ROBOT_MAZE_DASH_MISSION_ONE_AUTHORING_V1, ROBOT_MISSION_CONTROL_MISSION_ONE_AUTHORING_V1, type RobotMissionControlSafeRenderV1, SERVO_CREATURE_MISSION_ONE_AUTHORING_V1, SKYWING_SPRINT_MISSION_ONE_AUTHORING_V1, STAR_DEFENDER_SQUADRON_MISSION_ONE_AUTHORING_V1, STATIC_PROJECT_APPROVAL_STATEMENT_VERSION_V1, STATIC_PROJECT_DEFAULT_LIFETIME_DAYS_V1, STATIC_PROJECT_MAX_SOURCE_CHARACTERS_V1, STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1, STATIC_PROJECT_SAFETY_CHECK_IDS_V1, STATIC_PROJECT_SCANNER_VERSION_V1, type ScoreBandV1, type StaticProjectContractIssueV1, type StaticProjectGuardianApprovalV1, type StaticProjectModuleSlugV1, type StaticProjectPublicationV1, type StaticProjectSafeRenderV1, type StaticProjectSafetyCheckIdV1, type StaticProjectSafetyCheckV1, type StaticProjectSafetyScanV1, type StaticProjectSnapshotV1, VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1, VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1, VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1, type VoiceHelpAvailabilityReasonV1, type VoiceHelpAvailabilityV1, assertValidCanonicalSpokenHelpDescriptor, assertValidContextualHelpIdentifier, assertValidContextualVoiceQuestionMetadata, assertValidContextualVoiceQuestionResult, assertValidGuardianVoiceConsent, assertValidLearningPath, assertValidMissionAuthoringBundle, assertValidStaticProjectGuardianApproval, assertValidStaticProjectPublication, assertValidStaticProjectSnapshot, assertValidVoiceHelpAvailability, calculateAssessment, validateAssessmentRubric, validateLearningPath, validateMissionAuthoringBundle, validateStaticProjectGuardianApproval, validateStaticProjectPublication, validateStaticProjectSnapshot };
|
package/dist/index.d.ts
CHANGED
|
@@ -429,6 +429,109 @@ declare const JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1: LearningPathVersionV1;
|
|
|
429
429
|
/** Current pilot catalog for server adapters that intentionally follow releases. */
|
|
430
430
|
declare const JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT: LearningPathVersionV1;
|
|
431
431
|
|
|
432
|
+
/** Additive contract version for touch-first and spoken contextual help. */
|
|
433
|
+
declare const CONTEXTUAL_HELP_CONTRACT_VERSION_V1: "1.0.0";
|
|
434
|
+
declare const CONTEXTUAL_HELP_KINDS_V1: readonly ["command", "visual-block", "generated-code", "assessment-diagnostic"];
|
|
435
|
+
type ContextualHelpKindV1 = (typeof CONTEXTUAL_HELP_KINDS_V1)[number];
|
|
436
|
+
/**
|
|
437
|
+
* Opaque, manifest-bound identifier. It contains no source, transcript,
|
|
438
|
+
* learner identity or arbitrary synthesis text.
|
|
439
|
+
*/
|
|
440
|
+
interface ContextualHelpIdentifierV1 {
|
|
441
|
+
readonly schemaVersion: "1";
|
|
442
|
+
readonly contractVersion: typeof CONTEXTUAL_HELP_CONTRACT_VERSION_V1;
|
|
443
|
+
readonly kind: ContextualHelpKindV1;
|
|
444
|
+
readonly moduleId: string;
|
|
445
|
+
readonly moduleVersion: string;
|
|
446
|
+
readonly manifestVersion: string;
|
|
447
|
+
readonly helpId: string;
|
|
448
|
+
}
|
|
449
|
+
type GuardianVoiceConsentStateV1 = "granted" | "withdrawn";
|
|
450
|
+
type GuardianVoiceProcessingRouteV1 = "private-edge-only";
|
|
451
|
+
/** Voice consent is deliberately separate from general AI consent. */
|
|
452
|
+
interface GuardianVoiceConsentV1 {
|
|
453
|
+
readonly schemaVersion: "1";
|
|
454
|
+
readonly actorAccountId: string;
|
|
455
|
+
readonly subjectAccountId: string;
|
|
456
|
+
readonly policyVersion: string;
|
|
457
|
+
readonly state: GuardianVoiceConsentStateV1;
|
|
458
|
+
readonly permittedProcessingRoute: GuardianVoiceProcessingRouteV1;
|
|
459
|
+
readonly recordedAt: string;
|
|
460
|
+
}
|
|
461
|
+
type VoiceHelpAvailabilityReasonV1 = "available" | "module-access-required" | "guardian-consent-required" | "guardian-consent-withdrawn" | "age-or-safeguarding-gate" | "capability-disabled" | "rollout-disabled" | "private-edge-unavailable";
|
|
462
|
+
/** Read-aloud and microphone availability are evaluated independently. */
|
|
463
|
+
interface VoiceHelpAvailabilityV1 {
|
|
464
|
+
readonly schemaVersion: "1";
|
|
465
|
+
readonly readAloudAvailable: boolean;
|
|
466
|
+
readonly microphoneAvailable: boolean;
|
|
467
|
+
readonly microphoneReason: VoiceHelpAvailabilityReasonV1;
|
|
468
|
+
readonly questionProcessingRoute: GuardianVoiceProcessingRouteV1;
|
|
469
|
+
readonly guardianVoiceConsentRequired: true;
|
|
470
|
+
readonly maximumRecordingDurationMs: 10_000;
|
|
471
|
+
readonly maximumAudioBytes: 2_097_152;
|
|
472
|
+
readonly rawAudioRetention: "request-memory-only";
|
|
473
|
+
readonly transcriptRetention: "request-memory-only";
|
|
474
|
+
}
|
|
475
|
+
/** Metadata accepted beside an authenticated multipart audio upload. */
|
|
476
|
+
interface ContextualVoiceQuestionMetadataV1 {
|
|
477
|
+
readonly schemaVersion: "1";
|
|
478
|
+
readonly help: ContextualHelpIdentifierV1;
|
|
479
|
+
readonly locale: string;
|
|
480
|
+
readonly mediaType: string;
|
|
481
|
+
readonly durationMs: number;
|
|
482
|
+
readonly audioBytes: number;
|
|
483
|
+
readonly assessmentEvidenceId?: string;
|
|
484
|
+
}
|
|
485
|
+
declare const CONTEXTUAL_VOICE_INTENTS_V1: readonly ["describe-command", "describe-inputs", "show-example", "explain-assessment-failure", "suggest-next-experiment", "repeat", "stop", "unresolved"];
|
|
486
|
+
type ContextualVoiceIntentV1 = (typeof CONTEXTUAL_VOICE_INTENTS_V1)[number];
|
|
487
|
+
type ContextualVoiceSuggestedActionV1 = "open-help" | "insert-example" | "show-inputs" | "show-assessment-evidence" | "try-next-experiment" | "repeat" | "stop" | "type-question";
|
|
488
|
+
declare const CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1: readonly ["open-help", "insert-example", "show-inputs", "show-assessment-evidence", "try-next-experiment", "repeat", "stop", "type-question"];
|
|
489
|
+
interface ContextualVoiceAnswerV1 {
|
|
490
|
+
readonly helpId: string;
|
|
491
|
+
readonly source: "module-documentation" | "assessment-evidence" | "authored-fallback";
|
|
492
|
+
/** Server-resolved visible answer; never a model-authored open response. */
|
|
493
|
+
readonly text: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The transcript is returned only so the learner can verify recognition. The
|
|
497
|
+
* request boundary must use no-store and discard it after the current view.
|
|
498
|
+
*/
|
|
499
|
+
interface ContextualVoiceQuestionResultV1 {
|
|
500
|
+
readonly schemaVersion: "1";
|
|
501
|
+
readonly help: ContextualHelpIdentifierV1;
|
|
502
|
+
readonly intent: ContextualVoiceIntentV1;
|
|
503
|
+
readonly status: "resolved" | "suggestions" | "stopped";
|
|
504
|
+
readonly transientTranscript: string;
|
|
505
|
+
readonly transcriptRetention: "request-memory-only";
|
|
506
|
+
readonly answer?: ContextualVoiceAnswerV1;
|
|
507
|
+
readonly suggestedActions: ContextualVoiceSuggestedActionV1[];
|
|
508
|
+
readonly mayAssignScore: false;
|
|
509
|
+
readonly mayAwardReward: false;
|
|
510
|
+
readonly mayPublish: false;
|
|
511
|
+
readonly mayControlHardware: false;
|
|
512
|
+
}
|
|
513
|
+
/** Canonical audio lookup metadata. Authoritative speech text stays server-side. */
|
|
514
|
+
interface CanonicalSpokenHelpDescriptorV1 {
|
|
515
|
+
readonly schemaVersion: "1";
|
|
516
|
+
readonly help: ContextualHelpIdentifierV1;
|
|
517
|
+
readonly canonicalTextId: string;
|
|
518
|
+
readonly authoritativeTextDigest: `sha256:${string}`;
|
|
519
|
+
readonly locale: string;
|
|
520
|
+
readonly voiceProfile: string;
|
|
521
|
+
readonly pronunciationVersion: string;
|
|
522
|
+
readonly utteranceClass: "system-generic";
|
|
523
|
+
readonly sharingScope: "global";
|
|
524
|
+
readonly reuse: "exact-only";
|
|
525
|
+
readonly containsPersonalData: false;
|
|
526
|
+
readonly containsLearnerContent: false;
|
|
527
|
+
}
|
|
528
|
+
declare function assertValidContextualHelpIdentifier(value: ContextualHelpIdentifierV1): void;
|
|
529
|
+
declare function assertValidGuardianVoiceConsent(value: GuardianVoiceConsentV1): void;
|
|
530
|
+
declare function assertValidContextualVoiceQuestionMetadata(value: ContextualVoiceQuestionMetadataV1): void;
|
|
531
|
+
declare function assertValidVoiceHelpAvailability(value: VoiceHelpAvailabilityV1): void;
|
|
532
|
+
declare function assertValidCanonicalSpokenHelpDescriptor(value: CanonicalSpokenHelpDescriptorV1): void;
|
|
533
|
+
declare function assertValidContextualVoiceQuestionResult(value: ContextualVoiceQuestionResultV1): void;
|
|
534
|
+
|
|
432
535
|
/** Versioned, infrastructure-neutral contracts for Guardian-approved static projects. */
|
|
433
536
|
declare const STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1: "1.0.0";
|
|
434
537
|
declare const STATIC_PROJECT_SCANNER_VERSION_V1: "junior-coder-static-scan-v1";
|
|
@@ -630,4 +733,4 @@ declare function validateLearningPath(path: LearningPathVersionV1): LearningVali
|
|
|
630
733
|
/** Fail fast when a path is not safe to publish or consume. */
|
|
631
734
|
declare function assertValidLearningPath(path: LearningPathVersionV1): void;
|
|
632
735
|
|
|
633
|
-
export { ADVENTURE_MISSION_PLANNER_MISSION_ONE_AUTHORING_V1, type AdventureMissionPlannerSafeRenderV1, type AssessmentCheckResultV1, type AssessmentCriterionV1, type AssessmentDimensionV1, type AssessmentResultV1, type AssessmentRubricV1, type AttemptEvidenceV1, BEACON_BOT_MISSION_ONE_AUTHORING_V1, type BadgeDefinitionV1, CREATURE_CARE_DASHBOARD_MISSION_ONE_AUTHORING_V1, type CommercialStateV1, type CourseMaterialAudienceV1, type CourseMaterialKindV1, type CourseMaterialV1, type CourseMaterialsManifestV1, type CreatureCareDashboardSafeRenderV1, DANCE_ROVER_MISSION_ONE_AUTHORING_V1, type FacilitatorMissionAuthoringV1, type GuardianAiConsentV1, type HardwareItemV1, type HardwareModeV1, type HardwareRequirementManifestV1, type HardwareVerificationStatusV1, JUNIOR_CODER_MISSION_STAGE_ORDER_V1, JUNIOR_CODER_MODULE_PRICE_V1_1, JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1, type LearnerMissionAuthoringV1, type LearningGoalV1, type LearningModuleVersionV1, type LearningPathVersionV1, type LearningValidationIssueV1, METEOR_SHIELD_MISSION_ONE_AUTHORING_V1, MISSION_AUTHORING_CONTRACT_VERSION_V1, type MissionAccessibilityAlternativeV1, type MissionArtifactKindV1, type MissionArtifactReferenceV1, type MissionAuthoringBundleV1, type MissionAuthoringGoalV1, type MissionAuthoringValidationIssueV1, type MissionBoundedSuggestionV1, type MissionEvidenceKindV1, type MissionEvidenceRequirementV1, type MissionEvidenceRetentionV1, type MissionFunctionParameterV1, type MissionFunctionReferenceV1, type MissionHardwareAcquisitionScopeV1, type MissionHardwareComponentDisclosureV1, type MissionHardwareDisclosureV1, type MissionInteractionModeV1, type MissionInteractionRequirementV1, type MissionPhysicalSafeguardsV1, type MissionReadinessCheckV1, type MissionRewardBindingV1, type MissionSideAdventureV1, type MissionStageCardV1, type MissionStageKindV1, type MissionV1, type ModuleAgentDefinitionV1, type ModuleAgentFeedbackV1, type ModuleAgentRoleV1, type ModuleCategoryV1, type ModuleEntitlementV1, type ModulePricingV1, type ModuleReferencePriceV1, OBSTACLE_EXPLORER_MISSION_ONE_AUTHORING_V1, PADDLE_PULSE_MISSION_ONE_AUTHORING_V1, PIXEL_TRAIL_CHALLENGE_MISSION_ONE_AUTHORING_V1, type PublishedStaticProjectSnapshotV1, RAINBOW_RESCUE_ROVER_MISSION_ONE_AUTHORING_V1, RESCUE_CREW_COMMANDER_MISSION_ONE_AUTHORING_V1, ROAD_HOPPER_RALLY_MISSION_ONE_AUTHORING_V1, ROBOT_MAZE_DASH_MISSION_ONE_AUTHORING_V1, ROBOT_MISSION_CONTROL_MISSION_ONE_AUTHORING_V1, type RobotMissionControlSafeRenderV1, SERVO_CREATURE_MISSION_ONE_AUTHORING_V1, SKYWING_SPRINT_MISSION_ONE_AUTHORING_V1, STAR_DEFENDER_SQUADRON_MISSION_ONE_AUTHORING_V1, STATIC_PROJECT_APPROVAL_STATEMENT_VERSION_V1, STATIC_PROJECT_DEFAULT_LIFETIME_DAYS_V1, STATIC_PROJECT_MAX_SOURCE_CHARACTERS_V1, STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1, STATIC_PROJECT_SAFETY_CHECK_IDS_V1, STATIC_PROJECT_SCANNER_VERSION_V1, type ScoreBandV1, type StaticProjectContractIssueV1, type StaticProjectGuardianApprovalV1, type StaticProjectModuleSlugV1, type StaticProjectPublicationV1, type StaticProjectSafeRenderV1, type StaticProjectSafetyCheckIdV1, type StaticProjectSafetyCheckV1, type StaticProjectSafetyScanV1, type StaticProjectSnapshotV1, VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1, VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1, VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1, assertValidLearningPath, assertValidMissionAuthoringBundle, assertValidStaticProjectGuardianApproval, assertValidStaticProjectPublication, assertValidStaticProjectSnapshot, calculateAssessment, validateAssessmentRubric, validateLearningPath, validateMissionAuthoringBundle, validateStaticProjectGuardianApproval, validateStaticProjectPublication, validateStaticProjectSnapshot };
|
|
736
|
+
export { ADVENTURE_MISSION_PLANNER_MISSION_ONE_AUTHORING_V1, type AdventureMissionPlannerSafeRenderV1, type AssessmentCheckResultV1, type AssessmentCriterionV1, type AssessmentDimensionV1, type AssessmentResultV1, type AssessmentRubricV1, type AttemptEvidenceV1, BEACON_BOT_MISSION_ONE_AUTHORING_V1, type BadgeDefinitionV1, CONTEXTUAL_HELP_CONTRACT_VERSION_V1, CONTEXTUAL_HELP_KINDS_V1, CONTEXTUAL_VOICE_INTENTS_V1, CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1, CREATURE_CARE_DASHBOARD_MISSION_ONE_AUTHORING_V1, type CanonicalSpokenHelpDescriptorV1, type CommercialStateV1, type ContextualHelpIdentifierV1, type ContextualHelpKindV1, type ContextualVoiceAnswerV1, type ContextualVoiceIntentV1, type ContextualVoiceQuestionMetadataV1, type ContextualVoiceQuestionResultV1, type ContextualVoiceSuggestedActionV1, type CourseMaterialAudienceV1, type CourseMaterialKindV1, type CourseMaterialV1, type CourseMaterialsManifestV1, type CreatureCareDashboardSafeRenderV1, DANCE_ROVER_MISSION_ONE_AUTHORING_V1, type FacilitatorMissionAuthoringV1, type GuardianAiConsentV1, type GuardianVoiceConsentStateV1, type GuardianVoiceConsentV1, type GuardianVoiceProcessingRouteV1, type HardwareItemV1, type HardwareModeV1, type HardwareRequirementManifestV1, type HardwareVerificationStatusV1, JUNIOR_CODER_MISSION_STAGE_ORDER_V1, JUNIOR_CODER_MODULE_PRICE_V1_1, JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1, JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1, type LearnerMissionAuthoringV1, type LearningGoalV1, type LearningModuleVersionV1, type LearningPathVersionV1, type LearningValidationIssueV1, METEOR_SHIELD_MISSION_ONE_AUTHORING_V1, MISSION_AUTHORING_CONTRACT_VERSION_V1, type MissionAccessibilityAlternativeV1, type MissionArtifactKindV1, type MissionArtifactReferenceV1, type MissionAuthoringBundleV1, type MissionAuthoringGoalV1, type MissionAuthoringValidationIssueV1, type MissionBoundedSuggestionV1, type MissionEvidenceKindV1, type MissionEvidenceRequirementV1, type MissionEvidenceRetentionV1, type MissionFunctionParameterV1, type MissionFunctionReferenceV1, type MissionHardwareAcquisitionScopeV1, type MissionHardwareComponentDisclosureV1, type MissionHardwareDisclosureV1, type MissionInteractionModeV1, type MissionInteractionRequirementV1, type MissionPhysicalSafeguardsV1, type MissionReadinessCheckV1, type MissionRewardBindingV1, type MissionSideAdventureV1, type MissionStageCardV1, type MissionStageKindV1, type MissionV1, type ModuleAgentDefinitionV1, type ModuleAgentFeedbackV1, type ModuleAgentRoleV1, type ModuleCategoryV1, type ModuleEntitlementV1, type ModulePricingV1, type ModuleReferencePriceV1, OBSTACLE_EXPLORER_MISSION_ONE_AUTHORING_V1, PADDLE_PULSE_MISSION_ONE_AUTHORING_V1, PIXEL_TRAIL_CHALLENGE_MISSION_ONE_AUTHORING_V1, type PublishedStaticProjectSnapshotV1, RAINBOW_RESCUE_ROVER_MISSION_ONE_AUTHORING_V1, RESCUE_CREW_COMMANDER_MISSION_ONE_AUTHORING_V1, ROAD_HOPPER_RALLY_MISSION_ONE_AUTHORING_V1, ROBOT_MAZE_DASH_MISSION_ONE_AUTHORING_V1, ROBOT_MISSION_CONTROL_MISSION_ONE_AUTHORING_V1, type RobotMissionControlSafeRenderV1, SERVO_CREATURE_MISSION_ONE_AUTHORING_V1, SKYWING_SPRINT_MISSION_ONE_AUTHORING_V1, STAR_DEFENDER_SQUADRON_MISSION_ONE_AUTHORING_V1, STATIC_PROJECT_APPROVAL_STATEMENT_VERSION_V1, STATIC_PROJECT_DEFAULT_LIFETIME_DAYS_V1, STATIC_PROJECT_MAX_SOURCE_CHARACTERS_V1, STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1, STATIC_PROJECT_SAFETY_CHECK_IDS_V1, STATIC_PROJECT_SCANNER_VERSION_V1, type ScoreBandV1, type StaticProjectContractIssueV1, type StaticProjectGuardianApprovalV1, type StaticProjectModuleSlugV1, type StaticProjectPublicationV1, type StaticProjectSafeRenderV1, type StaticProjectSafetyCheckIdV1, type StaticProjectSafetyCheckV1, type StaticProjectSafetyScanV1, type StaticProjectSnapshotV1, VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1, VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1, VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1, type VoiceHelpAvailabilityReasonV1, type VoiceHelpAvailabilityV1, assertValidCanonicalSpokenHelpDescriptor, assertValidContextualHelpIdentifier, assertValidContextualVoiceQuestionMetadata, assertValidContextualVoiceQuestionResult, assertValidGuardianVoiceConsent, assertValidLearningPath, assertValidMissionAuthoringBundle, assertValidStaticProjectGuardianApproval, assertValidStaticProjectPublication, assertValidStaticProjectSnapshot, assertValidVoiceHelpAvailability, calculateAssessment, validateAssessmentRubric, validateLearningPath, validateMissionAuthoringBundle, validateStaticProjectGuardianApproval, validateStaticProjectPublication, validateStaticProjectSnapshot };
|
package/dist/index.js
CHANGED
|
@@ -571,6 +571,164 @@ var JUNIOR_CODER_ROBOT_RESCUE_PATH_CURRENT = JUNIOR_CODER_ROBOT_RESCUE_PATH_V1_1
|
|
|
571
571
|
// src/contracts.ts
|
|
572
572
|
var MISSION_AUTHORING_CONTRACT_VERSION_V1 = "1.0.0";
|
|
573
573
|
|
|
574
|
+
// src/contextual-help.ts
|
|
575
|
+
var CONTEXTUAL_HELP_CONTRACT_VERSION_V1 = "1.0.0";
|
|
576
|
+
var CONTEXTUAL_HELP_KINDS_V1 = Object.freeze([
|
|
577
|
+
"command",
|
|
578
|
+
"visual-block",
|
|
579
|
+
"generated-code",
|
|
580
|
+
"assessment-diagnostic"
|
|
581
|
+
]);
|
|
582
|
+
var CONTEXTUAL_VOICE_INTENTS_V1 = Object.freeze([
|
|
583
|
+
"describe-command",
|
|
584
|
+
"describe-inputs",
|
|
585
|
+
"show-example",
|
|
586
|
+
"explain-assessment-failure",
|
|
587
|
+
"suggest-next-experiment",
|
|
588
|
+
"repeat",
|
|
589
|
+
"stop",
|
|
590
|
+
"unresolved"
|
|
591
|
+
]);
|
|
592
|
+
var CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1 = Object.freeze([
|
|
593
|
+
"open-help",
|
|
594
|
+
"insert-example",
|
|
595
|
+
"show-inputs",
|
|
596
|
+
"show-assessment-evidence",
|
|
597
|
+
"try-next-experiment",
|
|
598
|
+
"repeat",
|
|
599
|
+
"stop",
|
|
600
|
+
"type-question"
|
|
601
|
+
]);
|
|
602
|
+
var OPAQUE_ID = /^[a-z0-9]+(?:[._:-][a-z0-9]+)*$/u;
|
|
603
|
+
var SEMVER = /^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][A-Za-z0-9.-]+)?$/u;
|
|
604
|
+
var SHA_256 = /^sha256:[a-f0-9]{64}$/u;
|
|
605
|
+
var LOCALE = /^[a-z]{2,3}(?:-[A-Z]{2})?$/u;
|
|
606
|
+
var MEDIA_TYPE = /^audio\/[a-z0-9.+-]+$/u;
|
|
607
|
+
function containsDisallowedControlCharacter(value) {
|
|
608
|
+
return [...value].some((character) => {
|
|
609
|
+
const code = character.codePointAt(0) ?? 0;
|
|
610
|
+
return code <= 8 || code === 11 || code === 12 || code >= 14 && code <= 31 || code === 127;
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function requireOpaqueId(value, label, maximum = 160) {
|
|
614
|
+
if (value.length === 0 || value.length > maximum || !OPAQUE_ID.test(value)) {
|
|
615
|
+
throw new Error(`${label} must be a bounded opaque identifier.`);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
function requireSemver(value, label) {
|
|
619
|
+
if (!SEMVER.test(value)) {
|
|
620
|
+
throw new Error(`${label} must be an immutable semantic version.`);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
function requireIsoTimestamp(value, label) {
|
|
624
|
+
if (!/^\d{4}-\d{2}-\d{2}T/u.test(value) || !Number.isFinite(Date.parse(value))) {
|
|
625
|
+
throw new Error(`${label} must be an ISO-8601 timestamp.`);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
function assertValidContextualHelpIdentifier(value) {
|
|
629
|
+
if (value.schemaVersion !== "1") {
|
|
630
|
+
throw new Error("schemaVersion must be 1.");
|
|
631
|
+
}
|
|
632
|
+
if (value.contractVersion !== CONTEXTUAL_HELP_CONTRACT_VERSION_V1) {
|
|
633
|
+
throw new Error("contractVersion is unsupported.");
|
|
634
|
+
}
|
|
635
|
+
if (!CONTEXTUAL_HELP_KINDS_V1.includes(value.kind)) {
|
|
636
|
+
throw new Error("kind is unsupported.");
|
|
637
|
+
}
|
|
638
|
+
requireOpaqueId(value.moduleId, "moduleId");
|
|
639
|
+
requireSemver(value.moduleVersion, "moduleVersion");
|
|
640
|
+
requireSemver(value.manifestVersion, "manifestVersion");
|
|
641
|
+
requireOpaqueId(value.helpId, "helpId");
|
|
642
|
+
}
|
|
643
|
+
function assertValidGuardianVoiceConsent(value) {
|
|
644
|
+
if (value.schemaVersion !== "1") {
|
|
645
|
+
throw new Error("schemaVersion must be 1.");
|
|
646
|
+
}
|
|
647
|
+
requireOpaqueId(value.actorAccountId, "actorAccountId");
|
|
648
|
+
requireOpaqueId(value.subjectAccountId, "subjectAccountId");
|
|
649
|
+
requireSemver(value.policyVersion, "policyVersion");
|
|
650
|
+
if (value.state !== "granted" && value.state !== "withdrawn") {
|
|
651
|
+
throw new Error("state must be granted or withdrawn.");
|
|
652
|
+
}
|
|
653
|
+
if (value.permittedProcessingRoute !== "private-edge-only") {
|
|
654
|
+
throw new Error("permittedProcessingRoute must be private-edge-only.");
|
|
655
|
+
}
|
|
656
|
+
requireIsoTimestamp(value.recordedAt, "recordedAt");
|
|
657
|
+
}
|
|
658
|
+
function assertValidContextualVoiceQuestionMetadata(value) {
|
|
659
|
+
assertValidContextualHelpIdentifier(value.help);
|
|
660
|
+
if (!LOCALE.test(value.locale)) throw new Error("locale is invalid.");
|
|
661
|
+
if (!MEDIA_TYPE.test(value.mediaType)) throw new Error("mediaType is invalid.");
|
|
662
|
+
if (!Number.isInteger(value.durationMs) || value.durationMs < 1 || value.durationMs > 1e4) {
|
|
663
|
+
throw new Error("durationMs must be between 1 and 10000.");
|
|
664
|
+
}
|
|
665
|
+
if (!Number.isInteger(value.audioBytes) || value.audioBytes < 1 || value.audioBytes > 2097152) {
|
|
666
|
+
throw new Error("audioBytes must be between 1 and 2097152.");
|
|
667
|
+
}
|
|
668
|
+
if (value.assessmentEvidenceId !== void 0) {
|
|
669
|
+
requireOpaqueId(value.assessmentEvidenceId, "assessmentEvidenceId");
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
function assertValidVoiceHelpAvailability(value) {
|
|
673
|
+
if (value.schemaVersion !== "1") throw new Error("schemaVersion must be 1.");
|
|
674
|
+
if (value.questionProcessingRoute !== "private-edge-only") {
|
|
675
|
+
throw new Error("questionProcessingRoute must be private-edge-only.");
|
|
676
|
+
}
|
|
677
|
+
if (value.guardianVoiceConsentRequired !== true) {
|
|
678
|
+
throw new Error("guardianVoiceConsentRequired must remain true.");
|
|
679
|
+
}
|
|
680
|
+
if (value.maximumRecordingDurationMs !== 1e4 || value.maximumAudioBytes !== 2097152 || value.rawAudioRetention !== "request-memory-only" || value.transcriptRetention !== "request-memory-only") {
|
|
681
|
+
throw new Error("Voice limits and transient retention are immutable in version one.");
|
|
682
|
+
}
|
|
683
|
+
if (value.microphoneAvailable !== (value.microphoneReason === "available")) {
|
|
684
|
+
throw new Error("microphoneReason must match microphone availability.");
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
function assertValidCanonicalSpokenHelpDescriptor(value) {
|
|
688
|
+
if (value.schemaVersion !== "1") throw new Error("schemaVersion must be 1.");
|
|
689
|
+
assertValidContextualHelpIdentifier(value.help);
|
|
690
|
+
requireOpaqueId(value.canonicalTextId, "canonicalTextId");
|
|
691
|
+
if (!SHA_256.test(value.authoritativeTextDigest)) {
|
|
692
|
+
throw new Error("authoritativeTextDigest must be a SHA-256 digest.");
|
|
693
|
+
}
|
|
694
|
+
if (!LOCALE.test(value.locale)) throw new Error("locale is invalid.");
|
|
695
|
+
requireOpaqueId(value.voiceProfile, "voiceProfile");
|
|
696
|
+
requireSemver(value.pronunciationVersion, "pronunciationVersion");
|
|
697
|
+
if (value.utteranceClass !== "system-generic" || value.sharingScope !== "global" || value.reuse !== "exact-only" || value.containsPersonalData !== false || value.containsLearnerContent !== false) {
|
|
698
|
+
throw new Error("Canonical spoken help must use global system-generic exact-only reuse.");
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function assertValidContextualVoiceQuestionResult(value) {
|
|
702
|
+
if (value.schemaVersion !== "1") throw new Error("schemaVersion must be 1.");
|
|
703
|
+
assertValidContextualHelpIdentifier(value.help);
|
|
704
|
+
if (!CONTEXTUAL_VOICE_INTENTS_V1.includes(value.intent)) {
|
|
705
|
+
throw new Error("intent is unsupported.");
|
|
706
|
+
}
|
|
707
|
+
if (value.transcriptRetention !== "request-memory-only") {
|
|
708
|
+
throw new Error("transcriptRetention must be request-memory-only.");
|
|
709
|
+
}
|
|
710
|
+
if (value.status !== "resolved" && value.status !== "suggestions" && value.status !== "stopped") {
|
|
711
|
+
throw new Error("status is unsupported.");
|
|
712
|
+
}
|
|
713
|
+
if (value.transientTranscript.length > 500 || containsDisallowedControlCharacter(value.transientTranscript)) {
|
|
714
|
+
throw new Error("transientTranscript is invalid.");
|
|
715
|
+
}
|
|
716
|
+
if (value.answer) {
|
|
717
|
+
requireOpaqueId(value.answer.helpId, "answer.helpId");
|
|
718
|
+
if (value.answer.source !== "module-documentation" && value.answer.source !== "assessment-evidence" && value.answer.source !== "authored-fallback" || value.answer.text.length === 0 || value.answer.text.length > 800 || containsDisallowedControlCharacter(value.answer.text)) {
|
|
719
|
+
throw new Error("answer.text is invalid.");
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
if (value.suggestedActions.some(
|
|
723
|
+
(action) => !CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1.includes(action)
|
|
724
|
+
)) {
|
|
725
|
+
throw new Error("suggestedActions contains an unsupported action.");
|
|
726
|
+
}
|
|
727
|
+
if (value.mayAssignScore !== false || value.mayAwardReward !== false || value.mayPublish !== false || value.mayControlHardware !== false) {
|
|
728
|
+
throw new Error("mayAssignScore, reward, publish and hardware authority must remain false.");
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
574
732
|
// src/publishing.ts
|
|
575
733
|
var STATIC_PROJECT_PUBLISHING_CONTRACT_VERSION_V1 = "1.0.0";
|
|
576
734
|
var STATIC_PROJECT_SCANNER_VERSION_V1 = "junior-coder-static-scan-v1";
|
|
@@ -6759,6 +6917,10 @@ ${summary}`);
|
|
|
6759
6917
|
export {
|
|
6760
6918
|
ADVENTURE_MISSION_PLANNER_MISSION_ONE_AUTHORING_V1,
|
|
6761
6919
|
BEACON_BOT_MISSION_ONE_AUTHORING_V1,
|
|
6920
|
+
CONTEXTUAL_HELP_CONTRACT_VERSION_V1,
|
|
6921
|
+
CONTEXTUAL_HELP_KINDS_V1,
|
|
6922
|
+
CONTEXTUAL_VOICE_INTENTS_V1,
|
|
6923
|
+
CONTEXTUAL_VOICE_SUGGESTED_ACTIONS_V1,
|
|
6762
6924
|
CREATURE_CARE_DASHBOARD_MISSION_ONE_AUTHORING_V1,
|
|
6763
6925
|
DANCE_ROVER_MISSION_ONE_AUTHORING_V1,
|
|
6764
6926
|
JUNIOR_CODER_MISSION_STAGE_ORDER_V1,
|
|
@@ -6788,11 +6950,17 @@ export {
|
|
|
6788
6950
|
VIBE_BUG_DETECTIVE_MISSION_ONE_AUTHORING_V1,
|
|
6789
6951
|
VIBE_GAME_REMIX_LAB_MISSION_ONE_AUTHORING_V1,
|
|
6790
6952
|
VIBE_IDEA_STUDIO_MISSION_ONE_AUTHORING_V1,
|
|
6953
|
+
assertValidCanonicalSpokenHelpDescriptor,
|
|
6954
|
+
assertValidContextualHelpIdentifier,
|
|
6955
|
+
assertValidContextualVoiceQuestionMetadata,
|
|
6956
|
+
assertValidContextualVoiceQuestionResult,
|
|
6957
|
+
assertValidGuardianVoiceConsent,
|
|
6791
6958
|
assertValidLearningPath,
|
|
6792
6959
|
assertValidMissionAuthoringBundle,
|
|
6793
6960
|
assertValidStaticProjectGuardianApproval,
|
|
6794
6961
|
assertValidStaticProjectPublication,
|
|
6795
6962
|
assertValidStaticProjectSnapshot,
|
|
6963
|
+
assertValidVoiceHelpAvailability,
|
|
6796
6964
|
calculateAssessment,
|
|
6797
6965
|
validateAssessmentRubric,
|
|
6798
6966
|
validateLearningPath,
|