Skip to content

Output schema

The artifact codeanalyzer-typescript emits is a single TSApplication. Every model below is a TypeScript interface defined in src/schema/schema.ts; the JSON and msgpack outputs are serializations of the same schema. All field names are snake_case so the keys match the CLDK SDK’s models. Line/column fields default to -1 when unknown.

flowchart TB
    APP[TSApplication] --> ST["symbol_table: {path: TSModule}"]
    APP --> CG["call_graph: [TSCallEdge]"]
    APP --> EX["external_symbols: {sig: TSExternalSymbol}"]
    APP --> EP["entrypoints: {framework: [TSEntrypoint]}"]
    ST --> MOD[TSModule]
    MOD --> CLS[TSClass]
    MOD --> IF[TSInterface]
    MOD --> EN[TSEnum]
    MOD --> TA[TSTypeAlias]
    MOD --> FN[TSCallable]
    MOD --> NS[TSNamespace]
    CLS --> M[TSCallable]
    CLS --> ATTR[TSClassAttribute]
    FN --> CALL[TSCallsite]
    FN --> PARAM[TSCallableParameter]

The root object.

FieldTypeDescription
symbol_tableRecord<string, TSModule>File path → module model. The whole-project inventory.
call_graphTSCallEdge[]Identity-keyed call edges.
external_symbolsRecord<string, TSExternalSymbol>Phantom stubs for call targets outside the project.
entrypointsRecord<string, TSEntrypoint[]>Framework name → detected roots. Empty at level 1.

One per source file.

FieldTypeDescription
file_pathstringPath to the file.
module_namestringThe file key minus extension (== signature prefix).
importsTSImport[]Import statements.
exportsTSExport[]Export statements and re-exports.
commentsTSComment[]Comments and JSDoc.
classesRecord<string, TSClass>Top-level classes by name.
interfacesRecord<string, TSInterface>Top-level interfaces by name.
enumsRecord<string, TSEnum>Top-level enums by name.
type_aliasesRecord<string, TSTypeAlias>Top-level type aliases by name.
functionsRecord<string, TSCallable>Top-level functions by name.
namespacesRecord<string, TSNamespace>Top-level namespaces by name.
variablesTSVariableDeclaration[]Module-level variables.
is_tsxbooleanWhether the file is .tsx/.jsx.
is_declaration_filebooleanWhether it’s a .d.ts file.
content_hash, last_modified, file_sizestring / number / numberCache-invalidation metadata (nullable).
FieldTypeDescription
namestringClass short name.
signaturestringFully-qualified identity (e.g. src/user.UserService).
base_classesstring[]Spine: union of extends + implements as signature strings.
implements_typesstring[]Typed split: just the implemented interfaces.
type_parametersTSTypeParameter[]Generic parameters.
decoratorsTSDecorator[]Class decorators.
methodsRecord<string, TSCallable>Methods by name.
attributesRecord<string, TSClassAttribute>Class attributes by name.
inner_classesRecord<string, TSClass>Nested classes.
is_abstract, is_exported, is_ambientbooleanClass modifiers (abstract, export, declare).
comments, codeTSComment[] / stringJSDoc/comments and source.
start_line, end_linenumberSource span.

A TypeScript node kind with no analog in the Python/Java schema.

FieldTypeDescription
name, signaturestringShort name and fully-qualified identity.
base_classesstring[]Extended interfaces (signature strings).
type_parametersTSTypeParameter[]Generic parameters.
methodsRecord<string, TSCallable>Method members (bodiless).
propertiesRecord<string, TSClassAttribute>Property members.
call_signaturesstring[]Raw text of call/construct signatures.
index_signaturesstring[]Raw text of [key: string]: T.
is_exported, is_ambientbooleanModifiers.
comments, code, start_line, end_lineJSDoc, source, span.
FieldTypeDescription
name, signaturestringShort name and identity.
membersTSEnumMember[]Each member’s name and value (initializer text or computed const value).
is_constbooleanconst enum.
is_exported, is_ambientbooleanModifiers.
comments, code, start_line, end_lineJSDoc, source, span.
FieldTypeDescription
name, signaturestringShort name and identity.
aliased_typestringThe right-hand-side type text.
type_parametersTSTypeParameter[]Generic parameters.
is_exported, is_ambientbooleanModifiers.
comments, code, start_line, end_lineJSDoc, source, span.

A recursive container with the same declaration buckets as a module.

FieldTypeDescription
name, signaturestringShort name and identity.
classes, interfaces, enums, type_aliases, functions, namespacesRecord<string, …>Nested declarations by name.
variablesTSVariableDeclaration[]Namespace-level variables.
is_exported, is_ambient, comments, start_line, end_lineModifiers, JSDoc, span.

A function, method, constructor, accessor, or arrow. The richest model in the artifact.

FieldTypeDescription
namestringCallable short name.
pathstringFile the callable is defined in.
signaturestringFully-qualified identity (e.g. src/user.UserService.getUser). The call-graph node key.
kindTSCallableKindfunction | method | constructor | getter | setter | arrow | function_expression.
parametersTSCallableParameter[]Declared parameters.
type_parametersTSTypeParameter[]Generic parameters.
return_typestring | nullResolved return type, if known.
decoratorsTSDecorator[]Applied decorators.
codestring | nullThe source body.
call_sitesTSCallsite[]Calls made from this callable.
accessed_symbolsTSSymbol[]Symbols read/written in the body.
local_variablesTSVariableDeclaration[]Locals.
inner_callables, inner_classesRecord<string, …>Nested definitions.
cyclomatic_complexitynumberComputed complexity.
is_entrypointbooleanWhether a finder marked this an entrypoint (level 2).
entrypoint_frameworkstring | nullThe framework, if so.
accessibilitystring | nullpublic | private | protected | null.
is_static, is_abstract, is_async, is_generator, is_optional, is_readonly, is_exported, is_ambient, is_implicitbooleanTypeScript modifiers (is_implicit = synthesized default constructor).
accessor_kindstring | nullgetter | setter | null.
overload_signaturesTSOverloadSignature[]Overload signatures preceding the implementation.
start_line, end_line, code_start_linenumberSource spans.

A single call made from within a callable — the rich per-call metadata behind a graph edge.

FieldTypeDescription
method_namestringThe invoked name as written.
receiver_expr, receiver_typestring | nullThe receiver expression and its resolved type.
argument_typesstring[]Resolved argument types.
type_argumentsstring[]Explicit call type args, foo<T>().
return_typestring | nullResolved return type.
callee_signaturestring | nullThe resolved target’s signature (backfilled by the resolver call graph).
is_constructor_callbooleanWhether the call is new X().
is_optional_chainbooleanWhether the call is a?.b().
start_line, start_column, end_line, end_columnnumberSource location.

An identity-only call-graph edge.

FieldTypeDescription
sourcestringCaller’s TSCallable.signature.
targetstringCallee’s TSCallable.signature or a TSExternalSymbol.signature.
type"CALL_DEP"Edge kind.
weightnumberEdge weight; incremented when the same call repeats.
provenancestring[]How it was resolved: "tsc", "import" (phantom), "codeql" (level 2), or an extension token. Open vocabulary.
tagsRecord<string, string>Free-form metadata. RTA-expanded edges carry ts.dispatch=rta.

A synthetic stub for a call target outside the project — an imported library member or Node builtin (WALA-style phantom node).

FieldTypeDescription
signaturestringSynthetic identity, e.g. node:fs.readFileSync, express.Router.get. A call edge target may byte-match this.
namestringThe called member, e.g. readFileSync.
modulestringThe import/require specifier, e.g. node:fs, express, @scope/pkg.
kindstring"function" | "constructor" | "unknown".
is_externaltrueAlways true.

A framework-dispatched root, referencing a callable by signature. Populated by level-2 finders; entrypoints is {} at level 1.

FieldTypeDescription
signaturestringThe TSCallable.signature this entrypoint refers to.
frameworkstringThe dispatching framework.
detection_sourcestringHow it was detected — decorator, base_class, convention, extension, … Open vocabulary.
route_pathstring | nullFor HTTP routes.
http_methodsstring[]For HTTP routes.
source_filestring | nullFile declaring the binding.
tagsRecord<string, string>Free-form, namespaced metadata for extensions.
  • TSImportmodule specifier, name, alias, is_type_only, import_kind (named | default | namespace | side_effect), and span.
  • TSExportmodule (re-export source, nullable), name, alias, is_type_only, export_kind (named | default | namespace | re_export), and span.
  • TSCommentcontent, is_docstring (JSDoc attached to a declaration), and span.
  • TSDecoratorname, checker-resolved qualified_name, raw positional_arguments and keyword_arguments (source fragments for finders to parse), and span.
  • TSTypeParametername, constraint (the extends … clause), default (the = … clause).
  • TSCallableParametername, type, default_value, is_optional, is_rest, is_readonly, accessibility (parameter-property visibility for DI), parameter decorators, and span.
  • TSClassAttributename, type, initializer, accessibility, is_static, is_readonly, is_optional, is_abstract, decorators, comments, span.
  • TSVariableDeclarationname, type, initializer, value, scope, declaration_kind (const | let | var | using | unknown), is_readonly, is_exported, span.
  • TSSymbol — a referenced symbol: name, scope, kind, resolved type, qualified_name, is_builtin, location.
  • TSEnumMembername, value, span.
  • TSOverloadSignatureparameters, return_type, type_parameters, span.

Three pure functions in schema.ts produce every signature, so caller- and callee-side ids byte-match:

  • fileKeyOf(absPath, projectRoot){ fileKey, modulePrefix } — the symbol-table key (project-relative POSIX path with extension) and the signature prefix (without extension).
  • signatureOf(prefix, ...members) — dot-joins a scope prefix with member names.
  • constructorSignatureOf(classSignature) — normalizes a constructor to <ClassSignature>.constructor.