node-type-registry 0.46.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,6 +106,13 @@ export interface DataEntityMembershipParams {
106
106
  export interface DataForceCurrentUserParams {
107
107
  field_name?: string;
108
108
  }
109
+ /** Creates a companion _translations table with lang_code + translatable fields. Copies SELECT policies and column-ref fields from the base table. Adds @i18n smart comment so the Graphile i18n plugin discovers it. Requires i18n_module to be provisioned for the database. */
110
+ export interface DataI18nParams {
111
+ fields: string[];
112
+ table_suffix?: string;
113
+ lang_code_type?: 'citext' | 'text';
114
+ copy_mutation_policies?: boolean;
115
+ }
109
116
  /** Adds a UUID primary key column with auto-generation default (uuidv7). This is the standard primary key pattern for all tables. */
110
117
  export interface DataIdParams {
111
118
  field_name?: string;
@@ -664,16 +671,6 @@ export interface AuthzCompositeParams {
664
671
  }
665
672
  /** Denies all access. Generates FALSE expression. */
666
673
  export type AuthzDenyAllParams = {};
667
- /** Path-scoped file sharing via ltree containment. Grants access when a path_shares row matches the current user, bucket, and an ancestor path with the required permission. */
668
- export interface AuthzFilePathParams {
669
- shares_schema: string;
670
- shares_table: string;
671
- files_schema?: string;
672
- files_table: string;
673
- permission_field: string;
674
- bucket_field?: string;
675
- path_field?: string;
676
- }
677
674
  /** Direct equality comparison between a table column and the current user ID. Simplest authorization pattern with no subqueries. */
678
675
  export interface AuthzDirectOwnerParams {
679
676
  entity_field: string;
@@ -693,10 +690,30 @@ export interface AuthzEntityMembershipParams {
693
690
  is_admin?: boolean;
694
691
  is_owner?: boolean;
695
692
  }
693
+ /** Path-scoped file sharing via ltree containment. Grants access when a path_shares row matches the current user, bucket, and an ancestor path with the required permission. */
694
+ export interface AuthzFilePathParams {
695
+ shares_schema: string;
696
+ shares_table: string;
697
+ files_schema?: string;
698
+ files_table: string;
699
+ permission_field: string;
700
+ bucket_field?: string;
701
+ path_field?: string;
702
+ }
696
703
  /** Check if current user is in an array column on the same row. */
697
704
  export interface AuthzMemberListParams {
698
705
  array_field: string;
699
706
  }
707
+ /** Compound policy: the row must be owned by the current user (owner_field = current_user_id) AND the current user must be a member of the entity referenced by entity_field. Combines direct ownership with entity membership — the actor can only access rows they own within entities they belong to. */
708
+ export interface AuthzMemberOwnerParams {
709
+ owner_field: string;
710
+ entity_field: string;
711
+ sel_field?: string;
712
+ membership_type?: number | string;
713
+ entity_type?: string;
714
+ permission?: string;
715
+ permissions?: string[];
716
+ }
700
717
  /** Restrictive policy that blocks read-only members from mutations. Checks actor_id + is_read_only IS NOT TRUE on the SPRT. Designed to run as a restrictive counterpart after a permissive AuthzEntityMembership policy has already verified membership. */
701
718
  export interface AuthzNotReadOnlyParams {
702
719
  entity_field: string;
@@ -709,16 +726,6 @@ export interface AuthzOrgHierarchyParams {
709
726
  anchor_field: string;
710
727
  max_depth?: number;
711
728
  }
712
- /** Compound policy: the row must be owned by the current user (owner_field = current_user_id) AND the current user must be a member of the entity referenced by entity_field. Combines direct ownership with entity membership — the actor can only access rows they own within entities they belong to. */
713
- export interface AuthzMemberOwnerParams {
714
- owner_field: string;
715
- entity_field: string;
716
- sel_field?: string;
717
- membership_type?: number | string;
718
- entity_type?: string;
719
- permission?: string;
720
- permissions?: string[];
721
- }
722
729
  /** Peer visibility through shared entity membership. Authorizes access to user-owned rows when the owner and current user are both members of the same entity. Self-joins the SPRT table to find peers. */
723
730
  export interface AuthzPeerOwnershipParams {
724
731
  owner_field: string;
@@ -905,7 +912,7 @@ export interface BlueprintField {
905
912
  /** An RLS policy entry for a blueprint table. Uses $type to match the blueprint JSON convention. */
906
913
  export interface BlueprintPolicy {
907
914
  /** Authz* policy type name (e.g., "AuthzDirectOwner", "AuthzAllowAll"). */
908
- $type: 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzMemberOwner' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal';
915
+ $type: 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzFilePath' | 'AuthzMemberList' | 'AuthzMemberOwner' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal';
909
916
  /** Privileges this policy applies to (e.g., ["select"], ["insert", "update", "delete"]). */
910
917
  privileges?: string[];
911
918
  /** Whether this policy is permissive (true) or restrictive (false). Defaults to true. */
@@ -1023,6 +1030,8 @@ export interface BlueprintStorageConfig {
1023
1030
  scope?: 'app' | 'org';
1024
1031
  /** Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case. */
1025
1032
  storage_key?: string;
1033
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "buckets" instead of "org_buckets"). */
1034
+ prefix?: string;
1026
1035
  /** Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning. */
1027
1036
  buckets?: BlueprintBucketSeed[];
1028
1037
  /** Override for presigned upload URL expiry time in seconds. */
@@ -1084,6 +1093,8 @@ export interface BlueprintNamespaceConfig {
1084
1093
  scope?: 'app' | 'org';
1085
1094
  /** Module discriminator for multi-module namespaces. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_namespaces. */
1086
1095
  key?: string;
1096
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "namespaces" instead of "org_namespaces"). */
1097
+ prefix?: string;
1087
1098
  /** RLS policy overrides for the namespaces table. NULL = apply defaults from apply_namespace_security(). */
1088
1099
  policies?: BlueprintPolicy[];
1089
1100
  /** Per-table overrides for namespace tables. Each key targets a specific table (namespaces, namespace_events) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
@@ -1098,6 +1109,8 @@ export interface BlueprintFunctionConfig {
1098
1109
  scope?: 'app' | 'org';
1099
1110
  /** Module discriminator for multi-module functions. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_function_definitions. */
1100
1111
  key?: string;
1112
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "function_definitions" instead of "org_function_definitions"). */
1113
+ prefix?: string;
1101
1114
  /** RLS policy overrides for the function tables. NULL = apply defaults from apply_function_security(). */
1102
1115
  policies?: BlueprintPolicy[];
1103
1116
  /** Per-table overrides for function tables. Each key targets a specific table (definitions, invocations, execution_logs) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
@@ -1107,18 +1120,24 @@ export interface BlueprintFunctionConfig {
1107
1120
  execution_logs?: BlueprintEntityTableProvision;
1108
1121
  };
1109
1122
  }
1110
- /** Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables (and optionally knowledge with vector embeddings). */
1123
+ /** Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables. Opt-in: has_plans (plan + approval workflow), has_resources (unified skills/knowledge with chunking), has_agents (agent registry + personas, implies has_resources). */
1111
1124
  export interface BlueprintAgentConfig {
1112
1125
  /** Agent scope. "app" (default) creates app-level agent tables (membership_type = NULL). "org" creates per-org agent tables. Only used at the top level of a blueprint definition — entity-scoped agents inherit scope from the entity type. */
1113
1126
  scope?: 'app' | 'org';
1114
1127
  /** Module discriminator for multi-module agents. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_agent_thread. */
1115
1128
  key?: string;
1129
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "agent_thread" instead of "org_agent_thread"). */
1130
+ prefix?: string;
1116
1131
  /** API name for the agent module. Used in GraphQL naming. Defaults to "agent". */
1117
1132
  api_name?: string;
1118
- /** Whether to provision the agent_knowledge table with vector embeddings, tags, and trigger_phrases. Also inferred when a "knowledge" key is present. Defaults to false. */
1119
- has_knowledge?: boolean;
1120
- /** Knowledge configuration overrides. Set has_chunks to false to disable the chunking pipeline. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_knowledge table. Presence implies has_knowledge = true. */
1121
- knowledge?: {
1133
+ /** Whether to provision the agent_plan table for workflow plans with ordered tasks and approval gates. When true, tasks belong to plans (plan_id NOT NULL) instead of directly to threads. Defaults to false. */
1134
+ has_plans?: boolean;
1135
+ /** Whether to provision the unified agent_resource table (kind: skill/knowledge/convention) with auto-chunking (ProcessChunks) and vector embeddings. Defaults to false. */
1136
+ has_resources?: boolean;
1137
+ /** Whether to provision agent + agent_persona tables for agent registry and templates. Implies has_resources. Defaults to false. */
1138
+ has_agents?: boolean;
1139
+ /** Resource configuration array. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_resource table. Set has_chunks to false to disable the ProcessChunks pipeline. Defaults: 768 dimensions, 1000 chunk_size, 200 chunk_overlap, paragraph strategy, ["tsvector"] search indexes. */
1140
+ resources?: {
1122
1141
  has_chunks?: boolean;
1123
1142
  dimensions?: number;
1124
1143
  chunk_size?: number;
@@ -1126,17 +1145,20 @@ export interface BlueprintAgentConfig {
1126
1145
  chunk_strategy?: 'fixed' | 'sentence' | 'paragraph' | 'semantic';
1127
1146
  embedding_model?: string;
1128
1147
  embedding_provider?: string;
1129
- search_indexes?: ('fulltext' | 'bm25' | 'trigram')[];
1130
- };
1148
+ search_indexes?: ('tsvector' | 'bm25' | 'trigram')[];
1149
+ }[];
1131
1150
  /** RLS policy overrides for the agent tables. NULL = apply defaults from apply_agent_security(). */
1132
1151
  policies?: BlueprintPolicy[];
1133
- /** Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, knowledge) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
1152
+ /** Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, plan, resource, agent, persona) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
1134
1153
  provisions?: {
1135
1154
  thread?: BlueprintEntityTableProvision;
1136
1155
  message?: BlueprintEntityTableProvision;
1137
1156
  task?: BlueprintEntityTableProvision;
1138
1157
  prompt?: BlueprintEntityTableProvision;
1139
- knowledge?: BlueprintEntityTableProvision;
1158
+ plan?: BlueprintEntityTableProvision;
1159
+ resource?: BlueprintEntityTableProvision;
1160
+ agent?: BlueprintEntityTableProvision;
1161
+ persona?: BlueprintEntityTableProvision;
1140
1162
  };
1141
1163
  }
1142
1164
  /** Graph module configuration. Presence triggers permission registration (manage_graphs, execute_graphs). The graph module requires a merkle_store_module_id dependency, so entity_type_provision only registers permissions here — the graph module itself must be provisioned separately. */
@@ -1202,7 +1224,7 @@ export interface BlueprintEntityType {
1202
1224
  graphs?: BlueprintGraphConfig[];
1203
1225
  }
1204
1226
  /** String shorthand -- just the node type name. */
1205
- export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzMemberOwner' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'DataBulk' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'DataForceCurrentUser' | 'DataId' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'DataJsonb' | 'DataMemberOwner' | 'DataOwnedFields' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings' | 'EventReferral' | 'EventTracker' | 'JobTrigger' | 'LimitEnforceAggregate' | 'LimitEnforceCounter' | 'LimitEnforceFeature' | 'LimitEnforceRate' | 'LimitTrackUsage' | 'LimitWarningAggregate' | 'LimitWarningCounter' | 'LimitWarningRate' | 'ProcessChunks' | 'ProcessExtraction' | 'ProcessFileEmbedding' | 'ProcessImageEmbedding' | 'ProcessImageVersions';
1227
+ export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzFilePath' | 'AuthzMemberList' | 'AuthzMemberOwner' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'DataBulk' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'DataForceCurrentUser' | 'DataI18n' | 'DataId' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'DataJsonb' | 'DataMemberOwner' | 'DataOwnedFields' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings' | 'EventReferral' | 'EventTracker' | 'JobTrigger' | 'LimitEnforceAggregate' | 'LimitEnforceCounter' | 'LimitEnforceFeature' | 'LimitEnforceRate' | 'LimitTrackUsage' | 'LimitWarningAggregate' | 'LimitWarningCounter' | 'LimitWarningRate' | 'ProcessChunks' | 'ProcessExtraction' | 'ProcessFileEmbedding' | 'ProcessImageEmbedding' | 'ProcessImageVersions';
1206
1228
  /** Object form -- { $type, data } with typed parameters. */
1207
1229
  export type BlueprintNodeObject = {
1208
1230
  $type: 'AuthzAllowAll';
@@ -1216,9 +1238,6 @@ export type BlueprintNodeObject = {
1216
1238
  } | {
1217
1239
  $type: 'AuthzDenyAll';
1218
1240
  data?: Record<string, never>;
1219
- } | {
1220
- $type: 'AuthzFilePath';
1221
- data: AuthzFilePathParams;
1222
1241
  } | {
1223
1242
  $type: 'AuthzDirectOwner';
1224
1243
  data: AuthzDirectOwnerParams;
@@ -1228,18 +1247,21 @@ export type BlueprintNodeObject = {
1228
1247
  } | {
1229
1248
  $type: 'AuthzEntityMembership';
1230
1249
  data: AuthzEntityMembershipParams;
1250
+ } | {
1251
+ $type: 'AuthzFilePath';
1252
+ data: AuthzFilePathParams;
1231
1253
  } | {
1232
1254
  $type: 'AuthzMemberList';
1233
1255
  data: AuthzMemberListParams;
1256
+ } | {
1257
+ $type: 'AuthzMemberOwner';
1258
+ data: AuthzMemberOwnerParams;
1234
1259
  } | {
1235
1260
  $type: 'AuthzNotReadOnly';
1236
1261
  data: AuthzNotReadOnlyParams;
1237
1262
  } | {
1238
1263
  $type: 'AuthzOrgHierarchy';
1239
1264
  data: AuthzOrgHierarchyParams;
1240
- } | {
1241
- $type: 'AuthzMemberOwner';
1242
- data: AuthzMemberOwnerParams;
1243
1265
  } | {
1244
1266
  $type: 'AuthzPeerOwnership';
1245
1267
  data: AuthzPeerOwnershipParams;
@@ -1285,6 +1307,9 @@ export type BlueprintNodeObject = {
1285
1307
  } | {
1286
1308
  $type: 'DataForceCurrentUser';
1287
1309
  data: DataForceCurrentUserParams;
1310
+ } | {
1311
+ $type: 'DataI18n';
1312
+ data: DataI18nParams;
1288
1313
  } | {
1289
1314
  $type: 'DataId';
1290
1315
  data: DataIdParams;
@@ -572,6 +572,7 @@ function buildBlueprintStorageConfig() {
572
572
  t.tsLiteralType(t.stringLiteral('org'))
573
573
  ])), 'Storage scope. "app" (default) creates app-level storage (no owner_id). "org" creates per-org/user storage (owner_id = org entity id, buckets seeded per-entity via AFTER INSERT trigger). Only "app" and "org" are allowed — child entity types get storage via entity_types[].storage.'),
574
574
  addJSDoc(optionalProp('storage_key', t.tsStringKeyword()), 'Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case.'),
575
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "buckets" instead of "org_buckets").'),
575
576
  addJSDoc(optionalProp('buckets', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintBucketSeed')))), 'Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning.'),
576
577
  addJSDoc(optionalProp('upload_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned upload URL expiry time in seconds.'),
577
578
  addJSDoc(optionalProp('download_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned download URL expiry time in seconds.'),
@@ -632,6 +633,7 @@ function buildBlueprintNamespaceConfig() {
632
633
  t.tsLiteralType(t.stringLiteral('org'))
633
634
  ])), 'Namespace scope. "app" (default) creates app-level namespaces (membership_type = NULL). "org" creates per-org namespaces. Only used at the top level of a blueprint definition — entity-scoped namespaces inherit scope from the entity type.'),
634
635
  addJSDoc(optionalProp('key', t.tsStringKeyword()), 'Module discriminator for multi-module namespaces. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_namespaces.'),
636
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "namespaces" instead of "org_namespaces").'),
635
637
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policy overrides for the namespaces table. NULL = apply defaults from apply_namespace_security().'),
636
638
  addJSDoc(optionalProp('provisions', t.tsTypeLiteral([
637
639
  optionalProp('namespaces', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
@@ -652,6 +654,7 @@ function buildBlueprintFunctionConfig() {
652
654
  t.tsLiteralType(t.stringLiteral('org'))
653
655
  ])), 'Function scope. "app" (default) creates app-level functions (membership_type = NULL). "org" creates per-org functions. Only used at the top level of a blueprint definition — entity-scoped functions inherit scope from the entity type.'),
654
656
  addJSDoc(optionalProp('key', t.tsStringKeyword()), 'Module discriminator for multi-module functions. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_function_definitions.'),
657
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "function_definitions" instead of "org_function_definitions").'),
655
658
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policy overrides for the function tables. NULL = apply defaults from apply_function_security().'),
656
659
  addJSDoc(optionalProp('provisions', t.tsTypeLiteral([
657
660
  optionalProp('definitions', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
@@ -673,9 +676,12 @@ function buildBlueprintAgentConfig() {
673
676
  t.tsLiteralType(t.stringLiteral('org'))
674
677
  ])), 'Agent scope. "app" (default) creates app-level agent tables (membership_type = NULL). "org" creates per-org agent tables. Only used at the top level of a blueprint definition — entity-scoped agents inherit scope from the entity type.'),
675
678
  addJSDoc(optionalProp('key', t.tsStringKeyword()), 'Module discriminator for multi-module agents. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_agent_thread.'),
679
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "agent_thread" instead of "org_agent_thread").'),
676
680
  addJSDoc(optionalProp('api_name', t.tsStringKeyword()), 'API name for the agent module. Used in GraphQL naming. Defaults to "agent".'),
677
- addJSDoc(optionalProp('has_knowledge', t.tsBooleanKeyword()), 'Whether to provision the agent_knowledge table with vector embeddings, tags, and trigger_phrases. Also inferred when a "knowledge" key is present. Defaults to false.'),
678
- addJSDoc(optionalProp('knowledge', t.tsTypeLiteral([
681
+ addJSDoc(optionalProp('has_plans', t.tsBooleanKeyword()), 'Whether to provision the agent_plan table for workflow plans with ordered tasks and approval gates. When true, tasks belong to plans (plan_id NOT NULL) instead of directly to threads. Defaults to false.'),
682
+ addJSDoc(optionalProp('has_resources', t.tsBooleanKeyword()), 'Whether to provision the unified agent_resource table (kind: skill/knowledge/convention) with auto-chunking (ProcessChunks) and vector embeddings. Defaults to false.'),
683
+ addJSDoc(optionalProp('has_agents', t.tsBooleanKeyword()), 'Whether to provision agent + agent_persona tables for agent registry and templates. Implies has_resources. Defaults to false.'),
684
+ addJSDoc(optionalProp('resources', t.tsArrayType(t.tsTypeLiteral([
679
685
  optionalProp('has_chunks', t.tsBooleanKeyword()),
680
686
  optionalProp('dimensions', t.tsNumberKeyword()),
681
687
  optionalProp('chunk_size', t.tsNumberKeyword()),
@@ -689,20 +695,23 @@ function buildBlueprintAgentConfig() {
689
695
  optionalProp('embedding_model', t.tsStringKeyword()),
690
696
  optionalProp('embedding_provider', t.tsStringKeyword()),
691
697
  optionalProp('search_indexes', t.tsArrayType(t.tsUnionType([
692
- t.tsLiteralType(t.stringLiteral('fulltext')),
698
+ t.tsLiteralType(t.stringLiteral('tsvector')),
693
699
  t.tsLiteralType(t.stringLiteral('bm25')),
694
700
  t.tsLiteralType(t.stringLiteral('trigram'))
695
701
  ])))
696
- ])), 'Knowledge configuration overrides. Set has_chunks to false to disable the chunking pipeline. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_knowledge table. Presence implies has_knowledge = true.'),
702
+ ]))), 'Resource configuration array. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_resource table. Set has_chunks to false to disable the ProcessChunks pipeline. Defaults: 768 dimensions, 1000 chunk_size, 200 chunk_overlap, paragraph strategy, ["tsvector"] search indexes.'),
697
703
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policy overrides for the agent tables. NULL = apply defaults from apply_agent_security().'),
698
704
  addJSDoc(optionalProp('provisions', t.tsTypeLiteral([
699
705
  optionalProp('thread', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
700
706
  optionalProp('message', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
701
707
  optionalProp('task', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
702
708
  optionalProp('prompt', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
703
- optionalProp('knowledge', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision')))
704
- ])), 'Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, knowledge) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision.')
705
- ]), 'Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables (and optionally knowledge with vector embeddings).');
709
+ optionalProp('plan', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
710
+ optionalProp('resource', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
711
+ optionalProp('agent', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
712
+ optionalProp('persona', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision')))
713
+ ])), 'Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, plan, resource, agent, persona) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision.')
714
+ ]), 'Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables. Opt-in: has_plans (plan + approval workflow), has_resources (unified skills/knowledge with chunking), has_agents (agent registry + personas, implies has_resources).');
706
715
  }
707
716
  /**
708
717
  * Build the BlueprintGraphConfig interface.
@@ -106,6 +106,13 @@ export interface DataEntityMembershipParams {
106
106
  export interface DataForceCurrentUserParams {
107
107
  field_name?: string;
108
108
  }
109
+ /** Creates a companion _translations table with lang_code + translatable fields. Copies SELECT policies and column-ref fields from the base table. Adds @i18n smart comment so the Graphile i18n plugin discovers it. Requires i18n_module to be provisioned for the database. */
110
+ export interface DataI18nParams {
111
+ fields: string[];
112
+ table_suffix?: string;
113
+ lang_code_type?: 'citext' | 'text';
114
+ copy_mutation_policies?: boolean;
115
+ }
109
116
  /** Adds a UUID primary key column with auto-generation default (uuidv7). This is the standard primary key pattern for all tables. */
110
117
  export interface DataIdParams {
111
118
  field_name?: string;
@@ -664,16 +671,6 @@ export interface AuthzCompositeParams {
664
671
  }
665
672
  /** Denies all access. Generates FALSE expression. */
666
673
  export type AuthzDenyAllParams = {};
667
- /** Path-scoped file sharing via ltree containment. Grants access when a path_shares row matches the current user, bucket, and an ancestor path with the required permission. */
668
- export interface AuthzFilePathParams {
669
- shares_schema: string;
670
- shares_table: string;
671
- files_schema?: string;
672
- files_table: string;
673
- permission_field: string;
674
- bucket_field?: string;
675
- path_field?: string;
676
- }
677
674
  /** Direct equality comparison between a table column and the current user ID. Simplest authorization pattern with no subqueries. */
678
675
  export interface AuthzDirectOwnerParams {
679
676
  entity_field: string;
@@ -693,10 +690,30 @@ export interface AuthzEntityMembershipParams {
693
690
  is_admin?: boolean;
694
691
  is_owner?: boolean;
695
692
  }
693
+ /** Path-scoped file sharing via ltree containment. Grants access when a path_shares row matches the current user, bucket, and an ancestor path with the required permission. */
694
+ export interface AuthzFilePathParams {
695
+ shares_schema: string;
696
+ shares_table: string;
697
+ files_schema?: string;
698
+ files_table: string;
699
+ permission_field: string;
700
+ bucket_field?: string;
701
+ path_field?: string;
702
+ }
696
703
  /** Check if current user is in an array column on the same row. */
697
704
  export interface AuthzMemberListParams {
698
705
  array_field: string;
699
706
  }
707
+ /** Compound policy: the row must be owned by the current user (owner_field = current_user_id) AND the current user must be a member of the entity referenced by entity_field. Combines direct ownership with entity membership — the actor can only access rows they own within entities they belong to. */
708
+ export interface AuthzMemberOwnerParams {
709
+ owner_field: string;
710
+ entity_field: string;
711
+ sel_field?: string;
712
+ membership_type?: number | string;
713
+ entity_type?: string;
714
+ permission?: string;
715
+ permissions?: string[];
716
+ }
700
717
  /** Restrictive policy that blocks read-only members from mutations. Checks actor_id + is_read_only IS NOT TRUE on the SPRT. Designed to run as a restrictive counterpart after a permissive AuthzEntityMembership policy has already verified membership. */
701
718
  export interface AuthzNotReadOnlyParams {
702
719
  entity_field: string;
@@ -709,16 +726,6 @@ export interface AuthzOrgHierarchyParams {
709
726
  anchor_field: string;
710
727
  max_depth?: number;
711
728
  }
712
- /** Compound policy: the row must be owned by the current user (owner_field = current_user_id) AND the current user must be a member of the entity referenced by entity_field. Combines direct ownership with entity membership — the actor can only access rows they own within entities they belong to. */
713
- export interface AuthzMemberOwnerParams {
714
- owner_field: string;
715
- entity_field: string;
716
- sel_field?: string;
717
- membership_type?: number | string;
718
- entity_type?: string;
719
- permission?: string;
720
- permissions?: string[];
721
- }
722
729
  /** Peer visibility through shared entity membership. Authorizes access to user-owned rows when the owner and current user are both members of the same entity. Self-joins the SPRT table to find peers. */
723
730
  export interface AuthzPeerOwnershipParams {
724
731
  owner_field: string;
@@ -905,7 +912,7 @@ export interface BlueprintField {
905
912
  /** An RLS policy entry for a blueprint table. Uses $type to match the blueprint JSON convention. */
906
913
  export interface BlueprintPolicy {
907
914
  /** Authz* policy type name (e.g., "AuthzDirectOwner", "AuthzAllowAll"). */
908
- $type: 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzMemberOwner' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal';
915
+ $type: 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzFilePath' | 'AuthzMemberList' | 'AuthzMemberOwner' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal';
909
916
  /** Privileges this policy applies to (e.g., ["select"], ["insert", "update", "delete"]). */
910
917
  privileges?: string[];
911
918
  /** Whether this policy is permissive (true) or restrictive (false). Defaults to true. */
@@ -1023,6 +1030,8 @@ export interface BlueprintStorageConfig {
1023
1030
  scope?: 'app' | 'org';
1024
1031
  /** Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case. */
1025
1032
  storage_key?: string;
1033
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "buckets" instead of "org_buckets"). */
1034
+ prefix?: string;
1026
1035
  /** Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning. */
1027
1036
  buckets?: BlueprintBucketSeed[];
1028
1037
  /** Override for presigned upload URL expiry time in seconds. */
@@ -1084,6 +1093,8 @@ export interface BlueprintNamespaceConfig {
1084
1093
  scope?: 'app' | 'org';
1085
1094
  /** Module discriminator for multi-module namespaces. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_namespaces. */
1086
1095
  key?: string;
1096
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "namespaces" instead of "org_namespaces"). */
1097
+ prefix?: string;
1087
1098
  /** RLS policy overrides for the namespaces table. NULL = apply defaults from apply_namespace_security(). */
1088
1099
  policies?: BlueprintPolicy[];
1089
1100
  /** Per-table overrides for namespace tables. Each key targets a specific table (namespaces, namespace_events) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
@@ -1098,6 +1109,8 @@ export interface BlueprintFunctionConfig {
1098
1109
  scope?: 'app' | 'org';
1099
1110
  /** Module discriminator for multi-module functions. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_function_definitions. */
1100
1111
  key?: string;
1112
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "function_definitions" instead of "org_function_definitions"). */
1113
+ prefix?: string;
1101
1114
  /** RLS policy overrides for the function tables. NULL = apply defaults from apply_function_security(). */
1102
1115
  policies?: BlueprintPolicy[];
1103
1116
  /** Per-table overrides for function tables. Each key targets a specific table (definitions, invocations, execution_logs) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
@@ -1107,18 +1120,24 @@ export interface BlueprintFunctionConfig {
1107
1120
  execution_logs?: BlueprintEntityTableProvision;
1108
1121
  };
1109
1122
  }
1110
- /** Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables (and optionally knowledge with vector embeddings). */
1123
+ /** Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables. Opt-in: has_plans (plan + approval workflow), has_resources (unified skills/knowledge with chunking), has_agents (agent registry + personas, implies has_resources). */
1111
1124
  export interface BlueprintAgentConfig {
1112
1125
  /** Agent scope. "app" (default) creates app-level agent tables (membership_type = NULL). "org" creates per-org agent tables. Only used at the top level of a blueprint definition — entity-scoped agents inherit scope from the entity type. */
1113
1126
  scope?: 'app' | 'org';
1114
1127
  /** Module discriminator for multi-module agents. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_agent_thread. */
1115
1128
  key?: string;
1129
+ /** Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "agent_thread" instead of "org_agent_thread"). */
1130
+ prefix?: string;
1116
1131
  /** API name for the agent module. Used in GraphQL naming. Defaults to "agent". */
1117
1132
  api_name?: string;
1118
- /** Whether to provision the agent_knowledge table with vector embeddings, tags, and trigger_phrases. Also inferred when a "knowledge" key is present. Defaults to false. */
1119
- has_knowledge?: boolean;
1120
- /** Knowledge configuration overrides. Set has_chunks to false to disable the chunking pipeline. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_knowledge table. Presence implies has_knowledge = true. */
1121
- knowledge?: {
1133
+ /** Whether to provision the agent_plan table for workflow plans with ordered tasks and approval gates. When true, tasks belong to plans (plan_id NOT NULL) instead of directly to threads. Defaults to false. */
1134
+ has_plans?: boolean;
1135
+ /** Whether to provision the unified agent_resource table (kind: skill/knowledge/convention) with auto-chunking (ProcessChunks) and vector embeddings. Defaults to false. */
1136
+ has_resources?: boolean;
1137
+ /** Whether to provision agent + agent_persona tables for agent registry and templates. Implies has_resources. Defaults to false. */
1138
+ has_agents?: boolean;
1139
+ /** Resource configuration array. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_resource table. Set has_chunks to false to disable the ProcessChunks pipeline. Defaults: 768 dimensions, 1000 chunk_size, 200 chunk_overlap, paragraph strategy, ["tsvector"] search indexes. */
1140
+ resources?: {
1122
1141
  has_chunks?: boolean;
1123
1142
  dimensions?: number;
1124
1143
  chunk_size?: number;
@@ -1126,17 +1145,20 @@ export interface BlueprintAgentConfig {
1126
1145
  chunk_strategy?: 'fixed' | 'sentence' | 'paragraph' | 'semantic';
1127
1146
  embedding_model?: string;
1128
1147
  embedding_provider?: string;
1129
- search_indexes?: ('fulltext' | 'bm25' | 'trigram')[];
1130
- };
1148
+ search_indexes?: ('tsvector' | 'bm25' | 'trigram')[];
1149
+ }[];
1131
1150
  /** RLS policy overrides for the agent tables. NULL = apply defaults from apply_agent_security(). */
1132
1151
  policies?: BlueprintPolicy[];
1133
- /** Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, knowledge) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
1152
+ /** Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, plan, resource, agent, persona) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision. */
1134
1153
  provisions?: {
1135
1154
  thread?: BlueprintEntityTableProvision;
1136
1155
  message?: BlueprintEntityTableProvision;
1137
1156
  task?: BlueprintEntityTableProvision;
1138
1157
  prompt?: BlueprintEntityTableProvision;
1139
- knowledge?: BlueprintEntityTableProvision;
1158
+ plan?: BlueprintEntityTableProvision;
1159
+ resource?: BlueprintEntityTableProvision;
1160
+ agent?: BlueprintEntityTableProvision;
1161
+ persona?: BlueprintEntityTableProvision;
1140
1162
  };
1141
1163
  }
1142
1164
  /** Graph module configuration. Presence triggers permission registration (manage_graphs, execute_graphs). The graph module requires a merkle_store_module_id dependency, so entity_type_provision only registers permissions here — the graph module itself must be provisioned separately. */
@@ -1202,7 +1224,7 @@ export interface BlueprintEntityType {
1202
1224
  graphs?: BlueprintGraphConfig[];
1203
1225
  }
1204
1226
  /** String shorthand -- just the node type name. */
1205
- export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzMemberOwner' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'DataBulk' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'DataForceCurrentUser' | 'DataId' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'DataJsonb' | 'DataMemberOwner' | 'DataOwnedFields' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings' | 'EventReferral' | 'EventTracker' | 'JobTrigger' | 'LimitEnforceAggregate' | 'LimitEnforceCounter' | 'LimitEnforceFeature' | 'LimitEnforceRate' | 'LimitTrackUsage' | 'LimitWarningAggregate' | 'LimitWarningCounter' | 'LimitWarningRate' | 'ProcessChunks' | 'ProcessExtraction' | 'ProcessFileEmbedding' | 'ProcessImageEmbedding' | 'ProcessImageVersions';
1227
+ export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzFilePath' | 'AuthzMemberList' | 'AuthzMemberOwner' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'DataBulk' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'DataForceCurrentUser' | 'DataI18n' | 'DataId' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'DataJsonb' | 'DataMemberOwner' | 'DataOwnedFields' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings' | 'EventReferral' | 'EventTracker' | 'JobTrigger' | 'LimitEnforceAggregate' | 'LimitEnforceCounter' | 'LimitEnforceFeature' | 'LimitEnforceRate' | 'LimitTrackUsage' | 'LimitWarningAggregate' | 'LimitWarningCounter' | 'LimitWarningRate' | 'ProcessChunks' | 'ProcessExtraction' | 'ProcessFileEmbedding' | 'ProcessImageEmbedding' | 'ProcessImageVersions';
1206
1228
  /** Object form -- { $type, data } with typed parameters. */
1207
1229
  export type BlueprintNodeObject = {
1208
1230
  $type: 'AuthzAllowAll';
@@ -1216,9 +1238,6 @@ export type BlueprintNodeObject = {
1216
1238
  } | {
1217
1239
  $type: 'AuthzDenyAll';
1218
1240
  data?: Record<string, never>;
1219
- } | {
1220
- $type: 'AuthzFilePath';
1221
- data: AuthzFilePathParams;
1222
1241
  } | {
1223
1242
  $type: 'AuthzDirectOwner';
1224
1243
  data: AuthzDirectOwnerParams;
@@ -1228,18 +1247,21 @@ export type BlueprintNodeObject = {
1228
1247
  } | {
1229
1248
  $type: 'AuthzEntityMembership';
1230
1249
  data: AuthzEntityMembershipParams;
1250
+ } | {
1251
+ $type: 'AuthzFilePath';
1252
+ data: AuthzFilePathParams;
1231
1253
  } | {
1232
1254
  $type: 'AuthzMemberList';
1233
1255
  data: AuthzMemberListParams;
1256
+ } | {
1257
+ $type: 'AuthzMemberOwner';
1258
+ data: AuthzMemberOwnerParams;
1234
1259
  } | {
1235
1260
  $type: 'AuthzNotReadOnly';
1236
1261
  data: AuthzNotReadOnlyParams;
1237
1262
  } | {
1238
1263
  $type: 'AuthzOrgHierarchy';
1239
1264
  data: AuthzOrgHierarchyParams;
1240
- } | {
1241
- $type: 'AuthzMemberOwner';
1242
- data: AuthzMemberOwnerParams;
1243
1265
  } | {
1244
1266
  $type: 'AuthzPeerOwnership';
1245
1267
  data: AuthzPeerOwnershipParams;
@@ -1285,6 +1307,9 @@ export type BlueprintNodeObject = {
1285
1307
  } | {
1286
1308
  $type: 'DataForceCurrentUser';
1287
1309
  data: DataForceCurrentUserParams;
1310
+ } | {
1311
+ $type: 'DataI18n';
1312
+ data: DataI18nParams;
1288
1313
  } | {
1289
1314
  $type: 'DataId';
1290
1315
  data: DataIdParams;
@@ -537,6 +537,7 @@ function buildBlueprintStorageConfig() {
537
537
  t.tsLiteralType(t.stringLiteral('org'))
538
538
  ])), 'Storage scope. "app" (default) creates app-level storage (no owner_id). "org" creates per-org/user storage (owner_id = org entity id, buckets seeded per-entity via AFTER INSERT trigger). Only "app" and "org" are allowed — child entity types get storage via entity_types[].storage.'),
539
539
  addJSDoc(optionalProp('storage_key', t.tsStringKeyword()), 'Discriminator for multi-module storage. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{storage_key}_buckets. Max 16 chars, lowercase snake_case.'),
540
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "buckets" instead of "org_buckets").'),
540
541
  addJSDoc(optionalProp('buckets', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintBucketSeed')))), 'Initial bucket seed entries. Each creates a row in {prefix}_buckets during provisioning.'),
541
542
  addJSDoc(optionalProp('upload_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned upload URL expiry time in seconds.'),
542
543
  addJSDoc(optionalProp('download_url_expiry_seconds', t.tsNumberKeyword()), 'Override for presigned download URL expiry time in seconds.'),
@@ -597,6 +598,7 @@ function buildBlueprintNamespaceConfig() {
597
598
  t.tsLiteralType(t.stringLiteral('org'))
598
599
  ])), 'Namespace scope. "app" (default) creates app-level namespaces (membership_type = NULL). "org" creates per-org namespaces. Only used at the top level of a blueprint definition — entity-scoped namespaces inherit scope from the entity type.'),
599
600
  addJSDoc(optionalProp('key', t.tsStringKeyword()), 'Module discriminator for multi-module namespaces. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_namespaces.'),
601
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "namespaces" instead of "org_namespaces").'),
600
602
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policy overrides for the namespaces table. NULL = apply defaults from apply_namespace_security().'),
601
603
  addJSDoc(optionalProp('provisions', t.tsTypeLiteral([
602
604
  optionalProp('namespaces', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
@@ -617,6 +619,7 @@ function buildBlueprintFunctionConfig() {
617
619
  t.tsLiteralType(t.stringLiteral('org'))
618
620
  ])), 'Function scope. "app" (default) creates app-level functions (membership_type = NULL). "org" creates per-org functions. Only used at the top level of a blueprint definition — entity-scoped functions inherit scope from the entity type.'),
619
621
  addJSDoc(optionalProp('key', t.tsStringKeyword()), 'Module discriminator for multi-module functions. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_function_definitions.'),
622
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "function_definitions" instead of "org_function_definitions").'),
620
623
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policy overrides for the function tables. NULL = apply defaults from apply_function_security().'),
621
624
  addJSDoc(optionalProp('provisions', t.tsTypeLiteral([
622
625
  optionalProp('definitions', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
@@ -638,9 +641,12 @@ function buildBlueprintAgentConfig() {
638
641
  t.tsLiteralType(t.stringLiteral('org'))
639
642
  ])), 'Agent scope. "app" (default) creates app-level agent tables (membership_type = NULL). "org" creates per-org agent tables. Only used at the top level of a blueprint definition — entity-scoped agents inherit scope from the entity type.'),
640
643
  addJSDoc(optionalProp('key', t.tsStringKeyword()), 'Module discriminator for multi-module agents. Defaults to "default" (omitted from table names). Non-default keys appear as an infix: {prefix}_{key}_agent_thread.'),
644
+ addJSDoc(optionalProp('prefix', t.tsStringKeyword()), 'Override the table-name prefix. By default the prefix is derived from the scope (e.g. "org"). Set to an empty string to produce unprefixed table names (e.g. "agent_thread" instead of "org_agent_thread").'),
641
645
  addJSDoc(optionalProp('api_name', t.tsStringKeyword()), 'API name for the agent module. Used in GraphQL naming. Defaults to "agent".'),
642
- addJSDoc(optionalProp('has_knowledge', t.tsBooleanKeyword()), 'Whether to provision the agent_knowledge table with vector embeddings, tags, and trigger_phrases. Also inferred when a "knowledge" key is present. Defaults to false.'),
643
- addJSDoc(optionalProp('knowledge', t.tsTypeLiteral([
646
+ addJSDoc(optionalProp('has_plans', t.tsBooleanKeyword()), 'Whether to provision the agent_plan table for workflow plans with ordered tasks and approval gates. When true, tasks belong to plans (plan_id NOT NULL) instead of directly to threads. Defaults to false.'),
647
+ addJSDoc(optionalProp('has_resources', t.tsBooleanKeyword()), 'Whether to provision the unified agent_resource table (kind: skill/knowledge/convention) with auto-chunking (ProcessChunks) and vector embeddings. Defaults to false.'),
648
+ addJSDoc(optionalProp('has_agents', t.tsBooleanKeyword()), 'Whether to provision agent + agent_persona tables for agent registry and templates. Implies has_resources. Defaults to false.'),
649
+ addJSDoc(optionalProp('resources', t.tsArrayType(t.tsTypeLiteral([
644
650
  optionalProp('has_chunks', t.tsBooleanKeyword()),
645
651
  optionalProp('dimensions', t.tsNumberKeyword()),
646
652
  optionalProp('chunk_size', t.tsNumberKeyword()),
@@ -654,20 +660,23 @@ function buildBlueprintAgentConfig() {
654
660
  optionalProp('embedding_model', t.tsStringKeyword()),
655
661
  optionalProp('embedding_provider', t.tsStringKeyword()),
656
662
  optionalProp('search_indexes', t.tsArrayType(t.tsUnionType([
657
- t.tsLiteralType(t.stringLiteral('fulltext')),
663
+ t.tsLiteralType(t.stringLiteral('tsvector')),
658
664
  t.tsLiteralType(t.stringLiteral('bm25')),
659
665
  t.tsLiteralType(t.stringLiteral('trigram'))
660
666
  ])))
661
- ])), 'Knowledge configuration overrides. Set has_chunks to false to disable the chunking pipeline. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_knowledge table. Presence implies has_knowledge = true.'),
667
+ ]))), 'Resource configuration array. Controls vector dimensions, chunking strategy, embedding model/provider, and text search indexes for the agent_resource table. Set has_chunks to false to disable the ProcessChunks pipeline. Defaults: 768 dimensions, 1000 chunk_size, 200 chunk_overlap, paragraph strategy, ["tsvector"] search indexes.'),
662
668
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policy overrides for the agent tables. NULL = apply defaults from apply_agent_security().'),
663
669
  addJSDoc(optionalProp('provisions', t.tsTypeLiteral([
664
670
  optionalProp('thread', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
665
671
  optionalProp('message', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
666
672
  optionalProp('task', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
667
673
  optionalProp('prompt', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
668
- optionalProp('knowledge', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision')))
669
- ])), 'Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, knowledge) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision.')
670
- ]), 'Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables (and optionally knowledge with vector embeddings).');
674
+ optionalProp('plan', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
675
+ optionalProp('resource', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
676
+ optionalProp('agent', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))),
677
+ optionalProp('persona', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision')))
678
+ ])), 'Per-table overrides for agent tables. Each key targets a specific table (thread, message, task, prompt, plan, resource, agent, persona) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision.')
679
+ ]), 'Agent module configuration. When used at the top level of a blueprint, the scope field controls whether agents are app-level ("app", default) or org-level ("org"). When used inside entity_types[], scope is inherited from the entity type. Provisions thread, message, task, prompt tables. Opt-in: has_plans (plan + approval workflow), has_resources (unified skills/knowledge with chunking), has_agents (agent registry + personas, implies has_resources).');
671
680
  }
672
681
  /**
673
682
  * Build the BlueprintGraphConfig interface.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-type-registry",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Node type definitions for the Constructive blueprint system. Single source of truth for all Authz*, Data*, Relation*, and View* node types.",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "main": "index.js",
@@ -47,5 +47,5 @@
47
47
  "registry",
48
48
  "graphile"
49
49
  ],
50
- "gitHead": "025f9c4283cf3629e8d74f87ee699b375293c81d"
50
+ "gitHead": "c9ff6a6cec5d8cb455010b190b78c3d055097981"
51
51
  }