node-type-registry 0.44.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.
- package/README.md +4 -0
- package/blueprint-types.generated.d.ts +62 -37
- package/codegen/generate-types.js +16 -7
- package/data/data-i18n.d.ts +2 -0
- package/data/data-i18n.js +47 -0
- package/data/index.d.ts +1 -0
- package/data/index.js +3 -1
- package/esm/blueprint-types.generated.d.ts +62 -37
- package/esm/codegen/generate-types.js +16 -7
- package/esm/data/data-i18n.d.ts +2 -0
- package/esm/data/data-i18n.js +44 -0
- package/esm/data/index.d.ts +1 -0
- package/esm/data/index.js +1 -0
- package/esm/module-presets/auth-email-magic.js +6 -14
- package/esm/module-presets/auth-email.d.ts +3 -3
- package/esm/module-presets/auth-email.js +10 -29
- package/esm/module-presets/auth-hardened.js +6 -21
- package/esm/module-presets/auth-passkey.js +6 -15
- package/esm/module-presets/auth-sso.d.ts +1 -1
- package/esm/module-presets/auth-sso.js +8 -18
- package/esm/module-presets/b2b-storage.js +16 -22
- package/esm/module-presets/b2b.js +20 -38
- package/esm/module-presets/full.d.ts +1 -1
- package/esm/module-presets/full.js +25 -28
- package/esm/module-presets/minimal.js +1 -12
- package/esm/module-presets/types.d.ts +9 -15
- package/module-presets/auth-email-magic.js +6 -14
- package/module-presets/auth-email.d.ts +3 -3
- package/module-presets/auth-email.js +10 -29
- package/module-presets/auth-hardened.js +6 -21
- package/module-presets/auth-passkey.js +6 -15
- package/module-presets/auth-sso.d.ts +1 -1
- package/module-presets/auth-sso.js +8 -18
- package/module-presets/b2b-storage.js +16 -22
- package/module-presets/b2b.js +20 -38
- package/module-presets/full.d.ts +1 -1
- package/module-presets/full.js +25 -28
- package/module-presets/minimal.js +1 -12
- package/module-presets/types.d.ts +9 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -131,6 +131,10 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
|
131
131
|
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
|
|
132
132
|
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
|
|
133
133
|
|
|
134
|
+
### 📚 Documentation & Skills
|
|
135
|
+
|
|
136
|
+
* [constructive-skills](https://github.com/constructive-io/constructive-skills): **📖 Platform documentation and AI agent skills** — feature catalog, blueprint reference, SDK guides (i18n, billing, limits, events, uploads, security, entities, search, AI), and deployment guides.
|
|
137
|
+
|
|
134
138
|
## Credits
|
|
135
139
|
|
|
136
140
|
**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
|
|
@@ -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' | '
|
|
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 (
|
|
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
|
|
1119
|
-
|
|
1120
|
-
/**
|
|
1121
|
-
|
|
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?: ('
|
|
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,
|
|
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
|
-
|
|
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' | '
|
|
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('
|
|
678
|
-
addJSDoc(optionalProp('
|
|
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('
|
|
698
|
+
t.tsLiteralType(t.stringLiteral('tsvector')),
|
|
693
699
|
t.tsLiteralType(t.stringLiteral('bm25')),
|
|
694
700
|
t.tsLiteralType(t.stringLiteral('trigram'))
|
|
695
701
|
])))
|
|
696
|
-
])), '
|
|
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('
|
|
704
|
-
|
|
705
|
-
|
|
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.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataI18n = void 0;
|
|
4
|
+
exports.DataI18n = {
|
|
5
|
+
name: 'DataI18n',
|
|
6
|
+
slug: 'data_i18n',
|
|
7
|
+
category: 'data',
|
|
8
|
+
display_name: 'Internationalization',
|
|
9
|
+
description: 'Creates a companion _translations table with lang_code + translatable ' +
|
|
10
|
+
'fields. Copies SELECT policies and column-ref fields from the base ' +
|
|
11
|
+
'table. Adds @i18n smart comment so the Graphile i18n plugin discovers ' +
|
|
12
|
+
'it. Requires i18n_module to be provisioned for the database.',
|
|
13
|
+
parameter_schema: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
fields: {
|
|
17
|
+
type: 'array',
|
|
18
|
+
items: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
format: 'column-ref'
|
|
21
|
+
},
|
|
22
|
+
description: 'Field names on the base table to make translatable. Each field ' +
|
|
23
|
+
'is duplicated on the translation table with the same type.'
|
|
24
|
+
},
|
|
25
|
+
table_suffix: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Suffix for the translation table name',
|
|
28
|
+
default: '_translations'
|
|
29
|
+
},
|
|
30
|
+
lang_code_type: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
enum: ['citext', 'text'],
|
|
33
|
+
description: 'Type for the lang_code column',
|
|
34
|
+
default: 'citext'
|
|
35
|
+
},
|
|
36
|
+
copy_mutation_policies: {
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
description: 'Whether to also copy INSERT/UPDATE/DELETE policies (not just ' +
|
|
39
|
+
'SELECT). Default true — translations should be editable by the ' +
|
|
40
|
+
'same users who can edit the base row.',
|
|
41
|
+
default: true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
required: ['fields']
|
|
45
|
+
},
|
|
46
|
+
tags: ['i18n', 'translation', 'schema']
|
|
47
|
+
};
|
package/data/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { DataCompositeField } from './data-composite-field';
|
|
|
7
7
|
export { DataDirectOwner } from './data-direct-owner';
|
|
8
8
|
export { DataEntityMembership } from './data-entity-membership';
|
|
9
9
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
10
|
+
export { DataI18n } from './data-i18n';
|
|
10
11
|
export { DataId } from './data-id';
|
|
11
12
|
export { DataImmutableFields } from './data-immutable-fields';
|
|
12
13
|
export { DataInflection } from './data-inflection';
|
package/data/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableUserSettings = exports.TableUserProfiles = exports.TableOrganizationSettings = exports.SearchVector = exports.SearchUnified = exports.SearchTrgm = exports.SearchSpatialAggregate = exports.SearchSpatial = exports.SearchFullText = exports.SearchBm25 = exports.DataTimestamps = exports.DataTags = exports.DataStatusField = exports.DataSoftDelete = exports.DataSlug = exports.DataRealtime = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.DataOwnedFields = exports.DataMemberOwner = exports.DataJsonb = exports.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataId = exports.DataForceCurrentUser = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = exports.DataBulk = exports.CheckOneOf = exports.CheckNotEqual = exports.CheckLessThan = exports.CheckGreaterThan = void 0;
|
|
3
|
+
exports.TableUserSettings = exports.TableUserProfiles = exports.TableOrganizationSettings = exports.SearchVector = exports.SearchUnified = exports.SearchTrgm = exports.SearchSpatialAggregate = exports.SearchSpatial = exports.SearchFullText = exports.SearchBm25 = exports.DataTimestamps = exports.DataTags = exports.DataStatusField = exports.DataSoftDelete = exports.DataSlug = exports.DataRealtime = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.DataOwnedFields = exports.DataMemberOwner = exports.DataJsonb = exports.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataId = exports.DataI18n = exports.DataForceCurrentUser = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = exports.DataBulk = exports.CheckOneOf = exports.CheckNotEqual = exports.CheckLessThan = exports.CheckGreaterThan = void 0;
|
|
4
4
|
var check_greater_than_1 = require("./check-greater-than");
|
|
5
5
|
Object.defineProperty(exports, "CheckGreaterThan", { enumerable: true, get: function () { return check_greater_than_1.CheckGreaterThan; } });
|
|
6
6
|
var check_less_than_1 = require("./check-less-than");
|
|
@@ -19,6 +19,8 @@ var data_entity_membership_1 = require("./data-entity-membership");
|
|
|
19
19
|
Object.defineProperty(exports, "DataEntityMembership", { enumerable: true, get: function () { return data_entity_membership_1.DataEntityMembership; } });
|
|
20
20
|
var data_force_current_user_1 = require("./data-force-current-user");
|
|
21
21
|
Object.defineProperty(exports, "DataForceCurrentUser", { enumerable: true, get: function () { return data_force_current_user_1.DataForceCurrentUser; } });
|
|
22
|
+
var data_i18n_1 = require("./data-i18n");
|
|
23
|
+
Object.defineProperty(exports, "DataI18n", { enumerable: true, get: function () { return data_i18n_1.DataI18n; } });
|
|
22
24
|
var data_id_1 = require("./data-id");
|
|
23
25
|
Object.defineProperty(exports, "DataId", { enumerable: true, get: function () { return data_id_1.DataId; } });
|
|
24
26
|
var data_immutable_fields_1 = require("./data-immutable-fields");
|