core/src¶
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.
Classes¶
- CircularDependencyError
- CircularGuardRequiresError
- FileNotFoundError
- GitAuthError
- GitCloneError
- GitRefNotFoundError
- LockfileIntegrityError
- MissingParamError
- OfflineResolveError
- ParamTypeMismatchError
- ParseError
- PSError
- RateLimitError
- RegistryPathNotFoundError
- ResolveError
- SemverNoMatchError
- UndefinedVariableError
- UnexpectedTokenError
- UnknownAliasError
- UnknownParamError
- ValidationError
Interfaces¶
- ApplyOverrideOptions
- ArrayContent
- ArrayElementNode
- ArrayValueNode
- BaseNode
- BasePolicyDefinition
- Block
- BlockBody
- BlockBodyOptions
- BlockCollectionMergePolicy
- BlockMergePolicy
- BlockOperation
- BlockReplacement
- BlockShapeContract
- BuildProfileConfig
- CanonicalBlock
- CanonicalExtendBlock
- CanonicalNode
- CanonicalOverrideBlock
- CanonicalProgram
- CanonicalProgramOptions
- CatalogEntry
- ComposedPhase
- DefaultFeatureProfile
- DetectionHints
- Diagnostic
- ExampleDefinition
- ExtendBlock
- ExtendOperation
- FieldEntry
- FormatDiagnosticOptions
- FormattingConfig
- HookCapability
- HookTerminalCapability
- InheritDeclaration
- InheritOperation
- InlineUseDeclaration
- InlineUseEntry
- LayerBoundaryPolicy
- LegacyProjectionOptions
- ListEntry
- Lockfile
- LockfileDependency
- LockfileReference
- Logger
- MetaBlock
- MixedContent
- NamespaceDefinition
- NormalizeBlockAliasOptions
- ObjectContent
- ObjectFieldNode
- ObjectValueNode
- OutputConvention
- OverrideBlock
- OverrideOperation
- ParamArgument
- ParamDefinition
- PathReference
- PolicyViolation
- PresentationEntry
- PresentationSelection
- PrettierMarkdownOptions
- Program
- ProjectContext
- PromptScriptConfig
- PropertyProtectionPolicy
- RegistryAliasEntry
- RegistryAllowlistPolicy
- RegistryManifest
- RegistryMeta
- ReplaceModifier
- ScalarValueNode
- SectionContract
- SectionRenderer
- SkillContractField
- SkillDefinition
- SkillPathConfig
- SourceAttribution
- SourceLocation
- SourceRange
- SuggestionAction
- SuggestionCondition
- SuggestionReasoning
- SuggestionResult
- SuggestionRule
- SyntaxFeatureUsage
- SyntaxVersionDef
- TargetConfig
- TargetDefinition
- TemplateContext
- TemplateExpression
- TemplateValueNode
- TextContent
- TextEntry
- TextValueNode
- TypeExpression
- TypeExpressionValueNode
- UseDeclaration
- UseOperation
- UserConfig
- ValueReplacement
Type Aliases¶
- BlockContent
- BlockEntry
- BlockInput
- BlockName
- BlockShape
- BlockTypeName
- BuiltInConventionName
- ClaudeVersion
- ConventionName
- CustomTarget
- DeepReadonly
- DiagnosticSeverity
- FactoryRulesMode
- GithubVersion
- HookProjectRootStrategy
- HookRuntimeTarget
- HookSupportStatus
- HookTerminalGuarantee
- HookTimeoutUnit
- KnownTarget
- ManifestTarget
- OverrideReplacement
- ParamType
- PolicyDefinition
- PolicyKind
- PolicySeverity
- PortableHookInterpreter
- PresentationPrecedence
- PrimitiveValue
- ProgramInput
- ProgramOperation
- RegistriesConfig
- ReservedWord
- Severity
- SyntaxFeature
- TargetEntry
- TargetFamily
- TargetName
- Value
- ValueNode
Variables¶
- BLOCK_ALIASES
- BLOCK_SHAPE_CONTRACTS
- BLOCK_TYPES
- BUILT_IN_CONVENTIONS
- CONTEXTUAL_DIRECTIVES
- CONTEXTUAL_OPERATION_DIRECTIVES
- DEFAULT_OUTPUT_PATHS
- DEFAULT_PRETTIER_OPTIONS
- HOOK_CAPABILITIES
- HOOK_RUNTIME_CAPABILITIES
- IMPORT_MARKER_PREFIX
- IMPORT_MERGE_POLICY
- INHERITANCE_MERGE_POLICY
- KNOWN_TARGETS
- LATEST_SYNTAX_VERSION
- LOCKFILE_VERSION
- MARKDOWN_CONVENTION
- noopLogger
- PORTABLE_HOOK_INTERPRETERS
- RESERVED_WORDS
- SECTION_REGISTRY
- SKILL_REPLACE_PROPERTY_NAMES
- SYNTAX_FEATURES
- SYNTAX_VERSIONS
- TARGET_DEFINITIONS
- VSCODE_HOOK_CAPABILITY
- XML_CONVENTION
Functions¶
- applyOverride
- bindParams
- blockBodyToContent
- blockContentToBody
- blockOwnsSection
- compareVersions
- composeBlockBodies
- consumeInlineUses
- createBlockBody
- createCanonicalBlock
- createCanonicalExtendBlock
- createCanonicalOverrideBlock
- createCanonicalProgram
- createLocation
- createLogger
- createPathReference
- createValueNode
- customTarget
- deepClone
- deepMerge
- findClosestMatch
- formatDiagnostic
- formatDiagnostics
- formatPath
- formatVersion
- getBlockItems
- getBlockProperties
- getBlocksForVersion
- getBlockShapeContract
- getBlockText
- getBuiltInConvention
- getCanonicalBlockName
- getCanonicalBlocks
- getDefaultOutputPath
- getFeaturesForVersion
- getFileName
- getInlineUses
- getLatestSyntaxVersion
- getMinimumVersionForBlock
- getMinimumVersionForFeature
- getObservedBlockShape
- getPackageInfo
- getPackageVersion
- getPrimarySectionForBlock
- getSectionContract
- getSectionsForBlock
- getSyntaxFeatureUsages
- getTargetDefinition
- getTargetFeatures
- getTargetSkillPath
- incrementVersion
- interpolateAST
- interpolateContent
- interpolateEnvVars
- interpolateText
- isAbsolutePath
- isBlockType
- isBuiltInConvention
- isCanonicalBlock
- isCanonicalProgram
- isGeneratedByPromptScript
- isKnownSyntaxVersion
- isKnownTarget
- isPlainObject
- isPortableHookInterpreter
- isPortableHookScriptPath
- isPortablePathSegment
- isRelativePath
- isReservedWord
- isTemplateExpression
- isTextContent
- isValidLockfile
- isValidVersion
- levenshteinDistance
- mergeBlockCollections
- mergeBlockContent
- mergeValueNodeLocations
- normalizeBlockAliases
- normalizeLegacyHeadingEntries
- normalizeProgram
- parsePath
- parseVersion
- prepareBlockContentForMerge
- presentationEntryKey
- reconcileBlockBody
- reconcileBlockBodyAtPath
- reconcileValueNode
- resolvePath
- resolveUseImport
- selectPresentationEntries
- stripFrontmatterMarkerLines
- stripLeadingHtmlMarker
- stripPromptScriptMarkers
- toLegacyBlock
- toLegacyProgram
- updateCanonicalBlockBody
- updateCanonicalProgramOperations
- usesSequentialOperations
- valueNodeToValue