Core API
Core types, errors, and utilities for the PromptScript toolchain.
This package provides the foundational types and comprehensive error handling classes used across the entire PromptScript ecosystem. It includes:
- Common Types: AST interfaces, configuration schemas, and shared type definitions.
- Error Handling: A hierarchy of typed errors (
PSError) for precise exception management. - Utilities: Shared helper functions for path manipulation and validation.
Enumerations
Classes
- AgentConflictError
- CircularDependencyError
- CircularGuardRequiresError
- FileNotFoundError
- GitAuthError
- GitCloneError
- GitRefNotFoundError
- LockfileIntegrityError
- MissingParamError
- OfflineResolveError
- OutputPlanPathError
- ParamTypeMismatchError
- ParseError
- PSError
- RateLimitError
- RegistryPathNotFoundError
- ResolveError
- SemverNoMatchError
- TargetCapabilitiesError
- UndefinedVariableError
- UnexpectedTokenError
- UnknownAliasError
- UnknownParamError
- ValidationError
Interfaces
- AgentConflict
- AgentFieldStatusGroups
- AgentFieldTargetSupport
- AgentProvenance
- ApprovalApproverV1
- ApprovalRecordV1
- ArrayContent
- ArrayElementNode
- ArrayValueNode
- BaseNode
- BasePolicyDefinition
- Block
- BlockBody
- BlockBodyOptions
- BlockOperation
- BlockReplacement
- BlockShapeContract
- BuildProfileConfig
- CanonicalBlock
- CanonicalExtendBlock
- CanonicalNode
- CanonicalOverrideBlock
- CanonicalProgram
- CanonicalProgramOptions
- CatalogEntry
- ComposedPhase
- ContentRulesPolicy
- DefaultFeatureProfile
- DetectionHints
- EvalAssertionBase
- EvalAssertionResultV1
- EvalBudgetV1
- EvalCacheEntryV1
- EvalCacheRequestV1
- EvalCacheResponseV1
- EvalCacheUseV1
- EvalCaseErrorV1
- EvalCaseResultV1
- EvalComparisonEntryV1
- EvalComparisonV1
- EvalConfig
- EvalContainsAssertion
- EvalDatasetAllow
- EvalDatasetAllowPii
- EvalDatasetRef
- EvalDatasetRefV1
- EvalDatasetRowV1
- EvalEqualsAssertion
- EvalFindingV1
- EvalImportReplacementsV1
- EvalImportSkippedV1
- EvalImportStepsV1
- EvalImportSummaryV1
- EvalJsonSchemaAssertion
- EvalJudgeAgreementV1
- EvalJudgeConfig
- EvalJudgeRefV1
- EvalJudgeResultV1
- EvalLabelRowV1
- EvalLatencyThresholds
- EvalLatencyV1
- EvalLlmJudgeAssertion
- EvalModelEntry
- EvalModelResultV1
- EvalPromptRefV1
- EvalProviderConfig
- EvalRegexAssertion
- EvalReportCacheV1
- EvalReportErrorV1
- EvalReportV1
- EvalSampleFeedbackV1
- EvalSampleV1
- EvalSuiteResultV1
- EvalSuiteV1
- EvalThresholdResultV1
- EvalThresholds
- EvalTokenUsageV1
- EvalUsageV1
- ExampleDefinition
- ExtendBlock
- ExtendOperation
- FieldEntry
- FormattingConfig
- GovernanceCodeownersConfig
- GovernanceConfig
- GovernanceMeta
- HookCapability
- HookTerminalCapability
- InheritDeclaration
- InheritOperation
- InlineUseDeclaration
- InlineUseEntry
- LayerBoundaryPolicy
- LegacyProjectionOptions
- ListEntry
- Lockfile
- LockfileDependency
- LockfileReference
- Logger
- MaxExperimentWeightPolicy
- MetaBlock
- MixedContent
- ModelAllowlistPolicy
- ModelCatalog
- ModelInvocation
- ModelParams
- ModelPricing
- ModelProfile
- ModelProfileInput
- ModelsConfig
- ModelSet
- ModelTargetScheme
- NamespaceDefinition
- ObjectContent
- ObjectFieldNode
- ObjectValueNode
- OmittedManagedDirectory
- OutputArtifact
- OutputConvention
- OutputPlan
- OutputPlanCandidate
- OutputPlanCollision
- OutputPlanFile
- OutputPlanManagedPaths
- OverrideBlock
- OverrideOperation
- ParamArgument
- ParamDefinition
- PathReference
- PolicySubject
- PolicyViolation
- PresentationEntry
- PrettierMarkdownOptions
- Program
- ProjectContext
- PromptBundleIndexEntry
- PromptBundleIndexV1
- PromptBundleInput
- PromptBundleMessage
- PromptBundleModel
- PromptBundleOutput
- PromptBundleOutputProperty
- PromptBundleProvenance
- PromptBundleSegment
- PromptBundleV1
- PromptComposition
- PromptDefinition
- PromptExtraction
- PromptExtractionIssue
- PromptOutputField
- PromptOutputSchema
- PromptPolicyMatch
- PromptReleaseControlArm
- PromptReleaseExperiment
- PromptReleaseLabelEntry
- PromptReleaseLabelEntryV2
- PromptReleaseLabelV1
- PromptReleaseLabelV2
- PromptReleasePricingModel
- PromptReleasePricingV1
- PromptReleaseVariantArm
- PromptScriptConfig
- PropertyProtectionPolicy
- ProvenanceEntry
- ProvenanceEvent
- ProvenanceLink
- ProvenanceStep
- ProvenanceTrace
- RegistryAliasEntry
- RegistryAllowlistPolicy
- RegistryManifest
- RegistryMeta
- ReleasesConfig
- ReplaceModifier
- RequiredApproval
- RequiredApprovalsPolicy
- RequiredEvalsPolicy
- RequiredMetadataPolicy
- RiskFloorPolicy
- RiskFloorRow
- RuntimeSlotMatch
- ScalarValueNode
- SectionContract
- SectionRenderer
- SkillContractField
- SkillDefinition
- SkillPathConfig
- SkillPhaseContent
- SourceAttribution
- SourceLocation
- SourceRange
- StructuredMergeOperation
- StructuredMergePlan
- SuggestionAction
- SuggestionCondition
- SuggestionReasoning
- SuggestionResult
- SuggestionRule
- SyntaxFeatureUsage
- SyntaxVersionDef
- TargetCapability
- TargetConfig
- TargetDefinition
- TargetModel
- TargetResourceCapability
- TargetSectionCapability
- TargetSettingsConfig
- TargetSettingsPermissions
- TargetVersionCapability
- TemplateContext
- TemplateExpression
- TemplateValueNode
- TextContent
- TextEntry
- TextValueNode
- TypeExpression
- TypeExpressionValueNode
- UseDeclaration
- UseOperation
- UserConfig
- ValidateErrorV1
- ValidateLocationV1
- ValidateReportV1
- ValidateSummaryV1
- ValidateWarningV1
- ValidationExclude
- ValueReplacement
Type Aliases
- AgentFieldMatrix
- AgentFieldStatus
- BlockContent
- BlockEntry
- BlockInput
- BlockName
- BlockShape
- BlockTypeName
- BuiltInConventionName
- CanonicalAgentField
- CanonicalProgramInput
- ClaudeVersion
- ComposableBlock
- ContentRuleCheck
- ConventionName
- CustomTarget
- DeepReadonly
- DefaultOutputPathMap
- EnvironmentVariableProvider
- EvalAssertion
- EvalAssertionKind
- EvalCacheKey
- EvalCacheMode
- EvalCaseStatus
- EvalExpectedValue
- EvalFindingSeverity
- EvalInputValue
- EvalJudgeRuns
- EvalOutcome
- EvalProviderKind
- EvalThresholdName
- EvalVerdict
- FactoryHooksFile
- FactoryRulesMode
- GithubVersion
- GovernanceOwner
- GovernanceRoleName
- GovernanceRoleOwners
- HookProjectRootStrategy
- HookRuntimeTarget
- HookSupportStatus
- HookTerminalGuarantee
- HookTimeoutUnit
- KnownTarget
- LegacyContentType
- LegacyProgram
- ManifestTarget
- MarkerMode
- ModelResolution
- ModelStatus
- OutputPlanArtifactRole
- OutputPlanCollisionResolution
- OutputResourceKind
- OverrideReplacement
- ParamType
- PathTokenName
- PathTokenValues
- PolicyDefinition
- PolicyKind
- PolicySeverity
- PortableHookInterpreter
- PrimitiveValue
- ProgramInput
- ProgramOperation
- PromptBundleRole
- PromptInput
- PromptReleaseLabel
- PromptScalarType
- ProvenanceAction
- ProvenanceOperation
- RegistriesConfig
- ReleaseEnvironmentName
- ReservedWord
- RiskLevel
- SectionProfile
- Severity
- SyntaxFeature
- TargetEntry
- TargetFamily
- TargetFeatureStatus
- TargetModelIssue
- TargetName
- TargetReferenceMode
- TargetSectionMap
- TargetSectionSupport
- TargetVersionMap
- Value
- ValueNode
Variables
- APPROVAL_RECORD_SCHEMA_URL
- BLOCK_ALIASES
- BLOCK_SHAPE_CONTRACTS
- BLOCK_TYPES
- BUILT_IN_CONVENTIONS
- CANONICAL_AGENT_FIELDS
- CODING_TARGETS
- COMPOSABLE_BLOCKS
- CONTEXTUAL_DIRECTIVES
- CONTEXTUAL_OPERATION_DIRECTIVES
- DEFAULT_PRETTIER_OPTIONS
- FLOATING_MODEL_ALIASES
- GIT_HOST_USER_PATTERN
- HOOK_CAPABILITIES
- HOOK_RUNTIME_CAPABILITIES
- INHERIT_MODEL
- KNOWN_TARGETS
- LATEST_SYNTAX_VERSION
- LOCKFILE_VERSION
- MARKDOWN_CONVENTION
- MAX_APPROVER_LENGTH
- MODEL_TARGET_SCHEMES
- noopLogger
- OUTPUT_RESOURCE_KINDS
- PATH_TOKEN_NAMES
- PORTABLE_HOOK_INTERPRETERS
- PROMPT_BUNDLE_INDEX_SCHEMA_URL
- PROMPT_BUNDLE_SCHEMA_URL
- PROMPT_ENTRY_KEYS
- PROMPT_INPUT_NAME_PATTERN
- PROMPT_KEY_PATTERN
- PROMPT_MODEL_KEYS
- PROMPT_SCALAR_TYPES
- RESERVED_WORDS
- RISK_LEVELS
- RUNTIME_SLOT_NAMESPACE
- SECTION_PROFILES
- SECTION_REGISTRY
- SYNTAX_FEATURES
- SYNTAX_VERSIONS
- TARGET_CAPABILITIES
- TARGET_DEFINITIONS
- TARGET_DELEGATES
- TEMPLATE_VARIABLE_PATTERN
- VSCODE_HOOK_CAPABILITY
- XML_CONVENTION
Functions
- approvalRecordPath
- blockBodyToContent
- blockContentToBody
- blockOwnsSection
- buildSkillPhaseSection
- collectProvenance
- createBlockBody
- createCanonicalBlock
- createCanonicalExtendBlock
- createCanonicalOverrideBlock
- createCanonicalProgram
- createLogger
- createModelCatalog
- createOutputPlan
- createValueNode
- customTarget
- effectiveGovernance
- extractPromptDefinitions
- findRuntimeSlots
- getAgentFieldStatus
- getAgentFieldSupport
- getAgentProperties
- getAgentProvenance
- getAgentProvenanceEntries
- getBlocksForVersion
- getBlockShapeContract
- getBuiltInConvention
- getCanonicalBlockName
- getDefaultOutputPath
- getFeaturesForVersion
- getHighestKnownSyntaxVersion
- getLatestSyntaxVersion
- getMinimumVersionForBlock
- getMinimumVersionForFeature
- getModelCatalog
- getModelTargetScheme
- getObservedBlockShape
- getPrimarySectionForBlock
- getSectionContract
- getSectionsForBlock
- getSkillPhaseSourceLabel
- getSyntaxFeatureUsages
- getTargetCapability
- getTargetDefinition
- getTargetFeatures
- getTargetFeatureStatus
- getTargetSectionCapability
- getTargetSkillPath
- hashPromptBundle
- interpolateText
- isApprovalRecordV1
- isApproverHandle
- isBlockType
- isBuiltInConvention
- isCanonicalBlock
- isCanonicalProgram
- isInModelSet
- isKnownSyntaxVersion
- isKnownTarget
- isPathTokenName
- isPromptId
- isPromptTarget
- isReservedWord
- isTemplateExpression
- isTextContent
- isValidLockfile
- listAgentFieldSupportTargets
- listNativeAgentTargets
- listUnsupportedAgentFields
- mapModelToTarget
- normalizeModelName
- normalizeOutputCollisionKey
- normalizeOutputPath
- normalizeProgram
- parseApprovalRecord
- readMetaGovernance
- reconcileBlockBody
- replacePathTokens
- resolveModelSet
- resolveTargetVersion
- serializeApprovalRecord
- toLegacyBlock
- toLegacyProgram
- validateGovernanceFields
- valueNodeToValue