@memberjunction/core-actions 6.1.4 → 6.2.0-edge.1
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/dist/config.d.ts +74 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +48 -9
- package/dist/config.js.map +1 -1
- package/dist/custom/ai/base-find-actions.action.js +6 -6
- package/dist/custom/ai/base-find-agents.action.js +6 -6
- package/dist/custom/ai/find-candidate-agents.action.js +2 -2
- package/dist/custom/ai/generate-image.action.d.ts +13 -1
- package/dist/custom/ai/generate-image.action.d.ts.map +1 -1
- package/dist/custom/ai/generate-image.action.js +25 -13
- package/dist/custom/ai/generate-image.action.js.map +1 -1
- package/dist/custom/ai/semantic-entity-search.helper.d.ts +6 -0
- package/dist/custom/ai/semantic-entity-search.helper.d.ts.map +1 -1
- package/dist/custom/ai/semantic-entity-search.helper.js +16 -4
- package/dist/custom/ai/semantic-entity-search.helper.js.map +1 -1
- package/dist/custom/data/search-query-catalog.action.js +2 -2
- package/dist/custom/integration/api-rate-limiter.action.d.ts +4 -0
- package/dist/custom/integration/api-rate-limiter.action.d.ts.map +1 -1
- package/dist/custom/integration/api-rate-limiter.action.js +10 -2
- package/dist/custom/integration/api-rate-limiter.action.js.map +1 -1
- package/dist/custom/integration/gamma-generate-presentation.action.js +2 -2
- package/dist/custom/integration/integration-action-executor.d.ts +22 -22
- package/dist/custom/integration/integration-action-executor.js +83 -83
- package/dist/custom/interactive-forms/_shared.d.ts +69 -0
- package/dist/custom/interactive-forms/_shared.d.ts.map +1 -1
- package/dist/custom/interactive-forms/_shared.js +118 -38
- package/dist/custom/interactive-forms/_shared.js.map +1 -1
- package/dist/custom/interactive-forms/activate-interactive-form-version.action.js +25 -25
- package/dist/custom/interactive-forms/create-interactive-form.action.js +22 -22
- package/dist/custom/interactive-forms/modify-interactive-form.action.js +35 -35
- package/dist/custom/interactive-forms/revert-interactive-form.action.js +32 -32
- package/dist/custom/lists/_action-helpers.d.ts +10 -0
- package/dist/custom/lists/_action-helpers.d.ts.map +1 -1
- package/dist/custom/lists/_action-helpers.js +26 -6
- package/dist/custom/lists/_action-helpers.js.map +1 -1
- package/dist/custom/lists/add-view-results-to-list.action.js +8 -8
- package/dist/custom/lists/bulk-update-list-item-status.action.js +8 -8
- package/dist/custom/lists/compose-lists.action.js +14 -14
- package/dist/custom/lists/invite-to-list.action.js +10 -10
- package/dist/custom/lists/materialize-list-from-view.action.js +13 -13
- package/dist/custom/lists/move-list-members.action.js +12 -12
- package/dist/custom/lists/refresh-list-from-source.action.js +8 -8
- package/dist/custom/lists/resolve-audience.action.js +7 -7
- package/dist/custom/lists/revoke-list-invitation.action.js +3 -3
- package/dist/custom/lists/share-list.action.js +8 -8
- package/dist/custom/lists/unshare-list.action.js +3 -3
- package/dist/custom/utilities/address-services.action.js +2 -2
- package/dist/custom/utilities/artifact-builder-service.d.ts +16 -16
- package/dist/custom/utilities/artifact-builder-service.js +39 -39
- package/dist/custom/utilities/artifact-builder-service.js.map +1 -1
- package/dist/custom/utilities/base-file-handler.d.ts.map +1 -1
- package/dist/custom/utilities/base-file-handler.js +4 -2
- package/dist/custom/utilities/base-file-handler.js.map +1 -1
- package/dist/custom/utilities/docx-renderer.d.ts +17 -11
- package/dist/custom/utilities/docx-renderer.d.ts.map +1 -1
- package/dist/custom/utilities/docx-renderer.js +60 -48
- package/dist/custom/utilities/docx-renderer.js.map +1 -1
- package/dist/custom/utilities/json-param-helper.d.ts +6 -0
- package/dist/custom/utilities/json-param-helper.d.ts.map +1 -1
- package/dist/custom/utilities/json-param-helper.js +16 -4
- package/dist/custom/utilities/json-param-helper.js.map +1 -1
- package/dist/custom/utilities/pdf-renderer.d.ts +13 -7
- package/dist/custom/utilities/pdf-renderer.d.ts.map +1 -1
- package/dist/custom/utilities/pdf-renderer.js +27 -15
- package/dist/custom/utilities/pdf-renderer.js.map +1 -1
- package/dist/custom/utilities/xlsx-renderer.d.ts +19 -11
- package/dist/custom/utilities/xlsx-renderer.d.ts.map +1 -1
- package/dist/custom/utilities/xlsx-renderer.js +55 -39
- package/dist/custom/utilities/xlsx-renderer.js.map +1 -1
- package/dist/custom/visualization/create-svg-chart.action.js +23 -23
- package/dist/custom/visualization/create-svg-diagram.action.js +10 -10
- package/dist/custom/visualization/create-svg-infographic.action.js +4 -4
- package/dist/custom/visualization/create-svg-network.action.js +12 -12
- package/dist/custom/visualization/create-svg-sketch-diagram.action.js +10 -10
- package/dist/custom/visualization/create-svg-word-cloud.action.js +11 -11
- package/dist/custom/visualization/shared/svg-theming.d.ts +17 -0
- package/dist/custom/visualization/shared/svg-theming.d.ts.map +1 -1
- package/dist/custom/visualization/shared/svg-theming.js +34 -10
- package/dist/custom/visualization/shared/svg-theming.js.map +1 -1
- package/dist/custom/visualization/shared/svg-utils.d.ts +39 -0
- package/dist/custom/visualization/shared/svg-utils.d.ts.map +1 -1
- package/dist/custom/visualization/shared/svg-utils.js +81 -17
- package/dist/custom/visualization/shared/svg-utils.js.map +1 -1
- package/dist/custom/web/brave-search.action.d.ts +108 -0
- package/dist/custom/web/brave-search.action.d.ts.map +1 -0
- package/dist/custom/web/brave-search.action.js +285 -0
- package/dist/custom/web/brave-search.action.js.map +1 -0
- package/dist/custom/web/duckduckgo-rate-limiter.d.ts +17 -1
- package/dist/custom/web/duckduckgo-rate-limiter.d.ts.map +1 -1
- package/dist/custom/web/duckduckgo-rate-limiter.js +26 -6
- package/dist/custom/web/duckduckgo-rate-limiter.js.map +1 -1
- package/dist/custom/web/google-custom-search.action.js +2 -2
- package/dist/custom/web/perplexity-search.action.d.ts +76 -44
- package/dist/custom/web/perplexity-search.action.d.ts.map +1 -1
- package/dist/custom/web/perplexity-search.action.js +228 -157
- package/dist/custom/web/perplexity-search.action.js.map +1 -1
- package/dist/custom/web/rss-feed-parsing.d.ts +19 -0
- package/dist/custom/web/rss-feed-parsing.d.ts.map +1 -1
- package/dist/custom/web/rss-feed-parsing.js +45 -13
- package/dist/custom/web/rss-feed-parsing.js.map +1 -1
- package/dist/custom/web/rss-feed-read.action.d.ts.map +1 -1
- package/dist/custom/web/rss-feed-read.action.js +9 -6
- package/dist/custom/web/rss-feed-read.action.js.map +1 -1
- package/dist/custom/web/tavily-search.action.js +2 -2
- package/dist/custom/web/web-search.action.d.ts +56 -40
- package/dist/custom/web/web-search.action.d.ts.map +1 -1
- package/dist/custom/web/web-search.action.js +141 -413
- package/dist/custom/web/web-search.action.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +40 -39
package/dist/config.d.ts
CHANGED
|
@@ -8,10 +8,30 @@ declare const apiIntegrationsSchema: z.ZodObject<{
|
|
|
8
8
|
* Used by: Perplexity Search action
|
|
9
9
|
* Get your API key from: https://www.perplexity.ai/settings/api
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Serves two distinct products behind one key, selected by the action's `Mode` parameter:
|
|
12
|
+
* `search` (default) calls Perplexity's raw `/search` endpoint, which returns structured
|
|
13
|
+
* title/url/snippet results at a flat per-query price; `answer` calls the Sonar chat models,
|
|
14
|
+
* which return prose plus citations and are billed per token.
|
|
15
|
+
*
|
|
16
|
+
* For a web-search role prefer `braveApiKey` below — an independent index with lower latency.
|
|
17
|
+
* Use this when a synthesised answer is genuinely what the caller wants.
|
|
13
18
|
*/
|
|
14
19
|
perplexityApiKey: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/**
|
|
21
|
+
* Brave Search API Key for independent web search
|
|
22
|
+
* Used by: Brave Search action
|
|
23
|
+
* Get your API key from: https://api-dashboard.search.brave.com/
|
|
24
|
+
*
|
|
25
|
+
* This is the recommended web-search credential for new deployments. Brave serves from its
|
|
26
|
+
* own index rather than reselling Google's or Bing's, so it does not share a failure mode
|
|
27
|
+
* with the SERP-proxy vendors or with `google.customSearch` below. It returns the same
|
|
28
|
+
* title/url/snippet shape the Google action returns, which is what makes it a migration
|
|
29
|
+
* rather than a rewrite.
|
|
30
|
+
*
|
|
31
|
+
* NOTE: Brave retired its free tier in early 2026. Keys now meter against a stored card
|
|
32
|
+
* with no spending cap, so set a budget alert before pointing production traffic at it.
|
|
33
|
+
*/
|
|
34
|
+
braveApiKey: z.ZodOptional<z.ZodString>;
|
|
15
35
|
/**
|
|
16
36
|
* Tavily API Key for search built for LLM consumption
|
|
17
37
|
* Used by: Tavily Search action
|
|
@@ -38,9 +58,15 @@ declare const apiIntegrationsSchema: z.ZodObject<{
|
|
|
38
58
|
*
|
|
39
59
|
* NOTE: the Custom Search JSON API is CLOSED TO NEW CUSTOMERS. Projects that already have it
|
|
40
60
|
* enabled are served until 2027-01-01, when the API is discontinued. New deployments should
|
|
41
|
-
* configure `
|
|
42
|
-
*
|
|
43
|
-
*
|
|
61
|
+
* configure `braveApiKey` above instead — it is the only credential here that yields the same
|
|
62
|
+
* title/url/snippet result shape from an index that is not Google's.
|
|
63
|
+
*
|
|
64
|
+
* Google's stated successor (Vertex AI Search, since renamed Agent Search) searches your own
|
|
65
|
+
* indexed content or up to 50 verified domains rather than the public web, and yields neither
|
|
66
|
+
* an API key nor a CX. Gemini's `google_search` grounding does reach the public index, but
|
|
67
|
+
* returns expiring redirect URLs with no snippets, and its terms forbid caching or analysing
|
|
68
|
+
* the results — so neither is a drop-in for this action. `perplexityApiKey` is a reasonable
|
|
69
|
+
* fallback, but note its default mode is an answer engine rather than a search index.
|
|
44
70
|
*/
|
|
45
71
|
customSearch: z.ZodOptional<z.ZodObject<{
|
|
46
72
|
/**
|
|
@@ -93,6 +119,7 @@ declare const apiIntegrationsSchema: z.ZodObject<{
|
|
|
93
119
|
}>>;
|
|
94
120
|
}, "strip", z.ZodTypeAny, {
|
|
95
121
|
perplexityApiKey?: string;
|
|
122
|
+
braveApiKey?: string;
|
|
96
123
|
tavilyApiKey?: string;
|
|
97
124
|
gammaApiKey?: string;
|
|
98
125
|
google?: {
|
|
@@ -106,6 +133,7 @@ declare const apiIntegrationsSchema: z.ZodObject<{
|
|
|
106
133
|
};
|
|
107
134
|
}, {
|
|
108
135
|
perplexityApiKey?: string;
|
|
136
|
+
braveApiKey?: string;
|
|
109
137
|
tavilyApiKey?: string;
|
|
110
138
|
gammaApiKey?: string;
|
|
111
139
|
google?: {
|
|
@@ -131,10 +159,30 @@ declare const coreActionsConfigSchema: z.ZodObject<{
|
|
|
131
159
|
* Used by: Perplexity Search action
|
|
132
160
|
* Get your API key from: https://www.perplexity.ai/settings/api
|
|
133
161
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
162
|
+
* Serves two distinct products behind one key, selected by the action's `Mode` parameter:
|
|
163
|
+
* `search` (default) calls Perplexity's raw `/search` endpoint, which returns structured
|
|
164
|
+
* title/url/snippet results at a flat per-query price; `answer` calls the Sonar chat models,
|
|
165
|
+
* which return prose plus citations and are billed per token.
|
|
166
|
+
*
|
|
167
|
+
* For a web-search role prefer `braveApiKey` below — an independent index with lower latency.
|
|
168
|
+
* Use this when a synthesised answer is genuinely what the caller wants.
|
|
136
169
|
*/
|
|
137
170
|
perplexityApiKey: z.ZodOptional<z.ZodString>;
|
|
171
|
+
/**
|
|
172
|
+
* Brave Search API Key for independent web search
|
|
173
|
+
* Used by: Brave Search action
|
|
174
|
+
* Get your API key from: https://api-dashboard.search.brave.com/
|
|
175
|
+
*
|
|
176
|
+
* This is the recommended web-search credential for new deployments. Brave serves from its
|
|
177
|
+
* own index rather than reselling Google's or Bing's, so it does not share a failure mode
|
|
178
|
+
* with the SERP-proxy vendors or with `google.customSearch` below. It returns the same
|
|
179
|
+
* title/url/snippet shape the Google action returns, which is what makes it a migration
|
|
180
|
+
* rather than a rewrite.
|
|
181
|
+
*
|
|
182
|
+
* NOTE: Brave retired its free tier in early 2026. Keys now meter against a stored card
|
|
183
|
+
* with no spending cap, so set a budget alert before pointing production traffic at it.
|
|
184
|
+
*/
|
|
185
|
+
braveApiKey: z.ZodOptional<z.ZodString>;
|
|
138
186
|
/**
|
|
139
187
|
* Tavily API Key for search built for LLM consumption
|
|
140
188
|
* Used by: Tavily Search action
|
|
@@ -161,9 +209,15 @@ declare const coreActionsConfigSchema: z.ZodObject<{
|
|
|
161
209
|
*
|
|
162
210
|
* NOTE: the Custom Search JSON API is CLOSED TO NEW CUSTOMERS. Projects that already have it
|
|
163
211
|
* enabled are served until 2027-01-01, when the API is discontinued. New deployments should
|
|
164
|
-
* configure `
|
|
165
|
-
*
|
|
166
|
-
*
|
|
212
|
+
* configure `braveApiKey` above instead — it is the only credential here that yields the same
|
|
213
|
+
* title/url/snippet result shape from an index that is not Google's.
|
|
214
|
+
*
|
|
215
|
+
* Google's stated successor (Vertex AI Search, since renamed Agent Search) searches your own
|
|
216
|
+
* indexed content or up to 50 verified domains rather than the public web, and yields neither
|
|
217
|
+
* an API key nor a CX. Gemini's `google_search` grounding does reach the public index, but
|
|
218
|
+
* returns expiring redirect URLs with no snippets, and its terms forbid caching or analysing
|
|
219
|
+
* the results — so neither is a drop-in for this action. `perplexityApiKey` is a reasonable
|
|
220
|
+
* fallback, but note its default mode is an answer engine rather than a search index.
|
|
167
221
|
*/
|
|
168
222
|
customSearch: z.ZodOptional<z.ZodObject<{
|
|
169
223
|
/**
|
|
@@ -216,6 +270,7 @@ declare const coreActionsConfigSchema: z.ZodObject<{
|
|
|
216
270
|
}>>;
|
|
217
271
|
}, "strip", z.ZodTypeAny, {
|
|
218
272
|
perplexityApiKey?: string;
|
|
273
|
+
braveApiKey?: string;
|
|
219
274
|
tavilyApiKey?: string;
|
|
220
275
|
gammaApiKey?: string;
|
|
221
276
|
google?: {
|
|
@@ -229,6 +284,7 @@ declare const coreActionsConfigSchema: z.ZodObject<{
|
|
|
229
284
|
};
|
|
230
285
|
}, {
|
|
231
286
|
perplexityApiKey?: string;
|
|
287
|
+
braveApiKey?: string;
|
|
232
288
|
tavilyApiKey?: string;
|
|
233
289
|
gammaApiKey?: string;
|
|
234
290
|
google?: {
|
|
@@ -244,6 +300,7 @@ declare const coreActionsConfigSchema: z.ZodObject<{
|
|
|
244
300
|
}, "strip", z.ZodTypeAny, {
|
|
245
301
|
apiIntegrations?: {
|
|
246
302
|
perplexityApiKey?: string;
|
|
303
|
+
braveApiKey?: string;
|
|
247
304
|
tavilyApiKey?: string;
|
|
248
305
|
gammaApiKey?: string;
|
|
249
306
|
google?: {
|
|
@@ -259,6 +316,7 @@ declare const coreActionsConfigSchema: z.ZodObject<{
|
|
|
259
316
|
}, {
|
|
260
317
|
apiIntegrations?: {
|
|
261
318
|
perplexityApiKey?: string;
|
|
319
|
+
braveApiKey?: string;
|
|
262
320
|
tavilyApiKey?: string;
|
|
263
321
|
gammaApiKey?: string;
|
|
264
322
|
google?: {
|
|
@@ -278,15 +336,21 @@ export type ApiIntegrationsConfig = z.infer<typeof apiIntegrationsSchema>;
|
|
|
278
336
|
* Gets the Core Actions configuration, loading it from mj.config.cjs if not already loaded
|
|
279
337
|
* @returns The Core Actions configuration object
|
|
280
338
|
*/
|
|
339
|
+
export declare function GetCoreActionsConfig(): CoreActionsConfig;
|
|
340
|
+
/** @deprecated Use {@link GetCoreActionsConfig}. */
|
|
281
341
|
export declare function getCoreActionsConfig(): CoreActionsConfig;
|
|
282
342
|
/**
|
|
283
343
|
* Gets the API integrations configuration
|
|
284
344
|
* @returns The API integrations configuration object
|
|
285
345
|
*/
|
|
346
|
+
export declare function GetApiIntegrationsConfig(): ApiIntegrationsConfig;
|
|
347
|
+
/** @deprecated Use {@link GetApiIntegrationsConfig}. */
|
|
286
348
|
export declare function getApiIntegrationsConfig(): ApiIntegrationsConfig;
|
|
287
349
|
/**
|
|
288
350
|
* Clears the cached configuration (useful for testing)
|
|
289
351
|
*/
|
|
352
|
+
export declare function ClearCoreActionsConfig(): void;
|
|
353
|
+
/** @deprecated Use {@link ClearCoreActionsConfig}. */
|
|
290
354
|
export declare function clearCoreActionsConfig(): void;
|
|
291
355
|
export {};
|
|
292
356
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,QAAA,MAAM,qBAAqB;IACzB
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,QAAA,MAAM,qBAAqB;IACzB;;;;;;;;;;;;OAYG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;OAIG;;IAGH;;;;;OAKG;;IAGH;;;OAGG;;QAED;;;;;;;;;;;;;;;;;WAiBG;;YAED;;eAEG;;YAEH;;eAEG;;;;;;;;;QAIL;;;;;WAKG;;YAED;;eAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIP,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,uBAAuB;IAC3B;;OAEG;;QArGH;;;;;;;;;;;;WAYG;;QAGH;;;;;;;;;;;;;WAaG;;QAGH;;;;WAIG;;QAGH;;;;;WAKG;;QAGH;;;WAGG;;YAED;;;;;;;;;;;;;;;;;eAiBG;;gBAED;;mBAEG;;gBAEH;;mBAEG;;;;;;;;;YAIL;;;;;eAKG;;gBAED;;mBAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcP,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAI1E;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAgDxD;AAED,oDAAoD;AACpD,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,qBAAqB,CAGhE;AAED,wDAAwD;AACxD,wBAAgB,wBAAwB,IAAI,qBAAqB,CAEhE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,sDAAsD;AACtD,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
|
package/dist/config.js
CHANGED
|
@@ -11,10 +11,30 @@ const apiIntegrationsSchema = z.object({
|
|
|
11
11
|
* Used by: Perplexity Search action
|
|
12
12
|
* Get your API key from: https://www.perplexity.ai/settings/api
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Serves two distinct products behind one key, selected by the action's `Mode` parameter:
|
|
15
|
+
* `search` (default) calls Perplexity's raw `/search` endpoint, which returns structured
|
|
16
|
+
* title/url/snippet results at a flat per-query price; `answer` calls the Sonar chat models,
|
|
17
|
+
* which return prose plus citations and are billed per token.
|
|
18
|
+
*
|
|
19
|
+
* For a web-search role prefer `braveApiKey` below — an independent index with lower latency.
|
|
20
|
+
* Use this when a synthesised answer is genuinely what the caller wants.
|
|
16
21
|
*/
|
|
17
22
|
perplexityApiKey: z.string().optional(),
|
|
23
|
+
/**
|
|
24
|
+
* Brave Search API Key for independent web search
|
|
25
|
+
* Used by: Brave Search action
|
|
26
|
+
* Get your API key from: https://api-dashboard.search.brave.com/
|
|
27
|
+
*
|
|
28
|
+
* This is the recommended web-search credential for new deployments. Brave serves from its
|
|
29
|
+
* own index rather than reselling Google's or Bing's, so it does not share a failure mode
|
|
30
|
+
* with the SERP-proxy vendors or with `google.customSearch` below. It returns the same
|
|
31
|
+
* title/url/snippet shape the Google action returns, which is what makes it a migration
|
|
32
|
+
* rather than a rewrite.
|
|
33
|
+
*
|
|
34
|
+
* NOTE: Brave retired its free tier in early 2026. Keys now meter against a stored card
|
|
35
|
+
* with no spending cap, so set a budget alert before pointing production traffic at it.
|
|
36
|
+
*/
|
|
37
|
+
braveApiKey: z.string().optional(),
|
|
18
38
|
/**
|
|
19
39
|
* Tavily API Key for search built for LLM consumption
|
|
20
40
|
* Used by: Tavily Search action
|
|
@@ -41,9 +61,15 @@ const apiIntegrationsSchema = z.object({
|
|
|
41
61
|
*
|
|
42
62
|
* NOTE: the Custom Search JSON API is CLOSED TO NEW CUSTOMERS. Projects that already have it
|
|
43
63
|
* enabled are served until 2027-01-01, when the API is discontinued. New deployments should
|
|
44
|
-
* configure `
|
|
45
|
-
*
|
|
46
|
-
*
|
|
64
|
+
* configure `braveApiKey` above instead — it is the only credential here that yields the same
|
|
65
|
+
* title/url/snippet result shape from an index that is not Google's.
|
|
66
|
+
*
|
|
67
|
+
* Google's stated successor (Vertex AI Search, since renamed Agent Search) searches your own
|
|
68
|
+
* indexed content or up to 50 verified domains rather than the public web, and yields neither
|
|
69
|
+
* an API key nor a CX. Gemini's `google_search` grounding does reach the public index, but
|
|
70
|
+
* returns expiring redirect URLs with no snippets, and its terms forbid caching or analysing
|
|
71
|
+
* the results — so neither is a drop-in for this action. `perplexityApiKey` is a reasonable
|
|
72
|
+
* fallback, but note its default mode is an answer engine rather than a search index.
|
|
47
73
|
*/
|
|
48
74
|
customSearch: z.object({
|
|
49
75
|
/**
|
|
@@ -83,7 +109,7 @@ let _config = null;
|
|
|
83
109
|
* Gets the Core Actions configuration, loading it from mj.config.cjs if not already loaded
|
|
84
110
|
* @returns The Core Actions configuration object
|
|
85
111
|
*/
|
|
86
|
-
export function
|
|
112
|
+
export function GetCoreActionsConfig() {
|
|
87
113
|
if (_config) {
|
|
88
114
|
return _config;
|
|
89
115
|
}
|
|
@@ -103,6 +129,7 @@ export function getCoreActionsConfig() {
|
|
|
103
129
|
apiIntegrations: {
|
|
104
130
|
perplexityApiKey: fileConfig?.perplexityApiKey || process.env.PERPLEXITY_API_KEY,
|
|
105
131
|
tavilyApiKey: fileConfig?.tavilyApiKey || process.env.TAVILY_API_KEY,
|
|
132
|
+
braveApiKey: fileConfig?.braveApiKey || process.env.BRAVE_SEARCH_API_KEY,
|
|
106
133
|
gammaApiKey: fileConfig?.gammaApiKey || process.env.GAMMA_API_KEY,
|
|
107
134
|
google: {
|
|
108
135
|
customSearch: {
|
|
@@ -129,18 +156,30 @@ export function getCoreActionsConfig() {
|
|
|
129
156
|
throw error;
|
|
130
157
|
}
|
|
131
158
|
}
|
|
159
|
+
/** @deprecated Use {@link GetCoreActionsConfig}. */
|
|
160
|
+
export function getCoreActionsConfig() {
|
|
161
|
+
return GetCoreActionsConfig();
|
|
162
|
+
}
|
|
132
163
|
/**
|
|
133
164
|
* Gets the API integrations configuration
|
|
134
165
|
* @returns The API integrations configuration object
|
|
135
166
|
*/
|
|
136
|
-
export function
|
|
137
|
-
const config =
|
|
167
|
+
export function GetApiIntegrationsConfig() {
|
|
168
|
+
const config = GetCoreActionsConfig();
|
|
138
169
|
return config.apiIntegrations;
|
|
139
170
|
}
|
|
171
|
+
/** @deprecated Use {@link GetApiIntegrationsConfig}. */
|
|
172
|
+
export function getApiIntegrationsConfig() {
|
|
173
|
+
return GetApiIntegrationsConfig();
|
|
174
|
+
}
|
|
140
175
|
/**
|
|
141
176
|
* Clears the cached configuration (useful for testing)
|
|
142
177
|
*/
|
|
143
|
-
export function
|
|
178
|
+
export function ClearCoreActionsConfig() {
|
|
144
179
|
_config = null;
|
|
145
180
|
}
|
|
181
|
+
/** @deprecated Use {@link ClearCoreActionsConfig}. */
|
|
182
|
+
export function clearCoreActionsConfig() {
|
|
183
|
+
return ClearCoreActionsConfig();
|
|
184
|
+
}
|
|
146
185
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,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import { NormalizeUUID } from "@memberjunction/global";
|
|
|
2
2
|
import { BaseAction } from "@memberjunction/actions";
|
|
3
3
|
import { AIEngine } from "@memberjunction/aiengine";
|
|
4
4
|
import { RunView } from "@memberjunction/core";
|
|
5
|
-
import {
|
|
5
|
+
import { RunSemanticEntitySearch, GetActionParamValue, GetActionBooleanParam } from "./semantic-entity-search.helper.js";
|
|
6
6
|
/**
|
|
7
7
|
* Shared base for the "Find Best Action" / "Find Candidate Actions" wrappers.
|
|
8
8
|
*
|
|
@@ -20,10 +20,10 @@ export class BaseFindActionsAction extends BaseAction {
|
|
|
20
20
|
get entityName() { return 'MJ: Actions'; }
|
|
21
21
|
async InternalRunAction(params) {
|
|
22
22
|
try {
|
|
23
|
-
const taskDescription =
|
|
24
|
-
const maxResults = parseInt(String(
|
|
25
|
-
const minimumSimilarityScore = parseFloat(String(
|
|
26
|
-
const excludeAgentManagement =
|
|
23
|
+
const taskDescription = GetActionParamValue(params, 'taskdescription');
|
|
24
|
+
const maxResults = parseInt(String(GetActionParamValue(params, 'maxresults') ?? '10'));
|
|
25
|
+
const minimumSimilarityScore = parseFloat(String(GetActionParamValue(params, 'minimumsimilarityscore') ?? '0.5'));
|
|
26
|
+
const excludeAgentManagement = GetActionBooleanParam(params, 'excludeagentmanagement', true);
|
|
27
27
|
if (!taskDescription || taskDescription.trim().length === 0) {
|
|
28
28
|
return { Success: false, ResultCode: 'INVALID_INPUT', Message: 'TaskDescription parameter is required and cannot be empty' };
|
|
29
29
|
}
|
|
@@ -37,7 +37,7 @@ export class BaseFindActionsAction extends BaseAction {
|
|
|
37
37
|
return { Success: false, ResultCode: 'MISSING_USER_CONTEXT', Message: 'User context required' };
|
|
38
38
|
}
|
|
39
39
|
// Rank via the unified SearchEntity pipeline (over-fetch to allow post-filtering)
|
|
40
|
-
const search = await
|
|
40
|
+
const search = await RunSemanticEntitySearch(params, this.entityName, taskDescription, maxResults * 2, minimumSimilarityScore);
|
|
41
41
|
if (!search.ok) {
|
|
42
42
|
return { Success: false, ResultCode: search.resultCode ?? 'SEARCH_FAILED', Message: search.message ?? 'Semantic search failed' };
|
|
43
43
|
}
|
|
@@ -2,7 +2,7 @@ import { UUIDsEqual, NormalizeUUID } from "@memberjunction/global";
|
|
|
2
2
|
import { BaseAction } from "@memberjunction/actions";
|
|
3
3
|
import { AIEngine } from "@memberjunction/aiengine";
|
|
4
4
|
import { AIAgentPermissionHelper } from "@memberjunction/ai-engine-base";
|
|
5
|
-
import {
|
|
5
|
+
import { RunSemanticEntitySearch, GetActionParamValue, GetActionBooleanParam } from "./semantic-entity-search.helper.js";
|
|
6
6
|
/**
|
|
7
7
|
* Shared base for the "Find Best Agent" / "Find Candidate Agents" wrappers.
|
|
8
8
|
*
|
|
@@ -32,10 +32,10 @@ export class BaseFindAgentsAction extends BaseAction {
|
|
|
32
32
|
}
|
|
33
33
|
async InternalRunAction(params) {
|
|
34
34
|
try {
|
|
35
|
-
const taskDescription =
|
|
36
|
-
const maxResults = parseInt(String(
|
|
37
|
-
const minimumSimilarityScore = parseFloat(String(
|
|
38
|
-
const includeInactive =
|
|
35
|
+
const taskDescription = GetActionParamValue(params, 'taskdescription');
|
|
36
|
+
const maxResults = parseInt(String(GetActionParamValue(params, 'maxresults') ?? '5'));
|
|
37
|
+
const minimumSimilarityScore = parseFloat(String(GetActionParamValue(params, 'minimumsimilarityscore') ?? '0.5'));
|
|
38
|
+
const includeInactive = GetActionBooleanParam(params, 'includeinactive', false);
|
|
39
39
|
if (!taskDescription || taskDescription.trim().length === 0) {
|
|
40
40
|
return { Success: false, ResultCode: 'INVALID_INPUT', Message: 'TaskDescription parameter is required and cannot be empty' };
|
|
41
41
|
}
|
|
@@ -53,7 +53,7 @@ export class BaseFindAgentsAction extends BaseAction {
|
|
|
53
53
|
// ranking, so agents the daily vector sync hasn't embedded yet — e.g. one just
|
|
54
54
|
// created by the Agent Manager — are still discoverable by text instead of being
|
|
55
55
|
// invisible until the next sync.
|
|
56
|
-
const search = await
|
|
56
|
+
const search = await RunSemanticEntitySearch(params, this.entityName, taskDescription, maxResults * 3, minimumSimilarityScore, 'hybrid');
|
|
57
57
|
if (!search.ok) {
|
|
58
58
|
return { Success: false, ResultCode: search.resultCode ?? 'SEARCH_FAILED', Message: search.message ?? 'Semantic search failed' };
|
|
59
59
|
}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { RegisterClass } from "@memberjunction/global";
|
|
8
8
|
import { BaseAction } from "@memberjunction/actions";
|
|
9
9
|
import { BaseFindAgentsAction } from "./base-find-agents.action.js";
|
|
10
|
-
import {
|
|
10
|
+
import { GetActionBooleanParam } from "./semantic-entity-search.helper.js";
|
|
11
11
|
/**
|
|
12
12
|
* Finds candidate AI agents for a given task using semantic search.
|
|
13
13
|
*
|
|
@@ -32,7 +32,7 @@ let FindCandidateAgentsAction = class FindCandidateAgentsAction extends BaseFind
|
|
|
32
32
|
get actionLabel() { return 'find candidate agents'; }
|
|
33
33
|
get includeSubAgentDetails() { return true; }
|
|
34
34
|
applyInvocationFilter(agents, params) {
|
|
35
|
-
const excludeSubAgents =
|
|
35
|
+
const excludeSubAgents = GetActionBooleanParam(params, 'excludesubagents', true);
|
|
36
36
|
if (excludeSubAgents) {
|
|
37
37
|
// Sub-Agents and child agents are meant to be called by other agents, not discovered directly
|
|
38
38
|
return agents.filter(a => a.InvocationMode !== 'Sub-Agent' && !a.ParentID);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
1
|
+
import { ActionResultSimple, RunActionParams, RuntimeAPIKeyResolver } from "@memberjunction/actions-base";
|
|
2
2
|
import { BaseAction } from "@memberjunction/actions";
|
|
3
3
|
/**
|
|
4
4
|
* Action that generates images using AI image generation models (DALL-E, Gemini, etc.)
|
|
@@ -57,6 +57,18 @@ import { BaseAction } from "@memberjunction/actions";
|
|
|
57
57
|
* });
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the key an image generator should use.
|
|
62
|
+
*
|
|
63
|
+
* Inside an agent run, `resolve` is the run's {@link RuntimeAPIKeyResolver}: the RUN'S key for the
|
|
64
|
+
* driver class first, then the platform's — the same order the run's prompts use, so a run on a
|
|
65
|
+
* customer's OpenAI key now generates its images on that key too. Outside a run (or when the agent
|
|
66
|
+
* refuses this action the run's key) it is undefined / answers undefined, and `GetAIAPIKey` gives
|
|
67
|
+
* the platform key as it always did. Then the vendor-name fallback that was always here — but
|
|
68
|
+
* actually USED this time: the previous code found a key by vendor name and then handed the empty
|
|
69
|
+
* driver-class result to the generator, so that branch never produced an image.
|
|
70
|
+
*/
|
|
71
|
+
export declare function ResolveImageGenerationAPIKey(driverClass: string, vendorName: string | undefined, resolve?: RuntimeAPIKeyResolver): string;
|
|
60
72
|
export declare class GenerateImageAction extends BaseAction {
|
|
61
73
|
/**
|
|
62
74
|
* Generates or edits image(s) using AI image generation models.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-image.action.d.ts","sourceRoot":"","sources":["../../../src/custom/ai/generate-image.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-image.action.d.ts","sourceRoot":"","sources":["../../../src/custom/ai/generate-image.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1G,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAcrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAMzI;AAED,qBACa,mBAAoB,SAAQ,UAAU;IAE/C;;;;;;;;;;;;;;;;;;;OAmBG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAiIvF;;OAEG;YACW,qBAAqB;IA+DnC;;OAEG;YACW,sBAAsB;IAkCpC;;OAEG;YACW,gBAAgB;IAgC9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;OAEG;IACH,OAAO,CAAC,aAAa;IAKrB;;OAEG;IACH,OAAO,CAAC,cAAc;CAMzB"}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { RegisterClass } from "@memberjunction/global";
|
|
8
8
|
import { BaseAction } from "@memberjunction/actions";
|
|
9
9
|
import { MJGlobal, UUIDsEqual } from "@memberjunction/global";
|
|
10
|
-
import { BaseImageGenerator, GetAIAPIKey } from "@memberjunction/ai";
|
|
10
|
+
import { BaseImageGenerator, GetAIAPIKey, } from "@memberjunction/ai";
|
|
11
11
|
import { AIEngineBase } from "@memberjunction/ai-engine-base";
|
|
12
12
|
/**
|
|
13
13
|
* Action that generates images using AI image generation models (DALL-E, Gemini, etc.)
|
|
@@ -66,6 +66,26 @@ import { AIEngineBase } from "@memberjunction/ai-engine-base";
|
|
|
66
66
|
* });
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the key an image generator should use.
|
|
71
|
+
*
|
|
72
|
+
* Inside an agent run, `resolve` is the run's {@link RuntimeAPIKeyResolver}: the RUN'S key for the
|
|
73
|
+
* driver class first, then the platform's — the same order the run's prompts use, so a run on a
|
|
74
|
+
* customer's OpenAI key now generates its images on that key too. Outside a run (or when the agent
|
|
75
|
+
* refuses this action the run's key) it is undefined / answers undefined, and `GetAIAPIKey` gives
|
|
76
|
+
* the platform key as it always did. Then the vendor-name fallback that was always here — but
|
|
77
|
+
* actually USED this time: the previous code found a key by vendor name and then handed the empty
|
|
78
|
+
* driver-class result to the generator, so that branch never produced an image.
|
|
79
|
+
*/
|
|
80
|
+
export function ResolveImageGenerationAPIKey(driverClass, vendorName, resolve) {
|
|
81
|
+
const byDriver = resolve?.(driverClass) || GetAIAPIKey(driverClass);
|
|
82
|
+
if (byDriver)
|
|
83
|
+
return byDriver;
|
|
84
|
+
const byVendor = vendorName ? resolve?.(vendorName) || GetAIAPIKey(vendorName) : '';
|
|
85
|
+
if (byVendor)
|
|
86
|
+
return byVendor;
|
|
87
|
+
throw new Error(`No API key found for ${driverClass} or vendor ${vendorName || 'unknown'}`);
|
|
88
|
+
}
|
|
69
89
|
let GenerateImageAction = class GenerateImageAction extends BaseAction {
|
|
70
90
|
/**
|
|
71
91
|
* Generates or edits image(s) using AI image generation models.
|
|
@@ -108,7 +128,7 @@ let GenerateImageAction = class GenerateImageAction extends BaseAction {
|
|
|
108
128
|
};
|
|
109
129
|
}
|
|
110
130
|
// Get image generator model and create instance
|
|
111
|
-
const { generator, model, apiName } = await this.prepareImageGenerator(params.ContextUser, modelName);
|
|
131
|
+
const { generator, model, apiName } = await this.prepareImageGenerator(params.ContextUser, modelName, params.RuntimeAPIKeyResolver);
|
|
112
132
|
let result;
|
|
113
133
|
if (sourceImage) {
|
|
114
134
|
// Image-to-image: use EditImage when source image is provided
|
|
@@ -202,7 +222,7 @@ let GenerateImageAction = class GenerateImageAction extends BaseAction {
|
|
|
202
222
|
/**
|
|
203
223
|
* Prepare an image generator instance using proper metadata lookup
|
|
204
224
|
*/
|
|
205
|
-
async prepareImageGenerator(contextUser, modelName) {
|
|
225
|
+
async prepareImageGenerator(contextUser, modelName, resolve) {
|
|
206
226
|
// Ensure AIEngine is loaded
|
|
207
227
|
await AIEngineBase.Instance.Config(false, contextUser);
|
|
208
228
|
// Find image generator models
|
|
@@ -230,18 +250,10 @@ let GenerateImageAction = class GenerateImageAction extends BaseAction {
|
|
|
230
250
|
if (!inferenceProvider) {
|
|
231
251
|
throw new Error(`No active inference provider found for model '${model.Name}'`);
|
|
232
252
|
}
|
|
233
|
-
// Get API key using the vendor's driver class
|
|
234
253
|
const driverClass = inferenceProvider.DriverClass;
|
|
235
254
|
const apiName = inferenceProvider.APIName || model.APIName || model.Name;
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
// Try getting by vendor name as fallback
|
|
239
|
-
const vendor = AIEngineBase.Instance.Vendors.find(v => UUIDsEqual(v.ID, inferenceProvider.VendorID));
|
|
240
|
-
const vendorApiKey = vendor ? GetAIAPIKey(vendor.Name) : null;
|
|
241
|
-
if (!vendorApiKey) {
|
|
242
|
-
throw new Error(`No API key found for ${driverClass} or vendor ${vendor?.Name || 'unknown'}`);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
255
|
+
const vendor = AIEngineBase.Instance.Vendors.find(v => UUIDsEqual(v.ID, inferenceProvider.VendorID));
|
|
256
|
+
const apiKey = ResolveImageGenerationAPIKey(driverClass, vendor?.Name, resolve);
|
|
245
257
|
const generator = MJGlobal.Instance.ClassFactory.CreateInstance(BaseImageGenerator, driverClass, apiKey);
|
|
246
258
|
if (!generator) {
|
|
247
259
|
throw new Error(`Failed to create image generator instance for ${driverClass}. Ensure the provider is registered.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-image.action.js","sourceRoot":"","sources":["../../../src/custom/ai/generate-image.action.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACH,kBAAkB,EAKlB,WAAW,
|
|
1
|
+
{"version":3,"file":"generate-image.action.js","sourceRoot":"","sources":["../../../src/custom/ai/generate-image.action.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,C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M,EAAE,GAAG,CAAC,MAAM;YAClB,KAAK,EAAE,mBAAmB,KAAK,GAAG,CAAC,EAAE;SACxC,CAAC;IACN,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,MAAuB,EAAE,IAAY;QACvD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACnF,OAAO,KAAK,EAAE,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,YAAoB;QAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,YAAY,CAAC;QAC/D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3C,CAAC;CACJ,CAAA;AAjUY,mBAAmB;IAD/B,aAAa,CAAC,UAAU,EAAE,gBAAgB,CAAC;GAC/B,mBAAmB,CAiU/B"}
|
|
@@ -49,9 +49,15 @@ export interface SemanticSearchOutcome {
|
|
|
49
49
|
* that don't thread a provider (agents, MCP, CLI, scheduled jobs) — exactly
|
|
50
50
|
* like every other action.
|
|
51
51
|
*/
|
|
52
|
+
export declare function RunSemanticEntitySearch(params: RunActionParams, entityName: string, searchText: string, topK: number, minScore: number, mode?: 'semantic' | 'hybrid' | 'lexical'): Promise<SemanticSearchOutcome>;
|
|
53
|
+
/** @deprecated Use {@link RunSemanticEntitySearch}. */
|
|
52
54
|
export declare function runSemanticEntitySearch(params: RunActionParams, entityName: string, searchText: string, topK: number, minScore: number, mode?: 'semantic' | 'hybrid' | 'lexical'): Promise<SemanticSearchOutcome>;
|
|
53
55
|
/** Case-insensitive lookup of a raw action parameter value. */
|
|
56
|
+
export declare function GetActionParamValue(params: RunActionParams, name: string): unknown;
|
|
57
|
+
/** @deprecated Use {@link GetActionParamValue}. */
|
|
54
58
|
export declare function getActionParamValue(params: RunActionParams, name: string): unknown;
|
|
55
59
|
/** Case-insensitive boolean parameter accessor with a default. */
|
|
60
|
+
export declare function GetActionBooleanParam(params: RunActionParams, name: string, defaultValue: boolean): boolean;
|
|
61
|
+
/** @deprecated Use {@link GetActionBooleanParam}. */
|
|
56
62
|
export declare function getActionBooleanParam(params: RunActionParams, name: string, defaultValue: boolean): boolean;
|
|
57
63
|
//# sourceMappingURL=semantic-entity-search.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-entity-search.helper.d.ts","sourceRoot":"","sources":["../../../src/custom/ai/semantic-entity-search.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAwC,MAAM,sBAAsB,CAAC;AAErG;;;;;;;;;GASG;AAEH,sGAAsG;AACtG,MAAM,WAAW,qBAAqB;IAClC,kFAAkF;IAClF,EAAE,EAAE,OAAO,CAAC;IACZ,yCAAyC;IACzC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,UAAU,GAAG,QAAQ,GAAG,SAAsB,GACrD,OAAO,CAAC,qBAAqB,CAAC,CA6BhC;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAGlF;AAED,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAM3G"}
|
|
1
|
+
{"version":3,"file":"semantic-entity-search.helper.d.ts","sourceRoot":"","sources":["../../../src/custom/ai/semantic-entity-search.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAwC,MAAM,sBAAsB,CAAC;AAErG;;;;;;;;;GASG;AAEH,sGAAsG;AACtG,MAAM,WAAW,qBAAqB;IAClC,kFAAkF;IAClF,EAAE,EAAE,OAAO,CAAC;IACZ,yCAAyC;IACzC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,UAAU,GAAG,QAAQ,GAAG,SAAsB,GACrD,OAAO,CAAC,qBAAqB,CAAC,CA6BhC;AAED,uDAAuD;AACvD,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,UAAU,GAAG,QAAQ,GAAG,SAAsB,GACrD,OAAO,CAAC,qBAAqB,CAAC,CAEhC;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAGlF;AAED,mDAAmD;AACnD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAElF;AAED,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAM3G;AAED,qDAAqD;AACrD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAE3G"}
|
|
@@ -27,7 +27,7 @@ import { Metadata } from "@memberjunction/core";
|
|
|
27
27
|
* that don't thread a provider (agents, MCP, CLI, scheduled jobs) — exactly
|
|
28
28
|
* like every other action.
|
|
29
29
|
*/
|
|
30
|
-
export async function
|
|
30
|
+
export async function RunSemanticEntitySearch(params, entityName, searchText, topK, minScore, mode = 'semantic') {
|
|
31
31
|
const md = (params.Provider ?? Metadata.Provider);
|
|
32
32
|
if (!md) {
|
|
33
33
|
return {
|
|
@@ -54,14 +54,22 @@ export async function runSemanticEntitySearch(params, entityName, searchText, to
|
|
|
54
54
|
const results = await md.SearchEntity(searchParams);
|
|
55
55
|
return { ok: true, results };
|
|
56
56
|
}
|
|
57
|
+
/** @deprecated Use {@link RunSemanticEntitySearch}. */
|
|
58
|
+
export async function runSemanticEntitySearch(params, entityName, searchText, topK, minScore, mode = 'semantic') {
|
|
59
|
+
return RunSemanticEntitySearch(params, entityName, searchText, topK, minScore, mode);
|
|
60
|
+
}
|
|
57
61
|
/** Case-insensitive lookup of a raw action parameter value. */
|
|
58
|
-
export function
|
|
62
|
+
export function GetActionParamValue(params, name) {
|
|
59
63
|
const param = params.Params.find(p => p.Name.toLowerCase() === name.toLowerCase());
|
|
60
64
|
return param?.Value;
|
|
61
65
|
}
|
|
66
|
+
/** @deprecated Use {@link GetActionParamValue}. */
|
|
67
|
+
export function getActionParamValue(params, name) {
|
|
68
|
+
return GetActionParamValue(params, name);
|
|
69
|
+
}
|
|
62
70
|
/** Case-insensitive boolean parameter accessor with a default. */
|
|
63
|
-
export function
|
|
64
|
-
const value =
|
|
71
|
+
export function GetActionBooleanParam(params, name, defaultValue) {
|
|
72
|
+
const value = GetActionParamValue(params, name);
|
|
65
73
|
if (value === undefined || value === null)
|
|
66
74
|
return defaultValue;
|
|
67
75
|
if (typeof value === 'boolean')
|
|
@@ -70,4 +78,8 @@ export function getActionBooleanParam(params, name, defaultValue) {
|
|
|
70
78
|
return value.toLowerCase() === 'true';
|
|
71
79
|
return defaultValue;
|
|
72
80
|
}
|
|
81
|
+
/** @deprecated Use {@link GetActionBooleanParam}. */
|
|
82
|
+
export function getActionBooleanParam(params, name, defaultValue) {
|
|
83
|
+
return GetActionBooleanParam(params, name, defaultValue);
|
|
84
|
+
}
|
|
73
85
|
//# sourceMappingURL=semantic-entity-search.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-entity-search.helper.js","sourceRoot":"","sources":["../../../src/custom/ai/semantic-entity-search.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA0BhD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,MAAuB,EACvB,UAAkB,EAClB,UAAkB,EAClB,IAAY,EACZ,QAAgB,EAChB,OAA0C,UAAU;IAEpD,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAA4C,CAAC;IAC7F,IAAI,CAAC,EAAE,EAAE,CAAC;QACN,OAAO;YACH,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,EAAE;YAC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
1
|
+
{"version":3,"file":"semantic-entity-search.helper.js","sourceRoot":"","sources":["../../../src/custom/ai/semantic-entity-search.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA0BhD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,MAAuB,EACvB,UAAkB,EAClB,UAAkB,EAClB,IAAY,EACZ,QAAgB,EAChB,OAA0C,UAAU;IAEpD,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAA4C,CAAC;IAC7F,IAAI,CAAC,EAAE,EAAE,CAAC;QACN,OAAO;YACH,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,EAAE;YACX,UAAU,EAAE,kBAAkB;YAC9B,OAAO,EAAE,uGAAuG;SACnH,CAAC;IACN,CAAC;IAED,oFAAoF;IACpF,kFAAkF;IAClF,yFAAyF;IACzF,MAAM,gBAAgB,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE1D,MAAM,YAAY,GAAuB;QACrC,UAAU;QACV,UAAU;QACV,OAAO,EAAE;YACL,IAAI;YACJ,IAAI;YACJ,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,MAAM,CAAC,WAAW;SAClC;KACJ,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACpD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACjC,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,MAAuB,EACvB,UAAkB,EAClB,UAAkB,EAClB,IAAY,EACZ,QAAgB,EAChB,OAA0C,UAAU;IAEpD,OAAO,uBAAuB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,E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