Skip to content

PromptScript API


Interface: CanonicalProgram

Defined in: core/src/types/ast.ts:700

Immutable canonical program. Legacy collection fields are derived projections.

Extends

Properties

blocks

readonly blocks: readonly CanonicalBlock[]

Defined in: core/src/types/ast.ts:705


extends

readonly extends: readonly CanonicalExtendBlock[]

Defined in: core/src/types/ast.ts:706


inherit?

readonly optional inherit?: object

Defined in: core/src/types/ast.ts:703

loc

readonly loc: object

Source location

loc.column

readonly column: number

Column number (1-indexed)

loc.file

readonly file: string

File path

loc.line

readonly line: number

Line number (1-indexed)

loc.offset?

readonly optional offset?: number

Byte offset from start of file

params?

readonly optional params?: readonly object[]

Template parameters (for parameterized inheritance)

path

readonly path: object

Path to parent file

path.isRelative

readonly isRelative: boolean

Whether this is a relative path

path.loc

readonly loc: object

Source location

path.loc.column

readonly column: number

Column number (1-indexed)

path.loc.file

readonly file: string

File path

path.loc.line

readonly line: number

Line number (1-indexed)

path.loc.offset?

readonly optional offset?: number

Byte offset from start of file

path.namespace?

readonly optional namespace?: string

Namespace (e.g., "core" from "@core/...")

path.raw

readonly raw: string

Original string representation

path.segments

readonly segments: readonly string[]

Path segments

path.type

readonly type: "PathReference"

Node type discriminator

path.version?

readonly optional version?: string

Version constraint

type

readonly type: "InheritDeclaration"

Node type discriminator


loc

readonly loc: object

Defined in: core/src/types/ast.ts:467

column

readonly column: number

Column number (1-indexed)

file

readonly file: string

File path

line

readonly line: number

Line number (1-indexed)

offset?

readonly optional offset?: number

Byte offset from start of file

Inherited from

CanonicalNode.loc


meta?

readonly optional meta?: object

Defined in: core/src/types/ast.ts:702

fields

readonly fields: object

Key-value pairs

Index Signature

[key: string]: PrimitiveValue | { constraints?: { max?: number; min?: number; options?: readonly PrimitiveValue | { readonly type: "TypeExpression"; readonly kind: "string" | "number" | "boolean" | "enum" | "range" | "list"; readonly params?: readonly (PrimitiveValue | ... 4 more ... | { ...; })[] | undefined; readonly constraints?: { ...; } | undefined; readonly loc: { ...; }; } | { ...; } | readonly (Primitiv...[]; }; kind: "string" | "number" | "boolean" | "enum" | "range" | "list"; loc: { column: number; file: string; line: number; offset?: number; }; params?: readonly PrimitiveValue | { readonly type: "TypeExpression"; readonly kind: "string" | "number" | "boolean" | "enum" | "range" | "list"; readonly params?: readonly (PrimitiveValue | ... 4 more ... | { ...; })[] | undefined; readonly constraints?: { ...; } | undefined; readonly loc: { ...; }; } | { ...; } | readonly (Primitiv...[]; type: "TypeExpression"; } | { loc: { column: number; file: string; line: number; offset?: number; }; type: "TextContent"; value: string; } | readonly PrimitiveValue | { readonly type: "TypeExpression"; readonly kind: "string" | "number" | "boolean" | "enum" | "range" | "list"; readonly params?: readonly (PrimitiveValue | ... 4 more ... | { ...; })[] | undefined; readonly constraints?: { ...; } | undefined; readonly loc: { ...; }; } | { ...; } | readonly (Primitiv...[] | {[key: string]: PrimitiveValue | { readonly type: "TypeExpression"; readonly kind: "string" | "number" | "boolean" | "enum" | "range" | "list"; readonly params?: readonly (PrimitiveValue | ... 4 more ... | { ...; })[] | undefined; readonly constraints?: { ...; } | undefined; readonly loc: { ...; }; } | { ...; } | readonly (Primitiv...; } | { loc: { column: number; file: string; line: number; offset?: number; }; name: string; type: "TemplateExpression"; }

loc

readonly loc: object

Source location

loc.column

readonly column: number

Column number (1-indexed)

loc.file

readonly file: string

File path

loc.line

readonly line: number

Line number (1-indexed)

loc.offset?

readonly optional offset?: number

Byte offset from start of file

params?

readonly optional params?: readonly object[]

Template parameter definitions (for parameterized inheritance)

type

readonly type: "MetaBlock"

Node type discriminator


operations

readonly operations: readonly ProgramOperation[]

Defined in: core/src/types/ast.ts:709


overrides?

readonly optional overrides?: readonly CanonicalOverrideBlock[]

Defined in: core/src/types/ast.ts:707


syntaxFeatures?

readonly optional syntaxFeatures?: readonly object[]

Defined in: core/src/types/ast.ts:708


type

readonly type: "CanonicalProgram"

Defined in: core/src/types/ast.ts:701

Overrides

CanonicalNode.type


uses

readonly uses: readonly object[]

Defined in: core/src/types/ast.ts:704