percolation-inversion-compiler-ts 0.4.4
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/LICENSE +152 -0
- package/NOTICE +21 -0
- package/README.md +255 -0
- package/dist/agent/messages.d.ts +23 -0
- package/dist/agent/messages.js +457 -0
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +2646 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +983 -0
- package/dist/io/schema.d.ts +16 -0
- package/dist/io/schema.js +153 -0
- package/dist/packet/index.d.ts +10 -0
- package/dist/packet/index.js +385 -0
- package/fixtures/portability_conformance/README.md +17 -0
- package/fixtures/portability_conformance/agent_check_report.json +1251 -0
- package/fixtures/portability_conformance/agent_intake_report.json +1169 -0
- package/fixtures/portability_conformance/agent_message_delivery_report.json +124 -0
- package/fixtures/portability_conformance/agent_relay_readiness_report.json +40 -0
- package/fixtures/portability_conformance/alt_admission_decision.json +16 -0
- package/fixtures/portability_conformance/bottleneck_witness_report.json +23 -0
- package/fixtures/portability_conformance/collective_phase_certificate.json +330 -0
- package/fixtures/portability_conformance/frontier_debt_report.json +24 -0
- package/fixtures/portability_conformance/manifest.json +113 -0
- package/fixtures/portability_conformance/negative/checksum_mismatch.json +4 -0
- package/fixtures/portability_conformance/negative/schema_invalid_agent_check.json +3 -0
- package/fixtures/portability_conformance/negative/unknown_schema.json +3 -0
- package/fixtures/portability_conformance/phase_acceleration_benchmark_report.json +21 -0
- package/fixtures/portability_conformance/phase_acceleration_plan.json +72 -0
- package/fixtures/portability_conformance/phase_control_audit_summary.json +16 -0
- package/fixtures/portability_conformance/relay_inbox.json +37 -0
- package/fixtures/portability_conformance/runtime_step_report.json +1384 -0
- package/fixtures/portability_conformance/salience_schedule_report.json +100 -0
- package/fixtures/portability_conformance/theory_fidelity_report.json +53 -0
- package/fixtures/portability_conformance/value_bridge_report.json +17 -0
- package/fixtures/python_v044_cli/adoption_packet.json +131 -0
- package/fixtures/python_v044_cli/adoption_request.json +60 -0
- package/fixtures/python_v044_cli/agent_autonomy_audit.json +254 -0
- package/fixtures/python_v044_cli/agent_check_compact.json +80 -0
- package/fixtures/python_v044_cli/agent_check_full.json +1265 -0
- package/fixtures/python_v044_cli/agent_communication_guide.json +426 -0
- package/fixtures/python_v044_cli/agent_intake.json +1175 -0
- package/fixtures/python_v044_cli/agent_manifest.json +373 -0
- package/fixtures/python_v044_cli/agent_runbook.json +115 -0
- package/fixtures/python_v044_cli/demo_installed_smoke.json +1367 -0
- package/fixtures/python_v044_cli/doctor_development.json +264 -0
- package/fixtures/python_v044_cli/identity_explain_profile_production.json +39 -0
- package/fixtures/python_v044_cli/phase_benchmark.json +42 -0
- package/fixtures/python_v044_cli/phase_benchmark_suite.json +428 -0
- package/fixtures/python_v044_cli/phase_dashboard.json +173 -0
- package/fixtures/python_v044_cli/phase_gap.json +119 -0
- package/fixtures/python_v044_cli/phase_observe.json +203 -0
- package/fixtures/python_v044_cli/phase_plan_compact.json +384 -0
- package/fixtures/python_v044_cli/phase_plan_full.json +2020 -0
- package/fixtures/python_v044_cli/phase_runbook.json +66 -0
- package/fixtures/python_v044_cli/routes_bindings.json +716 -0
- package/fixtures/python_v044_cli/routes_explain_replay_trc_physical_trace.json +57 -0
- package/fixtures/python_v044_cli/runtime_step_demo.json +1384 -0
- package/fixtures/python_v044_cli/snapshot_list.json +112 -0
- package/fixtures/python_v044_cli/snapshot_routes.json +926 -0
- package/fixtures/python_v044_cli/snapshot_show_alt.json +6830 -0
- package/fixtures/python_v044_cli/snapshot_show_bit.json +594 -0
- package/fixtures/python_v044_cli/snapshot_show_ecpt.json +2894 -0
- package/fixtures/python_v044_cli/snapshot_show_sqot.json +2392 -0
- package/fixtures/python_v044_cli/snapshot_show_trc.json +3037 -0
- package/fixtures/python_v044_cli/snapshot_verify_alt.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_bit.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_ecpt.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_sqot.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_trc.json +10 -0
- package/fixtures/python_v044_demo/agent_inbox.json +26 -0
- package/fixtures/python_v044_demo/agent_message.json +19 -0
- package/fixtures/python_v044_demo/agent_output.txt +1 -0
- package/fixtures/python_v044_demo/alt_admission_packet.json +208 -0
- package/fixtures/python_v044_demo/asi_proxy_phase_request.json +47 -0
- package/fixtures/python_v044_demo/general_intake_policy.json +58 -0
- package/fixtures/python_v044_demo/manifest.json +78 -0
- package/fixtures/python_v044_demo/packet_envelope.json +1463 -0
- package/fixtures/python_v044_demo/phase_dashboard.json +175 -0
- package/fixtures/python_v044_demo/runtime_state.json +143 -0
- package/fixtures/python_v044_demo/runtime_step_input.json +8 -0
- package/fixtures/python_v044_demo/runtime_step_report.json +1384 -0
- package/fixtures/python_v044_snapshots/alt.json +6830 -0
- package/fixtures/python_v044_snapshots/bit.json +543 -0
- package/fixtures/python_v044_snapshots/ecpt.json +2741 -0
- package/fixtures/python_v044_snapshots/sqot.json +2134 -0
- package/fixtures/python_v044_snapshots/trc.json +2880 -0
- package/package.json +129 -0
- package/schemas/ALTAccelerationCertificate.schema.json +169 -0
- package/schemas/ALTAdmissionDecision.schema.json +199 -0
- package/schemas/ALTCARACertificate.schema.json +285 -0
- package/schemas/ALTDeprecationRecord.schema.json +171 -0
- package/schemas/ALTKernelTransitionReport.schema.json +185 -0
- package/schemas/ALTResurrectionRecord.schema.json +171 -0
- package/schemas/ASIProxyTargetContract.schema.json +52 -0
- package/schemas/AbstractionToken.schema.json +281 -0
- package/schemas/AccelerationCertificate.schema.json +225 -0
- package/schemas/AccelerationExperimentSuite.schema.json +3731 -0
- package/schemas/AcceptedPacketPath.schema.json +148 -0
- package/schemas/ActionCommit.schema.json +67 -0
- package/schemas/ActionGrammar.schema.json +36 -0
- package/schemas/ActionabilityVector.schema.json +33 -0
- package/schemas/ActivationThresholdCertificate.schema.json +185 -0
- package/schemas/AdapterRouteSpec.schema.json +110 -0
- package/schemas/AdoptionFirstRunCommand.schema.json +44 -0
- package/schemas/AdoptionReviewChecklist.schema.json +36 -0
- package/schemas/AdoptionSafetyBoundary.schema.json +104 -0
- package/schemas/AgentAutonomyAuditReport.schema.json +213 -0
- package/schemas/AgentCheckReport.schema.json +3494 -0
- package/schemas/AgentCommandInvocation.schema.json +63 -0
- package/schemas/AgentCommunicationGuide.schema.json +213 -0
- package/schemas/AgentCommunicationPolicy.schema.json +73 -0
- package/schemas/AgentCommunicationStep.schema.json +85 -0
- package/schemas/AgentConnectorSpec.schema.json +89 -0
- package/schemas/AgentFeatureReadinessReport.schema.json +206 -0
- package/schemas/AgentIdentityAttestation.schema.json +99 -0
- package/schemas/AgentIdentityCheckReport.schema.json +225 -0
- package/schemas/AgentInboxRecord.schema.json +319 -0
- package/schemas/AgentIntakeReport.schema.json +3373 -0
- package/schemas/AgentIntakeRequest.schema.json +2250 -0
- package/schemas/AgentMessageContractReport.schema.json +195 -0
- package/schemas/AgentMessageDeliveryReport.schema.json +630 -0
- package/schemas/AgentMessageEnvelope.schema.json +201 -0
- package/schemas/AgentMessageNonceLedger.schema.json +45 -0
- package/schemas/AgentMessageVerificationContext.schema.json +60 -0
- package/schemas/AgentNetworkReadinessReport.schema.json +109 -0
- package/schemas/AgentNextActionReport.schema.json +83 -0
- package/schemas/AgentPacketExchangeReport.schema.json +519 -0
- package/schemas/AgentPeerRecord.schema.json +85 -0
- package/schemas/AgentPolicyIdentity.schema.json +79 -0
- package/schemas/AgentPopulationState.schema.json +2523 -0
- package/schemas/AgentRelayReadinessReport.schema.json +125 -0
- package/schemas/AgentRunbookReport.schema.json +100 -0
- package/schemas/AgentRuntimeConfig.schema.json +78 -0
- package/schemas/AgentTask.schema.json +101 -0
- package/schemas/AgentToOperatorRequest.schema.json +222 -0
- package/schemas/AgentWorkflowGuide.schema.json +128 -0
- package/schemas/AgentWorkflowStep.schema.json +59 -0
- package/schemas/AlgebraLawCertificate.schema.json +101 -0
- package/schemas/AttestationRecord.schema.json +63 -0
- package/schemas/AutocatalyticClosureWitness.schema.json +187 -0
- package/schemas/BaselineRefreshCertificate.schema.json +178 -0
- package/schemas/BasinReachabilityReport.schema.json +244 -0
- package/schemas/BottleneckCandidate.schema.json +105 -0
- package/schemas/BottleneckIntervention.schema.json +157 -0
- package/schemas/BottleneckInversionPlan.schema.json +212 -0
- package/schemas/BottleneckWitnessReport.schema.json +128 -0
- package/schemas/BoundaryGeneratorRecord.schema.json +57 -0
- package/schemas/BoundaryScriptRecord.schema.json +30 -0
- package/schemas/BudgetedToleranceScheduler.schema.json +59 -0
- package/schemas/CalibrationCertificate.schema.json +252 -0
- package/schemas/CanonicalImplementationReadinessReport.schema.json +298 -0
- package/schemas/CanonicalManifest.schema.json +80 -0
- package/schemas/CanonicalManifestRecord.schema.json +54 -0
- package/schemas/CanonicalTheorySnapshotSummary.schema.json +102 -0
- package/schemas/CapabilityBasinContract.schema.json +59 -0
- package/schemas/CapabilityPacketCandidate.schema.json +247 -0
- package/schemas/CapabilityPacketRegistry.schema.json +442 -0
- package/schemas/CapabilityStateVector.schema.json +169 -0
- package/schemas/CascadeResidualPotential.schema.json +32 -0
- package/schemas/CertificateCompilerRecord.schema.json +81 -0
- package/schemas/CertificateFamily.schema.json +376 -0
- package/schemas/CertificateRoute.schema.json +128 -0
- package/schemas/CertifiedAbstractionCapital.schema.json +161 -0
- package/schemas/CheckResult.schema.json +369 -0
- package/schemas/CheckerContext.schema.json +255 -0
- package/schemas/ClosedLoopAgentIteration.schema.json +1045 -0
- package/schemas/CollectivePhaseCertificate.schema.json +1377 -0
- package/schemas/CommercialReadinessSummary.schema.json +134 -0
- package/schemas/ConfidenceLedger.schema.json +26 -0
- package/schemas/ContentAddressedEvidenceRef.schema.json +48 -0
- package/schemas/ControlledTransition.schema.json +90 -0
- package/schemas/CryptographicAgentIdentity.schema.json +192 -0
- package/schemas/DKWCertificate.schema.json +31 -0
- package/schemas/DiagnosticReservePolicy.schema.json +22 -0
- package/schemas/DischargeRouteBinding.schema.json +93 -0
- package/schemas/DomainTypedSemiring.schema.json +55 -0
- package/schemas/DominanceWitness.schema.json +31 -0
- package/schemas/EProcessCertificate.schema.json +22 -0
- package/schemas/EdgeRelationVerificationReport.schema.json +161 -0
- package/schemas/EdgeRelationVerifierSpec.schema.json +62 -0
- package/schemas/EdgeWitness.schema.json +73 -0
- package/schemas/EdgeWitnessCertificate.schema.json +192 -0
- package/schemas/EvidenceArtifact.schema.json +112 -0
- package/schemas/EvidenceEnvelopeStoreRecord.schema.json +100 -0
- package/schemas/EvidencePolicy.schema.json +57 -0
- package/schemas/EvidenceResolutionBatch.schema.json +347 -0
- package/schemas/EvidenceVerificationProfile.schema.json +74 -0
- package/schemas/ExecutableALTCertificatePacket.schema.json +1512 -0
- package/schemas/ExecutableTraceNormalForm.schema.json +659 -0
- package/schemas/ExecutionAvailablePathCertificate.schema.json +204 -0
- package/schemas/ExternalCandidateClassification.schema.json +10 -0
- package/schemas/ExternalObligationCatalog.schema.json +238 -0
- package/schemas/ExternalVerifierHook.schema.json +174 -0
- package/schemas/FiniteOrder.schema.json +34 -0
- package/schemas/FinitePhaseControlCertificate.schema.json +100 -0
- package/schemas/FiniteTraceLaw.schema.json +30 -0
- package/schemas/FixedPopulationLedger.schema.json +255 -0
- package/schemas/FormationCostLedger.schema.json +91 -0
- package/schemas/FoundryControlDashboard.schema.json +198 -0
- package/schemas/FoundryState.schema.json +1819 -0
- package/schemas/FrontierDebtReport.schema.json +115 -0
- package/schemas/FunctorLawCertificate.schema.json +82 -0
- package/schemas/FusedGeometricComparisonCertificate.schema.json +79 -0
- package/schemas/FutureFreedomVector.schema.json +84 -0
- package/schemas/GeneralIntakePolicy.schema.json +255 -0
- package/schemas/GeneralIntakePolicyDecision.schema.json +85 -0
- package/schemas/GeneralIntakeProfile.schema.json +11 -0
- package/schemas/GeneralIntakeReport.schema.json +861 -0
- package/schemas/GeneralIntakeRuntimeBridgeReport.schema.json +761 -0
- package/schemas/GeneralIntakeSource.schema.json +57 -0
- package/schemas/GoodTuringCertificate.schema.json +27 -0
- package/schemas/HazardEnvelopeCertificate.schema.json +192 -0
- package/schemas/HiddenCapabilityInjectionReport.schema.json +212 -0
- package/schemas/IdentityContributionStatus.schema.json +11 -0
- package/schemas/IdentityTrustProfile.schema.json +12 -0
- package/schemas/ImplementationMaturity.schema.json +27 -0
- package/schemas/IndependenceCertificate.schema.json +42 -0
- package/schemas/InnerViabilityKernel.schema.json +45 -0
- package/schemas/IntakeProvenanceRecord.schema.json +192 -0
- package/schemas/InterventionCandidate.schema.json +266 -0
- package/schemas/Judgment.schema.json +351 -0
- package/schemas/LatticeWitness.schema.json +63 -0
- package/schemas/LedgerCoordinate.schema.json +79 -0
- package/schemas/LifecycleCostBounds.schema.json +65 -0
- package/schemas/LiquidityCertificate.schema.json +1094 -0
- package/schemas/MartingaleBlockResidual.schema.json +32 -0
- package/schemas/MartingaleDeficiencyCertificate.schema.json +76 -0
- package/schemas/MechanismCubeCertificate.schema.json +92 -0
- package/schemas/MissionValidityCertificate.schema.json +153 -0
- package/schemas/MonoidRecord.schema.json +30 -0
- package/schemas/MonotoneMap.schema.json +61 -0
- package/schemas/NegativeLiquidityCertificate.schema.json +176 -0
- package/schemas/NonPromotionPolicy.schema.json +39 -0
- package/schemas/ObligationRule.schema.json +54 -0
- package/schemas/ObligationSet.schema.json +230 -0
- package/schemas/ObligationTrace.schema.json +156 -0
- package/schemas/ObservationWindow.schema.json +48 -0
- package/schemas/ObservedTraceProjection.schema.json +57 -0
- package/schemas/OccupationLedger.schema.json +33 -0
- package/schemas/OperationalCheck.schema.json +29 -0
- package/schemas/OperationalReadinessReport.schema.json +216 -0
- package/schemas/OperatorAdoptionPacket.schema.json +303 -0
- package/schemas/OpportunityMeasureContract.schema.json +165 -0
- package/schemas/OrderedPotentialCone.schema.json +125 -0
- package/schemas/PacketCapitalLineage.schema.json +90 -0
- package/schemas/PacketExchangeEnvelope.schema.json +213 -0
- package/schemas/PacketImportInspectionReport.schema.json +68 -0
- package/schemas/PacketIngestionReport.schema.json +655 -0
- package/schemas/PacketLineageDigest.schema.json +70 -0
- package/schemas/PacketMergeReport.schema.json +286 -0
- package/schemas/PacketPromotionPolicy.schema.json +47 -0
- package/schemas/PacketPromotionReport.schema.json +354 -0
- package/schemas/PacketRejection.schema.json +158 -0
- package/schemas/PhaseAccelerationBenchmarkReport.schema.json +103 -0
- package/schemas/PhaseAccelerationPlan.schema.json +4449 -0
- package/schemas/PhaseAccelerationRequest.schema.json +5333 -0
- package/schemas/PhaseAccelerationScore.schema.json +66 -0
- package/schemas/PhaseBenchmarkCaseResult.schema.json +164 -0
- package/schemas/PhaseBenchmarkSuiteReport.schema.json +234 -0
- package/schemas/PhaseBenchmarkTask.schema.json +36 -0
- package/schemas/PhaseComponentGap.schema.json +46 -0
- package/schemas/PhaseControlAction.schema.json +80 -0
- package/schemas/PhaseControlAuditSummary.schema.json +143 -0
- package/schemas/PhaseControlEnvelope.schema.json +53 -0
- package/schemas/PhaseControlObjective.schema.json +98 -0
- package/schemas/PhaseControlPlan.schema.json +377 -0
- package/schemas/PhaseControlRunReport.schema.json +425 -0
- package/schemas/PhaseControlState.schema.json +383 -0
- package/schemas/PhaseDashboardReport.schema.json +249 -0
- package/schemas/PhaseGapVector.schema.json +101 -0
- package/schemas/PhaseObservationReport.schema.json +321 -0
- package/schemas/PhaseTrajectoryReport.schema.json +4522 -0
- package/schemas/PopulationRuntimeStepReport.schema.json +5125 -0
- package/schemas/PortabilityConformanceReport.schema.json +99 -0
- package/schemas/PortabilitySchemaBundle.schema.json +23 -0
- package/schemas/ProblemSolvingTrace.schema.json +162 -0
- package/schemas/ProcessGrammarRecord.schema.json +56 -0
- package/schemas/ProductOrder.schema.json +53 -0
- package/schemas/ProductionReadinessProfile.schema.json +37 -0
- package/schemas/ProjectionAudit.schema.json +70 -0
- package/schemas/ProofObligation.schema.json +200 -0
- package/schemas/ProtocolFrameDigest.schema.json +79 -0
- package/schemas/ProtocolFunctorCertificate.schema.json +89 -0
- package/schemas/ProtocolObject.schema.json +45 -0
- package/schemas/ProtocolRelativeBenchmarkMetric.schema.json +39 -0
- package/schemas/ProvenanceManifest.schema.json +221 -0
- package/schemas/ProvenanceManifestEntry.schema.json +29 -0
- package/schemas/PsiDashboard.schema.json +213 -0
- package/schemas/PullbackGluingWitness.schema.json +43 -0
- package/schemas/QuarantineLedger.schema.json +31 -0
- package/schemas/ReachableMassRecursionCertificate.schema.json +129 -0
- package/schemas/ReconstructionResidual.schema.json +24 -0
- package/schemas/RefreshRule.schema.json +31 -0
- package/schemas/Registry.schema.json +231 -0
- package/schemas/ReleaseArtifactManifest.schema.json +62 -0
- package/schemas/ReproductionMatrixCertificate.schema.json +190 -0
- package/schemas/ResidualCarryForwardReport.schema.json +57 -0
- package/schemas/ResourceCalendarRecord.schema.json +67 -0
- package/schemas/ResourceEnvelope.schema.json +42 -0
- package/schemas/ResourceMatchedBaselineConfig.schema.json +81 -0
- package/schemas/RiskBudgetLedger.schema.json +19 -0
- package/schemas/RobotsDecision.schema.json +44 -0
- package/schemas/RootFinalityCertificate.schema.json +190 -0
- package/schemas/RouteExecutionBatch.schema.json +930 -0
- package/schemas/RouteExecutionRequest.schema.json +87 -0
- package/schemas/RuntimeActionResult.schema.json +807 -0
- package/schemas/RuntimeComparisonReport.schema.json +3670 -0
- package/schemas/RuntimeEvent.schema.json +142 -0
- package/schemas/RuntimeEventLog.schema.json +161 -0
- package/schemas/RuntimeExecutionReport.schema.json +872 -0
- package/schemas/RuntimeExecutorPolicy.schema.json +68 -0
- package/schemas/RuntimeHealthReport.schema.json +161 -0
- package/schemas/RuntimeIdentityContext.schema.json +480 -0
- package/schemas/RuntimeRunReport.schema.json +3487 -0
- package/schemas/RuntimeServiceSettings.schema.json +55 -0
- package/schemas/RuntimeState.schema.json +1438 -0
- package/schemas/RuntimeStepInput.schema.json +685 -0
- package/schemas/RuntimeStepReport.schema.json +3314 -0
- package/schemas/RuntimeStoreRecord.schema.json +106 -0
- package/schemas/RuntimeStoreSnapshot.schema.json +4815 -0
- package/schemas/SBOMManifest.schema.json +67 -0
- package/schemas/SQOTTheorySnapshot.schema.json +49 -0
- package/schemas/SafePhaseAction.schema.json +96 -0
- package/schemas/SalienceQueueRecord.schema.json +313 -0
- package/schemas/SalienceScheduleReport.schema.json +434 -0
- package/schemas/SalienceSchedulingDecision.schema.json +167 -0
- package/schemas/SchemaBundleDigest.schema.json +57 -0
- package/schemas/ScriptGroundMetricCertificate.schema.json +47 -0
- package/schemas/SelectiveCUPCertificate.schema.json +414 -0
- package/schemas/SettlementReturnRAFCertificate.schema.json +122 -0
- package/schemas/SinkhornCertificate.schema.json +55 -0
- package/schemas/SnapshotAttribution.schema.json +63 -0
- package/schemas/SnapshotCatalog.schema.json +481 -0
- package/schemas/SplitCertificate.schema.json +39 -0
- package/schemas/StatusAlgebraRecord.schema.json +37 -0
- package/schemas/StoppedEvidenceSheafCertificate.schema.json +120 -0
- package/schemas/StrictTexParseReport.schema.json +67 -0
- package/schemas/SybilResistanceLedger.schema.json +427 -0
- package/schemas/SybilResistancePolicy.schema.json +176 -0
- package/schemas/TRCCompileResult.schema.json +239 -0
- package/schemas/TRCStateRecord.schema.json +149 -0
- package/schemas/TelemetryCostCertificate.schema.json +171 -0
- package/schemas/TexGrammarDiagnostic.schema.json +39 -0
- package/schemas/TheoryAuditReport.schema.json +654 -0
- package/schemas/TheoryAuditSuiteReport.schema.json +775 -0
- package/schemas/TheoryFidelityReport.schema.json +100 -0
- package/schemas/TheoryImplementationRecord.schema.json +203 -0
- package/schemas/TheorySnapshot.schema.json +459 -0
- package/schemas/TheorySnapshotItem.schema.json +60 -0
- package/schemas/TokenLineage.schema.json +76 -0
- package/schemas/ToleranceAllocationCertificate.schema.json +62 -0
- package/schemas/TraceNormalizationCertificate.schema.json +77 -0
- package/schemas/TraceSufficiencyCertificate.schema.json +166 -0
- package/schemas/TransportCertificate.schema.json +178 -0
- package/schemas/TypedTraceTransducerRecord.schema.json +64 -0
- package/schemas/ValueBridgeReport.schema.json +131 -0
- package/schemas/VectorCompatibleFamily.schema.json +354 -0
- package/schemas/VerificationThroughputReport.schema.json +62 -0
- package/schemas/VerifiedCapabilityPacket.schema.json +251 -0
- package/schemas/VerifierEvidenceEnvelope.schema.json +178 -0
- package/schemas/VerifierResolution.schema.json +275 -0
- package/schemas/WebDiscoveryReport.schema.json +675 -0
- package/schemas/WebFetchPolicy.schema.json +145 -0
- package/schemas/WebFetchReport.schema.json +133 -0
- package/schemas/bundle.schema.json +100808 -0
- package/schemas/schema-digest.json +1674 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
// src/agent/messages.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
4
|
+
import { dirname as dirname2 } from "path";
|
|
5
|
+
|
|
6
|
+
// src/core/json.ts
|
|
7
|
+
function sortJson(value) {
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
return value.map((item) => sortJson(item));
|
|
10
|
+
}
|
|
11
|
+
if (value && typeof value === "object") {
|
|
12
|
+
const input = value;
|
|
13
|
+
const output = {};
|
|
14
|
+
for (const key of Object.keys(input).sort()) {
|
|
15
|
+
const child = input[key];
|
|
16
|
+
if (child !== void 0) {
|
|
17
|
+
output[key] = sortJson(child);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return output;
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
function stableStringify(value) {
|
|
25
|
+
return `${JSON.stringify(sortJson(value), null, 2)}
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
function parseJsonObject(text, label = "JSON") {
|
|
29
|
+
const parsed = JSON.parse(text);
|
|
30
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
31
|
+
throw new Error(`${label} must be a JSON object`);
|
|
32
|
+
}
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/core/ledger.ts
|
|
37
|
+
function emptyLedger() {
|
|
38
|
+
return { coordinates: {} };
|
|
39
|
+
}
|
|
40
|
+
function residualLedger(name, value = 1, description) {
|
|
41
|
+
return {
|
|
42
|
+
coordinates: {
|
|
43
|
+
[name]: {
|
|
44
|
+
name,
|
|
45
|
+
value,
|
|
46
|
+
unit: "dimensionless",
|
|
47
|
+
kind: "residual",
|
|
48
|
+
description: description ?? null,
|
|
49
|
+
evidence_status: "declared",
|
|
50
|
+
evidence_refs: [],
|
|
51
|
+
known: true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/io/schema.ts
|
|
58
|
+
import {
|
|
59
|
+
cpSync,
|
|
60
|
+
existsSync as existsSync2,
|
|
61
|
+
mkdirSync,
|
|
62
|
+
readdirSync,
|
|
63
|
+
readFileSync,
|
|
64
|
+
writeFileSync
|
|
65
|
+
} from "fs";
|
|
66
|
+
import { basename, join as join2 } from "path";
|
|
67
|
+
import Ajv2020Module from "ajv/dist/2020.js";
|
|
68
|
+
|
|
69
|
+
// src/io/paths.ts
|
|
70
|
+
import { existsSync } from "fs";
|
|
71
|
+
import { dirname, join, resolve } from "path";
|
|
72
|
+
import { fileURLToPath } from "url";
|
|
73
|
+
function packageRoot() {
|
|
74
|
+
let current = dirname(fileURLToPath(import.meta.url));
|
|
75
|
+
for (let i = 0; i < 8; i += 1) {
|
|
76
|
+
if (existsSync(join(current, "package.json")) && existsSync(join(current, "schemas"))) {
|
|
77
|
+
return current;
|
|
78
|
+
}
|
|
79
|
+
const next = dirname(current);
|
|
80
|
+
if (next === current) {
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
current = next;
|
|
84
|
+
}
|
|
85
|
+
return resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
86
|
+
}
|
|
87
|
+
function schemaDir() {
|
|
88
|
+
return join(packageRoot(), "schemas");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/io/schema.ts
|
|
92
|
+
var PUBLIC_SCHEMA_NAME = /^[A-Za-z][A-Za-z0-9]*$/;
|
|
93
|
+
function assertSchemaTypeName(typeName) {
|
|
94
|
+
if (!PUBLIC_SCHEMA_NAME.test(typeName)) {
|
|
95
|
+
throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function schemaPath(typeName) {
|
|
99
|
+
assertSchemaTypeName(typeName);
|
|
100
|
+
return join2(schemaDir(), `${typeName}.schema.json`);
|
|
101
|
+
}
|
|
102
|
+
function schemaByType(typeName = "Registry") {
|
|
103
|
+
const path = schemaPath(typeName);
|
|
104
|
+
if (!existsSync2(path)) {
|
|
105
|
+
throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
|
|
106
|
+
}
|
|
107
|
+
return parseJsonObject(readFileSync(path, "utf8"), `${typeName} schema`);
|
|
108
|
+
}
|
|
109
|
+
function validateData(data, schema) {
|
|
110
|
+
const Ajv2020 = Ajv2020Module;
|
|
111
|
+
const ajv = new Ajv2020({ allErrors: true, strict: false });
|
|
112
|
+
const validate = ajv.compile(schema);
|
|
113
|
+
const valid = Boolean(validate(data));
|
|
114
|
+
return {
|
|
115
|
+
valid,
|
|
116
|
+
errors: valid ? [] : (validate.errors ?? []).map(
|
|
117
|
+
(error) => `${error.instancePath || "/"} ${error.message ?? "is invalid"}`
|
|
118
|
+
)
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function validateByType(data, typeName) {
|
|
122
|
+
return validateData(data, schemaByType(typeName));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/io/identity.ts
|
|
126
|
+
function nonEmptyStringArray(value) {
|
|
127
|
+
return Array.isArray(value) && value.some((item) => typeof item === "string" && item.length > 0);
|
|
128
|
+
}
|
|
129
|
+
function runtimeIdentityContextAccepted(data) {
|
|
130
|
+
return validateByType(data, "RuntimeIdentityContext").valid && data.accepted === true && nonEmptyStringArray(data.accepted_agent_ids) && nonEmptyStringArray(data.accepted_public_key_ids);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// src/agent/messages.ts
|
|
134
|
+
function sha256(text) {
|
|
135
|
+
return createHash("sha256").update(text, "utf8").digest("hex");
|
|
136
|
+
}
|
|
137
|
+
function sortedUnique(values) {
|
|
138
|
+
return [
|
|
139
|
+
...new Set(values.filter((value) => Boolean(value)))
|
|
140
|
+
].sort();
|
|
141
|
+
}
|
|
142
|
+
function acceptedIdentityContext(path) {
|
|
143
|
+
if (!path || !existsSync3(path)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const data = parseJsonObject(
|
|
148
|
+
readFileSync2(path, "utf8"),
|
|
149
|
+
"identity context"
|
|
150
|
+
);
|
|
151
|
+
return runtimeIdentityContextAccepted(data);
|
|
152
|
+
} catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function createAgentMessage(options) {
|
|
157
|
+
const digest = sha256(options.text);
|
|
158
|
+
return {
|
|
159
|
+
audience: [],
|
|
160
|
+
content: options.text,
|
|
161
|
+
content_sha256: digest,
|
|
162
|
+
declared_packet_kind: "capability-packet-candidate",
|
|
163
|
+
declared_receiver_family: ["agent", "verifier"],
|
|
164
|
+
declared_routes: [],
|
|
165
|
+
declared_validity_domain: "protocol-relative-finite",
|
|
166
|
+
evidence_refs: [],
|
|
167
|
+
expires_at: null,
|
|
168
|
+
issued_at: null,
|
|
169
|
+
issuer_attestation_id: null,
|
|
170
|
+
issuer_public_key_id: null,
|
|
171
|
+
message_id: `agent-message:${digest.slice(0, 12)}`,
|
|
172
|
+
metadata: {},
|
|
173
|
+
nonce: options.nonce ?? null,
|
|
174
|
+
protocol_version: "pic-agent-message-v1",
|
|
175
|
+
receiver_agent_id: options.receiver ?? null,
|
|
176
|
+
reply_to: null,
|
|
177
|
+
route_request_refs: [],
|
|
178
|
+
sender_agent_id: options.sender,
|
|
179
|
+
signature_ref: null,
|
|
180
|
+
tags: ["agent-message"],
|
|
181
|
+
thread_id: null
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function readAgentMessage(path) {
|
|
185
|
+
const message = parseJsonObject(readFileSync2(path, "utf8"), "agent message");
|
|
186
|
+
const validation = validateByType(message, "AgentMessageEnvelope");
|
|
187
|
+
if (!validation.valid) {
|
|
188
|
+
throw new Error(
|
|
189
|
+
`agent message schema-invalid: ${validation.errors.join("; ")}`
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
return message;
|
|
193
|
+
}
|
|
194
|
+
function agentMessageContract(message) {
|
|
195
|
+
const content = String(message.content ?? "");
|
|
196
|
+
const digestValid = sha256(content) === message.content_sha256;
|
|
197
|
+
const declaredReceiverFamily = Array.isArray(message.declared_receiver_family) ? message.declared_receiver_family.map(String) : [];
|
|
198
|
+
const evidenceRefs = Array.isArray(message.evidence_refs) ? message.evidence_refs.map(String) : [];
|
|
199
|
+
const routeRefs = Array.isArray(message.route_request_refs) ? message.route_request_refs.map(String) : [];
|
|
200
|
+
const reasons = digestValid ? [] : ["message content digest mismatch"];
|
|
201
|
+
return {
|
|
202
|
+
accepted: digestValid,
|
|
203
|
+
candidate_only: true,
|
|
204
|
+
declared_packet_kind: message.declared_packet_kind ?? "capability-packet-candidate",
|
|
205
|
+
declared_receiver_family: declaredReceiverFamily,
|
|
206
|
+
declared_validity_domain: message.declared_validity_domain ?? "protocol-relative-finite",
|
|
207
|
+
evidence_refs: evidenceRefs,
|
|
208
|
+
message_contract_valid: digestValid,
|
|
209
|
+
message_id: message.message_id ?? null,
|
|
210
|
+
protocol_version: message.protocol_version ?? "pic-agent-message-v1",
|
|
211
|
+
reasons,
|
|
212
|
+
receiver_agent_id: message.receiver_agent_id ?? null,
|
|
213
|
+
report_id: `agent-message-contract:${sha256(stableStringify(message)).slice(0, 12)}`,
|
|
214
|
+
residual_ledger: digestValid ? emptyLedger() : residualLedger(
|
|
215
|
+
`agent-message:${String(message.message_id ?? "unknown")}:digest-mismatch`,
|
|
216
|
+
1,
|
|
217
|
+
"message content digest mismatch"
|
|
218
|
+
),
|
|
219
|
+
route_request_refs: routeRefs,
|
|
220
|
+
sender_agent_id: message.sender_agent_id ?? null,
|
|
221
|
+
settled: false
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function verifyAgentMessage(message, options = {}) {
|
|
225
|
+
const profile = options.profile ?? "development";
|
|
226
|
+
const contract = agentMessageContract(message);
|
|
227
|
+
const content = String(message.content ?? "");
|
|
228
|
+
const digest = String(message.content_sha256 ?? sha256(content));
|
|
229
|
+
const nonce = typeof message.nonce === "string" ? message.nonce : null;
|
|
230
|
+
const replayDetected = Boolean(nonce && options.seenNonces?.includes(nonce));
|
|
231
|
+
const signaturePresent = Boolean(
|
|
232
|
+
message.signature_ref && message.issuer_public_key_id && message.issuer_attestation_id
|
|
233
|
+
);
|
|
234
|
+
const signatureRequired = ["production", "adversarial"].includes(
|
|
235
|
+
profile.toLowerCase()
|
|
236
|
+
);
|
|
237
|
+
const identityRequired = signatureRequired;
|
|
238
|
+
const identityAccepted = acceptedIdentityContext(options.identityContextPath);
|
|
239
|
+
const reasons = [
|
|
240
|
+
...contract.reasons ?? []
|
|
241
|
+
];
|
|
242
|
+
const identityReasons = [];
|
|
243
|
+
if (replayDetected) {
|
|
244
|
+
reasons.push("message replay nonce was already seen");
|
|
245
|
+
}
|
|
246
|
+
if (signatureRequired && !signaturePresent) {
|
|
247
|
+
reasons.push("signed agent message required by profile");
|
|
248
|
+
}
|
|
249
|
+
if (identityRequired && !identityAccepted) {
|
|
250
|
+
identityReasons.push("accepted identity context required by profile");
|
|
251
|
+
}
|
|
252
|
+
reasons.push(...identityReasons);
|
|
253
|
+
const accepted = contract.accepted === true && reasons.length === 0;
|
|
254
|
+
const packetId = `packet:agent-message:${String(message.message_id ?? "unknown")}`;
|
|
255
|
+
const packets = contract.accepted === true ? [
|
|
256
|
+
{
|
|
257
|
+
authority_granted: false,
|
|
258
|
+
authority_requested: false,
|
|
259
|
+
authority_required: false,
|
|
260
|
+
claim: content,
|
|
261
|
+
content_sha256: digest,
|
|
262
|
+
dependencies: [],
|
|
263
|
+
evidence_hash_valid: true,
|
|
264
|
+
evidence_refs: sortedUnique([
|
|
265
|
+
...Array.isArray(message.evidence_refs) ? message.evidence_refs.map(String) : [],
|
|
266
|
+
`sha256:${digest}`,
|
|
267
|
+
`agent-message:${String(message.message_id ?? "unknown")}`
|
|
268
|
+
]),
|
|
269
|
+
expected_downstream_gain: 125e-5,
|
|
270
|
+
expires_at: null,
|
|
271
|
+
freshness: 1,
|
|
272
|
+
hazard_charge: 0,
|
|
273
|
+
identity_contribution_status: "provisional",
|
|
274
|
+
issuer_agent_id: message.sender_agent_id ?? null,
|
|
275
|
+
issuer_attestation_id: message.issuer_attestation_id ?? null,
|
|
276
|
+
issuer_public_key_id: message.issuer_public_key_id ?? null,
|
|
277
|
+
issuer_signature_ref: message.signature_ref ?? null,
|
|
278
|
+
packet_id: packetId,
|
|
279
|
+
receiver_family: Array.isArray(message.declared_receiver_family) ? message.declared_receiver_family.map(String) : ["agent", "verifier"],
|
|
280
|
+
residual_charge: 0,
|
|
281
|
+
reuse_context: "general",
|
|
282
|
+
rollback_available: true,
|
|
283
|
+
route_safe: true,
|
|
284
|
+
salience_class: "packet",
|
|
285
|
+
source_kind: "agent-message",
|
|
286
|
+
source_ref: String(message.message_id ?? "unknown"),
|
|
287
|
+
status: "provisional",
|
|
288
|
+
tags: sortedUnique([
|
|
289
|
+
...Array.isArray(message.tags) ? message.tags.map(String) : [],
|
|
290
|
+
"agent-message",
|
|
291
|
+
"external-candidate",
|
|
292
|
+
"general"
|
|
293
|
+
]),
|
|
294
|
+
verification_cost: 5e-3,
|
|
295
|
+
verifier_routes: Array.isArray(message.declared_routes) ? message.declared_routes.map(String) : []
|
|
296
|
+
}
|
|
297
|
+
] : [];
|
|
298
|
+
return {
|
|
299
|
+
accepted,
|
|
300
|
+
candidate_packet_ids: packets.map((packet) => packet.packet_id),
|
|
301
|
+
consumed_nonces: accepted && nonce ? [nonce] : [],
|
|
302
|
+
identity_reasons: sortedUnique(identityReasons),
|
|
303
|
+
identity_status: identityAccepted ? "verified" : identityRequired ? "required" : "not-required",
|
|
304
|
+
identity_verified: identityAccepted,
|
|
305
|
+
message_contract_valid: contract.accepted === true,
|
|
306
|
+
message_id: message.message_id ?? null,
|
|
307
|
+
next_safe_commands: [
|
|
308
|
+
"uv run pic agent message contract --message <message.json>",
|
|
309
|
+
"uv run pic ecology bridge-runtime --report <general-intake-report.json>"
|
|
310
|
+
],
|
|
311
|
+
nonce_ledger: {
|
|
312
|
+
accepted,
|
|
313
|
+
consumed_nonces: accepted && nonce ? [nonce] : [],
|
|
314
|
+
ledger_id: "agent-message-nonce-ledger",
|
|
315
|
+
reasons: sortedUnique(reasons),
|
|
316
|
+
rejected_message_ids: accepted ? [] : [String(message.message_id ?? "unknown")],
|
|
317
|
+
replayed_nonces: replayDetected && nonce ? [nonce] : []
|
|
318
|
+
},
|
|
319
|
+
nonce_status: replayDetected ? "replayed" : nonce && accepted ? "consumed" : "not-provided",
|
|
320
|
+
packets,
|
|
321
|
+
quarantine_recommended: reasons.length > 0,
|
|
322
|
+
reasons: sortedUnique(reasons),
|
|
323
|
+
replay_detected: replayDetected,
|
|
324
|
+
report_id: `agent-message-check:${String(message.message_id ?? "unknown")}`,
|
|
325
|
+
residual_ledger: reasons.length === 0 ? emptyLedger() : residualLedger(
|
|
326
|
+
`agent-message:${String(message.message_id ?? "unknown")}:verification-residual`,
|
|
327
|
+
reasons.length,
|
|
328
|
+
"agent message verification residual"
|
|
329
|
+
),
|
|
330
|
+
sender_agent_id: message.sender_agent_id ?? null,
|
|
331
|
+
settled: false,
|
|
332
|
+
signature_present: signaturePresent,
|
|
333
|
+
signature_required: signatureRequired
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function initAgentInbox(path, inboxId = "agent-inbox") {
|
|
337
|
+
const record = {
|
|
338
|
+
inbox_id: inboxId,
|
|
339
|
+
messages: [],
|
|
340
|
+
peers: [],
|
|
341
|
+
seen_nonces: []
|
|
342
|
+
};
|
|
343
|
+
mkdirSync2(dirname2(path), { recursive: true });
|
|
344
|
+
writeFileSync2(path, stableStringify(record), "utf8");
|
|
345
|
+
return record;
|
|
346
|
+
}
|
|
347
|
+
function readAgentInbox(path) {
|
|
348
|
+
const text = readFileSync2(path, "utf8").trim();
|
|
349
|
+
if (text.includes("\n") && !text.startsWith("{")) {
|
|
350
|
+
return {
|
|
351
|
+
inbox_id: "agent-inbox",
|
|
352
|
+
messages: text.split(/\r?\n/).filter(Boolean).map((line) => parseJsonObject(line, "agent inbox line")),
|
|
353
|
+
peers: [],
|
|
354
|
+
seen_nonces: []
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
const inbox = parseJsonObject(text, "agent inbox");
|
|
358
|
+
const validation = validateByType(inbox, "AgentInboxRecord");
|
|
359
|
+
if (!validation.valid) {
|
|
360
|
+
throw new Error(
|
|
361
|
+
`agent inbox schema-invalid: ${validation.errors.join("; ")}`
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
return inbox;
|
|
365
|
+
}
|
|
366
|
+
function writeAgentInbox(path, inbox) {
|
|
367
|
+
mkdirSync2(dirname2(path), { recursive: true });
|
|
368
|
+
writeFileSync2(path, stableStringify(inbox), "utf8");
|
|
369
|
+
}
|
|
370
|
+
function appendAgentMessage(inboxPath, message) {
|
|
371
|
+
const inbox = existsSync3(inboxPath) ? readAgentInbox(inboxPath) : { inbox_id: "agent-inbox", messages: [], peers: [], seen_nonces: [] };
|
|
372
|
+
const messages = Array.isArray(inbox.messages) ? inbox.messages : [];
|
|
373
|
+
const updated = {
|
|
374
|
+
...inbox,
|
|
375
|
+
messages: [...messages, message]
|
|
376
|
+
};
|
|
377
|
+
writeAgentInbox(inboxPath, updated);
|
|
378
|
+
return updated;
|
|
379
|
+
}
|
|
380
|
+
function deliveryReport(action, inboxRef, inbox, reports, profile = "development") {
|
|
381
|
+
const accepted = reports.every((report) => report.accepted === true);
|
|
382
|
+
const delivered = accepted ? reports.map((report) => String(report.message_id ?? "unknown")) : [];
|
|
383
|
+
const rejected = accepted ? [] : reports.map((report) => String(report.message_id ?? "unknown"));
|
|
384
|
+
const consumed = sortedUnique(
|
|
385
|
+
reports.flatMap(
|
|
386
|
+
(report) => Array.isArray(report.consumed_nonces) ? report.consumed_nonces.map(String) : []
|
|
387
|
+
)
|
|
388
|
+
);
|
|
389
|
+
const reasons = sortedUnique(
|
|
390
|
+
reports.flatMap(
|
|
391
|
+
(report) => Array.isArray(report.reasons) ? report.reasons.map(String) : []
|
|
392
|
+
)
|
|
393
|
+
);
|
|
394
|
+
return {
|
|
395
|
+
accepted,
|
|
396
|
+
action,
|
|
397
|
+
candidate_only: true,
|
|
398
|
+
candidate_packet_ids: sortedUnique(
|
|
399
|
+
reports.flatMap(
|
|
400
|
+
(report) => Array.isArray(report.candidate_packet_ids) ? report.candidate_packet_ids.map(String) : []
|
|
401
|
+
)
|
|
402
|
+
),
|
|
403
|
+
delivered_message_ids: delivered,
|
|
404
|
+
exchange_reports: reports,
|
|
405
|
+
identity_context_accepted: false,
|
|
406
|
+
inbox_id: inbox.inbox_id ?? "agent-inbox",
|
|
407
|
+
inbox_ref: inboxRef,
|
|
408
|
+
message_ids: reports.map(
|
|
409
|
+
(report) => String(report.message_id ?? "unknown")
|
|
410
|
+
),
|
|
411
|
+
next_safe_commands: [
|
|
412
|
+
"uv run pic agent inbox verify --inbox <inbox.json>",
|
|
413
|
+
"uv run pic ecology bridge-runtime --report <general-intake-report.json>"
|
|
414
|
+
],
|
|
415
|
+
nonce_ledger: {
|
|
416
|
+
accepted,
|
|
417
|
+
consumed_nonces: consumed,
|
|
418
|
+
ledger_id: "agent-message-nonce-ledger",
|
|
419
|
+
reasons,
|
|
420
|
+
rejected_message_ids: rejected,
|
|
421
|
+
replayed_nonces: []
|
|
422
|
+
},
|
|
423
|
+
operationally_usable: accepted,
|
|
424
|
+
profile,
|
|
425
|
+
reasons,
|
|
426
|
+
rejected_message_ids: rejected,
|
|
427
|
+
report_id: `agent-message-delivery:${action}:${String(inbox.inbox_id ?? "agent-inbox")}`,
|
|
428
|
+
settled: false
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
function receiveAgentInbox(inboxPath, options = {}) {
|
|
432
|
+
const inbox = readAgentInbox(inboxPath);
|
|
433
|
+
const seen = Array.isArray(inbox.seen_nonces) ? inbox.seen_nonces.map(String) : [];
|
|
434
|
+
const messages = Array.isArray(inbox.messages) ? inbox.messages : [];
|
|
435
|
+
const reports = messages.map(
|
|
436
|
+
(message) => verifyAgentMessage(message, { ...options, seenNonces: seen })
|
|
437
|
+
);
|
|
438
|
+
return deliveryReport(
|
|
439
|
+
"receive",
|
|
440
|
+
inboxPath,
|
|
441
|
+
inbox,
|
|
442
|
+
reports,
|
|
443
|
+
options.profile ?? "development"
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
export {
|
|
447
|
+
agentMessageContract,
|
|
448
|
+
appendAgentMessage,
|
|
449
|
+
createAgentMessage,
|
|
450
|
+
deliveryReport,
|
|
451
|
+
initAgentInbox,
|
|
452
|
+
readAgentInbox,
|
|
453
|
+
readAgentMessage,
|
|
454
|
+
receiveAgentInbox,
|
|
455
|
+
verifyAgentMessage,
|
|
456
|
+
writeAgentInbox
|
|
457
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|