@memberjunction/ng-dashboards 6.2.0-edge.4 → 6.2.0-edge.6
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 +28 -0
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.d.ts +1 -1
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.d.ts.map +1 -1
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.js +15 -7
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.js.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.d.ts +7 -1
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.d.ts.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.js +209 -57
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.js.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.d.ts +12 -11
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.d.ts.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.js +15 -15
- package/dist/AI/components/duplicates/duplicate-detection-run-scope.js.map +1 -1
- package/dist/AI/components/execution-monitoring.component.d.ts.map +1 -1
- package/dist/AI/components/execution-monitoring.component.js +28 -16
- package/dist/AI/components/execution-monitoring.component.js.map +1 -1
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts +1 -0
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts.map +1 -1
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js +30 -6
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js.map +1 -1
- package/dist/AI/components/tags/tags-resource.component.d.ts +1 -1
- package/dist/AI/components/tags/tags-resource.component.d.ts.map +1 -1
- package/dist/AI/components/tags/tags-resource.component.js +15 -7
- package/dist/AI/components/tags/tags-resource.component.js.map +1 -1
- package/dist/AI/components/vectors/sensitive-fields.d.ts +58 -0
- package/dist/AI/components/vectors/sensitive-fields.d.ts.map +1 -0
- package/dist/AI/components/vectors/sensitive-fields.js +251 -0
- package/dist/AI/components/vectors/sensitive-fields.js.map +1 -0
- package/dist/AI/components/vectors/vector-document-rules.d.ts +139 -0
- package/dist/AI/components/vectors/vector-document-rules.d.ts.map +1 -0
- package/dist/AI/components/vectors/vector-document-rules.js +182 -0
- package/dist/AI/components/vectors/vector-document-rules.js.map +1 -0
- package/dist/AI/components/vectors/vector-management-resource.component.d.ts +83 -14
- package/dist/AI/components/vectors/vector-management-resource.component.d.ts.map +1 -1
- package/dist/AI/components/vectors/vector-management-resource.component.js +546 -271
- package/dist/AI/components/vectors/vector-management-resource.component.js.map +1 -1
- package/dist/AI/components/vectors/vector-store-selection.d.ts +32 -0
- package/dist/AI/components/vectors/vector-store-selection.d.ts.map +1 -0
- package/dist/AI/components/vectors/vector-store-selection.js +57 -0
- package/dist/AI/components/vectors/vector-store-selection.js.map +1 -0
- package/dist/ChiefOfStaff/chief-of-staff-agent-context.d.ts +236 -0
- package/dist/ChiefOfStaff/chief-of-staff-agent-context.d.ts.map +1 -0
- package/dist/ChiefOfStaff/chief-of-staff-agent-context.js +374 -0
- package/dist/ChiefOfStaff/chief-of-staff-agent-context.js.map +1 -0
- package/dist/ChiefOfStaff/chief-of-staff-dashboard.component.d.ts +195 -0
- package/dist/ChiefOfStaff/chief-of-staff-dashboard.component.d.ts.map +1 -0
- package/dist/ChiefOfStaff/chief-of-staff-dashboard.component.js +2910 -0
- package/dist/ChiefOfStaff/chief-of-staff-dashboard.component.js.map +1 -0
- package/dist/ChiefOfStaff/index.d.ts +3 -0
- package/dist/ChiefOfStaff/index.d.ts.map +1 -0
- package/dist/ChiefOfStaff/index.js +3 -0
- package/dist/ChiefOfStaff/index.js.map +1 -0
- package/dist/Communication/communication-agent-context.d.ts +11 -1
- package/dist/Communication/communication-agent-context.d.ts.map +1 -1
- package/dist/Communication/communication-agent-context.js +15 -0
- package/dist/Communication/communication-agent-context.js.map +1 -1
- package/dist/Communication/communication-dashboard.component.d.ts.map +1 -1
- package/dist/Communication/communication-dashboard.component.js +5 -0
- package/dist/Communication/communication-dashboard.component.js.map +1 -1
- package/dist/Communication/communication-logs-resource.component.d.ts.map +1 -1
- package/dist/Communication/communication-logs-resource.component.js +2 -1
- package/dist/Communication/communication-logs-resource.component.js.map +1 -1
- package/dist/Communication/communication-monitor-resource.component.d.ts.map +1 -1
- package/dist/Communication/communication-monitor-resource.component.js +23 -18
- package/dist/Communication/communication-monitor-resource.component.js.map +1 -1
- package/dist/Communication/communication-providers-resource.component.d.ts +27 -1
- package/dist/Communication/communication-providers-resource.component.d.ts.map +1 -1
- package/dist/Communication/communication-providers-resource.component.js +722 -78
- package/dist/Communication/communication-providers-resource.component.js.map +1 -1
- package/dist/Communication/communication-runs-resource.component.d.ts.map +1 -1
- package/dist/Communication/communication-runs-resource.component.js +11 -10
- package/dist/Communication/communication-runs-resource.component.js.map +1 -1
- package/dist/DashboardEditor/dashboard-editor.component.d.ts +17 -2
- package/dist/DashboardEditor/dashboard-editor.component.d.ts.map +1 -1
- package/dist/DashboardEditor/dashboard-editor.component.js +94 -43
- package/dist/DashboardEditor/dashboard-editor.component.js.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts +49 -0
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.js +220 -55
- package/dist/DataExplorer/data-explorer-dashboard.component.js.map +1 -1
- package/dist/DataExplorer/models/explorer-state.interface.d.ts +2 -0
- package/dist/DataExplorer/models/explorer-state.interface.d.ts.map +1 -1
- package/dist/DataExplorer/models/explorer-state.interface.js.map +1 -1
- package/dist/DevTools/app-state-inspector.component.d.ts.map +1 -1
- package/dist/DevTools/app-state-inspector.component.js +1 -0
- package/dist/DevTools/app-state-inspector.component.js.map +1 -1
- package/dist/DevTools/class-registry.component.d.ts.map +1 -1
- package/dist/DevTools/class-registry.component.js +1 -0
- package/dist/DevTools/class-registry.component.js.map +1 -1
- package/dist/DevTools/event-monitor.component.d.ts.map +1 -1
- package/dist/DevTools/event-monitor.component.js +2 -0
- package/dist/DevTools/event-monitor.component.js.map +1 -1
- package/dist/DevTools/graphql-console.component.d.ts.map +1 -1
- package/dist/DevTools/graphql-console.component.js.map +1 -1
- package/dist/DevTools/grid-width-lab.component.d.ts.map +1 -1
- package/dist/DevTools/grid-width-lab.component.js +1 -0
- package/dist/DevTools/grid-width-lab.component.js.map +1 -1
- package/dist/DevTools/layout-inspector.component.d.ts.map +1 -1
- package/dist/DevTools/layout-inspector.component.js +1 -0
- package/dist/DevTools/layout-inspector.component.js.map +1 -1
- package/dist/DevTools/lazy-module-status.component.d.ts.map +1 -1
- package/dist/DevTools/lazy-module-status.component.js +1 -0
- package/dist/DevTools/lazy-module-status.component.js.map +1 -1
- package/dist/DevTools/settings-explorer.component.d.ts.map +1 -1
- package/dist/DevTools/settings-explorer.component.js +1 -0
- package/dist/DevTools/settings-explorer.component.js.map +1 -1
- package/dist/DevTools/tab-strip-lab.component.d.ts.map +1 -1
- package/dist/DevTools/tab-strip-lab.component.js +1 -0
- package/dist/DevTools/tab-strip-lab.component.js.map +1 -1
- package/dist/EntityAdmin/entity-admin-dashboard.component.d.ts +5 -0
- package/dist/EntityAdmin/entity-admin-dashboard.component.d.ts.map +1 -1
- package/dist/EntityAdmin/entity-admin-dashboard.component.js +8 -5
- package/dist/EntityAdmin/entity-admin-dashboard.component.js.map +1 -1
- package/dist/Integration/components/overview/overview.component.js +2 -2
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.js +2 -2
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.js.map +1 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipeline.engine.d.ts +11 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipeline.engine.d.ts.map +1 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipeline.engine.js +24 -2
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipeline.engine.js.map +1 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.d.ts +16 -2
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.d.ts.map +1 -1
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.js +87 -33
- package/dist/KnowledgeHub/components/feature-pipelines/feature-pipelines-resource.component.js.map +1 -1
- package/dist/LoginStudio/login-studio-inspector.component.d.ts +130 -0
- package/dist/LoginStudio/login-studio-inspector.component.d.ts.map +1 -0
- package/dist/LoginStudio/login-studio-inspector.component.js +781 -0
- package/dist/LoginStudio/login-studio-inspector.component.js.map +1 -0
- package/dist/LoginStudio/login-studio-resource.component.d.ts +161 -0
- package/dist/LoginStudio/login-studio-resource.component.d.ts.map +1 -0
- package/dist/LoginStudio/login-studio-resource.component.js +890 -0
- package/dist/LoginStudio/login-studio-resource.component.js.map +1 -0
- package/dist/MCP/mcp-dashboard.component.d.ts +24 -4
- package/dist/MCP/mcp-dashboard.component.d.ts.map +1 -1
- package/dist/MCP/mcp-dashboard.component.js +118 -65
- package/dist/MCP/mcp-dashboard.component.js.map +1 -1
- package/dist/PredictiveStudio/business-predictions.view-models.d.ts +1 -1
- package/dist/PredictiveStudio/business-predictions.view-models.d.ts.map +1 -1
- package/dist/PredictiveStudio/business-predictions.view-models.js +3 -3
- package/dist/PredictiveStudio/business-predictions.view-models.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-experiments.component.d.ts +6 -63
- package/dist/PredictiveStudio/components/ps-experiments.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-experiments.component.js +256 -521
- package/dist/PredictiveStudio/components/ps-experiments.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.d.ts +0 -18
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.js +122 -249
- package/dist/PredictiveStudio/components/ps-pipeline-wizard.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-pipelines.component.d.ts +5 -9
- package/dist/PredictiveStudio/components/ps-pipelines.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-pipelines.component.js +98 -130
- package/dist/PredictiveStudio/components/ps-pipelines.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.d.ts +53 -4
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.js +335 -326
- package/dist/PredictiveStudio/components/ps-predictions-grid.component.js.map +1 -1
- package/dist/PredictiveStudio/components/ps-row-drivers.component.d.ts +19 -0
- package/dist/PredictiveStudio/components/ps-row-drivers.component.d.ts.map +1 -0
- package/dist/PredictiveStudio/components/ps-row-drivers.component.js +85 -0
- package/dist/PredictiveStudio/components/ps-row-drivers.component.js.map +1 -0
- package/dist/PredictiveStudio/engine/predictive-studio.engine.d.ts +19 -1
- package/dist/PredictiveStudio/engine/predictive-studio.engine.d.ts.map +1 -1
- package/dist/PredictiveStudio/engine/predictive-studio.engine.js +51 -2
- package/dist/PredictiveStudio/engine/predictive-studio.engine.js.map +1 -1
- package/dist/PredictiveStudio/predictive-studio-agent-context.d.ts +3 -1
- package/dist/PredictiveStudio/predictive-studio-agent-context.d.ts.map +1 -1
- package/dist/PredictiveStudio/predictive-studio-agent-context.js +3 -0
- package/dist/PredictiveStudio/predictive-studio-agent-context.js.map +1 -1
- package/dist/PredictiveStudio/predictive-studio-score-history.service.d.ts +27 -4
- package/dist/PredictiveStudio/predictive-studio-score-history.service.d.ts.map +1 -1
- package/dist/PredictiveStudio/predictive-studio-score-history.service.js +94 -61
- package/dist/PredictiveStudio/predictive-studio-score-history.service.js.map +1 -1
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.d.ts +29 -5
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.d.ts.map +1 -1
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.js +185 -103
- package/dist/PredictiveStudio/resources/ps-predictions-resource.component.js.map +1 -1
- package/dist/PredictiveStudio/resources/ps-studio-resource.component.js +1 -1
- package/dist/PredictiveStudio/resources/ps-studio-resource.component.js.map +1 -1
- package/dist/Workflows/components/workflow-runs-resource.component.js +4 -4
- package/dist/Workflows/components/workflow-runs-resource.component.js.map +1 -1
- package/dist/ai-dashboards.module.d.ts +22 -21
- package/dist/ai-dashboards.module.d.ts.map +1 -1
- package/dist/ai-dashboards.module.js +8 -2
- package/dist/ai-dashboards.module.js.map +1 -1
- package/dist/core-dashboards.module.d.ts +2 -1
- package/dist/core-dashboards.module.d.ts.map +1 -1
- package/dist/core-dashboards.module.js +11 -3
- package/dist/core-dashboards.module.js.map +1 -1
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +4 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +72 -69
- package/dist/PredictiveStudio/at-risk.view-models.d.ts +0 -120
- package/dist/PredictiveStudio/at-risk.view-models.d.ts.map +0 -1
- package/dist/PredictiveStudio/at-risk.view-models.js +0 -261
- package/dist/PredictiveStudio/at-risk.view-models.js.map +0 -1
- package/dist/PredictiveStudio/components/ps-confirm-modal.component.d.ts +0 -109
- package/dist/PredictiveStudio/components/ps-confirm-modal.component.d.ts.map +0 -1
- package/dist/PredictiveStudio/components/ps-confirm-modal.component.js +0 -323
- package/dist/PredictiveStudio/components/ps-confirm-modal.component.js.map +0 -1
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.d.ts +0 -137
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.d.ts.map +0 -1
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.js +0 -826
- package/dist/PredictiveStudio/components/ps-run-experiment-modal.component.js.map +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rules the Vectors tab applies when it turns a model suggestion into real metadata.
|
|
3
|
+
*
|
|
4
|
+
* Three separate refusals live here, and they share a theme with `sensitive-fields.ts`: the
|
|
5
|
+
* suggestion comes from a language model and the template stays hand-editable afterwards, so
|
|
6
|
+
* anything that matters has to be a property of the code rather than of the prompt.
|
|
7
|
+
*
|
|
8
|
+
* 1. The Entity Document Type is resolved from the use case the user actually picked,
|
|
9
|
+
* instead of always writing a duplicate-detection document.
|
|
10
|
+
* 2. The number of interpolated fields is bounded, because an unbounded list is how a
|
|
11
|
+
* template balloons and how columns nobody chose end up embedded.
|
|
12
|
+
* 3. MemberJunction's own internal entities are not offered as vectorization targets.
|
|
13
|
+
*
|
|
14
|
+
* Kept out of the component so each rule can be tested as a function rather than through a
|
|
15
|
+
* TestBed, matching how `sensitive-fields.ts` is structured.
|
|
16
|
+
*/
|
|
17
|
+
import { TemplatePlaceholderNames } from './sensitive-fields';
|
|
18
|
+
// ─── 1. Entity Document Type per use case ────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* The Entity Document Type each use case writes.
|
|
21
|
+
*
|
|
22
|
+
* The dialog offers these use cases, and until now every one of them produced a
|
|
23
|
+
* `Record Duplicate` document — the type name was hardcoded in the save path, so choosing
|
|
24
|
+
* "search" silently discarded the choice and wrote the wrong type. A vector pool is typed:
|
|
25
|
+
* `Provider.SearchEntity` and the Search Entity action read `Search`-typed documents, so a
|
|
26
|
+
* search request stored as `Record Duplicate` is not merely mislabelled, it is not found by
|
|
27
|
+
* the thing that wanted it.
|
|
28
|
+
*
|
|
29
|
+
* The two names here are MJ's own, not invented: both are seeded Entity Document Types, and
|
|
30
|
+
* the Vectorize Entity action's `EntityDocumentType` parameter is documented as defaulting
|
|
31
|
+
* to `Record Duplicate` and accepting `Search`.
|
|
32
|
+
*
|
|
33
|
+
* The dialog's Use Case buttons are exactly this map's keys. There is no `classification`
|
|
34
|
+
* entry: MJ seeds no `Classification` type, so that button failed on every stock install and
|
|
35
|
+
* was removed until the type exists (#5630).
|
|
36
|
+
*/
|
|
37
|
+
export const ENTITY_DOCUMENT_TYPE_BY_USE_CASE = {
|
|
38
|
+
'duplicate detection': 'Record Duplicate',
|
|
39
|
+
'search': 'Search',
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The Entity Document Type name for a use case, or null when the use case is unrecognised.
|
|
43
|
+
*
|
|
44
|
+
* Returns null rather than falling back to a default: a use case this code does not know
|
|
45
|
+
* about must not quietly become a duplicate-detection document.
|
|
46
|
+
*/
|
|
47
|
+
export function EntityDocumentTypeForUseCase(useCase) {
|
|
48
|
+
if (!useCase) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return ENTITY_DOCUMENT_TYPE_BY_USE_CASE[useCase.trim().toLowerCase()] ?? null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The use case the suggestion prompt is given for an existing document of this type, or null
|
|
55
|
+
* when the type has none (e.g. `Context`).
|
|
56
|
+
*
|
|
57
|
+
* The edit panel's "Regenerate template" uses it, so a regenerated template still matches the
|
|
58
|
+
* document's type. It reads the same map as {@link EntityDocumentTypeForUseCase}, so the two
|
|
59
|
+
* directions cannot drift. Callers refuse on null rather than substitute a use case.
|
|
60
|
+
*/
|
|
61
|
+
export function SuggestionUseCaseForDocumentType(typeName) {
|
|
62
|
+
if (!typeName) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const wanted = typeName.trim().toLowerCase();
|
|
66
|
+
const match = Object.entries(ENTITY_DOCUMENT_TYPE_BY_USE_CASE)
|
|
67
|
+
.find(([, documentType]) => documentType.toLowerCase() === wanted);
|
|
68
|
+
return match ? match[0] : null;
|
|
69
|
+
}
|
|
70
|
+
// ─── 2. How many fields a template may interpolate ───────────────────────────
|
|
71
|
+
/**
|
|
72
|
+
* The most distinct fields one generated template may interpolate.
|
|
73
|
+
*
|
|
74
|
+
* Derived from the suggestion prompt's own contract rather than copied from elsewhere.
|
|
75
|
+
* `metadata/prompts/templates/system/entity-document-suggestion.template.md` requires
|
|
76
|
+
* "**Output must be 1-4 natural language sentences**" and explains at length why a
|
|
77
|
+
* key-value dump embeds badly compared with English prose.
|
|
78
|
+
*
|
|
79
|
+
* So: 4 sentences — the prompt's own ceiling — times 6 interpolations per sentence, past
|
|
80
|
+
* which a sentence stops being the natural English the prompt demands and becomes the dump
|
|
81
|
+
* it explicitly forbids. That gives 24.
|
|
82
|
+
*
|
|
83
|
+
* Cross-check against the prompt's three worked examples, which interpolate 8, 6 and 4
|
|
84
|
+
* distinct placeholders: 24 is three times the richest thing the prompt itself demonstrates,
|
|
85
|
+
* so the cap cannot fire on anything the prompt teaches a model to produce. It fires when a
|
|
86
|
+
* model has ignored the sentence contract and reached for the whole table.
|
|
87
|
+
*/
|
|
88
|
+
export const MAX_TEMPLATE_FIELDS = 24;
|
|
89
|
+
/** Distinct `{{Placeholder}}` field names a template interpolates. */
|
|
90
|
+
export function TemplateFieldNames(templateText) {
|
|
91
|
+
return [...new Set(TemplatePlaceholderNames(templateText))];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Truncates a model-supplied field list to the cap.
|
|
95
|
+
*
|
|
96
|
+
* Truncation rather than refusal, because this list is the model's own description of what
|
|
97
|
+
* it selected and is shown as chips — dropping the tail and saying so is more useful than
|
|
98
|
+
* discarding the whole suggestion. The authoritative refusal is on the template, below,
|
|
99
|
+
* since the template is what actually gets embedded.
|
|
100
|
+
*/
|
|
101
|
+
export function CapSelectedFields(fields) {
|
|
102
|
+
if (!fields || fields.length === 0) {
|
|
103
|
+
return { fields: [], dropped: 0 };
|
|
104
|
+
}
|
|
105
|
+
const unique = [...new Set(fields)];
|
|
106
|
+
if (unique.length <= MAX_TEMPLATE_FIELDS) {
|
|
107
|
+
return { fields: unique, dropped: 0 };
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
fields: unique.slice(0, MAX_TEMPLATE_FIELDS),
|
|
111
|
+
dropped: unique.length - MAX_TEMPLATE_FIELDS,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The refusal message when a template interpolates more fields than the cap allows, or null
|
|
116
|
+
* when it is within the cap.
|
|
117
|
+
*
|
|
118
|
+
* A template cannot be truncated without mangling its prose, so this one refuses rather than
|
|
119
|
+
* trimming — and the message carries both numbers, because "too many fields" without the
|
|
120
|
+
* count is not actionable. The template is editable in the dialog, so the user can act on it
|
|
121
|
+
* without losing the suggestion.
|
|
122
|
+
*/
|
|
123
|
+
export function TemplateFieldCapRefusal(templateText) {
|
|
124
|
+
const names = TemplateFieldNames(templateText);
|
|
125
|
+
if (names.length <= MAX_TEMPLATE_FIELDS) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return (`This template interpolates ${names.length} fields, and at most ${MAX_TEMPLATE_FIELDS} ` +
|
|
129
|
+
`may be embedded. A template this wide stops reading like the natural language that ` +
|
|
130
|
+
`embeds well, and pulls in columns nobody chose. Remove ` +
|
|
131
|
+
`${names.length - MAX_TEMPLATE_FIELDS} field(s) from the template and save again.`);
|
|
132
|
+
}
|
|
133
|
+
// ─── 3. Which entities may be offered as vectorization targets ───────────────
|
|
134
|
+
/**
|
|
135
|
+
* Schemas whose entities are not offered in the picker.
|
|
136
|
+
*
|
|
137
|
+
* Follows the existing frontend precedent — `FRONTEND_BLOCKED_SCHEMAS` in
|
|
138
|
+
* `DatabaseDesigner/services/database-designer.engine.ts` and in
|
|
139
|
+
* `DatabaseDesigner/components/create-wizard/steps/step-relationships.component.ts`, both
|
|
140
|
+
* `new Set(['__mj'])` — rather than inventing a rule.
|
|
141
|
+
*/
|
|
142
|
+
export const VECTOR_BLOCKED_SCHEMAS = new Set(['__mj']);
|
|
143
|
+
/**
|
|
144
|
+
* True when an entity may be offered as a vectorization target.
|
|
145
|
+
*
|
|
146
|
+
* The picker previously listed every entity in metadata, so MemberJunction's own ~378
|
|
147
|
+
* internal entities — prompt runs, audit logs, record changes, credentials — were offered
|
|
148
|
+
* alongside the user's business tables, both as noise and as embedding targets.
|
|
149
|
+
*
|
|
150
|
+
* Two rules, and they currently pick out the same set: every `MJ:`-prefixed entity is in the
|
|
151
|
+
* `__mj` schema and vice versa (378 and 378, exactly coextensive, in the 5.46 baseline). The
|
|
152
|
+
* name-prefix rule is therefore defence in depth against an MJ entity registered into some
|
|
153
|
+
* other schema, not extra coverage today. Said plainly so nobody later reads it as load
|
|
154
|
+
* bearing and is surprised.
|
|
155
|
+
*
|
|
156
|
+
* Note MJ does seed two `Search`-typed documents over `__mj` entities (`AI Agents Search`,
|
|
157
|
+
* `AI Prompts Search`), so framework entities are not unvectorizable in principle. Those
|
|
158
|
+
* arrive through metadata sync, which is a different authoring channel with a different
|
|
159
|
+
* audience; this dialog is where a business user configures vectorization of their own data,
|
|
160
|
+
* and burying their tables under the framework's is the defect being fixed.
|
|
161
|
+
*/
|
|
162
|
+
export function IsVectorizableEntity(entity) {
|
|
163
|
+
if (entity.SchemaName && VECTOR_BLOCKED_SCHEMAS.has(entity.SchemaName)) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return !entity.Name.startsWith('MJ:');
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The thresholds a model suggestion can put on the document it becomes. The suggestion panel
|
|
170
|
+
* shows the model's potential and absolute thresholds, and Save used to drop them, so the
|
|
171
|
+
* document kept the defaults the user never saw. Returns null when the suggestion's values are
|
|
172
|
+
* not usable as stored: each must be a number above 0 and at most 1 (the same fraction-of-1
|
|
173
|
+
* scale the document uses), and potential may not exceed absolute.
|
|
174
|
+
*/
|
|
175
|
+
export function SuggestedMatchThresholds(potential, absolute) {
|
|
176
|
+
const usable = (v) => typeof v === 'number' && Number.isFinite(v) && v > 0 && v <= 1;
|
|
177
|
+
if (!usable(potential) || !usable(absolute) || potential > absolute) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
return { Potential: potential, Absolute: absolute };
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=vector-document-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-document-rules.js","sourceRoot":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C,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QACrE,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAQD;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACpC,SAAoC,EACpC,QAAmC;IAEnC,MAAM,MAAM,GAAG,CAAC,CAA4B,EAAe,EAAE,CACzD,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACxD,CAAC","sourcesContent":["/**\n * Rules the Vectors tab applies when it turns a model suggestion into real metadata.\n *\n * Three separate refusals live here, and they share a theme with `sensitive-fields.ts`: the\n * suggestion comes from a language model and the template stays hand-editable afterwards, so\n * anything that matters has to be a property of the code rather than of the prompt.\n *\n * 1. The Entity Document Type is resolved from the use case the user actually picked,\n * instead of always writing a duplicate-detection document.\n * 2. The number of interpolated fields is bounded, because an unbounded list is how a\n * template balloons and how columns nobody chose end up embedded.\n * 3. MemberJunction's own internal entities are not offered as vectorization targets.\n *\n * Kept out of the component so each rule can be tested as a function rather than through a\n * TestBed, matching how `sensitive-fields.ts` is structured.\n */\n\nimport { TemplatePlaceholderNames } from './sensitive-fields';\n\n// ─── 1. Entity Document Type per use case ────────────────────────────────────\n\n/**\n * The Entity Document Type each use case writes.\n *\n * The dialog offers these use cases, and until now every one of them produced a\n * `Record Duplicate` document — the type name was hardcoded in the save path, so choosing\n * \"search\" silently discarded the choice and wrote the wrong type. A vector pool is typed:\n * `Provider.SearchEntity` and the Search Entity action read `Search`-typed documents, so a\n * search request stored as `Record Duplicate` is not merely mislabelled, it is not found by\n * the thing that wanted it.\n *\n * The two names here are MJ's own, not invented: both are seeded Entity Document Types, and\n * the Vectorize Entity action's `EntityDocumentType` parameter is documented as defaulting\n * to `Record Duplicate` and accepting `Search`.\n *\n * The dialog's Use Case buttons are exactly this map's keys. There is no `classification`\n * entry: MJ seeds no `Classification` type, so that button failed on every stock install and\n * was removed until the type exists (#5630).\n */\nexport const ENTITY_DOCUMENT_TYPE_BY_USE_CASE: Readonly<Record<string, string>> = {\n 'duplicate detection': 'Record Duplicate',\n 'search': 'Search',\n};\n\n/**\n * The Entity Document Type name for a use case, or null when the use case is unrecognised.\n *\n * Returns null rather than falling back to a default: a use case this code does not know\n * about must not quietly become a duplicate-detection document.\n */\nexport function EntityDocumentTypeForUseCase(useCase: string | null | undefined): string | null {\n if (!useCase) {\n return null;\n }\n return ENTITY_DOCUMENT_TYPE_BY_USE_CASE[useCase.trim().toLowerCase()] ?? null;\n}\n\n/**\n * The use case the suggestion prompt is given for an existing document of this type, or null\n * when the type has none (e.g. `Context`).\n *\n * The edit panel's \"Regenerate template\" uses it, so a regenerated template still matches the\n * document's type. It reads the same map as {@link EntityDocumentTypeForUseCase}, so the two\n * directions cannot drift. Callers refuse on null rather than substitute a use case.\n */\nexport function SuggestionUseCaseForDocumentType(typeName: string | null | undefined): string | null {\n if (!typeName) {\n return null;\n }\n const wanted = typeName.trim().toLowerCase();\n const match = Object.entries(ENTITY_DOCUMENT_TYPE_BY_USE_CASE)\n .find(([, documentType]) => documentType.toLowerCase() === wanted);\n return match ? match[0] : null;\n}\n\n// ─── 2. How many fields a template may interpolate ───────────────────────────\n\n/**\n * The most distinct fields one generated template may interpolate.\n *\n * Derived from the suggestion prompt's own contract rather than copied from elsewhere.\n * `metadata/prompts/templates/system/entity-document-suggestion.template.md` requires\n * \"**Output must be 1-4 natural language sentences**\" and explains at length why a\n * key-value dump embeds badly compared with English prose.\n *\n * So: 4 sentences — the prompt's own ceiling — times 6 interpolations per sentence, past\n * which a sentence stops being the natural English the prompt demands and becomes the dump\n * it explicitly forbids. That gives 24.\n *\n * Cross-check against the prompt's three worked examples, which interpolate 8, 6 and 4\n * distinct placeholders: 24 is three times the richest thing the prompt itself demonstrates,\n * so the cap cannot fire on anything the prompt teaches a model to produce. It fires when a\n * model has ignored the sentence contract and reached for the whole table.\n */\nexport const MAX_TEMPLATE_FIELDS = 24;\n\n/** Distinct `{{Placeholder}}` field names a template interpolates. */\nexport function TemplateFieldNames(templateText: string | null | undefined): string[] {\n return [...new Set(TemplatePlaceholderNames(templateText))];\n}\n\n/**\n * Truncates a model-supplied field list to the cap.\n *\n * Truncation rather than refusal, because this list is the model's own description of what\n * it selected and is shown as chips — dropping the tail and saying so is more useful than\n * discarding the whole suggestion. The authoritative refusal is on the template, below,\n * since the template is what actually gets embedded.\n */\nexport function CapSelectedFields(\n fields: ReadonlyArray<string> | null | undefined,\n): { fields: string[]; dropped: number } {\n if (!fields || fields.length === 0) {\n return { fields: [], dropped: 0 };\n }\n const unique = [...new Set(fields)];\n if (unique.length <= MAX_TEMPLATE_FIELDS) {\n return { fields: unique, dropped: 0 };\n }\n return {\n fields: unique.slice(0, MAX_TEMPLATE_FIELDS),\n dropped: unique.length - MAX_TEMPLATE_FIELDS,\n };\n}\n\n/**\n * The refusal message when a template interpolates more fields than the cap allows, or null\n * when it is within the cap.\n *\n * A template cannot be truncated without mangling its prose, so this one refuses rather than\n * trimming — and the message carries both numbers, because \"too many fields\" without the\n * count is not actionable. The template is editable in the dialog, so the user can act on it\n * without losing the suggestion.\n */\nexport function TemplateFieldCapRefusal(templateText: string | null | undefined): string | null {\n const names = TemplateFieldNames(templateText);\n if (names.length <= MAX_TEMPLATE_FIELDS) {\n return null;\n }\n return (\n `This template interpolates ${names.length} fields, and at most ${MAX_TEMPLATE_FIELDS} ` +\n `may be embedded. A template this wide stops reading like the natural language that ` +\n `embeds well, and pulls in columns nobody chose. Remove ` +\n `${names.length - MAX_TEMPLATE_FIELDS} field(s) from the template and save again.`\n );\n}\n\n// ─── 3. Which entities may be offered as vectorization targets ───────────────\n\n/**\n * Schemas whose entities are not offered in the picker.\n *\n * Follows the existing frontend precedent — `FRONTEND_BLOCKED_SCHEMAS` in\n * `DatabaseDesigner/services/database-designer.engine.ts` and in\n * `DatabaseDesigner/components/create-wizard/steps/step-relationships.component.ts`, both\n * `new Set(['__mj'])` — rather than inventing a rule.\n */\nexport const VECTOR_BLOCKED_SCHEMAS: ReadonlySet<string> = new Set(['__mj']);\n\n/**\n * True when an entity may be offered as a vectorization target.\n *\n * The picker previously listed every entity in metadata, so MemberJunction's own ~378\n * internal entities — prompt runs, audit logs, record changes, credentials — were offered\n * alongside the user's business tables, both as noise and as embedding targets.\n *\n * Two rules, and they currently pick out the same set: every `MJ:`-prefixed entity is in the\n * `__mj` schema and vice versa (378 and 378, exactly coextensive, in the 5.46 baseline). The\n * name-prefix rule is therefore defence in depth against an MJ entity registered into some\n * other schema, not extra coverage today. Said plainly so nobody later reads it as load\n * bearing and is surprised.\n *\n * Note MJ does seed two `Search`-typed documents over `__mj` entities (`AI Agents Search`,\n * `AI Prompts Search`), so framework entities are not unvectorizable in principle. Those\n * arrive through metadata sync, which is a different authoring channel with a different\n * audience; this dialog is where a business user configures vectorization of their own data,\n * and burying their tables under the framework's is the defect being fixed.\n */\nexport function IsVectorizableEntity(\n entity: { Name: string; SchemaName?: string | null },\n): boolean {\n if (entity.SchemaName && VECTOR_BLOCKED_SCHEMAS.has(entity.SchemaName)) {\n return false;\n }\n return !entity.Name.startsWith('MJ:');\n}\n\n/** Match thresholds an Entity Document stores, as fractions of 1. */\nexport interface DocumentMatchThresholds {\n Potential: number;\n Absolute: number;\n}\n\n/**\n * The thresholds a model suggestion can put on the document it becomes. The suggestion panel\n * shows the model's potential and absolute thresholds, and Save used to drop them, so the\n * document kept the defaults the user never saw. Returns null when the suggestion's values are\n * not usable as stored: each must be a number above 0 and at most 1 (the same fraction-of-1\n * scale the document uses), and potential may not exceed absolute.\n */\nexport function SuggestedMatchThresholds(\n potential: number | null | undefined,\n absolute: number | null | undefined\n): DocumentMatchThresholds | null {\n const usable = (v: number | null | undefined): v is number =>\n typeof v === 'number' && Number.isFinite(v) && v > 0 && v <= 1;\n if (!usable(potential) || !usable(absolute) || potential > absolute) {\n return null;\n }\n return { Potential: potential, Absolute: absolute };\n}\n"]}
|
|
@@ -12,12 +12,15 @@ import { ResourceData, MJVectorDatabaseEntity } from '@memberjunction/core-entit
|
|
|
12
12
|
import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';
|
|
13
13
|
import { ViewToggleOption } from '@memberjunction/ng-ui-components';
|
|
14
14
|
import { KPICardData } from '../widgets/kpi-card.component';
|
|
15
|
+
import { VectorIndexOption } from './vector-store-selection';
|
|
15
16
|
import * as i0 from "@angular/core";
|
|
16
17
|
/** Flattened row for the entity sync table */
|
|
17
18
|
interface EntitySyncRow {
|
|
18
19
|
EntityDocumentID: string;
|
|
19
20
|
EntityName: string;
|
|
20
21
|
DocumentName: string;
|
|
22
|
+
/** Entity Document Type name, e.g. 'Search'. Fixed at creation, shown read-only. */
|
|
23
|
+
DocumentType: string;
|
|
21
24
|
VectorCount: number;
|
|
22
25
|
LastSynced: Date | null;
|
|
23
26
|
Status: 'Synced' | 'Syncing' | 'Error' | 'Pending';
|
|
@@ -48,6 +51,11 @@ export declare class VectorManagementResourceComponent extends BaseResourceCompo
|
|
|
48
51
|
private activityService;
|
|
49
52
|
protected navigationService: NavigationService;
|
|
50
53
|
protected destroy$: Subject<void>;
|
|
54
|
+
/**
|
|
55
|
+
* How long a sync may go without a progress event before the tab stops waiting. Reaching it does
|
|
56
|
+
* not mean the sync finished (see subscribeToPipelineProgress).
|
|
57
|
+
*/
|
|
58
|
+
private static readonly SYNC_SILENCE_LIMIT_MS;
|
|
51
59
|
/** View mode: 'index' = Option A (shared index as hero, entity docs as children),
|
|
52
60
|
* 'operations' = Option C (operations monitoring with real-time sync status) */
|
|
53
61
|
ViewMode: 'index' | 'operations';
|
|
@@ -81,6 +89,8 @@ export declare class VectorManagementResourceComponent extends BaseResourceCompo
|
|
|
81
89
|
EditDocVectorIndexID: string;
|
|
82
90
|
EditDocStatus: string;
|
|
83
91
|
EditDocTemplate: string;
|
|
92
|
+
/** Entity Document Type of the document being edited. Fixed at creation, shown read-only. */
|
|
93
|
+
EditDocType: string;
|
|
84
94
|
IsEditRegenerating: boolean;
|
|
85
95
|
/** Parse {{ FieldName }} patterns from the edit panel's template */
|
|
86
96
|
get EditDocSelectedFields(): string[];
|
|
@@ -145,20 +155,29 @@ export declare class VectorManagementResourceComponent extends BaseResourceCompo
|
|
|
145
155
|
}[];
|
|
146
156
|
/** Selected vector index ID — if user picks an existing one */
|
|
147
157
|
SelectedVectorIndexID: string;
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
/**
|
|
159
|
+
* The indexes the suggestion panel offers: those in the selected database built with the selected
|
|
160
|
+
* embedding model, so a chosen index can never store a different model than the one shown.
|
|
161
|
+
*/
|
|
162
|
+
get FilteredIndexesForSelectedDB(): VectorIndexOption[];
|
|
163
|
+
/** The indexes the edit panel offers, matched to its database and embedding model the same way. */
|
|
164
|
+
get EditFilteredIndexes(): VectorIndexOption[];
|
|
165
|
+
/** Suggestion panel: picking an index moves the model and database dropdowns to its values. */
|
|
166
|
+
OnSuggestVectorIndexChange(indexID: string): void;
|
|
167
|
+
/** Suggestion panel: a chosen index from another database goes back to Auto. */
|
|
168
|
+
OnSuggestVectorDBChange(databaseID: string): void;
|
|
169
|
+
/** Suggestion panel: a chosen index built with another model goes back to Auto. */
|
|
170
|
+
OnSuggestEmbeddingModelChange(embeddingModelID: string): void;
|
|
171
|
+
/** Edit panel: picking an index moves the model and database dropdowns to its values. */
|
|
172
|
+
OnEditVectorIndexChange(indexID: string): void;
|
|
173
|
+
/** Edit panel: a chosen index from another database goes back to Auto. */
|
|
174
|
+
OnEditVectorDBChange(databaseID: string): void;
|
|
175
|
+
/** Edit panel: a chosen index built with another model goes back to Auto. */
|
|
176
|
+
OnEditEmbeddingModelChange(embeddingModelID: string): void;
|
|
177
|
+
private get suggestSelection();
|
|
178
|
+
private applySuggestSelection;
|
|
179
|
+
private get editSelection();
|
|
180
|
+
private applyEditSelection;
|
|
162
181
|
/** Grouped entity list for the suggestion panel — schemas as groups, entities as items */
|
|
163
182
|
EntityGroups: {
|
|
164
183
|
SchemaName: string;
|
|
@@ -323,6 +342,51 @@ export declare class VectorManagementResourceComponent extends BaseResourceCompo
|
|
|
323
342
|
private resolveOrCreateVectorIndex;
|
|
324
343
|
/** Create a Template + TemplateContent record for the entity document */
|
|
325
344
|
private createTemplateForDocument;
|
|
345
|
+
/** The Template name this dialog deterministically gives the current document. */
|
|
346
|
+
private templateNameForDocument;
|
|
347
|
+
/**
|
|
348
|
+
* The Entity Document for the current dialog, reusing the row an earlier attempt created
|
|
349
|
+
* rather than adding a second one.
|
|
350
|
+
*
|
|
351
|
+
* This flow writes three rows — Template, Template Content, Entity Document — in that
|
|
352
|
+
* order, and only the last is protected by a unique index (`UQ_EntityDocument_Name` on
|
|
353
|
+
* `EntityDocument.Name`). So a duplicate was not a rare partial-failure case: that index
|
|
354
|
+
* guarantees a second attempt with the same name fails at the final step, *after* the
|
|
355
|
+
* Template and Template Content rows have been written again. Orphans accumulated one
|
|
356
|
+
* pair per retry.
|
|
357
|
+
*
|
|
358
|
+
* Matched on Name, because that is the identity the database itself enforces.
|
|
359
|
+
*
|
|
360
|
+
* An existing document is adopted only when this dialog created it — its TemplateID points
|
|
361
|
+
* at the template named `Template for <document name>` — and only for the same entity, so a
|
|
362
|
+
* retry never moves another entity's document. A collision with a document
|
|
363
|
+
* authored anywhere else is refused, because silently overwriting somebody's configured
|
|
364
|
+
* document is worse than asking for a different name.
|
|
365
|
+
*/
|
|
366
|
+
private findOrCreateEntityDocument;
|
|
367
|
+
/**
|
|
368
|
+
* The Template for the current document, reusing an earlier attempt's row.
|
|
369
|
+
*
|
|
370
|
+
* An adopted Entity Document already points at its template (findOrCreateEntityDocument
|
|
371
|
+
* checked its name), so that row is reused by ID. Matching it on Name + UserID instead
|
|
372
|
+
* misses it when another user created it, writes a second template, re-points the document
|
|
373
|
+
* and orphans the first Template and Template Content.
|
|
374
|
+
*
|
|
375
|
+
* For a new document, matched on Name + UserID: `Template` carries no unique index, and that
|
|
376
|
+
* pair is exactly what this flow writes, so it identifies our own prior row without claiming
|
|
377
|
+
* anyone else's.
|
|
378
|
+
*/
|
|
379
|
+
private findOrCreateTemplate;
|
|
380
|
+
/**
|
|
381
|
+
* The Template Content row for a template, reusing the one it already has.
|
|
382
|
+
*
|
|
383
|
+
* `Priority ASC`, first row, is how loadEditDocTemplate and saveEditDocTemplate already
|
|
384
|
+
* identify "the" content of a template — this follows that convention rather than adding
|
|
385
|
+
* a second one.
|
|
386
|
+
*/
|
|
387
|
+
private findOrCreateTemplateContent;
|
|
388
|
+
/** True when the template with this ID carries the given name. */
|
|
389
|
+
private templateHasName;
|
|
326
390
|
/** Build grouped entity list from metadata, grouped by SchemaName */
|
|
327
391
|
private loadEntityGroups;
|
|
328
392
|
private updateRowStatus;
|
|
@@ -336,6 +400,11 @@ export declare class VectorManagementResourceComponent extends BaseResourceCompo
|
|
|
336
400
|
private callSuggestionPrompt;
|
|
337
401
|
/** Find the Entity Document Suggestion prompt from AIEngineBase */
|
|
338
402
|
private findSuggestionPrompt;
|
|
403
|
+
/**
|
|
404
|
+
* What a document for this use case embeds its fields for. Only a duplicate-detection document
|
|
405
|
+
* may embed a date of birth (see sensitive-fields.ts).
|
|
406
|
+
*/
|
|
407
|
+
private vectorFieldPurpose;
|
|
339
408
|
/** Build the data payload for the suggestion prompt */
|
|
340
409
|
private buildPromptData;
|
|
341
410
|
static ɵfac: i0.ɵɵFactoryDeclaration<VectorManagementResourceComponent, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-management-resource.component.d.ts","sourceRoot":"","sources":["../../../../src/AI/components/vectors/vector-management-resource.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAgC,SAAS,EAAE,aAAa,EAAoB,UAAU,EAAU,MAAM,eAAe,CAAC;AAC7H,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EACH,YAAY,EAEZ,sBAAsB,EAMzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAmB,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;;
|
|
1
|
+
{"version":3,"file":"vector-management-resource.component.d.ts","sourceRoot":"","sources":["../../../../src/AI/components/vectors/vector-management-resource.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAgC,SAAS,EAAE,aAAa,EAAoB,UAAU,EAAU,MAAM,eAAe,CAAC;AAC7H,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EACH,YAAY,EAEZ,sBAAsB,EAMzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAmB,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAS5D,OAAO,EAMH,iBAAiB,EAEpB,MAAM,0BAA0B,CAAC;;AAmBlC,8CAA8C;AAC9C,UAAU,aAAa;IACnB,gBAAgB,EAAE,MAAM,CA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