Class: DeclarativeKindPort¶
WHO — identity + composition role.
Core contract + the optional KindPresentation slice. Python's twin
keeps the two apart at runtime (KindPort runtime_checkable Protocol
+ KindPresentation typing-only capability); TS folds the optional
slice in via extends — structural typing has no isinstance gate to
protect.
Implements¶
KindPortDeclarativeMarker
Constructors¶
Constructor¶
Parameters¶
| Parameter | Type |
|---|---|
typedDef |
{ apiVersion: "github.com/ruinosus/dna/core/v1"; kind: "KindDefinition"; metadata: { description: string; group: string; icon: string; labels: Record\<string, string>; name: string; version: string; }; spec: { alias: string; ascii_icon?: string | null; default_agent?: string | null; default_agent_field?: string | null; dep_filters?: Record\<string, string> | null; describe?: string | Record\<string, unknown> | null; description_fallback_field?: string | null; display_label?: string | null; docs?: string; embed?: string[] | null; flatten_in_context: boolean; graph_style?: Record\<string, string> | null; is_overlayable: boolean; is_root: boolean; is_runtime_artifact: boolean; origin: string; plane: "record" | "composition"; prompt_target: boolean; prompt_target_priority: number; schema: Record\<string, unknown>; scope_inheritable: boolean; spec_defaults?: Record\<string, unknown> | null; storage: Record\<string, unknown>; summary: Record\<string, unknown> | null; target_api_version: string; target_kind: string; tenant_scope: "tenanted" | "global"; tenant_scope_declared: boolean; ui?: Record\<string, unknown> | null; ui_schema?: Record\<string, unknown> | null; volatile_spec_fields?: string[] | null; }; } |
typedDef.apiVersion |
"github.com/ruinosus/dna/core/v1" |
typedDef.kind |
"KindDefinition" |
typedDef.metadata |
{ description: string; group: string; icon: string; labels: Record\<string, string>; name: string; version: string; } |
typedDef.metadata.description |
string |
typedDef.metadata.group |
string |
typedDef.metadata.icon |
string |
typedDef.metadata.labels |
Record\<string, string> |
typedDef.metadata.name |
string |
typedDef.metadata.version |
string |
typedDef.spec |
{ alias: string; ascii_icon?: string | null; default_agent?: string | null; default_agent_field?: string | null; dep_filters?: Record\<string, string> | null; describe?: string | Record\<string, unknown> | null; description_fallback_field?: string | null; display_label?: string | null; docs?: string; embed?: string[] | null; flatten_in_context: boolean; graph_style?: Record\<string, string> | null; is_overlayable: boolean; is_root: boolean; is_runtime_artifact: boolean; origin: string; plane: "record" | "composition"; prompt_target: boolean; prompt_target_priority: number; schema: Record\<string, unknown>; scope_inheritable: boolean; spec_defaults?: Record\<string, unknown> | null; storage: Record\<string, unknown>; summary: Record\<string, unknown> | null; target_api_version: string; target_kind: string; tenant_scope: "tenanted" | "global"; tenant_scope_declared: boolean; ui?: Record\<string, unknown> | null; ui_schema?: Record\<string, unknown> | null; volatile_spec_fields?: string[] | null; } |
typedDef.spec.alias |
string |
typedDef.spec.ascii_icon? |
string | null |
typedDef.spec.default_agent? |
string | null |
typedDef.spec.default_agent_field? |
string | null |
typedDef.spec.dep_filters? |
Record\<string, string> | null |
typedDef.spec.describe? |
string | Record\<string, unknown> | null |
typedDef.spec.description_fallback_field? |
string | null |
typedDef.spec.display_label? |
string | null |
typedDef.spec.docs? |
string |
typedDef.spec.embed? |
string[] | null |
typedDef.spec.flatten_in_context |
boolean |
typedDef.spec.graph_style? |
Record\<string, string> | null |
typedDef.spec.is_overlayable |
boolean |
typedDef.spec.is_root |
boolean |
typedDef.spec.is_runtime_artifact |
boolean |
typedDef.spec.origin |
string |
typedDef.spec.plane |
"record" | "composition" |
typedDef.spec.prompt_target |
boolean |
typedDef.spec.prompt_target_priority |
number |
typedDef.spec.schema |
Record\<string, unknown> |
typedDef.spec.scope_inheritable |
boolean |
typedDef.spec.spec_defaults? |
Record\<string, unknown> | null |
typedDef.spec.storage |
Record\<string, unknown> |
typedDef.spec.summary |
Record\<string, unknown> | null |
typedDef.spec.target_api_version |
string |
typedDef.spec.target_kind |
string |
typedDef.spec.tenant_scope |
"tenanted" | "global" |
typedDef.spec.tenant_scope_declared |
boolean |
typedDef.spec.ui? |
Record\<string, unknown> | null |
typedDef.spec.ui_schema? |
Record\<string, unknown> | null |
typedDef.spec.volatile_spec_fields? |
string[] | null |
Returns¶
DeclarativeKindPort
Properties¶
__declarative__¶
Implementation of¶
alias¶
Implementation of¶
apiVersion¶
Implementation of¶
asciiIcon¶
Single emoji or character for ASCII tree / compact views.
Implementation of¶
descriptionFallbackField?¶
Spec field to derive metadata.description from when none was declared.
Implementation of¶
KindPort.descriptionFallbackField
displayLabel¶
Human-friendly plural label (e.g. "Agents" for Agent).
Implementation of¶
docs?¶
Canonical prose documentation. May be overridden at load time by a DOCS.md file
alongside the extension's source. Resolved prose is cached on _resolvedDocs.
Implementation of¶
embedFields¶
flattenInContext¶
Implementation of¶
graphStyle¶
Colors for mermaid diagrams, graph nodes, and other visualizations.
fill¶
stroke¶
textColor¶
Implementation of¶
isOverlayable¶
Implementation of¶
isPromptTarget¶
Implementation of¶
isRoot¶
Implementation of¶
isRuntimeArtifact¶
true for Kinds whose documents are produced by runtime workflows
(eval engine, GAIA pipeline, autolab loop, evidence-capture hooks)
rather than authored as source-of-truth. Tools that replicate "the
inputs to the system" — filesystem→Postgres seed, catalog publish,
manifest export — MUST skip Kinds where this is true so they don't
re-inject historical execution data as canonical configuration.
Default false (provided by KindBase) keeps existing extensions
unchanged.
Implementation of¶
jsonSchema¶
Public read-only view of the JSON Schema authored in the KindDefinition. Consumers like the Studio's NewDocumentWizard use this to pre-populate required fields with empty-but-valid stubs.
kind¶
Implementation of¶
origin¶
Implementation of¶
plane¶
Implementation of¶
promptTargetPriority¶
Implementation of¶
scope?¶
Optional tenant scope declaration. When unset (Phase 1 default), the kernel treats the kind permissively (back-compat). Phase 2 iterates through every Extension to set TENANTED or GLOBAL explicitly, flipping enforcement on per-Kind. See TenantScope.
Implementation of¶
scopeInheritable¶
Implementation of¶
storage¶
Implementation of¶
ui?¶
uiSchema?¶
Per-field UI hints for Studio form rendering, keyed by spec field
name (widget/label/help/language/height/order — see
docs/KIND-UI-HINTS.md). When absent, consumers infer the widget
from the value type.
Implementation of¶
volatileSpecFields¶
Methods¶
dependencies()¶
Which spec fields reference other kinds by alias. Clearer name for depFilters().
Returns¶
Record\<string, string> | null
Implementation of¶
depFilters()¶
Returns¶
Record\<string, string> | null
Implementation of¶
describe()¶
Display string for a doc (spec D3).
- Template form (string): substitute {field} placeholders from the
spec top level; a missing/None field renders as "".
- Projection form ({path: field}): return the spec field verbatim (or
null if absent).
- No describe declared → null (today's behavior).
Twin of Python DeclarativeKindPort.describe.
Parameters¶
| Parameter | Type |
|---|---|
doc |
Document |
Returns¶
string | null
Implementation of¶
fromTyped()¶
Parameters¶
| Parameter | Type |
|---|---|
typedDef |
{ apiVersion: "github.com/ruinosus/dna/core/v1"; kind: "KindDefinition"; metadata: { description: string; group: string; icon: string; labels: Record\<string, string>; name: string; version: string; }; spec: { alias: string; ascii_icon?: string | null; default_agent?: string | null; default_agent_field?: string | null; dep_filters?: Record\<string, string> | null; describe?: string | Record\<string, unknown> | null; description_fallback_field?: string | null; display_label?: string | null; docs?: string; embed?: string[] | null; flatten_in_context: boolean; graph_style?: Record\<string, string> | null; is_overlayable: boolean; is_root: boolean; is_runtime_artifact: boolean; origin: string; plane: "record" | "composition"; prompt_target: boolean; prompt_target_priority: number; schema: Record\<string, unknown>; scope_inheritable: boolean; spec_defaults?: Record\<string, unknown> | null; storage: Record\<string, unknown>; summary: Record\<string, unknown> | null; target_api_version: string; target_kind: string; tenant_scope: "tenanted" | "global"; tenant_scope_declared: boolean; ui?: Record\<string, unknown> | null; ui_schema?: Record\<string, unknown> | null; volatile_spec_fields?: string[] | null; }; } |
typedDef.apiVersion |
"github.com/ruinosus/dna/core/v1" |
typedDef.kind |
"KindDefinition" |
typedDef.metadata |
{ description: string; group: string; icon: string; labels: Record\<string, string>; name: string; version: string; } |
typedDef.metadata.description |
string |
typedDef.metadata.group |
string |
typedDef.metadata.icon |
string |
typedDef.metadata.labels |
Record\<string, string> |
typedDef.metadata.name |
string |
typedDef.metadata.version |
string |
typedDef.spec |
{ alias: string; ascii_icon?: string | null; default_agent?: string | null; default_agent_field?: string | null; dep_filters?: Record\<string, string> | null; describe?: string | Record\<string, unknown> | null; description_fallback_field?: string | null; display_label?: string | null; docs?: string; embed?: string[] | null; flatten_in_context: boolean; graph_style?: Record\<string, string> | null; is_overlayable: boolean; is_root: boolean; is_runtime_artifact: boolean; origin: string; plane: "record" | "composition"; prompt_target: boolean; prompt_target_priority: number; schema: Record\<string, unknown>; scope_inheritable: boolean; spec_defaults?: Record\<string, unknown> | null; storage: Record\<string, unknown>; summary: Record\<string, unknown> | null; target_api_version: string; target_kind: string; tenant_scope: "tenanted" | "global"; tenant_scope_declared: boolean; ui?: Record\<string, unknown> | null; ui_schema?: Record\<string, unknown> | null; volatile_spec_fields?: string[] | null; } |
typedDef.spec.alias |
string |
typedDef.spec.ascii_icon? |
string | null |
typedDef.spec.default_agent? |
string | null |
typedDef.spec.default_agent_field? |
string | null |
typedDef.spec.dep_filters? |
Record\<string, string> | null |
typedDef.spec.describe? |
string | Record\<string, unknown> | null |
typedDef.spec.description_fallback_field? |
string | null |
typedDef.spec.display_label? |
string | null |
typedDef.spec.docs? |
string |
typedDef.spec.embed? |
string[] | null |
typedDef.spec.flatten_in_context |
boolean |
typedDef.spec.graph_style? |
Record\<string, string> | null |
typedDef.spec.is_overlayable |
boolean |
typedDef.spec.is_root |
boolean |
typedDef.spec.is_runtime_artifact |
boolean |
typedDef.spec.origin |
string |
typedDef.spec.plane |
"record" | "composition" |
typedDef.spec.prompt_target |
boolean |
typedDef.spec.prompt_target_priority |
number |
typedDef.spec.schema |
Record\<string, unknown> |
typedDef.spec.scope_inheritable |
boolean |
typedDef.spec.spec_defaults? |
Record\<string, unknown> | null |
typedDef.spec.storage |
Record\<string, unknown> |
typedDef.spec.summary |
Record\<string, unknown> | null |
typedDef.spec.target_api_version |
string |
typedDef.spec.target_kind |
string |
typedDef.spec.tenant_scope |
"tenanted" | "global" |
typedDef.spec.tenant_scope_declared |
boolean |
typedDef.spec.ui? |
Record\<string, unknown> | null |
typedDef.spec.ui_schema? |
Record\<string, unknown> | null |
typedDef.spec.volatile_spec_fields? |
string[] | null |
Returns¶
DeclarativeKindPort
getDefaultAgentName()¶
Parameters¶
| Parameter | Type |
|---|---|
doc |
Document |
Returns¶
string | null
Implementation of¶
getLayerPolicies()¶
Parameters¶
| Parameter | Type |
|---|---|
_doc |
Document |
Returns¶
Record\<string, string> | null
Implementation of¶
parse()¶
Parameters¶
| Parameter | Type |
|---|---|
raw |
Record\<string, unknown> |
Returns¶
unknown
Implementation of¶
preview()¶
Preview blocks derived from the kind's JSON schema. Walks the
top-level properties of jsonSchema and renders each one based on
its declared type:
- string with format=markdown OR maxLength>=400 → markdown block
- string → fields entry
- integer / number / boolean → fields entry
- array of strings → fields entry (bullets)
- array of objects / object → code block (json)
- enum → fields entry
Required fields surface first, optional after.
Parameters¶
| Parameter | Type |
|---|---|
doc |
Document |
Returns¶
Implementation of¶
promptTemplate()¶
Returns¶
string | null
Implementation of¶
schema()¶
JSON Schema for this kind's spec. Zod-based kinds convert their schema; declarative kinds return native JSON Schema.
Returns¶
Record\<string, unknown> | null
Implementation of¶
summary()¶
Declarative projection (F3 spec D2): when the KindDefinition declares
summary: {field: <plain default | projection object>}, project the
doc's spec. A PLAIN value keeps today's meaning (present field from
spec, else the declared default). A PROJECTION object runs the closed
vocabulary (count_of/path/paths/format + combinators). No declaration →
null (today's behavior). Twin of Python DeclarativeKindPort.summary.
Parameters¶
| Parameter | Type |
|---|---|
doc |
Document |
Returns¶
Record\<string, unknown> | null