node-type-registry 0.36.0 → 0.38.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.
Files changed (133) hide show
  1. package/blueprint-types.generated.d.ts +46 -7
  2. package/codegen/generate-types.js +40 -4
  3. package/conditions/index.d.ts +1 -0
  4. package/conditions/index.js +8 -0
  5. package/conditions/trigger-condition.d.ts +35 -0
  6. package/conditions/trigger-condition.js +97 -0
  7. package/data/index.d.ts +0 -10
  8. package/data/index.js +1 -21
  9. package/data/search-unified.js +8 -0
  10. package/data/search-vector.js +12 -0
  11. package/esm/blueprint-types.generated.d.ts +46 -7
  12. package/esm/codegen/generate-types.js +40 -4
  13. package/esm/conditions/index.d.ts +1 -0
  14. package/esm/conditions/index.js +1 -0
  15. package/esm/conditions/trigger-condition.d.ts +35 -0
  16. package/esm/conditions/trigger-condition.js +94 -0
  17. package/esm/data/index.d.ts +0 -10
  18. package/esm/data/index.js +0 -10
  19. package/esm/data/search-unified.js +8 -0
  20. package/esm/data/search-vector.js +12 -0
  21. package/esm/event/index.d.ts +2 -0
  22. package/esm/event/index.js +2 -0
  23. package/esm/event/referral.d.ts +2 -0
  24. package/esm/event/referral.js +62 -0
  25. package/esm/event/tracker.d.ts +2 -0
  26. package/esm/event/tracker.js +71 -0
  27. package/esm/index.d.ts +5 -0
  28. package/esm/index.js +13 -0
  29. package/esm/job/index.d.ts +1 -0
  30. package/esm/job/index.js +1 -0
  31. package/esm/{data/data-job-trigger.js → job/trigger.js} +3 -53
  32. package/esm/limit/enforce-aggregate.d.ts +2 -0
  33. package/esm/{data/data-aggregate-limit-counter.js → limit/enforce-aggregate.js} +6 -6
  34. package/esm/limit/enforce-counter.d.ts +2 -0
  35. package/esm/{data/data-limit-counter.js → limit/enforce-counter.js} +6 -6
  36. package/esm/limit/enforce-feature.d.ts +2 -0
  37. package/esm/{data/data-feature-flag.js → limit/enforce-feature.js} +6 -6
  38. package/esm/limit/enforce-rate.d.ts +2 -0
  39. package/esm/limit/enforce-rate.js +39 -0
  40. package/esm/limit/index.d.ts +8 -0
  41. package/esm/limit/index.js +8 -0
  42. package/esm/limit/track-usage.d.ts +2 -0
  43. package/esm/{data/data-billing-meter.js → limit/track-usage.js} +6 -6
  44. package/esm/limit/warning-aggregate.d.ts +2 -0
  45. package/esm/limit/warning-aggregate.js +24 -0
  46. package/esm/limit/warning-counter.d.ts +2 -0
  47. package/esm/limit/warning-counter.js +30 -0
  48. package/esm/limit/warning-rate.d.ts +2 -0
  49. package/esm/limit/warning-rate.js +30 -0
  50. package/esm/module-presets/auth-email-magic.js +2 -2
  51. package/esm/module-presets/auth-email.js +5 -5
  52. package/esm/module-presets/auth-hardened.js +2 -2
  53. package/esm/module-presets/auth-passkey.js +2 -2
  54. package/esm/module-presets/auth-sso.d.ts +1 -1
  55. package/esm/module-presets/auth-sso.js +5 -5
  56. package/esm/module-presets/b2b-storage.js +6 -6
  57. package/esm/module-presets/b2b.js +2 -2
  58. package/esm/module-presets/minimal.d.ts +1 -1
  59. package/esm/module-presets/minimal.js +3 -3
  60. package/esm/{data/data-chunks.js → process/chunks.js} +19 -0
  61. package/esm/{data/process-extraction.js → process/extraction.js} +15 -10
  62. package/esm/{data/data-file-embedding.js → process/file-embedding.js} +22 -10
  63. package/esm/{data/data-image-embedding.js → process/image-embedding.js} +15 -9
  64. package/esm/{data/process-image-versions.js → process/image-versions.js} +3 -9
  65. package/esm/process/index.d.ts +5 -0
  66. package/esm/process/index.js +5 -0
  67. package/event/index.d.ts +2 -0
  68. package/event/index.js +7 -0
  69. package/event/referral.d.ts +2 -0
  70. package/event/referral.js +65 -0
  71. package/event/tracker.d.ts +2 -0
  72. package/event/tracker.js +74 -0
  73. package/index.d.ts +5 -0
  74. package/index.js +13 -0
  75. package/job/index.d.ts +1 -0
  76. package/job/index.js +5 -0
  77. package/{data/data-job-trigger.js → job/trigger.js} +3 -53
  78. package/limit/enforce-aggregate.d.ts +2 -0
  79. package/{data/data-aggregate-limit-counter.js → limit/enforce-aggregate.js} +7 -7
  80. package/limit/enforce-counter.d.ts +2 -0
  81. package/{data/data-limit-counter.js → limit/enforce-counter.js} +7 -7
  82. package/limit/enforce-feature.d.ts +2 -0
  83. package/{data/data-feature-flag.js → limit/enforce-feature.js} +7 -7
  84. package/limit/enforce-rate.d.ts +2 -0
  85. package/limit/enforce-rate.js +42 -0
  86. package/limit/index.d.ts +8 -0
  87. package/limit/index.js +19 -0
  88. package/limit/track-usage.d.ts +2 -0
  89. package/{data/data-billing-meter.js → limit/track-usage.js} +7 -7
  90. package/limit/warning-aggregate.d.ts +2 -0
  91. package/limit/warning-aggregate.js +27 -0
  92. package/limit/warning-counter.d.ts +2 -0
  93. package/limit/warning-counter.js +33 -0
  94. package/limit/warning-rate.d.ts +2 -0
  95. package/limit/warning-rate.js +33 -0
  96. package/module-presets/auth-email-magic.js +2 -2
  97. package/module-presets/auth-email.js +5 -5
  98. package/module-presets/auth-hardened.js +2 -2
  99. package/module-presets/auth-passkey.js +2 -2
  100. package/module-presets/auth-sso.d.ts +1 -1
  101. package/module-presets/auth-sso.js +5 -5
  102. package/module-presets/b2b-storage.js +6 -6
  103. package/module-presets/b2b.js +2 -2
  104. package/module-presets/minimal.d.ts +1 -1
  105. package/module-presets/minimal.js +3 -3
  106. package/package.json +2 -2
  107. package/{data/data-chunks.js → process/chunks.js} +19 -0
  108. package/{data/process-extraction.js → process/extraction.js} +15 -10
  109. package/{data/data-file-embedding.js → process/file-embedding.js} +22 -10
  110. package/{data/data-image-embedding.js → process/image-embedding.js} +15 -9
  111. package/{data/process-image-versions.js → process/image-versions.js} +3 -9
  112. package/process/index.d.ts +5 -0
  113. package/process/index.js +13 -0
  114. package/data/data-aggregate-limit-counter.d.ts +0 -2
  115. package/data/data-billing-meter.d.ts +0 -2
  116. package/data/data-feature-flag.d.ts +0 -2
  117. package/data/data-limit-counter.d.ts +0 -2
  118. package/esm/data/data-aggregate-limit-counter.d.ts +0 -2
  119. package/esm/data/data-billing-meter.d.ts +0 -2
  120. package/esm/data/data-feature-flag.d.ts +0 -2
  121. package/esm/data/data-limit-counter.d.ts +0 -2
  122. /package/{data/data-job-trigger.d.ts → esm/job/trigger.d.ts} +0 -0
  123. /package/{data/data-chunks.d.ts → esm/process/chunks.d.ts} +0 -0
  124. /package/{data/process-extraction.d.ts → esm/process/extraction.d.ts} +0 -0
  125. /package/{data/data-file-embedding.d.ts → esm/process/file-embedding.d.ts} +0 -0
  126. /package/{data/data-image-embedding.d.ts → esm/process/image-embedding.d.ts} +0 -0
  127. /package/{data/process-image-versions.d.ts → esm/process/image-versions.d.ts} +0 -0
  128. /package/{esm/data/data-job-trigger.d.ts → job/trigger.d.ts} +0 -0
  129. /package/{esm/data/data-chunks.d.ts → process/chunks.d.ts} +0 -0
  130. /package/{esm/data/process-extraction.d.ts → process/extraction.d.ts} +0 -0
  131. /package/{esm/data/data-file-embedding.d.ts → process/file-embedding.d.ts} +0 -0
  132. /package/{esm/data/data-image-embedding.d.ts → process/image-embedding.d.ts} +0 -0
  133. /package/{esm/data/process-image-versions.d.ts → process/image-versions.d.ts} +0 -0
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimitWarningRate = void 0;
4
+ exports.LimitWarningRate = {
5
+ name: 'LimitWarningRate',
6
+ slug: 'limit_warning_rate',
7
+ category: 'limit_warning',
8
+ display_name: 'Warning Rate Limit',
9
+ description: 'Attaches an AFTER INSERT trigger that checks if the actor\'s current request count in the active sliding window has crossed any warning threshold configured in the limit_warnings table. If a threshold is reached for the first time, enqueues a background job (e.g. email notification). Uses limit_warning_state for one-time dedup per warning/actor pair. Requires both a limits_module with limit_warnings enabled and a rate_limit_meters_module.',
10
+ parameter_schema: {
11
+ type: 'object',
12
+ properties: {
13
+ meter_slug: {
14
+ type: 'string',
15
+ description: 'Slug of the billing meter to check rate limits against (must match a meters table entry)',
16
+ },
17
+ entity_field: {
18
+ type: 'string',
19
+ format: 'column-ref',
20
+ description: 'Column on the target table that holds the entity id for rate limit lookup',
21
+ default: 'entity_id',
22
+ },
23
+ actor_field: {
24
+ type: 'string',
25
+ format: 'column-ref',
26
+ description: 'Column on the target table that holds the actor id for rate limit lookup',
27
+ default: 'owner_id',
28
+ },
29
+ },
30
+ required: ['meter_slug'],
31
+ },
32
+ tags: ['rate-limits', 'triggers', 'warning', 'notifications', 'metering'],
33
+ };
@@ -41,8 +41,8 @@ exports.PresetAuthEmailMagic = {
41
41
  'levels_module:app',
42
42
  'memberships_module:app',
43
43
  'sessions_module',
44
- 'secrets_module',
45
- 'encrypted_secrets_module',
44
+ 'user_state_module',
45
+ 'config_secrets_user_module',
46
46
  'emails_module',
47
47
  'rls_module',
48
48
  'user_auth_module',
@@ -26,7 +26,7 @@ exports.PresetAuthEmail = {
26
26
  summary: 'Standard email/password auth flow with app-level permissions. No orgs, no SSO, no MFA.',
27
27
  description: 'Installs `user_auth_module` with exactly the table dependencies its insert trigger ' +
28
28
  'hard-requires: users, app-scoped memberships (plus their permissions/limits/levels ' +
29
- 'dependencies), emails, secrets, encrypted secrets, sessions, plus RLS. You get the ' +
29
+ 'dependencies), emails, user state, user secrets, sessions, plus RLS. You get the ' +
30
30
  'standard password-based auth procedures (sign_up, sign_in, reset_password, ' +
31
31
  "verify_email, delete_account, ...) and that's it. Everything else in the module " +
32
32
  'catalog — SSO, passkeys, SMS, rate limits, orgs, invites — is deliberately omitted. ' +
@@ -52,8 +52,8 @@ exports.PresetAuthEmail = {
52
52
  'levels_module:app',
53
53
  'memberships_module:app',
54
54
  'sessions_module',
55
- 'secrets_module',
56
- 'encrypted_secrets_module',
55
+ 'user_state_module',
56
+ 'config_secrets_user_module',
57
57
  'emails_module',
58
58
  'rls_module',
59
59
  'user_auth_module'
@@ -65,8 +65,8 @@ exports.PresetAuthEmail = {
65
65
  'limits_module:app': 'Required by `memberships_module:app`: NOT NULL FK to caps table.',
66
66
  'levels_module:app': 'Required by `memberships_module:app`: NOT NULL FK to levels table.',
67
67
  emails_module: 'Required by the `user_auth_module` insert trigger (`RAISE EXCEPTION REQUIRES emails_module`).',
68
- encrypted_secrets_module: 'Required for password hashing; referenced by `set_password`, `verify_password`, and reset flows.',
69
- secrets_module: 'API-key storage (`create_api_key`, `revoke_api_key`, `my_api_keys`).'
68
+ config_secrets_user_module: 'Required for password hashing; referenced by `set_password`, `verify_password`, and reset flows.',
69
+ user_state_module: 'API-key storage (`create_api_key`, `revoke_api_key`, `my_api_keys`).'
70
70
  },
71
71
  omits_notes: {
72
72
  rate_limits_module: 'Omitted intentionally; throttle_* helpers are null-safe and the auth procs compile without it. Add later via `auth:hardened`.',
@@ -38,8 +38,8 @@ exports.PresetAuthHardened = {
38
38
  'levels_module:app',
39
39
  'memberships_module:app',
40
40
  'sessions_module',
41
- 'secrets_module',
42
- 'encrypted_secrets_module',
41
+ 'user_state_module',
42
+ 'config_secrets_user_module',
43
43
  'emails_module',
44
44
  'rls_module',
45
45
  'user_auth_module',
@@ -39,8 +39,8 @@ exports.PresetAuthPasskey = {
39
39
  'levels_module:app',
40
40
  'memberships_module:app',
41
41
  'sessions_module',
42
- 'secrets_module',
43
- 'encrypted_secrets_module',
42
+ 'user_state_module',
43
+ 'config_secrets_user_module',
44
44
  'emails_module',
45
45
  'rls_module',
46
46
  'user_auth_module',
@@ -6,7 +6,7 @@ import type { ModulePreset } from './types';
6
6
  * `(provider, external_id)`) and `identity_providers_module` (the provider
7
7
  * config: URLs, client_id, encrypted client_secret, scopes, PKCE/nonce
8
8
  * knobs). The generator then emits `sign_in_identity` / `sign_up_identity`
9
- * procedures which rely on `encrypted_secrets_module` to decrypt the client
9
+ * procedures which rely on `config_secrets_user_module` to decrypt the client
10
10
  * secret at auth time.
11
11
  *
12
12
  * Password fallback stays on by default (break-glass for admins); flip the
@@ -8,7 +8,7 @@ exports.PresetAuthSso = void 0;
8
8
  * `(provider, external_id)`) and `identity_providers_module` (the provider
9
9
  * config: URLs, client_id, encrypted client_secret, scopes, PKCE/nonce
10
10
  * knobs). The generator then emits `sign_in_identity` / `sign_up_identity`
11
- * procedures which rely on `encrypted_secrets_module` to decrypt the client
11
+ * procedures which rely on `config_secrets_user_module` to decrypt the client
12
12
  * secret at auth time.
13
13
  *
14
14
  * Password fallback stays on by default (break-glass for admins); flip the
@@ -29,7 +29,7 @@ exports.PresetAuthSso = {
29
29
  'encrypted client secrets) and `connected_accounts_module` (the junction mapping a ' +
30
30
  'Constructive user to a `(provider, external_id)` pair). The generator emits ' +
31
31
  '`sign_in_identity` and `sign_up_identity` procedures which decrypt the client secret ' +
32
- 'through `encrypted_secrets_module` at auth time. Keep password flows as break-glass, or ' +
32
+ 'through `config_secrets_user_module` at auth time. Keep password flows as break-glass, or ' +
33
33
  'disable them via `app_settings_auth` toggles for strictly-SSO deployments.',
34
34
  good_for: [
35
35
  'B2B apps where end users sign in via their employer IdP',
@@ -48,8 +48,8 @@ exports.PresetAuthSso = {
48
48
  'levels_module:app',
49
49
  'memberships_module:app',
50
50
  'sessions_module',
51
- 'secrets_module',
52
- 'encrypted_secrets_module',
51
+ 'user_state_module',
52
+ 'config_secrets_user_module',
53
53
  'emails_module',
54
54
  'rls_module',
55
55
  'user_auth_module',
@@ -59,7 +59,7 @@ exports.PresetAuthSso = {
59
59
  includes_notes: {
60
60
  connected_accounts_module: 'Junction table for (user, provider, external_id). Without it, `sign_in_identity` does not compile.',
61
61
  identity_providers_module: 'Provider config table (URLs, client_id, encrypted client_secret, scopes, PKCE knobs).',
62
- encrypted_secrets_module: 'Required by `auth:email` already; also used by SSO to decrypt the provider client_secret at auth time.'
62
+ config_secrets_user_module: 'Required by `auth:email` already; also used by SSO to decrypt the provider client_secret at auth time.'
63
63
  },
64
64
  omits_notes: {
65
65
  webauthn_credentials_module: 'No passkeys — add `auth:passkey` or move to `auth:hardened`.',
@@ -20,9 +20,9 @@ exports.PresetB2bStorage = {
20
20
  'hierarchy), plus `storage_module` for file uploads. The storage module creates ' +
21
21
  '`app_buckets` and `app_files` tables with full RLS: AuthzPublishable for public reads, ' +
22
22
  'AuthzAppMembership for member access, AuthzDirectOwner for uploader-only modify/delete. ' +
23
- 'Entity-type provisioning with `has_storage=true` adds per-scope storage tables ' +
24
- 'automatically. Choose this when your B2B app needs file uploads, avatars, attachments, ' +
25
- 'or any object storage tied to workspaces.',
23
+ 'Entity-type provisioning with a non-empty `storage` array adds per-scope storage tables ' +
24
+ 'automatically (multiple modules per entity via storage_key). Choose this when your B2B ' +
25
+ 'app needs file uploads, avatars, attachments, or any object storage tied to workspaces.',
26
26
  good_for: [
27
27
  'B2B SaaS with file uploads (documents, avatars, attachments)',
28
28
  'Apps where storage is scoped to orgs/workspaces',
@@ -44,8 +44,8 @@ exports.PresetB2bStorage = {
44
44
  'memberships_module:app',
45
45
  'memberships_module:org',
46
46
  'sessions_module',
47
- 'secrets_module',
48
- 'encrypted_secrets_module',
47
+ 'user_state_module',
48
+ 'config_secrets_user_module',
49
49
  'emails_module',
50
50
  'rls_module',
51
51
  'user_auth_module',
@@ -65,7 +65,7 @@ exports.PresetB2bStorage = {
65
65
  'devices_module'
66
66
  ],
67
67
  includes_notes: {
68
- storage_module: 'File upload infrastructure: app_buckets + app_files tables with RLS. Entity-type storage scopes layered on top via `has_storage=true`.',
68
+ storage_module: 'File upload infrastructure: app_buckets + app_files tables with RLS. Entity-type storage scopes layered on top via the `storage` array (array-only format, supports multiple modules per entity via storage_key).',
69
69
  devices_module: 'Device tracking and trusted-device MFA bypass.'
70
70
  },
71
71
  omits_notes: {
@@ -40,8 +40,8 @@ exports.PresetB2b = {
40
40
  'memberships_module:app',
41
41
  'memberships_module:org',
42
42
  'sessions_module',
43
- 'secrets_module',
44
- 'encrypted_secrets_module',
43
+ 'user_state_module',
44
+ 'config_secrets_user_module',
45
45
  'emails_module',
46
46
  'rls_module',
47
47
  'user_auth_module',
@@ -5,7 +5,7 @@ import type { ModulePreset } from './types';
5
5
  *
6
6
  * This is the barest foundation: a `users` table, a `sessions` table so
7
7
  * something upstream can mint tokens, `rls_module` so row-level security
8
- * is enforceable, and `secrets_module` so you can issue API keys. Nothing
8
+ * is enforceable, and `user_state_module` so you can issue API keys. Nothing
9
9
  * else.
10
10
  *
11
11
  * You still write your own identity bridge on top (or rely on a header-based
@@ -7,7 +7,7 @@ exports.PresetMinimal = void 0;
7
7
  *
8
8
  * This is the barest foundation: a `users` table, a `sessions` table so
9
9
  * something upstream can mint tokens, `rls_module` so row-level security
10
- * is enforceable, and `secrets_module` so you can issue API keys. Nothing
10
+ * is enforceable, and `user_state_module` so you can issue API keys. Nothing
11
11
  * else.
12
12
  *
13
13
  * You still write your own identity bridge on top (or rely on a header-based
@@ -35,13 +35,13 @@ exports.PresetMinimal = {
35
35
  'users_module',
36
36
  'sessions_module',
37
37
  'rls_module',
38
- 'secrets_module'
38
+ 'user_state_module'
39
39
  ],
40
40
  includes_notes: {
41
41
  users_module: 'The canonical users table. Required by every preset.',
42
42
  sessions_module: 'Session/token storage; needed so whatever upstream auth can mint a session row.',
43
43
  rls_module: 'RLS policy infrastructure. Without it, row-level security is not enforced.',
44
- secrets_module: 'API-key storage. Optional for this preset but almost always wanted alongside upstream auth.'
44
+ user_state_module: 'API-key storage. Optional for this preset but almost always wanted alongside upstream auth.'
45
45
  },
46
46
  omits_notes: {
47
47
  user_auth_module: 'No server-side sign_up/sign_in procedures in this preset.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-type-registry",
3
- "version": "0.36.0",
3
+ "version": "0.38.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": "79f9109e05713e24fbef527864e0df02634aa891"
50
+ "gitHead": "1aaafe14a8ba4eeeaab099f5fdc69865ce4e2a2e"
51
51
  }
@@ -66,6 +66,17 @@ exports.ProcessChunks = {
66
66
  description: 'Distance metric for the HNSW index on chunk embeddings',
67
67
  default: 'cosine'
68
68
  },
69
+ // ── Model config (optional — flows into job payload) ──────────
70
+ embedding_model: {
71
+ type: 'string',
72
+ description: 'Embedding model identifier for per-chunk embeddings. ' +
73
+ 'When null, the worker falls back to runtime config (llm_module / env vars).'
74
+ },
75
+ embedding_provider: {
76
+ type: 'string',
77
+ description: 'Embedding provider name (e.g. "ollama", "openai"). ' +
78
+ 'When null, the worker falls back to runtime config.'
79
+ },
69
80
  // ── Table naming ───────────────────────────────────────────────
70
81
  chunks_table_name: {
71
82
  type: 'string',
@@ -77,6 +88,14 @@ exports.ProcessChunks = {
77
88
  items: { type: 'string' },
78
89
  description: 'Field names from the parent table to copy into chunk metadata'
79
90
  },
91
+ // ── Search indexes ───────────────────────────────────────────────
92
+ search_indexes: {
93
+ type: 'array',
94
+ items: { type: 'string', enum: ['fulltext', 'bm25', 'trigram'] },
95
+ description: 'Text search indexes to create on the chunks content column. ' +
96
+ 'Omit to mirror the parent table\'s text search indexes. ' +
97
+ 'Set explicitly to override (e.g. ["fulltext", "bm25"]).'
98
+ },
80
99
  // ── Job trigger ────────────────────────────────────────────────
81
100
  enqueue_chunking_job: {
82
101
  type: 'boolean',
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessExtraction = void 0;
4
+ const conditions_1 = require("../conditions");
4
5
  /**
5
6
  * File extraction processing node.
6
7
  *
@@ -25,6 +26,7 @@ exports.ProcessExtraction = {
25
26
  'Typically used upstream of ProcessFileEmbedding or ProcessChunks.',
26
27
  parameter_schema: {
27
28
  type: 'object',
29
+ $defs: conditions_1.conditionDefs,
28
30
  properties: {
29
31
  // ── Output fields ─────────────────────────────────────────────
30
32
  text_field: {
@@ -39,6 +41,18 @@ exports.ProcessExtraction = {
39
41
  description: 'JSONB field for extraction metadata (page count, language, etc.)',
40
42
  default: 'extracted_metadata'
41
43
  },
44
+ // ── Model config (optional — flows into job payload) ──────────
45
+ extraction_model: {
46
+ type: 'string',
47
+ description: 'Extraction model identifier (e.g. a vision model for OCR, an LLM for ' +
48
+ 'structured extraction). Included in the job payload so the worker knows ' +
49
+ 'which model to use. When null, the worker falls back to runtime config.'
50
+ },
51
+ extraction_provider: {
52
+ type: 'string',
53
+ description: 'Extraction provider name (e.g. "ollama", "openai"). ' +
54
+ 'When null, the worker falls back to runtime config.'
55
+ },
42
56
  // ── MIME scoping ──────────────────────────────────────────────
43
57
  mime_patterns: {
44
58
  type: 'array',
@@ -70,16 +84,7 @@ exports.ProcessExtraction = {
70
84
  bucket_id: 'bucket_id'
71
85
  }
72
86
  },
73
- trigger_conditions: {
74
- description: 'Additional compound conditions beyond MIME filtering. ' +
75
- 'Merged with the auto-generated MIME conditions via AND. ' +
76
- 'Use this to add status checks (e.g., status = \'uploaded\').',
77
- 'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
78
- oneOf: [
79
- { $ref: '#/$defs/triggerCondition' },
80
- { type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
81
- ]
82
- },
87
+ trigger_conditions: conditions_1.triggerConditionsProperty,
83
88
  // ── Job options ───────────────────────────────────────────────
84
89
  queue_name: {
85
90
  type: 'string',
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessFileEmbedding = void 0;
4
+ const conditions_1 = require("../conditions");
4
5
  exports.ProcessFileEmbedding = {
5
6
  name: 'ProcessFileEmbedding',
6
7
  slug: 'data_file_embedding',
@@ -15,6 +16,7 @@ exports.ProcessFileEmbedding = {
15
16
  'names, and embedding strategies.',
16
17
  parameter_schema: {
17
18
  type: 'object',
19
+ $defs: conditions_1.conditionDefs,
18
20
  properties: {
19
21
  // ── Vector config (passed through to SearchVector) ─────────────
20
22
  field_name: {
@@ -45,6 +47,18 @@ exports.ProcessFileEmbedding = {
45
47
  description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
46
48
  default: {}
47
49
  },
50
+ // ── Model config (optional — flows into job payload) ──────────
51
+ embedding_model: {
52
+ type: 'string',
53
+ description: 'Embedding model identifier (e.g. "nomic-embed-text", "text-embedding-3-small", ' +
54
+ '"clip-vit-base-patch32"). Included in the job payload so the worker knows which ' +
55
+ 'model to use. When null, the worker falls back to runtime config (llm_module / env vars).'
56
+ },
57
+ embedding_provider: {
58
+ type: 'string',
59
+ description: 'Embedding provider name (e.g. "ollama", "openai"). ' +
60
+ 'When null, the worker falls back to runtime config.'
61
+ },
48
62
  // ── MIME scoping ───────────────────────────────────────────────
49
63
  mime_patterns: {
50
64
  type: 'array',
@@ -77,16 +91,7 @@ exports.ProcessFileEmbedding = {
77
91
  bucket_id: 'bucket_id'
78
92
  }
79
93
  },
80
- trigger_conditions: {
81
- description: 'Additional compound conditions beyond MIME filtering. ' +
82
- 'Merged with the auto-generated MIME conditions via AND. ' +
83
- 'Use this to add status checks, field guards, etc.',
84
- 'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
85
- oneOf: [
86
- { $ref: '#/$defs/triggerCondition' },
87
- { type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
88
- ]
89
- },
94
+ trigger_conditions: conditions_1.triggerConditionsProperty,
90
95
  // ── Extraction config (optional — enables extract mode) ────────
91
96
  extraction: {
92
97
  type: 'object',
@@ -150,6 +155,13 @@ exports.ProcessFileEmbedding = {
150
155
  items: { type: 'string' },
151
156
  description: 'Field names from parent to copy into chunk metadata'
152
157
  },
158
+ search_indexes: {
159
+ type: 'array',
160
+ items: { type: 'string', enum: ['fulltext', 'bm25', 'trigram'] },
161
+ description: 'Text search indexes to create on the chunks content column. ' +
162
+ 'Omit to mirror the parent table\'s text search indexes. ' +
163
+ 'Set explicitly to override.'
164
+ },
153
165
  enqueue_chunking_job: {
154
166
  type: 'boolean',
155
167
  description: 'Whether to auto-enqueue a chunking job on insert/update',
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessImageEmbedding = void 0;
4
+ const conditions_1 = require("../conditions");
4
5
  /**
5
6
  * Image-specific preset of ProcessFileEmbedding.
6
7
  *
@@ -24,6 +25,7 @@ exports.ProcessImageEmbedding = {
24
25
  'Accepts all ProcessFileEmbedding parameters — any overrides are forwarded through.',
25
26
  parameter_schema: {
26
27
  type: 'object',
28
+ $defs: conditions_1.conditionDefs,
27
29
  properties: {
28
30
  // ── Vector config (passed through to ProcessFileEmbedding) ──────────
29
31
  field_name: {
@@ -54,6 +56,18 @@ exports.ProcessImageEmbedding = {
54
56
  description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
55
57
  default: {}
56
58
  },
59
+ // ── Model config (optional — flows into job payload) ──────────
60
+ embedding_model: {
61
+ type: 'string',
62
+ description: 'Embedding model identifier (e.g. "clip-vit-base-patch32"). ' +
63
+ 'Included in the job payload so the worker knows which model to use. ' +
64
+ 'When null, the worker falls back to runtime config (llm_module / env vars).'
65
+ },
66
+ embedding_provider: {
67
+ type: 'string',
68
+ description: 'Embedding provider name (e.g. "ollama", "openai"). ' +
69
+ 'When null, the worker falls back to runtime config.'
70
+ },
57
71
  // ── MIME scoping ───────────────────────────────────────────────
58
72
  mime_patterns: {
59
73
  type: 'array',
@@ -84,15 +98,7 @@ exports.ProcessImageEmbedding = {
84
98
  bucket_id: 'bucket_id'
85
99
  }
86
100
  },
87
- trigger_conditions: {
88
- description: 'Additional compound conditions beyond MIME filtering. ' +
89
- 'Merged with the auto-generated MIME conditions via AND.',
90
- 'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
91
- oneOf: [
92
- { $ref: '#/$defs/triggerCondition' },
93
- { type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
94
- ]
95
- },
101
+ trigger_conditions: conditions_1.triggerConditionsProperty,
96
102
  // ── Extraction config (optional — enables extract mode) ────────
97
103
  extraction: {
98
104
  type: 'object',
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessImageVersions = void 0;
4
+ const conditions_1 = require("../conditions");
4
5
  /**
5
6
  * Image version processing node.
6
7
  *
@@ -26,6 +27,7 @@ exports.ProcessImageVersions = {
26
27
  'file records linked to the source image.',
27
28
  parameter_schema: {
28
29
  type: 'object',
30
+ $defs: conditions_1.conditionDefs,
29
31
  required: ['versions'],
30
32
  properties: {
31
33
  // ── Version definitions ───────────────────────────────────────
@@ -101,15 +103,7 @@ exports.ProcessImageVersions = {
101
103
  bucket_id: 'bucket_id'
102
104
  }
103
105
  },
104
- trigger_conditions: {
105
- description: 'Additional compound conditions beyond MIME filtering. ' +
106
- 'Merged with the auto-generated MIME conditions via AND.',
107
- 'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
108
- oneOf: [
109
- { $ref: '#/$defs/triggerCondition' },
110
- { type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
111
- ]
112
- },
106
+ trigger_conditions: conditions_1.triggerConditionsProperty,
113
107
  // ── Job options ───────────────────────────────────────────────
114
108
  queue_name: {
115
109
  type: 'string',
@@ -0,0 +1,5 @@
1
+ export { ProcessChunks } from './chunks';
2
+ export { ProcessExtraction } from './extraction';
3
+ export { ProcessFileEmbedding } from './file-embedding';
4
+ export { ProcessImageEmbedding } from './image-embedding';
5
+ export { ProcessImageVersions } from './image-versions';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessImageVersions = exports.ProcessImageEmbedding = exports.ProcessFileEmbedding = exports.ProcessExtraction = exports.ProcessChunks = void 0;
4
+ var chunks_1 = require("./chunks");
5
+ Object.defineProperty(exports, "ProcessChunks", { enumerable: true, get: function () { return chunks_1.ProcessChunks; } });
6
+ var extraction_1 = require("./extraction");
7
+ Object.defineProperty(exports, "ProcessExtraction", { enumerable: true, get: function () { return extraction_1.ProcessExtraction; } });
8
+ var file_embedding_1 = require("./file-embedding");
9
+ Object.defineProperty(exports, "ProcessFileEmbedding", { enumerable: true, get: function () { return file_embedding_1.ProcessFileEmbedding; } });
10
+ var image_embedding_1 = require("./image-embedding");
11
+ Object.defineProperty(exports, "ProcessImageEmbedding", { enumerable: true, get: function () { return image_embedding_1.ProcessImageEmbedding; } });
12
+ var image_versions_1 = require("./image-versions");
13
+ Object.defineProperty(exports, "ProcessImageVersions", { enumerable: true, get: function () { return image_versions_1.ProcessImageVersions; } });
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const LimitAggregate: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const BillingMeter: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const LimitFeatureFlag: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const LimitCounter: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const LimitAggregate: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const BillingMeter: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const LimitFeatureFlag: NodeTypeDefinition;
@@ -1,2 +0,0 @@
1
- import type { NodeTypeDefinition } from '../types';
2
- export declare const LimitCounter: NodeTypeDefinition;