@ai-matrx/records 0.96.3 → 0.96.5
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/CHANGELOG.md +12 -0
- package/dist/memory/index.cjs +21 -3
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +21 -3
- package/dist/memory/index.js.map +1 -1
- package/dist/templates/index.cjs +32 -13
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +32 -13
- package/dist/templates/index.js.map +1 -1
- package/dist/{types-BhGs3f8s.d.cts → types-KdeN9-5L.d.cts} +11 -3
- package/dist/{types-DAruHh1G.d.ts → types-qvGJwpw3.d.ts} +11 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentSnapshotRow, T as TemplateSpec, a as TemplateTable, S as SharedBlockId, C as CapabilityWord, b as TemplateField, c as TemplateAgent, d as TemplateAutomation, e as TemplateBooking, f as TemplateChecklist, g as TemplateDashboard, h as TemplateDigest, i as TemplateDocument, j as TemplateDrillDown, k as TemplateDimensions, l as TemplateForm, m as TemplateNotification, n as TemplatePortal, o as TemplateRowAction, p as TemplateStageRules, q as TemplateView, r as TemplateMergeBinding, s as TemplateTryIt, t as TemplateWorkflow, u as TemplateFootprint, I as IndustryGroup, v as TemplateJob, w as TeachesFeature, x as TemplateViewKind, y as TemplateBookingWindow } from '../types-
|
|
2
|
-
export { z as CAPABILITY_WORDS, B as CATALOGUE_QUOTAS, D as CATALOGUE_STATUSES, E as CHOICE_COLORS, F as CHOICE_COLORS_DISTINCT_UP_TO, G as CatalogueRow, H as CatalogueStatus, J as ChoiceColor, K as ConfidentialLevel, L as ConfidentialRequest, M as DEFAULT_TEMPLATE_AGENT, N as ENTITY_REFERENCE_KINDS, O as INDUSTRY_GROUPS, R as RELATIVE_DATE, P as RetiredId, Q as SHARED_BLOCKS, U as SHARED_BLOCK_IDS, V as STRENGTHS, W as SharedBlock, X as SharedBlockField, Y as SharedBlockUse, Z as Strength, _ as TABLE_KERNEL_ID, $ as TEACHES_FEATURES, a0 as TEMPLATE_AUDIENCES, a1 as TEMPLATE_EXTRA_KINDS, a2 as TEMPLATE_JOBS, a3 as TEMPLATE_REFERENCE_DATE, a4 as TEMPLATE_SPEC_VERSION, a5 as TEMPLATE_VIEW_KINDS, a6 as TemplateAgentQuestion, a7 as TemplateAgentVariable, a8 as TemplateAudience, a9 as TemplateCalendarView, aa as TemplateChecklistStep, ab as TemplateConfidential, ac as TemplateConfidentialReader, ad as TemplateDashboardBlock, ae as TemplateDimensionOverride, af as TemplateDrillPath, ag as TemplateExtra, ah as TemplateExtraAgent, ai as TemplateExtraAgentVariable, aj as TemplateExtraKind, ak as TemplateFormField, al as TemplateFoundation, am as TemplateGalleryView, an as TemplateGridView, ao as TemplateGuideStep, ap as TemplateKanbanView, aq as TemplateMeasureOverride, ar as TemplatePortalTable, as as TemplateProvenance, at as TemplateSource, au as TemplateTableSettings, av as TemplateTimelineView, aw as TemplateViewSort, ax as UseCaseSingulars, ay as WalkAction, az as WalkAssertion, aA as WalkImport, aB as WalkMove, aC as WalkStep, aD as confidentialPending, aE as confidentialRequests, aF as footprintOf, aG as membersAddRowsSteps, aH as tableSettingsProblems, aI as whenRule } from '../types-
|
|
1
|
+
import { A as AgentSnapshotRow, T as TemplateSpec, a as TemplateTable, S as SharedBlockId, C as CapabilityWord, b as TemplateField, c as TemplateAgent, d as TemplateAutomation, e as TemplateBooking, f as TemplateChecklist, g as TemplateDashboard, h as TemplateDigest, i as TemplateDocument, j as TemplateDrillDown, k as TemplateDimensions, l as TemplateForm, m as TemplateNotification, n as TemplatePortal, o as TemplateRowAction, p as TemplateStageRules, q as TemplateView, r as TemplateMergeBinding, s as TemplateTryIt, t as TemplateWorkflow, u as TemplateFootprint, I as IndustryGroup, v as TemplateJob, w as TeachesFeature, x as TemplateViewKind, y as TemplateBookingWindow } from '../types-KdeN9-5L.cjs';
|
|
2
|
+
export { z as CAPABILITY_WORDS, B as CATALOGUE_QUOTAS, D as CATALOGUE_STATUSES, E as CHOICE_COLORS, F as CHOICE_COLORS_DISTINCT_UP_TO, G as CatalogueRow, H as CatalogueStatus, J as ChoiceColor, K as ConfidentialLevel, L as ConfidentialRequest, M as DEFAULT_TEMPLATE_AGENT, N as ENTITY_REFERENCE_KINDS, O as INDUSTRY_GROUPS, R as RELATIVE_DATE, P as RetiredId, Q as SHARED_BLOCKS, U as SHARED_BLOCK_IDS, V as STRENGTHS, W as SharedBlock, X as SharedBlockField, Y as SharedBlockUse, Z as Strength, _ as TABLE_KERNEL_ID, $ as TEACHES_FEATURES, a0 as TEMPLATE_AUDIENCES, a1 as TEMPLATE_EXTRA_KINDS, a2 as TEMPLATE_JOBS, a3 as TEMPLATE_REFERENCE_DATE, a4 as TEMPLATE_SPEC_VERSION, a5 as TEMPLATE_VIEW_KINDS, a6 as TemplateAgentQuestion, a7 as TemplateAgentVariable, a8 as TemplateAudience, a9 as TemplateCalendarView, aa as TemplateChecklistStep, ab as TemplateConfidential, ac as TemplateConfidentialReader, ad as TemplateDashboardBlock, ae as TemplateDimensionOverride, af as TemplateDrillPath, ag as TemplateExtra, ah as TemplateExtraAgent, ai as TemplateExtraAgentVariable, aj as TemplateExtraKind, ak as TemplateFormField, al as TemplateFoundation, am as TemplateGalleryView, an as TemplateGridView, ao as TemplateGuideStep, ap as TemplateKanbanView, aq as TemplateMeasureOverride, ar as TemplatePortalTable, as as TemplateProvenance, at as TemplateSource, au as TemplateTableSettings, av as TemplateTimelineView, aw as TemplateViewSort, ax as UseCaseSingulars, ay as WalkAction, az as WalkAssertion, aA as WalkImport, aB as WalkMove, aC as WalkStep, aD as confidentialPending, aE as confidentialRequests, aF as footprintOf, aG as membersAddRowsSteps, aH as tableSettingsProblems, aI as whenRule } from '../types-KdeN9-5L.cjs';
|
|
3
3
|
import { c as AggregateMeasure, b as AggregateFilter } from '../subscription-ycCVo9e2.cjs';
|
|
4
4
|
import { U as UseCase, o as UseCaseRelationship } from '../types-DtEP7XLv.cjs';
|
|
5
5
|
import { U as UseCaseProblem } from '../validate-QdnFP97_.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentSnapshotRow, T as TemplateSpec, a as TemplateTable, S as SharedBlockId, C as CapabilityWord, b as TemplateField, c as TemplateAgent, d as TemplateAutomation, e as TemplateBooking, f as TemplateChecklist, g as TemplateDashboard, h as TemplateDigest, i as TemplateDocument, j as TemplateDrillDown, k as TemplateDimensions, l as TemplateForm, m as TemplateNotification, n as TemplatePortal, o as TemplateRowAction, p as TemplateStageRules, q as TemplateView, r as TemplateMergeBinding, s as TemplateTryIt, t as TemplateWorkflow, u as TemplateFootprint, I as IndustryGroup, v as TemplateJob, w as TeachesFeature, x as TemplateViewKind, y as TemplateBookingWindow } from '../types-
|
|
2
|
-
export { z as CAPABILITY_WORDS, B as CATALOGUE_QUOTAS, D as CATALOGUE_STATUSES, E as CHOICE_COLORS, F as CHOICE_COLORS_DISTINCT_UP_TO, G as CatalogueRow, H as CatalogueStatus, J as ChoiceColor, K as ConfidentialLevel, L as ConfidentialRequest, M as DEFAULT_TEMPLATE_AGENT, N as ENTITY_REFERENCE_KINDS, O as INDUSTRY_GROUPS, R as RELATIVE_DATE, P as RetiredId, Q as SHARED_BLOCKS, U as SHARED_BLOCK_IDS, V as STRENGTHS, W as SharedBlock, X as SharedBlockField, Y as SharedBlockUse, Z as Strength, _ as TABLE_KERNEL_ID, $ as TEACHES_FEATURES, a0 as TEMPLATE_AUDIENCES, a1 as TEMPLATE_EXTRA_KINDS, a2 as TEMPLATE_JOBS, a3 as TEMPLATE_REFERENCE_DATE, a4 as TEMPLATE_SPEC_VERSION, a5 as TEMPLATE_VIEW_KINDS, a6 as TemplateAgentQuestion, a7 as TemplateAgentVariable, a8 as TemplateAudience, a9 as TemplateCalendarView, aa as TemplateChecklistStep, ab as TemplateConfidential, ac as TemplateConfidentialReader, ad as TemplateDashboardBlock, ae as TemplateDimensionOverride, af as TemplateDrillPath, ag as TemplateExtra, ah as TemplateExtraAgent, ai as TemplateExtraAgentVariable, aj as TemplateExtraKind, ak as TemplateFormField, al as TemplateFoundation, am as TemplateGalleryView, an as TemplateGridView, ao as TemplateGuideStep, ap as TemplateKanbanView, aq as TemplateMeasureOverride, ar as TemplatePortalTable, as as TemplateProvenance, at as TemplateSource, au as TemplateTableSettings, av as TemplateTimelineView, aw as TemplateViewSort, ax as UseCaseSingulars, ay as WalkAction, az as WalkAssertion, aA as WalkImport, aB as WalkMove, aC as WalkStep, aD as confidentialPending, aE as confidentialRequests, aF as footprintOf, aG as membersAddRowsSteps, aH as tableSettingsProblems, aI as whenRule } from '../types-
|
|
1
|
+
import { A as AgentSnapshotRow, T as TemplateSpec, a as TemplateTable, S as SharedBlockId, C as CapabilityWord, b as TemplateField, c as TemplateAgent, d as TemplateAutomation, e as TemplateBooking, f as TemplateChecklist, g as TemplateDashboard, h as TemplateDigest, i as TemplateDocument, j as TemplateDrillDown, k as TemplateDimensions, l as TemplateForm, m as TemplateNotification, n as TemplatePortal, o as TemplateRowAction, p as TemplateStageRules, q as TemplateView, r as TemplateMergeBinding, s as TemplateTryIt, t as TemplateWorkflow, u as TemplateFootprint, I as IndustryGroup, v as TemplateJob, w as TeachesFeature, x as TemplateViewKind, y as TemplateBookingWindow } from '../types-qvGJwpw3.js';
|
|
2
|
+
export { z as CAPABILITY_WORDS, B as CATALOGUE_QUOTAS, D as CATALOGUE_STATUSES, E as CHOICE_COLORS, F as CHOICE_COLORS_DISTINCT_UP_TO, G as CatalogueRow, H as CatalogueStatus, J as ChoiceColor, K as ConfidentialLevel, L as ConfidentialRequest, M as DEFAULT_TEMPLATE_AGENT, N as ENTITY_REFERENCE_KINDS, O as INDUSTRY_GROUPS, R as RELATIVE_DATE, P as RetiredId, Q as SHARED_BLOCKS, U as SHARED_BLOCK_IDS, V as STRENGTHS, W as SharedBlock, X as SharedBlockField, Y as SharedBlockUse, Z as Strength, _ as TABLE_KERNEL_ID, $ as TEACHES_FEATURES, a0 as TEMPLATE_AUDIENCES, a1 as TEMPLATE_EXTRA_KINDS, a2 as TEMPLATE_JOBS, a3 as TEMPLATE_REFERENCE_DATE, a4 as TEMPLATE_SPEC_VERSION, a5 as TEMPLATE_VIEW_KINDS, a6 as TemplateAgentQuestion, a7 as TemplateAgentVariable, a8 as TemplateAudience, a9 as TemplateCalendarView, aa as TemplateChecklistStep, ab as TemplateConfidential, ac as TemplateConfidentialReader, ad as TemplateDashboardBlock, ae as TemplateDimensionOverride, af as TemplateDrillPath, ag as TemplateExtra, ah as TemplateExtraAgent, ai as TemplateExtraAgentVariable, aj as TemplateExtraKind, ak as TemplateFormField, al as TemplateFoundation, am as TemplateGalleryView, an as TemplateGridView, ao as TemplateGuideStep, ap as TemplateKanbanView, aq as TemplateMeasureOverride, ar as TemplatePortalTable, as as TemplateProvenance, at as TemplateSource, au as TemplateTableSettings, av as TemplateTimelineView, aw as TemplateViewSort, ax as UseCaseSingulars, ay as WalkAction, az as WalkAssertion, aA as WalkImport, aB as WalkMove, aC as WalkStep, aD as confidentialPending, aE as confidentialRequests, aF as footprintOf, aG as membersAddRowsSteps, aH as tableSettingsProblems, aI as whenRule } from '../types-qvGJwpw3.js';
|
|
3
3
|
import { c as AggregateMeasure, b as AggregateFilter } from '../subscription-DucBLG-Y.js';
|
|
4
4
|
import { U as UseCase, o as UseCaseRelationship } from '../types-D31PewA2.js';
|
|
5
5
|
import { U as UseCaseProblem } from '../validate-BWqeG2sK.js';
|
package/dist/templates/index.js
CHANGED
|
@@ -3797,7 +3797,7 @@ function validateTemplate(raw, options = {}) {
|
|
|
3797
3797
|
const keys = /* @__PURE__ */ new Set([...Object.keys(a.values ?? {}), ...Object.keys(b.values ?? {})]);
|
|
3798
3798
|
let differ = 0;
|
|
3799
3799
|
for (const k of keys) if (!sameJson(a.values?.[k] ?? null, b.values?.[k] ?? null)) differ += 1;
|
|
3800
|
-
if (differ < 3) say(`tables[0] (${main.token}).rows[${j}] (${b.key})`, `"${storeText(b.values?.[main.titleField])}" differs from "${storeText(a.values?.[main.titleField])}" in only ${differ} field(s); two real ${main.labelPlural.toLowerCase()} differ in at least three.`);
|
|
3800
|
+
if (differ < Math.min(3, keys.size)) say(`tables[0] (${main.token}).rows[${j}] (${b.key})`, `"${storeText(b.values?.[main.titleField])}" differs from "${storeText(a.values?.[main.titleField])}" in only ${differ} field(s); two real ${main.labelPlural.toLowerCase()} differ in at least three.`);
|
|
3801
3801
|
}
|
|
3802
3802
|
}
|
|
3803
3803
|
}
|
|
@@ -5955,11 +5955,28 @@ function compileInstallPlan(written) {
|
|
|
5955
5955
|
const spec = tokenizeValues({ ...written, attachments: void 0 }, attachmentKeys);
|
|
5956
5956
|
const bound = new Map(allTables(spec).filter((t) => t.bindsTo?.tableId).map((t) => [t.token, t.bindsTo]));
|
|
5957
5957
|
const has = (token, key) => bound.get(token)?.fields.includes(key) ?? false;
|
|
5958
|
+
const resolves = (target, v) => {
|
|
5959
|
+
const b = bound.get(target);
|
|
5960
|
+
return !b || !!b.seedRows || typeof v === "string" && !!b.rowIds?.[v];
|
|
5961
|
+
};
|
|
5958
5962
|
const tables = allTables(spec).map((t) => {
|
|
5959
|
-
if (bound.has(t.token)) return { ...t, rows: [] };
|
|
5960
|
-
const toBound = t.fields.filter((f) => f.parityType === "relation" && f.relationTarget && bound.has(f.relationTarget))
|
|
5963
|
+
if (bound.has(t.token)) return bound.get(t.token).seedRows ? t : { ...t, rows: [] };
|
|
5964
|
+
const toBound = t.fields.filter((f) => f.parityType === "relation" && f.relationTarget && bound.has(f.relationTarget));
|
|
5961
5965
|
if (!toBound.length) return t;
|
|
5962
|
-
|
|
5966
|
+
const lost = /* @__PURE__ */ new Set();
|
|
5967
|
+
const rows = t.rows.map((r) => {
|
|
5968
|
+
const values = { ...r.values ?? {} };
|
|
5969
|
+
for (const f of toBound) {
|
|
5970
|
+
const v = values[f.key];
|
|
5971
|
+
if (v === null || v === void 0) continue;
|
|
5972
|
+
const keep = Array.isArray(v) ? v.filter((x) => resolves(f.relationTarget, x)) : resolves(f.relationTarget, v) ? v : null;
|
|
5973
|
+
if (Array.isArray(keep) ? keep.length < v.length : keep === null) lost.add(f.key);
|
|
5974
|
+
if (keep === null || Array.isArray(keep) && !keep.length) delete values[f.key];
|
|
5975
|
+
else values[f.key] = keep;
|
|
5976
|
+
}
|
|
5977
|
+
return { ...r, values };
|
|
5978
|
+
});
|
|
5979
|
+
return { ...t, rows, fields: t.fields.map((f) => lost.has(f.key) && f.required ? { ...f, required: false } : f) };
|
|
5963
5980
|
});
|
|
5964
5981
|
const steps = [];
|
|
5965
5982
|
const tableRef = (token) => {
|
|
@@ -6035,6 +6052,7 @@ function compileInstallPlan(written) {
|
|
|
6035
6052
|
}
|
|
6036
6053
|
const rowIds = /* @__PURE__ */ new Map();
|
|
6037
6054
|
for (const t of tables) for (const r of t.rows) rowIds.set(`${t.token}.${r.key}`, minted(`row.${t.token}.${r.key}`));
|
|
6055
|
+
for (const [token, b] of bound) if (!b.seedRows) for (const [key, id] of Object.entries(b.rowIds ?? {})) rowIds.set(`${token}.${key}`, id);
|
|
6038
6056
|
const deferred = deferredRelations(tables);
|
|
6039
6057
|
for (const level of rowLevels(tables)) {
|
|
6040
6058
|
for (const t of level) {
|
|
@@ -7494,17 +7512,18 @@ function describeCheck(spec, ctx = {}) {
|
|
|
7494
7512
|
for (let round = 0; round < 3; round++) {
|
|
7495
7513
|
const bad = rowProblemTables(fixed.spec, problems);
|
|
7496
7514
|
if (!bad.size) break;
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
}
|
|
7515
|
+
const unlinked = [];
|
|
7516
|
+
for (const t of fixed.spec.tables) {
|
|
7517
|
+
if (bad.has(t.token) || !t.rows?.length) continue;
|
|
7518
|
+
const links = t.fields.filter((f) => f.relationTarget && bad.has(f.relationTarget) && t.rows.some((r) => r.values?.[f.key] != null));
|
|
7519
|
+
if (!links.length) continue;
|
|
7520
|
+
for (const f of links) {
|
|
7521
|
+
for (const r of t.rows) if (r.values) delete r.values[f.key];
|
|
7522
|
+
f.required = false;
|
|
7506
7523
|
}
|
|
7524
|
+
unlinked.push(`tables.${t.token}.rows: kept without their ${links.map((f) => f.label || f.key).join(" / ")} link (the rows they pointed at were left out)`);
|
|
7507
7525
|
}
|
|
7526
|
+
fixed.autoFixes.push(...unlinked);
|
|
7508
7527
|
for (const t of fixed.spec.tables) {
|
|
7509
7528
|
if (!bad.has(t.token) || !t.rows?.length) continue;
|
|
7510
7529
|
const why = problems.find((p) => ROW_AT.exec(p.at)?.[1] === t.token)?.says ?? "they did not pass the check";
|