@intentius/chant-lexicon-aws 0.124.31 → 0.124.33
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/actions/dynamodb.js +41 -0
- package/dist/actions/ecr.js +9 -0
- package/dist/actions/ecs.js +5 -0
- package/dist/actions/iam.js +3 -0
- package/dist/actions/index.js +9 -0
- package/dist/actions/lambda.js +11 -0
- package/dist/actions/logs.js +4 -0
- package/dist/actions/s3.js +40 -0
- package/dist/actions/sns.js +5 -0
- package/dist/actions/sqs.js +15 -0
- package/dist/agentcore/trace-fetch.d.ts.map +1 -1
- package/dist/agentcore/trace-fetch.js +472 -0
- package/dist/agentcore/trace-render.js +359 -0
- package/dist/ambient.js +148 -0
- package/dist/api/credential-chain.d.ts +30 -3
- package/dist/api/credential-chain.d.ts.map +1 -1
- package/dist/api/credential-chain.js +509 -0
- package/dist/api/read-client.d.ts +16 -43
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/api/read-client.js +458 -0
- package/dist/api/sigv4.d.ts +4 -4
- package/dist/api/sigv4.js +185 -0
- package/dist/behaviour-kinds.js +114 -0
- package/dist/caller-identity.d.ts +3 -5
- package/dist/caller-identity.d.ts.map +1 -1
- package/dist/caller-identity.js +146 -0
- package/dist/codegen/docs-cli.js +2 -0
- package/dist/codegen/docs.js +120 -0
- package/dist/codegen/enum-overlay.js +162 -0
- package/dist/codegen/extensions.js +139 -0
- package/dist/codegen/fallback.js +32 -0
- package/dist/codegen/generate-cli.js +15 -0
- package/dist/codegen/generate-lexicon.js +70 -0
- package/dist/codegen/generate-typescript.js +226 -0
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/generate.js +234 -0
- package/dist/codegen/naming.js +135 -0
- package/dist/codegen/package.js +67 -0
- package/dist/codegen/patches.d.ts +26 -1
- package/dist/codegen/patches.d.ts.map +1 -1
- package/dist/codegen/patches.js +90 -0
- package/dist/codegen/property-overlay.js +85 -0
- package/dist/codegen/property-overlay.json +1 -16
- package/dist/codegen/sam.js +402 -0
- package/dist/codegen/typecheck.js +4 -0
- package/dist/codegen/versions.js +31 -0
- package/dist/components/__tests__/mock-cloud-executor.js +326 -0
- package/dist/components/apply.d.ts +44 -1
- package/dist/components/apply.d.ts.map +1 -1
- package/dist/components/apply.js +752 -0
- package/dist/components/builders.js +37 -0
- package/dist/components/capability-plugin.js +66 -0
- package/dist/components/cloud-executor.d.ts +35 -0
- package/dist/components/cloud-executor.d.ts.map +1 -1
- package/dist/components/cloud-executor.js +576 -0
- package/dist/components/config-bom.js +207 -0
- package/dist/components/host-delivery.js +117 -0
- package/dist/components/index.js +18 -0
- package/dist/components/job-submission.js +77 -0
- package/dist/components/publish.js +234 -0
- package/dist/components/safety.js +62 -0
- package/dist/components/wait-aws.js +68 -0
- package/dist/composites/agentcore-agent.js +187 -0
- package/dist/composites/agentcore-trust-policy.js +13 -0
- package/dist/composites/alb-shared.js +84 -0
- package/dist/composites/bucket-deployment.js +93 -0
- package/dist/composites/catalog.js +2714 -0
- package/dist/composites/dynamodb-table.js +66 -0
- package/dist/composites/ec2-instance-bundle.js +75 -0
- package/dist/composites/ec2-instance-role.js +26 -0
- package/dist/composites/ecr-repository.js +64 -0
- package/dist/composites/ecs-trust-policy.js +10 -0
- package/dist/composites/efs-with-access-point.js +44 -0
- package/dist/composites/eks-cluster.js +118 -0
- package/dist/composites/fargate-alb.js +216 -0
- package/dist/composites/fargate-service.js +222 -0
- package/dist/composites/index.js +28 -0
- package/dist/composites/lambda-api.js +15 -0
- package/dist/composites/lambda-dynamodb.js +77 -0
- package/dist/composites/lambda-eventbridge.js +27 -0
- package/dist/composites/lambda-function.js +54 -0
- package/dist/composites/lambda-s3.js +93 -0
- package/dist/composites/lambda-sns.js +23 -0
- package/dist/composites/lambda-sqs.js +34 -0
- package/dist/composites/landing-zone.js +82 -0
- package/dist/composites/microvm-app.js +293 -0
- package/dist/composites/minimal-vpc.js +40 -0
- package/dist/composites/monitoring-stack.js +105 -0
- package/dist/composites/nlb-service.js +61 -0
- package/dist/composites/rds-instance.js +98 -0
- package/dist/composites/scheduled-lambda.js +28 -0
- package/dist/composites/solr-fargate-service.js +33 -0
- package/dist/composites/step-functions-workflow.js +78 -0
- package/dist/composites/vpc-default.js +132 -0
- package/dist/condition.js +43 -0
- package/dist/coverage.js +4 -0
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/deep-observe.js +709 -0
- package/dist/deep-topology.js +226 -0
- package/dist/default-tags.js +50 -0
- package/dist/defaults.js +85 -0
- package/dist/dependencies.js +269 -0
- package/dist/detect.js +21 -0
- package/dist/disruption.d.ts.map +1 -1
- package/dist/disruption.js +129 -0
- package/dist/effect-receipt-row.js +107 -0
- package/dist/generated/index.d.ts +1297 -82
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +12382 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +131 -0
- package/dist/health.d.ts +61 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +216 -0
- package/dist/identity-observe.d.ts.map +1 -1
- package/dist/identity-observe.js +127 -0
- package/dist/import/generator.js +757 -0
- package/dist/import/live-export.js +34 -0
- package/dist/import/parser.js +394 -0
- package/dist/index.js +69 -0
- package/dist/integrity.json +6 -6
- package/dist/intrinsics.js +393 -0
- package/dist/lint/audit-catalog.js +87 -0
- package/dist/lint/audit-lineage.js +150 -0
- package/dist/lint/post-synth/cf-refs.js +247 -0
- package/dist/lint/post-synth/cor020.js +60 -0
- package/dist/lint/post-synth/ext001.d.ts.map +1 -1
- package/dist/lint/post-synth/ext001.js +197 -0
- package/dist/lint/post-synth/index.js +124 -0
- package/dist/lint/post-synth/waw010.js +41 -0
- package/dist/lint/post-synth/waw011.js +41 -0
- package/dist/lint/post-synth/waw013.js +38 -0
- package/dist/lint/post-synth/waw014.js +42 -0
- package/dist/lint/post-synth/waw015.js +88 -0
- package/dist/lint/post-synth/waw016.d.ts.map +1 -1
- package/dist/lint/post-synth/waw016.js +116 -0
- package/dist/lint/post-synth/waw017.js +43 -0
- package/dist/lint/post-synth/waw018.js +61 -0
- package/dist/lint/post-synth/waw019.js +64 -0
- package/dist/lint/post-synth/waw020.js +56 -0
- package/dist/lint/post-synth/waw021.js +44 -0
- package/dist/lint/post-synth/waw022.js +36 -0
- package/dist/lint/post-synth/waw023.js +40 -0
- package/dist/lint/post-synth/waw024.js +46 -0
- package/dist/lint/post-synth/waw025.js +36 -0
- package/dist/lint/post-synth/waw026.js +38 -0
- package/dist/lint/post-synth/waw027.js +41 -0
- package/dist/lint/post-synth/waw028.js +39 -0
- package/dist/lint/post-synth/waw029.js +54 -0
- package/dist/lint/post-synth/waw030.js +282 -0
- package/dist/lint/post-synth/waw031.js +58 -0
- package/dist/lint/post-synth/waw032.js +45 -0
- package/dist/lint/post-synth/waw033.js +75 -0
- package/dist/lint/post-synth/waw034.js +52 -0
- package/dist/lint/post-synth/waw035.js +56 -0
- package/dist/lint/post-synth/waw036.js +79 -0
- package/dist/lint/post-synth/waw037.js +67 -0
- package/dist/lint/post-synth/waw038.js +42 -0
- package/dist/lint/post-synth/waw039.js +42 -0
- package/dist/lint/post-synth/waw040.js +45 -0
- package/dist/lint/post-synth/waw041.js +40 -0
- package/dist/lint/post-synth/waw042.js +99 -0
- package/dist/lint/post-synth/waw043.js +51 -0
- package/dist/lint/post-synth/waw044.js +64 -0
- package/dist/lint/post-synth/waw045.js +49 -0
- package/dist/lint/post-synth/waw046.js +52 -0
- package/dist/lint/post-synth/waw047.js +43 -0
- package/dist/lint/post-synth/waw048.js +40 -0
- package/dist/lint/post-synth/waw049.js +78 -0
- package/dist/lint/post-synth/waw050.js +44 -0
- package/dist/lint/post-synth/waw051.js +41 -0
- package/dist/lint/post-synth/waw052.js +43 -0
- package/dist/lint/post-synth/waw053.js +43 -0
- package/dist/lint/post-synth/waw054.js +41 -0
- package/dist/lint/post-synth/waw055.js +41 -0
- package/dist/lint/post-synth/waw056.js +65 -0
- package/dist/lint/post-synth/waw057.js +43 -0
- package/dist/lint/post-synth/waw058.js +61 -0
- package/dist/lint/post-synth/waw059.js +338 -0
- package/dist/lint/post-synth/waw060.js +83 -0
- package/dist/lint/post-synth/waw061.js +60 -0
- package/dist/lint/post-synth/waw062.js +0 -0
- package/dist/lint/post-synth/waw063.js +0 -0
- package/dist/lint/post-synth/waw064.js +45 -0
- package/dist/lint/post-synth/waw065.js +104 -0
- package/dist/lint/post-synth/waw066.js +145 -0
- package/dist/lint/post-synth/waw067.js +115 -0
- package/dist/lint/post-synth/waw068.js +69 -0
- package/dist/lint/post-synth/waw069.js +0 -0
- package/dist/lint/rules/hardcoded-region.js +38 -0
- package/dist/lint/rules/iam-wildcard.js +60 -0
- package/dist/lint/rules/index.js +6 -0
- package/dist/lint/rules/s3-encryption.js +60 -0
- package/dist/live-attrs.js +42 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +18 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +66 -0
- package/dist/manifest.json +1 -1
- package/dist/mapping.js +33 -0
- package/dist/meta.json +17359 -784
- package/dist/nested-stack.js +95 -0
- package/dist/okf/index.md +203 -0
- package/dist/okf/rules/EXT001.md +1 -0
- package/dist/okf/rules/WAW016.md +2 -0
- package/dist/okf/rules/WAW019.md +1 -0
- package/dist/okf/rules/WAW028.md +1 -0
- package/dist/okf/rules/WAW030.md +2 -0
- package/dist/okf/rules/WAW039.md +1 -0
- package/dist/okf/rules/WAW049.md +1 -0
- package/dist/okf/rules/WAW056.md +1 -0
- package/dist/okf/rules/WAW058.md +1 -0
- package/dist/okf/rules/WAW062.md +1 -0
- package/dist/okf/rules/WAW064.md +1 -0
- package/dist/okf/rules/WAW065.md +1 -0
- package/dist/okf/rules/WAW066.md +1 -0
- package/dist/okf/rules/WAW067.md +1 -0
- package/dist/okf/rules/WAW068.md +1 -0
- package/dist/okf/rules/WAW069.md +4 -0
- package/dist/okf/types/AIWorkloadConfig.md +23 -0
- package/dist/okf/types/ARCRegionSwitchPlan.md +1 -0
- package/dist/okf/types/AccountAccessApplication.md +28 -0
- package/dist/okf/types/AccountAccessEntitlement.md +22 -0
- package/dist/okf/types/ActionTarget.md +20 -0
- package/dist/okf/types/AdConfiguration.md +21 -0
- package/dist/okf/types/Adapter.md +26 -0
- package/dist/okf/types/AgentContext.md +35 -0
- package/dist/okf/types/AgentGoal.md +31 -0
- package/dist/okf/types/AgentProfile.md +34 -0
- package/dist/okf/types/Alarm.md +3 -1
- package/dist/okf/types/AlarmModel.md +14 -9
- package/dist/okf/types/AmplifyWebhook.md +25 -0
- package/dist/okf/types/ApiCache.md +8 -8
- package/dist/okf/types/ApiGatewayManagedOverrides.md +5 -5
- package/dist/okf/types/AppAuthorization.md +35 -0
- package/dist/okf/types/AppBlockBuilder.md +1 -0
- package/dist/okf/types/AppInstance.md +2 -2
- package/dist/okf/types/AppInstanceBot.md +2 -2
- package/dist/okf/types/AppStreamFleet.md +3 -2
- package/dist/okf/types/AppSyncApiKey.md +6 -6
- package/dist/okf/types/AppSyncType.md +22 -0
- package/dist/okf/types/ApplicationStatusCheck.md +36 -0
- package/dist/okf/types/ApplicationVersion.md +4 -1
- package/dist/okf/types/ApplicationsList.md +26 -0
- package/dist/okf/types/ApprovalPolicy.md +28 -0
- package/dist/okf/types/ArchiveRule.md +24 -0
- package/dist/okf/types/Asset.md +30 -0
- package/dist/okf/types/Backup.md +31 -0
- package/dist/okf/types/BedrockAgentCoreDataset.md +1 -1
- package/dist/okf/types/BedrockAgentCoreGateway.md +3 -0
- package/dist/okf/types/BedrockSession.md +28 -0
- package/dist/okf/types/BillEstimate.md +35 -0
- package/dist/okf/types/Brand.md +32 -0
- package/dist/okf/types/CallAnalyticsCategory.md +25 -0
- package/dist/okf/types/Campaign.md +28 -0
- package/dist/okf/types/CapacityProvider.md +30 -0
- package/dist/okf/types/Case.md +24 -0
- package/dist/okf/types/CertificateAssociation.md +13 -0
- package/dist/okf/types/ChangeSet.md +36 -0
- package/dist/okf/types/ChannelFlow.md +29 -0
- package/dist/okf/types/ChimeChannel.md +39 -0
- package/dist/okf/types/Classifier.md +6 -6
- package/dist/okf/types/ClientVpnAuthorizationRule.md +6 -6
- package/dist/okf/types/ClientVpnEndpoint.md +2 -0
- package/dist/okf/types/ClientVpnRoute.md +5 -5
- package/dist/okf/types/CloudConnector.md +29 -0
- package/dist/okf/types/Cluster.md +39 -0
- package/dist/okf/types/ClusterSchedulerConfig.md +30 -0
- package/dist/okf/types/CodeCommitRepository.md +12 -12
- package/dist/okf/types/CodeConnectionsHost.md +26 -0
- package/dist/okf/types/CodeRepository.md +5 -5
- package/dist/okf/types/CompositeAlarm.md +1 -0
- package/dist/okf/types/ComputeEnvironment.md +2 -0
- package/dist/okf/types/ComputeNodeGroup.md +1 -1
- package/dist/okf/types/ComputeQuota.md +34 -0
- package/dist/okf/types/ConfigRule.md +1 -1
- package/dist/okf/types/ConfigurationRecorder.md +7 -6
- package/dist/okf/types/ConnectAttachment.md +2 -0
- package/dist/okf/types/ConnectQueue.md +5 -1
- package/dist/okf/types/ConnectVocabulary.md +28 -0
- package/dist/okf/types/ConnectionType.md +24 -0
- package/dist/okf/types/ConsentPortal.md +33 -0
- package/dist/okf/types/ContactMethod.md +29 -0
- package/dist/okf/types/ContainerAssociation.md +26 -0
- package/dist/okf/types/ContainerFleet.md +1 -1
- package/dist/okf/types/ContainerGroupDefinition.md +1 -1
- package/dist/okf/types/Content.md +40 -0
- package/dist/okf/types/ContentAssociation.md +28 -0
- package/dist/okf/types/CustomDetectionRuleAssociation.md +28 -0
- package/dist/okf/types/CustomEntityType.md +4 -9
- package/dist/okf/types/Customization.md +22 -0
- package/dist/okf/types/CwIntegration.md +31 -0
- package/dist/okf/types/DAXParameterGroup.md +3 -8
- package/dist/okf/types/DAXSubnetGroup.md +0 -5
- package/dist/okf/types/DBClusterEndpoint.md +31 -0
- package/dist/okf/types/DBProxyTargetGroup.md +1 -0
- package/dist/okf/types/DBSnapshot.md +62 -0
- package/dist/okf/types/DLMLifecyclePolicy.md +12 -12
- package/dist/okf/types/DLPSetting.md +31 -0
- package/dist/okf/types/DMSInstanceProfile.md +1 -1
- package/dist/okf/types/DRSLaunchConfigurationTemplate.md +28 -0
- package/dist/okf/types/Daemon.md +1 -0
- package/dist/okf/types/DataExchangeDataSet.md +29 -0
- package/dist/okf/types/DataIntegrationFlow.md +27 -0
- package/dist/okf/types/DataMigration.md +1 -1
- package/dist/okf/types/DataProvider.md +2 -1
- package/dist/okf/types/DataQualityRuleset.md +6 -11
- package/dist/okf/types/DataSource.md +23 -0
- package/dist/okf/types/Dataset.md +20 -0
- package/dist/okf/types/DatasetIntegration.md +23 -0
- package/dist/okf/types/DbCluster.md +1 -1
- package/dist/okf/types/DbInstance.md +8 -2
- package/dist/okf/types/DeadlineBudget.md +29 -0
- package/dist/okf/types/DelegationSet.md +23 -0
- package/dist/okf/types/DeliveryChannel.md +6 -11
- package/dist/okf/types/DevOpsAgentAgentSpace.md +4 -0
- package/dist/okf/types/DevOpsAgentService.md +1 -0
- package/dist/okf/types/DevOpsAgentTrigger.md +28 -0
- package/dist/okf/types/DirectConnectGatewayAttachment.md +2 -0
- package/dist/okf/types/Directory.md +60 -0
- package/dist/okf/types/DocDBDBClusterParameterGroup.md +5 -10
- package/dist/okf/types/DocDBDBSubnetGroup.md +4 -9
- package/dist/okf/types/DocDBElasticClusterSnapshot.md +36 -0
- package/dist/okf/types/DocumentClassifierEndpoint.md +27 -0
- package/dist/okf/types/Domain.md +27 -0
- package/dist/okf/types/EKSCertificateAuthority.md +42 -0
- package/dist/okf/types/EKSCluster.md +8 -0
- package/dist/okf/types/EcSnapshot.md +66 -0
- package/dist/okf/types/EmailIdentityCertificate.md +15 -0
- package/dist/okf/types/EndpointConfig.md +14 -13
- package/dist/okf/types/EntityRecognizer.md +27 -0
- package/dist/okf/types/EntityRecognizerEndpoint.md +31 -0
- package/dist/okf/types/EnvironmentEC2.md +13 -13
- package/dist/okf/types/EvaluationForm.md +1 -0
- package/dist/okf/types/Evaluator.md +6 -2
- package/dist/okf/types/EventAction.md +26 -0
- package/dist/okf/types/EventRule.md +2 -0
- package/dist/okf/types/EventSource.md +30 -0
- package/dist/okf/types/EventTracker.md +22 -0
- package/dist/okf/types/EventsV2EventBus.md +28 -0
- package/dist/okf/types/EventsV2ResourcePolicy.md +19 -0
- package/dist/okf/types/EventsV2Subscriber.md +39 -0
- package/dist/okf/types/ExperimentDefinition.md +39 -0
- package/dist/okf/types/ExperimentRun.md +33 -0
- package/dist/okf/types/ExperimentTrialComponent.md +13 -11
- package/dist/okf/types/FHIRDatastore.md +3 -0
- package/dist/okf/types/FSxSnapshot.md +5 -5
- package/dist/okf/types/FSxVolume.md +9 -9
- package/dist/okf/types/FeaturedResultsSet.md +26 -0
- package/dist/okf/types/Feed.md +1 -0
- package/dist/okf/types/FieldLevelEncryptionConfig.md +25 -0
- package/dist/okf/types/FieldLevelEncryptionProfile.md +22 -0
- package/dist/okf/types/FileCache.md +45 -0
- package/dist/okf/types/Filter.md +27 -0
- package/dist/okf/types/Firewall.md +6 -0
- package/dist/okf/types/FlowMediaStream.md +28 -0
- package/dist/okf/types/FlowOutput.md +1 -0
- package/dist/okf/types/FpgaImage.md +38 -0
- package/dist/okf/types/Function.md +2 -2
- package/dist/okf/types/Gateway.md +41 -0
- package/dist/okf/types/GatewayClusterAssociations.md +23 -0
- package/dist/okf/types/GatewayRateLimit.md +26 -0
- package/dist/okf/types/GatewayRule.md +32 -0
- package/dist/okf/types/GlobalReplicationGroup.md +3 -0
- package/dist/okf/types/GlobalResolver.md +1 -1
- package/dist/okf/types/GlobalTable.md +1 -0
- package/dist/okf/types/GlueConnection.md +5 -4
- package/dist/okf/types/GlueSecurityConfiguration.md +1 -6
- package/dist/okf/types/GlueSession.md +38 -0
- package/dist/okf/types/GlueTable.md +5 -10
- package/dist/okf/types/GlueWorkflow.md +5 -10
- package/dist/okf/types/Group.md +27 -0
- package/dist/okf/types/Harness.md +1 -0
- package/dist/okf/types/HostKey.md +33 -0
- package/dist/okf/types/HostedZone.md +1 -0
- package/dist/okf/types/HttpApi.md +2 -0
- package/dist/okf/types/HttpNamespace.md +5 -5
- package/dist/okf/types/HubV2.md +1 -0
- package/dist/okf/types/HumanTaskUi.md +22 -0
- package/dist/okf/types/IPv4Pool.md +28 -0
- package/dist/okf/types/ImageBuilder.md +1 -0
- package/dist/okf/types/ImageBuilderImage.md +1 -1
- package/dist/okf/types/ImagePipeline.md +1 -1
- package/dist/okf/types/InferenceComponent.md +5 -1
- package/dist/okf/types/InfluxDBBackup.md +65 -0
- package/dist/okf/types/InfluxDBCluster.md +3 -0
- package/dist/okf/types/InfrastructureConfiguration.md +2 -0
- package/dist/okf/types/IngestionDestination.md +28 -0
- package/dist/okf/types/InputSecurityGroup.md +6 -4
- package/dist/okf/types/InspectorV2Connector.md +38 -0
- package/dist/okf/types/InstanceEventWindow.md +25 -0
- package/dist/okf/types/InstanceFleetConfig.md +10 -10
- package/dist/okf/types/InstanceGroupConfig.md +3 -3
- package/dist/okf/types/InstrumentationConfig.md +31 -0
- package/dist/okf/types/IntegrationAssociation.md +3 -0
- package/dist/okf/types/IoTSiteWiseApplication.md +34 -0
- package/dist/okf/types/IoTSiteWiseDataset.md +5 -2
- package/dist/okf/types/IoTSiteWiseTask.md +24 -0
- package/dist/okf/types/IpamExternalResourceVerificationToken.md +35 -0
- package/dist/okf/types/IpamInternetRegistryAssociation.md +32 -0
- package/dist/okf/types/Job.md +35 -0
- package/dist/okf/types/JobTemplate.md +26 -0
- package/dist/okf/types/KinesisChannel.md +31 -0
- package/dist/okf/types/KinesisStream.md +1 -0
- package/dist/okf/types/LambdaResourcePolicy.md +14 -0
- package/dist/okf/types/Lexicon.md +34 -0
- package/dist/okf/types/LicenseAssetGroup.md +23 -0
- package/dist/okf/types/LicenseConfiguration.md +33 -0
- package/dist/okf/types/LicenseServerEndpoint.md +32 -0
- package/dist/okf/types/LightsailKeyPair.md +29 -0
- package/dist/okf/types/LimitsProfile.md +27 -0
- package/dist/okf/types/LocationAzureBlob.md +2 -1
- package/dist/okf/types/LocationObjectStorage.md +1 -0
- package/dist/okf/types/LogAlarm.md +2 -0
- package/dist/okf/types/MGNConnector.md +23 -0
- package/dist/okf/types/MGNLaunchConfigurationTemplate.md +37 -0
- package/dist/okf/types/MLTransform.md +15 -15
- package/dist/okf/types/MWAAServerlessWorkflow.md +3 -0
- package/dist/okf/types/ManagedNotificationAccountContactAssociation.md +1 -0
- package/dist/okf/types/ManagedNotificationAdditionalChannelAssociation.md +1 -0
- package/dist/okf/types/MediaConvertJobTemplate.md +11 -13
- package/dist/okf/types/MediaConvertQueue.md +8 -10
- package/dist/okf/types/MediaInsightsPipelineConfiguration.md +28 -0
- package/dist/okf/types/MediaLiveInput.md +41 -18
- package/dist/okf/types/MediaPackageV2Channel.md +3 -0
- package/dist/okf/types/MediaPackageV2OriginEndpoint.md +1 -0
- package/dist/okf/types/MediaPipelineKinesisVideoStreamPool.md +28 -0
- package/dist/okf/types/MediaTailorFunction.md +27 -0
- package/dist/okf/types/MedicalVocabulary.md +21 -0
- package/dist/okf/types/Member.md +26 -0
- package/dist/okf/types/Memory.md +6 -0
- package/dist/okf/types/MemoryDBSnapshot.md +29 -0
- package/dist/okf/types/Metric.md +59 -0
- package/dist/okf/types/MetricAttribution.md +23 -0
- package/dist/okf/types/MicrosoftAD.md +11 -11
- package/dist/okf/types/MigrationProject.md +8 -1
- package/dist/okf/types/Monitor.md +26 -0
- package/dist/okf/types/NFSFileShare.md +44 -0
- package/dist/okf/types/NeptuneGraphGraph.md +1 -0
- package/dist/okf/types/NetworkConnector.md +4 -0
- package/dist/okf/types/NetworkFlowMonitorScope.md +23 -0
- package/dist/okf/types/NetworkMigrationDefinition.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerDeployment.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerPolicy.md +32 -0
- package/dist/okf/types/NetworkSecurityManagerScope.md +29 -0
- package/dist/okf/types/NotebookInstance.md +18 -18
- package/dist/okf/types/NotebookInstanceLifecycleConfig.md +6 -5
- package/dist/okf/types/NotifyConfiguration.md +35 -0
- package/dist/okf/types/OTelEnrichment.md +2 -0
- package/dist/okf/types/OnlineEvaluationConfig.md +0 -1
- package/dist/okf/types/OrganizationConfigRule.md +7 -7
- package/dist/okf/types/Outpost.md +32 -0
- package/dist/okf/types/ParallelData.md +40 -0
- package/dist/okf/types/Partition.md +5 -5
- package/dist/okf/types/PaymentConnector.md +4 -1
- package/dist/okf/types/Pentest.md +1 -0
- package/dist/okf/types/PerfReports.md +28 -0
- package/dist/okf/types/PermissionAssociation.md +30 -0
- package/dist/okf/types/PersonalizeDataset.md +1 -0
- package/dist/okf/types/PersonalizeDatasetGroup.md +1 -0
- package/dist/okf/types/PersonalizeSchema.md +1 -0
- package/dist/okf/types/Pipeline.md +25 -0
- package/dist/okf/types/PlaybackConfiguration.md +1 -0
- package/dist/okf/types/PolicyAssociation.md +1 -1
- package/dist/okf/types/PolicyGrant.md +2 -2
- package/dist/okf/types/PolicyPrincipalAttachment.md +2 -7
- package/dist/okf/types/PortalProduct.md +24 -0
- package/dist/okf/types/PrefetchSchedule.md +25 -0
- package/dist/okf/types/PricingPlanManagerSubscription.md +31 -0
- package/dist/okf/types/PrincipalAssociation.md +27 -0
- package/dist/okf/types/PrivateDnsNamespace.md +8 -8
- package/dist/okf/types/PrivateVirtualInterface.md +1 -0
- package/dist/okf/types/ProcurementPortalPreference.md +45 -0
- package/dist/okf/types/Program.md +33 -0
- package/dist/okf/types/ProjectMembership.md +1 -1
- package/dist/okf/types/ProtocolsList.md +26 -0
- package/dist/okf/types/PublicDnsNamespace.md +7 -7
- package/dist/okf/types/PublicVirtualInterface.md +1 -0
- package/dist/okf/types/QEV2IdcApplication.md +25 -0
- package/dist/okf/types/QueryLoggingConfig.md +21 -0
- package/dist/okf/types/QuerySuggestionsBlockList.md +25 -0
- package/dist/okf/types/QuickSightAssignment.md +24 -0
- package/dist/okf/types/RAMResourceAssociation.md +27 -0
- package/dist/okf/types/RDSClusterSnapshot.md +54 -0
- package/dist/okf/types/RDSDBParameterGroup.md +5 -0
- package/dist/okf/types/RDSDeployment.md +41 -0
- package/dist/okf/types/RcsAgent.md +38 -0
- package/dist/okf/types/ReceiptRule.md +5 -5
- package/dist/okf/types/ReceiptRuleSet.md +1 -6
- package/dist/okf/types/RecommenderFilter.md +27 -0
- package/dist/okf/types/RecommenderSchema.md +25 -0
- package/dist/okf/types/RecordSet.md +16 -22
- package/dist/okf/types/RecoveryPlan.md +28 -0
- package/dist/okf/types/RedshiftIdcApplication.md +31 -0
- package/dist/okf/types/RedshiftSnapshot.md +59 -0
- package/dist/okf/types/RegistrationAttachment.md +28 -0
- package/dist/okf/types/Registry.md +41 -0
- package/dist/okf/types/RegistryRecord.md +38 -0
- package/dist/okf/types/RelatedItem.md +24 -0
- package/dist/okf/types/ReplicationConfigurationTemplate.md +35 -0
- package/dist/okf/types/ReplicationSubnetGroup.md +4 -9
- package/dist/okf/types/ReplicationTask.md +14 -14
- package/dist/okf/types/ReportGenerator.md +29 -0
- package/dist/okf/types/ReportGroup.md +1 -3
- package/dist/okf/types/ResilienceHubV2Policy.md +1 -0
- package/dist/okf/types/ResilienceHubV2Service.md +1 -0
- package/dist/okf/types/ResourceConfiguration.md +1 -1
- package/dist/okf/types/ResourceMetricsConfiguration.md +21 -0
- package/dist/okf/types/RestApi.md +1 -0
- package/dist/okf/types/RetrievalInstruction.md +32 -0
- package/dist/okf/types/RouterOutput.md +1 -0
- package/dist/okf/types/Rule.md +31 -0
- package/dist/okf/types/RunCache.md +29 -0
- package/dist/okf/types/Runtime.md +2 -1
- package/dist/okf/types/SCNInstance.md +33 -0
- package/dist/okf/types/SDBDomain.md +2 -2
- package/dist/okf/types/SMBFileShare.md +49 -0
- package/dist/okf/types/SageMakerArtifact.md +27 -0
- package/dist/okf/types/SageMakerEndpoint.md +0 -1
- package/dist/okf/types/ScalableTarget.md +1 -0
- package/dist/okf/types/ScalingPlan.md +6 -6
- package/dist/okf/types/ScheduledReport.md +31 -0
- package/dist/okf/types/SecondaryNetwork.md +26 -0
- package/dist/okf/types/SecurityAgentArtifact.md +25 -0
- package/dist/okf/types/SecurityAgentIntegration.md +31 -0
- package/dist/okf/types/Server.md +1 -0
- package/dist/okf/types/ServerlessCache.md +2 -0
- package/dist/okf/types/ServerlessCacheSnapshot.md +31 -0
- package/dist/okf/types/ServerlessRepoApplication.md +32 -0
- package/dist/okf/types/ServiceDiscoveryInstance.md +3 -7
- package/dist/okf/types/SipMediaApplication.md +27 -0
- package/dist/okf/types/SiteToSiteVpnAttachment.md +2 -0
- package/dist/okf/types/SnapshotCopyGrant.md +20 -0
- package/dist/okf/types/Solution.md +1 -0
- package/dist/okf/types/SourceAssociation.md +25 -0
- package/dist/okf/types/SourceCredential.md +6 -6
- package/dist/okf/types/SourceNetwork.md +23 -0
- package/dist/okf/types/StackFleetAssociation.md +2 -7
- package/dist/okf/types/StorageTierPolicy.md +20 -0
- package/dist/okf/types/StorageVirtualMachine.md +9 -9
- package/dist/okf/types/Stream.md +28 -0
- package/dist/okf/types/SubnetCidrReservation.md +26 -0
- package/dist/okf/types/SubscriptionProvider.md +26 -0
- package/dist/okf/types/SupportPermit.md +29 -0
- package/dist/okf/types/Table.md +2 -1
- package/dist/okf/types/TableOptimizer.md +5 -10
- package/dist/okf/types/Tape.md +31 -0
- package/dist/okf/types/Template.md +36 -0
- package/dist/okf/types/Tenant.md +2 -0
- package/dist/okf/types/Terminology.md +39 -0
- package/dist/okf/types/Thesaurus.md +25 -0
- package/dist/okf/types/ThingPrincipalAttachment.md +3 -8
- package/dist/okf/types/Topic.md +1 -0
- package/dist/okf/types/TopicRuleDestination.md +1 -0
- package/dist/okf/types/TrafficPolicy.md +26 -0
- package/dist/okf/types/TrafficPolicyInstance.md +28 -0
- package/dist/okf/types/TranscribeVocabulary.md +27 -0
- package/dist/okf/types/TransitGatewayRouteTableAttachment.md +2 -0
- package/dist/okf/types/TransitVirtualInterface.md +1 -0
- package/dist/okf/types/Tunnel.md +25 -0
- package/dist/okf/types/UsageLimit.md +26 -0
- package/dist/okf/types/UseCase.md +23 -0
- package/dist/okf/types/User.md +47 -0
- package/dist/okf/types/VPCEndpoint.md +1 -1
- package/dist/okf/types/VPCEndpointService.md +6 -0
- package/dist/okf/types/VPCPeeringConnection.md +2 -2
- package/dist/okf/types/VPNConcentrator.md +1 -1
- package/dist/okf/types/VPNConnection.md +1 -1
- package/dist/okf/types/VerifiedDestinationNumber.md +25 -0
- package/dist/okf/types/View.md +27 -0
- package/dist/okf/types/VoiceConnector.md +30 -0
- package/dist/okf/types/Volume.md +44 -0
- package/dist/okf/types/Vpc.md +1 -1
- package/dist/okf/types/VpcAttachment.md +2 -0
- package/dist/okf/types/WebFunction.md +27 -0
- package/dist/okf/types/WebFunctionEndpoint.md +44 -0
- package/dist/okf/types/WebFunctionRevision.md +32 -0
- package/dist/okf/types/WickrNetwork.md +27 -0
- package/dist/okf/types/Worker.md +29 -0
- package/dist/okf/types/Workforce.md +26 -0
- package/dist/okf/types/Workload.md +35 -0
- package/dist/okf/types/WorkloadEstimate.md +35 -0
- package/dist/okf/types/Workspace.md +28 -0
- package/dist/okf/types/Workteam.md +8 -8
- package/dist/op/activities/aws-apply.js +214 -0
- package/dist/op/activities/floci.js +97 -0
- package/dist/op/activities/index.js +32 -0
- package/dist/op/builders.js +50 -0
- package/dist/ownership.js +52 -0
- package/dist/package-cli.js +25 -0
- package/dist/parameter.js +19 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1012 -0
- package/dist/properties.js +166 -0
- package/dist/pseudo.js +25 -0
- package/dist/receipt-store.d.ts.map +1 -1
- package/dist/receipt-store.js +233 -0
- package/dist/reference-catalog.js +106 -0
- package/dist/rules/ext001.ts +3 -3
- package/dist/rules/waw016.ts +2 -2
- package/dist/serializer.js +529 -0
- package/dist/spec/fetch.js +193 -0
- package/dist/spec/parse.js +259 -0
- package/dist/spec/pin.js +185 -0
- package/dist/spec/pinned-types.json +203 -0
- package/dist/stack-errors.js +14 -0
- package/dist/taggable.d.ts.map +1 -1
- package/dist/taggable.js +33 -0
- package/dist/teardown.js +199 -0
- package/dist/template-sections.js +53 -0
- package/dist/template-transform.js +50 -0
- package/dist/types/index.d.ts +18847 -1124
- package/dist/validate-cli.js +16 -0
- package/dist/validate.js +33 -0
- package/package.json +9 -9
- package/src/agentcore/trace-fetch.ts +2 -1
- package/src/api/credential-chain.ts +119 -9
- package/src/api/credential-isolation.test.ts +72 -0
- package/src/api/read-client-chain.test.ts +159 -0
- package/src/api/read-client.ts +42 -6
- package/src/api/sigv4.ts +4 -4
- package/src/caller-identity.ts +3 -5
- package/src/codegen/any-budget.test.ts +12 -2
- package/src/codegen/generate.ts +9 -0
- package/src/codegen/package.ts +2 -2
- package/src/codegen/patches.test.ts +95 -0
- package/src/codegen/patches.ts +53 -9
- package/src/codegen/property-overlay.json +1 -16
- package/src/components/apply.ts +218 -6
- package/src/components/cfn-plan-floci.e2e.test.ts +76 -0
- package/src/components/cfn-plan.test.ts +225 -16
- package/src/components/cloud-executor.ts +73 -25
- package/src/deep-observe.ts +2 -1
- package/src/disruption.ts +2 -1
- package/src/generated/index.d.ts +18847 -1124
- package/src/generated/index.ts +1376 -161
- package/src/generated/lexicon-aws.json +17359 -784
- package/src/health.test.ts +136 -0
- package/src/health.ts +281 -0
- package/src/identity-observe.ts +2 -1
- package/src/lint/post-synth/ext001.ts +3 -3
- package/src/lint/post-synth/waw016.ts +2 -2
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/plugin.ts +10 -1
- package/src/receipt-store.ts +2 -1
- package/src/spec/pin.ts +3 -3
- package/src/spec/pinned-types.json +203 -0
- package/src/taggable.ts +2 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const DynamoDBActions = {
|
|
2
|
+
// Broad groups
|
|
3
|
+
ReadOnly: [
|
|
4
|
+
"dynamodb:GetItem",
|
|
5
|
+
"dynamodb:BatchGetItem",
|
|
6
|
+
"dynamodb:Query",
|
|
7
|
+
"dynamodb:Scan",
|
|
8
|
+
"dynamodb:DescribeTable",
|
|
9
|
+
"dynamodb:ConditionCheckItem",
|
|
10
|
+
],
|
|
11
|
+
WriteOnly: [
|
|
12
|
+
"dynamodb:PutItem",
|
|
13
|
+
"dynamodb:UpdateItem",
|
|
14
|
+
"dynamodb:DeleteItem",
|
|
15
|
+
"dynamodb:BatchWriteItem",
|
|
16
|
+
],
|
|
17
|
+
ReadWrite: [
|
|
18
|
+
"dynamodb:GetItem",
|
|
19
|
+
"dynamodb:BatchGetItem",
|
|
20
|
+
"dynamodb:Query",
|
|
21
|
+
"dynamodb:Scan",
|
|
22
|
+
"dynamodb:DescribeTable",
|
|
23
|
+
"dynamodb:ConditionCheckItem",
|
|
24
|
+
"dynamodb:PutItem",
|
|
25
|
+
"dynamodb:UpdateItem",
|
|
26
|
+
"dynamodb:DeleteItem",
|
|
27
|
+
"dynamodb:BatchWriteItem",
|
|
28
|
+
],
|
|
29
|
+
Full: ["dynamodb:*"],
|
|
30
|
+
// Operation-specific
|
|
31
|
+
GetItem: ["dynamodb:GetItem", "dynamodb:BatchGetItem"],
|
|
32
|
+
PutItem: ["dynamodb:PutItem", "dynamodb:BatchWriteItem"],
|
|
33
|
+
Query: ["dynamodb:Query"],
|
|
34
|
+
Scan: ["dynamodb:Scan"],
|
|
35
|
+
};
|
|
36
|
+
// Map-backed lookup — avoids computed element access `DynamoDBActions[access]`
|
|
37
|
+
// that the evaluability lint (EVL003) flags despite the statically-typed key (#952).
|
|
38
|
+
const DYNAMODB_ACTIONS = new Map(Object.entries(DynamoDBActions));
|
|
39
|
+
export function dynamoDBActionsFor(access) {
|
|
40
|
+
return DYNAMODB_ACTIONS.get(access) ?? [];
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { S3Actions } from "./s3.js";
|
|
2
|
+
export { LambdaActions } from "./lambda.js";
|
|
3
|
+
export { DynamoDBActions } from "./dynamodb.js";
|
|
4
|
+
export { SQSActions } from "./sqs.js";
|
|
5
|
+
export { SNSActions } from "./sns.js";
|
|
6
|
+
export { IAMActions } from "./iam.js";
|
|
7
|
+
export { ECRActions } from "./ecr.js";
|
|
8
|
+
export { LogsActions } from "./logs.js";
|
|
9
|
+
export { ECSActions } from "./ecs.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const LambdaActions = {
|
|
2
|
+
Invoke: ["lambda:InvokeFunction", "lambda:InvokeAsync"],
|
|
3
|
+
ReadOnly: [
|
|
4
|
+
"lambda:GetFunction",
|
|
5
|
+
"lambda:GetFunctionConfiguration",
|
|
6
|
+
"lambda:GetPolicy",
|
|
7
|
+
"lambda:ListVersionsByFunction",
|
|
8
|
+
"lambda:ListAliases",
|
|
9
|
+
],
|
|
10
|
+
Full: ["lambda:*"],
|
|
11
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const S3Actions = {
|
|
2
|
+
// Broad groups (from AWS managed policies)
|
|
3
|
+
ReadOnly: [
|
|
4
|
+
"s3:GetObject",
|
|
5
|
+
"s3:GetObjectVersion",
|
|
6
|
+
"s3:GetBucketLocation",
|
|
7
|
+
"s3:ListBucket",
|
|
8
|
+
"s3:ListBucketVersions",
|
|
9
|
+
],
|
|
10
|
+
WriteOnly: [
|
|
11
|
+
"s3:PutObject",
|
|
12
|
+
"s3:DeleteObject",
|
|
13
|
+
"s3:PutObjectAcl",
|
|
14
|
+
"s3:AbortMultipartUpload",
|
|
15
|
+
],
|
|
16
|
+
ReadWrite: [
|
|
17
|
+
"s3:GetObject",
|
|
18
|
+
"s3:GetObjectVersion",
|
|
19
|
+
"s3:GetBucketLocation",
|
|
20
|
+
"s3:ListBucket",
|
|
21
|
+
"s3:ListBucketVersions",
|
|
22
|
+
"s3:PutObject",
|
|
23
|
+
"s3:DeleteObject",
|
|
24
|
+
"s3:PutObjectAcl",
|
|
25
|
+
"s3:AbortMultipartUpload",
|
|
26
|
+
],
|
|
27
|
+
Full: ["s3:*"],
|
|
28
|
+
// Operation-specific
|
|
29
|
+
GetObject: ["s3:GetObject", "s3:GetObjectVersion"],
|
|
30
|
+
PutObject: ["s3:PutObject", "s3:AbortMultipartUpload"],
|
|
31
|
+
DeleteObject: ["s3:DeleteObject", "s3:DeleteObjectVersion"],
|
|
32
|
+
ListObjects: ["s3:ListBucket", "s3:ListBucketVersions"],
|
|
33
|
+
};
|
|
34
|
+
// A Map-backed lookup avoids computed element access (`S3Actions[access]`), which
|
|
35
|
+
// the evaluability lint (EVL003) flags even though the key is statically typed —
|
|
36
|
+
// prefer this in evaluable code such as composites (#952).
|
|
37
|
+
const S3_ACTIONS = new Map(Object.entries(S3Actions));
|
|
38
|
+
export function s3ActionsFor(access) {
|
|
39
|
+
return S3_ACTIONS.get(access) ?? [];
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SQSActions = {
|
|
2
|
+
SendMessage: [
|
|
3
|
+
"sqs:SendMessage",
|
|
4
|
+
"sqs:GetQueueUrl",
|
|
5
|
+
"sqs:GetQueueAttributes",
|
|
6
|
+
],
|
|
7
|
+
ReceiveMessage: [
|
|
8
|
+
"sqs:ReceiveMessage",
|
|
9
|
+
"sqs:DeleteMessage",
|
|
10
|
+
"sqs:ChangeMessageVisibility",
|
|
11
|
+
"sqs:GetQueueUrl",
|
|
12
|
+
"sqs:GetQueueAttributes",
|
|
13
|
+
],
|
|
14
|
+
Full: ["sqs:*"],
|
|
15
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace-fetch.d.ts","sourceRoot":"","sources":["../../src/agentcore/trace-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"trace-fetch.d.ts","sourceRoot":"","sources":["../../src/agentcore/trace-fetch.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).
|
|
4
|
+
*
|
|
5
|
+
* Contributed the way the fly lexicon contributes `flyApply` and the cedar
|
|
6
|
+
* lexicon contributes `dogwoodReplay`: a plain exported async function taking
|
|
7
|
+
* one args object, re-exported from `src/op/activities/index.ts`, resolved **by
|
|
8
|
+
* name** by core's activity registry when a project lists the `aws` lexicon.
|
|
9
|
+
* It imports no runtime of its own, so the local executor
|
|
10
|
+
* (`packages/core/src/op/local-executor.ts`) calls it as-is. Transport is
|
|
11
|
+
* injectable through the same `AwsReadHttp` seam `src/api/read-client.ts`
|
|
12
|
+
* already uses, so tests never touch the network and `endpoint` retargets the
|
|
13
|
+
* whole thing.
|
|
14
|
+
*
|
|
15
|
+
* The output is text. The cedar lexicon's `PolicyReplayOp` reads a trace from
|
|
16
|
+
* `tracePath`, so `outPath` here is the handoff — and it is the *only* handoff.
|
|
17
|
+
* Neither package imports the other; the decoupling contract is the grammar.
|
|
18
|
+
*
|
|
19
|
+
* ## Which AgentCore surface actually carries decision history
|
|
20
|
+
*
|
|
21
|
+
* Investigated before building, because the answer changes what can be shipped.
|
|
22
|
+
* Verified against the live API reference and devguide on 2026-08-10:
|
|
23
|
+
*
|
|
24
|
+
* - **There is no `GetTrace`, no `GetSession`, and no `ListRuntimeSessions`.**
|
|
25
|
+
* The `bedrock-agentcore` data plane (API version 2024-02-28) publishes
|
|
26
|
+
* `StopRuntimeSession` with no read counterpart — a runtime session can be
|
|
27
|
+
* killed but not enumerated. `bedrock-agentcore-control` (2023-06-05) is
|
|
28
|
+
* resource CRUD only.
|
|
29
|
+
* <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_Operations.html>
|
|
30
|
+
* - **AgentCore Memory is the one fetchable session history**, and it is what
|
|
31
|
+
* this module reads: `ListSessions`
|
|
32
|
+
* (`POST /memories/{memoryId}/actor/{actorId}/sessions`) and `ListEvents`
|
|
33
|
+
* (`POST /memories/{memoryId}/actor/{actorId}/sessions/{sessionId}`), both
|
|
34
|
+
* paginated, with a `payload[]` of `conversational` (roles `ASSISTANT`,
|
|
35
|
+
* `USER`, `TOOL`, `OTHER`) or `blob` members.
|
|
36
|
+
* <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_ListEvents.html>
|
|
37
|
+
* <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_PayloadType.html>
|
|
38
|
+
* The caveat is load-bearing and is repeated in {@link AgentCoreMemorySource}:
|
|
39
|
+
* Memory holds what the agent *wrote* via `CreateEvent`. It is a store, not a
|
|
40
|
+
* service-side audit. An agent that never writes leaves nothing to replay.
|
|
41
|
+
* - **The service's own per-tool-call and per-decision records are CloudWatch
|
|
42
|
+
* Logs, not an API.** Gateway `tools/call` bodies land in
|
|
43
|
+
* `/aws/vendedlogs/bedrock-agentcore/gateway/APPLICATION_LOGS/{gateway_id}`;
|
|
44
|
+
* the allow/deny itself lives in `aws/spans` span attributes
|
|
45
|
+
* (`aws.agentcore.policy.authorization_decision` = `ALLOW`|`DENY`,
|
|
46
|
+
* `…determining_policies`, `…effects`, `…temporal.event_timestamp_ns`).
|
|
47
|
+
* <https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-gateway-metrics.html>
|
|
48
|
+
* <https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-policy-metrics.html>
|
|
49
|
+
* Both are reachable only through CloudWatch Logs Insights / X-Ray
|
|
50
|
+
* Transaction Search, and the gateway record's `requestBody` is a Java map
|
|
51
|
+
* `toString` (`{id=1, jsonrpc=2.0, method=tools/call, params={…}}`) rather
|
|
52
|
+
* than JSON. Those two sources are therefore *named and refused* here rather
|
|
53
|
+
* than guessed at — see {@link AgentCoreTraceUnavailableError}. An honest
|
|
54
|
+
* partial beats an invented API.
|
|
55
|
+
* - **No emulator serves any of it.** Floci's service index lists no
|
|
56
|
+
* `bedrock-agentcore` at all (its only Bedrock entry is a `bedrock-runtime`
|
|
57
|
+
* stub), and MiniStack implements twelve control-plane runtime/endpoint
|
|
58
|
+
* operations and states that Memory, Gateway, Identity and the rest are not
|
|
59
|
+
* implemented. A control-plane emulator is structurally incapable of serving
|
|
60
|
+
* decision history anyway, since every per-call record lives in CloudWatch.
|
|
61
|
+
* So the testable path today is the injected transport, and the mocked
|
|
62
|
+
* fixtures in `./trace-fetch.test.ts` are the contract.
|
|
63
|
+
*
|
|
64
|
+
* ## Signing
|
|
65
|
+
*
|
|
66
|
+
* SigV4 through `read-client.ts`'s `requestHeaders`, which is the same seam its
|
|
67
|
+
* own CloudFormation and Cloud Control calls use (#1686). Signed when
|
|
68
|
+
* credentials resolve and the target is real AWS; scope-only against an
|
|
69
|
+
* endpoint override, since an emulator does not verify signatures and requiring
|
|
70
|
+
* credentials to read a local lane would be a tax with nothing behind it.
|
|
71
|
+
* `signEndpointOverride: true` opts back in for an override that *is* real AWS.
|
|
72
|
+
* What counts as an override is read-client's `resolveEndpointOverride` rule —
|
|
73
|
+
* the `endpoint` option, else `AWS_ENDPOINT_URL_BEDROCK_AGENTCORE`, else
|
|
74
|
+
* `AWS_ENDPOINT_URL` (#1694).
|
|
75
|
+
*/
|
|
76
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
77
|
+
import { dirname, resolve } from "node:path";
|
|
78
|
+
import { AwsReadError, requestHeaders, serviceUrl, withChainCredentials, withEndpointOverride, } from "../api/read-client.js";
|
|
79
|
+
import { agentCoreDecimal, renderAgentCoreTrace, AgentCoreTraceError, } from "./trace-render.js";
|
|
80
|
+
const SERVICE = "bedrock-agentcore";
|
|
81
|
+
const DEFAULT_MAX_EVENTS = 1000;
|
|
82
|
+
/** `ListEvents` bounds `maxResults` at 100. */
|
|
83
|
+
const PAGE_SIZE = 100;
|
|
84
|
+
/**
|
|
85
|
+
* A source that exists in AWS but is not reachable the way this module reads.
|
|
86
|
+
*
|
|
87
|
+
* The message names the finding and the surface, so a caller who hits it knows
|
|
88
|
+
* whether they are blocked on chant or on AWS. Both current cases are the
|
|
89
|
+
* latter: the record is real, it is in CloudWatch Logs, and getting at it is a
|
|
90
|
+
* Logs Insights integration rather than an AgentCore API call.
|
|
91
|
+
*/
|
|
92
|
+
export class AgentCoreTraceUnavailableError extends Error {
|
|
93
|
+
constructor(source, message) {
|
|
94
|
+
super(message);
|
|
95
|
+
this.source = source;
|
|
96
|
+
this.name = "AgentCoreTraceUnavailableError";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const UNAVAILABLE = {
|
|
100
|
+
"gateway-logs": "AgentCore Gateway does not publish an API that returns per-invocation tool calls. " +
|
|
101
|
+
"The record exists, vended to CloudWatch Logs at " +
|
|
102
|
+
"/aws/vendedlogs/bedrock-agentcore/gateway/APPLICATION_LOGS/{gateway_id}, but its requestBody " +
|
|
103
|
+
"field is a Java map toString ({id=1, jsonrpc=2.0, method=tools/call, params={…}}) rather than " +
|
|
104
|
+
"JSON, so reading it is a CloudWatch Logs Insights integration with its own parser, not a fetch. " +
|
|
105
|
+
'Use source: "memory" (AgentCore Memory ListEvents), or file the Logs Insights source as its own issue. ' +
|
|
106
|
+
"See https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-gateway-metrics.html",
|
|
107
|
+
spans: "AgentCore policy decisions are not returned by any published API. AuthorizeAction and " +
|
|
108
|
+
"PartiallyAuthorizeActions appear only as a CloudWatch metric dimension; the per-call allow/deny " +
|
|
109
|
+
"lives in aws.agentcore.policy.authorization_decision on spans in the aws/spans log group, " +
|
|
110
|
+
"readable through CloudWatch Logs Insights or xray:StartTraceRetrieval and requiring Transaction " +
|
|
111
|
+
'Search. Use source: "memory" for the tool-call history a replay actually needs — a replay ' +
|
|
112
|
+
"recomputes the verdict from the policy set, so the recorded decision is a comparison input, not " +
|
|
113
|
+
"a trace input. See https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-policy-metrics.html",
|
|
114
|
+
};
|
|
115
|
+
function isRecord(value) {
|
|
116
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
117
|
+
}
|
|
118
|
+
/* ── Time ─────────────────────────────────────────────────────────────────── */
|
|
119
|
+
/**
|
|
120
|
+
* Epoch milliseconds from whatever the wire carried.
|
|
121
|
+
*
|
|
122
|
+
* restJson1 renders a `timestamp` shape as epoch **seconds**, possibly
|
|
123
|
+
* fractional, but the docs' examples and several SDK paths show ISO-8601, so
|
|
124
|
+
* both are accepted. A bare number is disambiguated by magnitude: anything at
|
|
125
|
+
* or beyond 1e12 is already milliseconds (1e12 ms is 2001; 1e12 s is the year
|
|
126
|
+
* 33658), so the heuristic has no realistic collision. Anything else throws
|
|
127
|
+
* rather than being coerced — a guessed timestamp puts every temporal window in
|
|
128
|
+
* the replay in the wrong place.
|
|
129
|
+
*/
|
|
130
|
+
export function toEpochMs(value, what) {
|
|
131
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
132
|
+
return value >= 1e12 ? Math.round(value) : Math.round(value * 1000);
|
|
133
|
+
}
|
|
134
|
+
if (typeof value === "string" && value.length > 0) {
|
|
135
|
+
const parsed = Date.parse(value);
|
|
136
|
+
if (Number.isFinite(parsed))
|
|
137
|
+
return parsed;
|
|
138
|
+
}
|
|
139
|
+
throw new AgentCoreTraceError(`agentcore trace: ${what} is not a usable timestamp (${JSON.stringify(value)}) — the history is malformed, and a guessed timepoint moves every temporal window in the replay`);
|
|
140
|
+
}
|
|
141
|
+
const IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
142
|
+
/** `tool-name` → `tool_name`, `2fa` → `f_2fa`. Deterministic, so goldens hold. */
|
|
143
|
+
export function identifierFor(key) {
|
|
144
|
+
const cleaned = key.replace(/[^A-Za-z0-9_]/g, "_");
|
|
145
|
+
return IDENT.test(cleaned) ? cleaned : `f_${cleaned}`;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* A non-integer JS number as a decimal literal the Cedar surface accepts.
|
|
149
|
+
*
|
|
150
|
+
* `String(1e-7)` is `"1e-7"`, which is not a decimal literal, so a legitimate
|
|
151
|
+
* small payload number would otherwise abort the whole fetch. `toFixed(20)` is
|
|
152
|
+
* the widest non-exponential rendering JS offers, and the trailing zeros it
|
|
153
|
+
* pads with come back off.
|
|
154
|
+
*
|
|
155
|
+
* A value too small for even that rounds to `0.0`, and a trace that says a
|
|
156
|
+
* policy compared against zero when the agent saw something else is the whole
|
|
157
|
+
* failure class this module exists to prevent — so it throws instead, naming
|
|
158
|
+
* the field.
|
|
159
|
+
*/
|
|
160
|
+
export function decimalText(value, context) {
|
|
161
|
+
const plain = String(value);
|
|
162
|
+
if (!/e/i.test(plain))
|
|
163
|
+
return plain;
|
|
164
|
+
const fixed = value.toFixed(20).replace(/(\.\d*?)0+$/, "$1");
|
|
165
|
+
const text = fixed.endsWith(".") ? `${fixed}0` : fixed;
|
|
166
|
+
if (Number(text) !== value) {
|
|
167
|
+
const where = context ? ` at ${context}` : "";
|
|
168
|
+
throw new AgentCoreTraceError(`agentcore trace: ${plain}${where} has no exact decimal spelling in the trace grammar — it would render as ${text}, and a policy comparing against that would be comparing against a number the agent never saw. Carry it as a string.`);
|
|
169
|
+
}
|
|
170
|
+
return text;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Coerce arbitrary JSON into trace values.
|
|
174
|
+
*
|
|
175
|
+
* A non-integer number becomes a Cedar decimal rather than being rounded,
|
|
176
|
+
* because the scale is the thing a policy compares against. `null` and
|
|
177
|
+
* `undefined` are dropped from *records*, because Cedar has no null and an
|
|
178
|
+
* invented sentinel would be matched by a predicate that meant something else.
|
|
179
|
+
* And a key the grammar cannot spell is renamed — every rename is returned, so
|
|
180
|
+
* a caller can see it, and `onNonIdentifierField: "fail"` refuses instead.
|
|
181
|
+
*
|
|
182
|
+
* Two things throw rather than being smoothed over, and both are the same
|
|
183
|
+
* failure this module refuses everywhere else — data that changes meaning
|
|
184
|
+
* without saying so. A `null` *inside an array* would shift every later index,
|
|
185
|
+
* so a predicate on `args[1]` would start matching `args[0]`'s value. And two
|
|
186
|
+
* payload keys that rewrite to the same identifier (`tool-name` and `tool.name`
|
|
187
|
+
* both become `tool_name`) would silently drop one of them.
|
|
188
|
+
*/
|
|
189
|
+
export function coerceFields(value, options = {}, path = "", renames = []) {
|
|
190
|
+
const fields = {};
|
|
191
|
+
if (!isRecord(value))
|
|
192
|
+
return { fields, renames };
|
|
193
|
+
const sources = new Map();
|
|
194
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
195
|
+
const here = path ? `${path}.${key}` : key;
|
|
196
|
+
const coerced = coerceValue(raw, options, here, renames);
|
|
197
|
+
if (coerced === undefined)
|
|
198
|
+
continue;
|
|
199
|
+
let name = key;
|
|
200
|
+
if (!IDENT.test(key)) {
|
|
201
|
+
if (options.onNonIdentifierField === "fail") {
|
|
202
|
+
throw new AgentCoreTraceError(`agentcore trace: the payload field "${here}" is not an identifier and the dogwood trace grammar cannot spell it — rename it at the source, or accept the rewrite by leaving onNonIdentifierField unset`);
|
|
203
|
+
}
|
|
204
|
+
name = identifierFor(key);
|
|
205
|
+
renames.push({ path: here, from: key, to: name });
|
|
206
|
+
}
|
|
207
|
+
const taken = sources.get(name);
|
|
208
|
+
if (taken !== undefined) {
|
|
209
|
+
throw new AgentCoreTraceError(`agentcore trace: the payload fields "${taken}" and "${key}" both spell "${name}" in the trace grammar, so one would overwrite the other and a predicate on it would read the wrong value — rename one at the source`);
|
|
210
|
+
}
|
|
211
|
+
sources.set(name, key);
|
|
212
|
+
fields[name] = coerced;
|
|
213
|
+
}
|
|
214
|
+
return { fields, renames };
|
|
215
|
+
}
|
|
216
|
+
function coerceValue(value, options, path, renames) {
|
|
217
|
+
if (value === null || value === undefined)
|
|
218
|
+
return undefined;
|
|
219
|
+
if (typeof value === "string" || typeof value === "boolean")
|
|
220
|
+
return value;
|
|
221
|
+
if (typeof value === "number") {
|
|
222
|
+
if (!Number.isFinite(value))
|
|
223
|
+
return undefined;
|
|
224
|
+
return Number.isInteger(value) ? value : agentCoreDecimal(decimalText(value, path), path);
|
|
225
|
+
}
|
|
226
|
+
if (Array.isArray(value)) {
|
|
227
|
+
return value.map((item, index) => {
|
|
228
|
+
const here = `${path}[${index}]`;
|
|
229
|
+
const coerced = coerceValue(item, options, here, renames);
|
|
230
|
+
if (coerced === undefined) {
|
|
231
|
+
throw new AgentCoreTraceError(`agentcore trace: ${here} has no value the trace grammar can carry (${JSON.stringify(item) ?? "undefined"}), and dropping it would shift every later element — so a predicate written against a position in this array would read its neighbour's value. Fix it at the source.`);
|
|
232
|
+
}
|
|
233
|
+
return coerced;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (isRecord(value))
|
|
237
|
+
return coerceFields(value, options, path, renames).fields;
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* One payload group from a `blob` member.
|
|
242
|
+
*
|
|
243
|
+
* A blob is arbitrary JSON, so `input` is not necessarily a record —
|
|
244
|
+
* `input: "the prompt text"` is a perfectly ordinary thing for an agent to
|
|
245
|
+
* write. A non-record is wrapped under `value` the same way a non-record
|
|
246
|
+
* `conversational.content` is, rather than being dropped for not being the
|
|
247
|
+
* shape this module hoped for.
|
|
248
|
+
*/
|
|
249
|
+
function coerceGroup(value, options, path, renames) {
|
|
250
|
+
if (value === undefined || value === null)
|
|
251
|
+
return {};
|
|
252
|
+
return coerceFields(isRecord(value) ? value : { value }, options, path, renames).fields;
|
|
253
|
+
}
|
|
254
|
+
/** Default role mapping. `TOOL` is a decision-kind `request`: it is the call being authorized. */
|
|
255
|
+
export const DEFAULT_ROLE_MAPPING = {
|
|
256
|
+
USER: { action: "Prompt", kind: "request" },
|
|
257
|
+
ASSISTANT: { action: "Respond", kind: "response" },
|
|
258
|
+
TOOL: { action: "InvokeTool", kind: "request" },
|
|
259
|
+
OTHER: { action: "Event", kind: "request" },
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* The `blob` convention this module reads.
|
|
263
|
+
*
|
|
264
|
+
* A `blob` payload is arbitrary JSON, so there is nothing to parse until
|
|
265
|
+
* someone agrees on a shape. This is that shape, and it is the one worth
|
|
266
|
+
* writing from `CreateEvent`: `action` and `kind` decide the trace's grammar
|
|
267
|
+
* slots, `input`/`output`/`error` become the payload groups that land in both
|
|
268
|
+
* bags, and everything else becomes `attributes`. Every key is optional; an
|
|
269
|
+
* absent `action` falls back to the role mapping's `OTHER`.
|
|
270
|
+
*/
|
|
271
|
+
export const BLOB_KEYS = ["action", "kind", "input", "output", "error"];
|
|
272
|
+
/**
|
|
273
|
+
* `ListEvents` output → the renderer's normalized events. Pure: no transport.
|
|
274
|
+
*
|
|
275
|
+
* One event with N payload members becomes N normalized events sharing the
|
|
276
|
+
* event's timestamp, with `#0`, `#1`, … appended to the id — the trace's
|
|
277
|
+
* `requestId` has to identify a decision point, and a two-member event is two
|
|
278
|
+
* decision points. A member that is neither `conversational` nor `blob` is a
|
|
279
|
+
* shape this module does not know, and it throws rather than being skipped:
|
|
280
|
+
* a silently dropped tool call is a temporal predicate that silently misses.
|
|
281
|
+
*/
|
|
282
|
+
export function normalizeMemoryEvents(events, options = {}) {
|
|
283
|
+
const roles = { ...DEFAULT_ROLE_MAPPING, ...(options.roles ?? {}) };
|
|
284
|
+
const renames = [];
|
|
285
|
+
const out = [];
|
|
286
|
+
events.forEach((event, index) => {
|
|
287
|
+
const where = `event ${index}${event.eventId ? ` (${event.eventId})` : ""}`;
|
|
288
|
+
const timeMs = toEpochMs(event.eventTimestamp, `${where}'s eventTimestamp`);
|
|
289
|
+
const members = event.payload ?? [];
|
|
290
|
+
if (members.length === 0) {
|
|
291
|
+
throw new AgentCoreTraceError(`agentcore trace: ${where} has an empty payload — either includePayloads was false or the history is truncated, and a payload-less trace replays green while proving nothing`, index);
|
|
292
|
+
}
|
|
293
|
+
members.forEach((member, slot) => {
|
|
294
|
+
const suffix = members.length > 1 ? `#${slot}` : "";
|
|
295
|
+
const base = {
|
|
296
|
+
timeMs,
|
|
297
|
+
sessionId: event.sessionId ?? "",
|
|
298
|
+
eventId: `${event.eventId ?? ""}${suffix}`,
|
|
299
|
+
actor: event.actorId ?? "",
|
|
300
|
+
target: options.target ?? event.memoryId ?? "",
|
|
301
|
+
};
|
|
302
|
+
if (member.conversational) {
|
|
303
|
+
const role = member.conversational.role ?? "OTHER";
|
|
304
|
+
const mapping = roles[role] ?? roles.OTHER;
|
|
305
|
+
const content = coerceGroup(isRecord(member.conversational.content)
|
|
306
|
+
? member.conversational.content
|
|
307
|
+
: { text: member.conversational.content }, options, `${where}.payload[${slot}].conversational.content`, renames);
|
|
308
|
+
out.push({
|
|
309
|
+
...base,
|
|
310
|
+
action: mapping.action,
|
|
311
|
+
kind: mapping.kind,
|
|
312
|
+
...(Object.keys(content).length > 0 ? { input: content } : {}),
|
|
313
|
+
attributes: { role },
|
|
314
|
+
});
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
if (member.blob !== undefined) {
|
|
318
|
+
const blob = isRecord(member.blob) ? member.blob : { value: member.blob };
|
|
319
|
+
const prefix = `${where}.payload[${slot}].blob`;
|
|
320
|
+
const rest = {};
|
|
321
|
+
for (const [key, value] of Object.entries(blob)) {
|
|
322
|
+
if (!BLOB_KEYS.includes(key))
|
|
323
|
+
rest[key] = value;
|
|
324
|
+
}
|
|
325
|
+
const groups = {
|
|
326
|
+
input: coerceGroup(blob.input, options, `${prefix}.input`, renames),
|
|
327
|
+
output: coerceGroup(blob.output, options, `${prefix}.output`, renames),
|
|
328
|
+
error: coerceGroup(blob.error, options, `${prefix}.error`, renames),
|
|
329
|
+
attributes: coerceFields(rest, options, prefix, renames).fields,
|
|
330
|
+
};
|
|
331
|
+
out.push({
|
|
332
|
+
...base,
|
|
333
|
+
action: typeof blob.action === "string" && blob.action.length > 0 ? blob.action : roles.OTHER.action,
|
|
334
|
+
kind: typeof blob.kind === "string" && blob.kind.length > 0 ? blob.kind : roles.OTHER.kind,
|
|
335
|
+
...(Object.keys(groups.input).length > 0 ? { input: groups.input } : {}),
|
|
336
|
+
...(Object.keys(groups.output).length > 0 ? { output: groups.output } : {}),
|
|
337
|
+
...(Object.keys(groups.error).length > 0 ? { error: groups.error } : {}),
|
|
338
|
+
...(Object.keys(groups.attributes).length > 0 ? { attributes: groups.attributes } : {}),
|
|
339
|
+
});
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
throw new AgentCoreTraceError(`agentcore trace: ${where}.payload[${slot}] is neither conversational nor blob — PayloadType is a union of exactly those two, so this is a shape change or a corrupt record, and skipping it would drop a decision point from the replay`, index);
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
return { events: out, renames };
|
|
346
|
+
}
|
|
347
|
+
/* ── Transport ────────────────────────────────────────────────────────────── */
|
|
348
|
+
const defaultHttp = async (url, init, signal) => {
|
|
349
|
+
const res = await fetch(url, { method: "POST", headers: init.headers, body: init.body, signal });
|
|
350
|
+
return { status: res.status, text: await res.text() };
|
|
351
|
+
};
|
|
352
|
+
async function agentCorePost(path, body, readOptions, http, signal) {
|
|
353
|
+
const options = await withChainCredentials(withEndpointOverride(SERVICE, readOptions));
|
|
354
|
+
const url = `${serviceUrl(SERVICE, options.endpoint, options.region)}${path.replace(/^\//, "")}`;
|
|
355
|
+
const wire = JSON.stringify(body);
|
|
356
|
+
const res = await http(url, {
|
|
357
|
+
headers: requestHeaders(SERVICE, url, wire, { "content-type": "application/json" }, options),
|
|
358
|
+
body: wire,
|
|
359
|
+
}, signal);
|
|
360
|
+
let parsed;
|
|
361
|
+
try {
|
|
362
|
+
parsed = JSON.parse(res.text);
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
throw new AwsReadError(`unparseable ${SERVICE} response for ${path}`, res.status);
|
|
366
|
+
}
|
|
367
|
+
const payload = isRecord(parsed) ? parsed : {};
|
|
368
|
+
const type = typeof payload.__type === "string" ? payload.__type.split("#").pop() : undefined;
|
|
369
|
+
if (type || res.status >= 400) {
|
|
370
|
+
const message = typeof payload.message === "string" ? payload.message : `${path} failed with HTTP ${res.status}`;
|
|
371
|
+
throw new AwsReadError(message, res.status, type);
|
|
372
|
+
}
|
|
373
|
+
return payload;
|
|
374
|
+
}
|
|
375
|
+
/** Path-segment encoding for the Memory REST routes. */
|
|
376
|
+
function segment(value, what) {
|
|
377
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
378
|
+
throw new AgentCoreTraceError(`agentcore trace: ${what} is required to read a session history`);
|
|
379
|
+
}
|
|
380
|
+
return encodeURIComponent(value);
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* `ListEvents` for one session, paginated to exhaustion or to `maxEvents`.
|
|
384
|
+
*
|
|
385
|
+
* `includePayloads` is always true: without it the response carries event ids
|
|
386
|
+
* and timestamps and nothing to match a predicate against, which is a trace
|
|
387
|
+
* that replays green and proves nothing.
|
|
388
|
+
*/
|
|
389
|
+
export async function listMemoryEvents(args, signal, http = defaultHttp) {
|
|
390
|
+
const path = `memories/${segment(args.memoryId, "memoryId")}` +
|
|
391
|
+
`/actor/${segment(args.actorId, "actorId")}` +
|
|
392
|
+
`/sessions/${segment(args.sessionId, "sessionId")}`;
|
|
393
|
+
const cap = args.maxEvents ?? DEFAULT_MAX_EVENTS;
|
|
394
|
+
// `ListEvents` bounds maxResults at 1..100, so a cap of 0 would go out as a
|
|
395
|
+
// request the service rejects rather than as an empty result.
|
|
396
|
+
if (!Number.isInteger(cap) || cap < 1) {
|
|
397
|
+
throw new AgentCoreTraceError(`agentcore trace: maxEvents must be a positive integer — got ${String(cap)}`);
|
|
398
|
+
}
|
|
399
|
+
const out = [];
|
|
400
|
+
let nextToken;
|
|
401
|
+
do {
|
|
402
|
+
const body = await agentCorePost(path, {
|
|
403
|
+
includePayloads: true,
|
|
404
|
+
maxResults: Math.min(PAGE_SIZE, cap - out.length),
|
|
405
|
+
...(nextToken ? { nextToken } : {}),
|
|
406
|
+
}, args, http, signal);
|
|
407
|
+
const events = Array.isArray(body.events) ? body.events : [];
|
|
408
|
+
out.push(...events);
|
|
409
|
+
nextToken = typeof body.nextToken === "string" && body.nextToken.length > 0 ? body.nextToken : undefined;
|
|
410
|
+
if (events.length === 0)
|
|
411
|
+
break;
|
|
412
|
+
} while (nextToken && out.length < cap);
|
|
413
|
+
return out.slice(0, cap);
|
|
414
|
+
}
|
|
415
|
+
function windowBound(value, what) {
|
|
416
|
+
if (value === undefined)
|
|
417
|
+
return undefined;
|
|
418
|
+
return toEpochMs(value, what);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Fetch an AgentCore session history and render it as dogwood trace text.
|
|
422
|
+
*
|
|
423
|
+
* The window is applied client-side because `ListEvents`' `filter` takes a
|
|
424
|
+
* branch and event metadata and has no time predicate, so a server-side window
|
|
425
|
+
* is not on offer. `maxEvents` bounds the fetch; `since`/`until` bound what is
|
|
426
|
+
* normalized and rendered.
|
|
427
|
+
*/
|
|
428
|
+
export async function awsAgentCoreFetchTrace(args, signal, http = defaultHttp) {
|
|
429
|
+
const source = args.source ?? "memory";
|
|
430
|
+
if (source !== "memory") {
|
|
431
|
+
const detail = UNAVAILABLE[source];
|
|
432
|
+
if (!detail) {
|
|
433
|
+
throw new AgentCoreTraceUnavailableError(source, `agentcore trace: unknown source "${String(source)}"`);
|
|
434
|
+
}
|
|
435
|
+
throw new AgentCoreTraceUnavailableError(source, `agentcore trace: ${detail}`);
|
|
436
|
+
}
|
|
437
|
+
const raw = await listMemoryEvents(args, signal, http);
|
|
438
|
+
const since = windowBound(args.since, "the window's `since`");
|
|
439
|
+
const until = windowBound(args.until, "the window's `until`");
|
|
440
|
+
// The window is applied to the *fetched* events, before normalizing, so an
|
|
441
|
+
// event the caller deliberately excluded cannot fail the run. Normalizing
|
|
442
|
+
// first would let one payload-less record anywhere in the fetched range abort
|
|
443
|
+
// a narrowed window with no way to recover short of shrinking maxEvents.
|
|
444
|
+
const inWindow = raw.filter((event, index) => {
|
|
445
|
+
const at = toEpochMs(event.eventTimestamp, `event ${index}${event.eventId ? ` (${event.eventId})` : ""}'s eventTimestamp`);
|
|
446
|
+
return (since === undefined || at >= since) && (until === undefined || at <= until);
|
|
447
|
+
});
|
|
448
|
+
const { events: windowed, renames } = normalizeMemoryEvents(inWindow, args);
|
|
449
|
+
if (windowed.length === 0 && (args.requireEvents ?? true)) {
|
|
450
|
+
const window = since !== undefined || until !== undefined ? " in the requested window" : "";
|
|
451
|
+
throw new AgentCoreTraceError(`agentcore trace: session ${args.sessionId} has no events${window} (${raw.length} fetched). ` +
|
|
452
|
+
"AgentCore Memory holds what the agent wrote through CreateEvent, not a service-side audit, so an " +
|
|
453
|
+
"agent that never writes leaves nothing to replay. Pass requireEvents: false to accept an empty trace.");
|
|
454
|
+
}
|
|
455
|
+
const { text, lines, issues } = renderAgentCoreTrace(windowed, args);
|
|
456
|
+
let written;
|
|
457
|
+
if (args.outPath) {
|
|
458
|
+
written = resolve(args.outPath);
|
|
459
|
+
await mkdir(dirname(written), { recursive: true });
|
|
460
|
+
await writeFile(written, text, "utf8");
|
|
461
|
+
}
|
|
462
|
+
return {
|
|
463
|
+
source,
|
|
464
|
+
sessionId: args.sessionId,
|
|
465
|
+
text,
|
|
466
|
+
lineCount: lines.length,
|
|
467
|
+
fetched: raw.length,
|
|
468
|
+
...(written ? { outPath: written } : {}),
|
|
469
|
+
renames,
|
|
470
|
+
issues,
|
|
471
|
+
};
|
|
472
|
+
}
|