@elementumai/edk 0.9.20 → 0.10.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/README.md +19 -7
- package/dist-sdk/src/catalog/factories.d.ts +10 -2
- package/dist-sdk/src/catalog/factories.js +10 -1
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/token.js +4 -0
- package/dist-sdk/src/catalog/types.d.ts +7 -1
- package/dist-sdk/src/catalog/types.js +1 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -2
- package/dist-sdk/src/core/triggers/on-demand.js +7 -0
- package/dist-sdk/src/core/types/app.d.ts +2 -2
- package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
- package/dist-sdk/src/engine/coverage-gaps.js +156 -0
- package/dist-sdk/src/engine/ei/run.d.ts +21 -1
- package/dist-sdk/src/engine/ei/run.js +89 -2
- package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
- package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
- package/dist-sdk/src/engine/pull/context.d.ts +68 -6
- package/dist-sdk/src/engine/pull/context.js +40 -1
- package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
- package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
- package/dist-sdk/src/engine/pull/result-output.js +27 -1
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/labels.d.ts +22 -5
- package/dist-sdk/src/engine/tf/labels.js +45 -3
- package/dist-sdk/src/engine/tf/parse.js +3 -2
- package/dist-sdk/src/engine/validation.d.ts +5 -0
- package/dist-sdk/src/engine/validation.js +12 -2
- package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
- package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +42 -19
- package/dist-sdk/src/entities/agent/from-tf.js +11 -3
- package/dist-sdk/src/entities/agent/module.js +2 -0
- package/dist-sdk/src/entities/agent/to-tf.js +14 -3
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -1
- package/dist-sdk/src/entities/agent-tool/from-tf.js +11 -5
- package/dist-sdk/src/entities/agent-tool/module.js +3 -0
- package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
- package/dist-sdk/src/entities/app/auto-share.js +49 -0
- package/dist-sdk/src/entities/app/build.d.ts +17 -3
- package/dist-sdk/src/entities/app/build.js +56 -4
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +6 -1
- package/dist-sdk/src/entities/app/from-tf.js +4 -0
- package/dist-sdk/src/entities/app/index.d.ts +2 -1
- package/dist-sdk/src/entities/app/index.js +1 -8
- package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/app/to-tf.js +21 -2
- package/dist-sdk/src/entities/automation/build.d.ts +10 -2
- package/dist-sdk/src/entities/automation/build.js +104 -17
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +17 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +156 -19
- package/dist-sdk/src/entities/automation/from-tf.d.ts +9 -2
- package/dist-sdk/src/entities/automation/from-tf.js +366 -86
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +70 -7
- package/dist-sdk/src/entities/automation/script-code.d.ts +5 -2
- package/dist-sdk/src/entities/automation/script-code.js +23 -5
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +37 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +76 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +92 -20
- package/dist-sdk/src/entities/automation/tasks.js +48 -15
- package/dist-sdk/src/entities/automation/to-tf.d.ts +20 -3
- package/dist-sdk/src/entities/automation/to-tf.js +606 -62
- package/dist-sdk/src/entities/automation/triggers.d.ts +8 -4
- package/dist-sdk/src/entities/automation/types.d.ts +9 -0
- package/dist-sdk/src/entities/automation/types.js +19 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
- package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
- package/dist-sdk/src/entities/chart/from-tf.js +9 -1
- package/dist-sdk/src/entities/data-lookup/module.js +2 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
- package/dist-sdk/src/entities/element/build.d.ts +3 -0
- package/dist-sdk/src/entities/element/build.js +1 -0
- package/dist-sdk/src/entities/element/from-tf.js +4 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/element/to-tf.js +8 -14
- package/dist-sdk/src/entities/field/build.d.ts +3 -2
- package/dist-sdk/src/entities/field/calc.d.ts +7 -7
- package/dist-sdk/src/entities/field/from-tf.d.ts +4 -4
- package/dist-sdk/src/entities/field/from-tf.js +205 -48
- package/dist-sdk/src/entities/field/module.js +1 -0
- package/dist-sdk/src/entities/field/options.js +6 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +4 -4
- package/dist-sdk/src/entities/field/to-tf.js +7 -1
- package/dist-sdk/src/entities/field/types.d.ts +2 -0
- package/dist-sdk/src/entities/field/types.js +27 -0
- package/dist-sdk/src/entities/role/from-tf.js +3 -3
- package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/role/to-tf.js +12 -4
- package/dist-sdk/src/entities/service-account/from-tf.js +3 -3
- package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +15 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +5 -0
- package/dist-sdk/src/entities/shared/filters/index.js +5 -0
- package/dist-sdk/src/entities/shared/filters/print.js +7 -2
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +5 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +42 -7
- package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -3
- package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
- package/dist-sdk/src/entities/shared/ref.js +5 -7
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +4 -0
- package/dist-sdk/src/entities/skill/access-policy.js +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +12 -5
- package/dist-sdk/src/entities/skill/from-tf.js +4 -2
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +41 -8
- package/dist-sdk/src/entities/skill-tool/module.js +3 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +0 -6
- package/dist-sdk/src/entities/skill-tool/to-tf.js +22 -9
- package/dist-sdk/src/entities/task/build.d.ts +8 -0
- package/dist-sdk/src/entities/task/build.js +10 -1
- package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/task/from-tf.js +7 -2
- package/dist-sdk/src/entities/task/module.js +2 -2
- package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
- package/dist-sdk/src/entities/task/to-tf.js +28 -1
- package/dist-sdk/src/entities/view/from-tf.js +9 -1
- package/dist-sdk/src/entities/view/to-tf.d.ts +6 -7
- package/dist-sdk/src/entities/view/to-tf.js +19 -8
- package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
- package/dist-sdk/src/entities/visual-flow/build.js +9 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/index.js +1 -1
- package/dist-sdk/src/entities/visual-flow/printer.js +19 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
- package/dist-sdk/src/entities/widget/from-tf.js +3 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/widget/to-tf.js +7 -6
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +133 -9
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +1 -0
- package/dist-sdk/src/graph/types.d.ts +29 -3
- package/package.json +7 -3
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* Platform ids never reach printed source (plan §4.2).
|
|
12
12
|
*/
|
|
13
13
|
import { quote } from "../../../../pull/util.js";
|
|
14
|
+
import { catalogRefForFieldOwner } from "../../../engine/pull/catalog-ref.js";
|
|
14
15
|
import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
|
|
15
16
|
import { safeIdentifier } from "../../../internal/safe-identifier.js";
|
|
16
17
|
const TOOL_FACTORY_BY_TYPE_KEY = {
|
|
@@ -107,8 +108,8 @@ export function printAgentV2(agent, opts) {
|
|
|
107
108
|
const targetOwner = searchTableTargetOwnerRefName(tool, appRefName, opts.foreignAppRefNames, opts.foreignElementRefNames);
|
|
108
109
|
return ((tool.filterVariables?.length ?? 0) > 0 ||
|
|
109
110
|
tool.fields?.some((field) => field.rawFieldId !== undefined) === true ||
|
|
110
|
-
tool.searchTableFields?.some((field) => !searchTableFieldMatchesTarget(field.fieldId, targetOwner, opts.foreignFieldRefsById)) === true ||
|
|
111
|
-
tool.returnFields?.some((field) => !searchTableFieldMatchesTarget(field.fieldId, targetOwner, opts.foreignFieldRefsById)) === true ||
|
|
111
|
+
tool.searchTableFields?.some((field) => field.fieldId !== undefined && !searchTableFieldMatchesTarget(field.fieldId, targetOwner, opts.foreignFieldRefsById, opts.foreignAppRefNamespaces, opts.foreignElementRefNamespaces)) === true ||
|
|
112
|
+
tool.returnFields?.some((field) => !searchTableFieldMatchesTarget(field.fieldId, targetOwner, opts.foreignFieldRefsById, opts.foreignAppRefNamespaces, opts.foreignElementRefNamespaces)) === true ||
|
|
112
113
|
tool.target?.kind === "unresolved" ||
|
|
113
114
|
tool.relatedTarget?.kind === "unresolved" ||
|
|
114
115
|
tool.searchTableRawId !== undefined);
|
|
@@ -197,7 +198,7 @@ export function printAgentV2(agent, opts) {
|
|
|
197
198
|
if (agent.tools.length > 0) {
|
|
198
199
|
lines.push(" tools: [");
|
|
199
200
|
for (const tool of agent.tools) {
|
|
200
|
-
lines.push(...printTool(tool, appRefName, crossOrg, opts.foreignAppRefNames, opts.foreignElementRefNames, opts.foreignTaskRefNames, opts.foreignSearchTableRefsByName, opts.foreignFieldRefsById).map((l) => ` ${l}`));
|
|
201
|
+
lines.push(...printTool(tool, appRefName, crossOrg, opts.foreignAppRefNames, opts.foreignElementRefNames, opts.foreignTaskRefNames, opts.foreignSearchTableRefsByName, opts.foreignFieldRefsById, opts.foreignAppRefNamespaces, opts.foreignElementRefNamespaces).map((l) => ` ${l}`));
|
|
201
202
|
}
|
|
202
203
|
lines.push(" ],");
|
|
203
204
|
}
|
|
@@ -414,11 +415,14 @@ function searchTableTargetOwnerRefName(tool, appRefName, foreignAppRefNames, for
|
|
|
414
415
|
* to the tool's own target. A global hit for a different dependency would print
|
|
415
416
|
* `catalog.other.fields.x`, which fails the owner-bound authoring type.
|
|
416
417
|
*/
|
|
417
|
-
function searchTableFieldMatchesTarget(fieldId, targetOwnerRefName, foreignFieldRefsById) {
|
|
418
|
+
function searchTableFieldMatchesTarget(fieldId, targetOwnerRefName, foreignFieldRefsById, foreignAppRefNamespaces, foreignElementRefNamespaces) {
|
|
418
419
|
const resolved = foreignFieldRefsById?.get(fieldId);
|
|
419
|
-
|
|
420
|
+
if (resolved === undefined || targetOwnerRefName === undefined)
|
|
421
|
+
return false;
|
|
422
|
+
const owner = catalogRefForFieldOwner(resolved.ownerRefName, foreignAppRefNamespaces, foreignElementRefNamespaces);
|
|
423
|
+
return owner === targetOwnerRefName || resolved.ownerRefName === targetOwnerRefName;
|
|
420
424
|
}
|
|
421
|
-
function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElementRefNames, foreignTaskRefNames, foreignSearchTableRefsByName, foreignFieldRefsById) {
|
|
425
|
+
function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElementRefNames, foreignTaskRefNames, foreignSearchTableRefsByName, foreignFieldRefsById, foreignAppRefNamespaces, foreignElementRefNamespaces) {
|
|
422
426
|
const factory = TOOL_FACTORY_BY_TYPE_KEY[tool.typeKey] ?? "agentSearchRecords";
|
|
423
427
|
const lines = [`${factory}({`];
|
|
424
428
|
lines.push(` name: ${quote(tool.name)},`);
|
|
@@ -633,7 +637,8 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
633
637
|
? undefined
|
|
634
638
|
: foreignSearchTableRefsByName?.get(JSON.stringify([parent, tool.searchTableName]));
|
|
635
639
|
if (typedTable !== undefined) {
|
|
636
|
-
|
|
640
|
+
const tableOwner = catalogRefForFieldOwner(typedTable.ownerRefName, foreignAppRefNamespaces, foreignElementRefNamespaces);
|
|
641
|
+
lines.push(` table: catalog.${tableOwner}.searchTables${safeMember(typedTable.tableKey)},`);
|
|
637
642
|
}
|
|
638
643
|
else {
|
|
639
644
|
const pinnedId = tool.searchTableId !== undefined ? `, id: ${quote(tool.searchTableId)}` : "";
|
|
@@ -686,21 +691,39 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
686
691
|
if (tool.searchTableFields !== undefined && tool.searchTableFields.length > 0) {
|
|
687
692
|
const targetOwner = searchTableTargetOwnerRefName(tool, appRefName, foreignAppRefNames, foreignElementRefNames);
|
|
688
693
|
lines.push(" fields: [");
|
|
694
|
+
const keyOwner = fieldOwnerRef(tool, appRefName, foreignAppRefNames, foreignElementRefNames);
|
|
689
695
|
for (const f of tool.searchTableFields) {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
696
|
+
let parts;
|
|
697
|
+
let todo = "";
|
|
698
|
+
if (f.key !== undefined) {
|
|
699
|
+
// field_id was already a reference to the target's field (edk#1403).
|
|
700
|
+
parts = keyOwner.kind === "catalog"
|
|
701
|
+
? [`field: ${keyOwner.expr}.fields.${f.key}`]
|
|
702
|
+
: [
|
|
703
|
+
`field: { __kind: "field", refName: ${quote(f.key)}, name: ${quote(f.name ?? f.key)}, fieldType: "TEXT", ` +
|
|
704
|
+
`parent: ${quote(keyOwner.name)}, parentKind: ${quote(keyOwner.entityType)}, parentName: ${quote(keyOwner.name)} }`,
|
|
705
|
+
];
|
|
706
|
+
if (keyOwner.kind === "raw") {
|
|
707
|
+
todo = ` // TODO: foreign field — type unconfirmed and refName is a best-effort guess; verify against "${keyOwner.name}"`;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
const fieldId = f.fieldId ?? "";
|
|
712
|
+
const resolved = foreignFieldRefsById?.get(fieldId);
|
|
713
|
+
const typed = searchTableFieldMatchesTarget(fieldId, targetOwner, foreignFieldRefsById, foreignAppRefNamespaces, foreignElementRefNamespaces)
|
|
714
|
+
? resolved
|
|
715
|
+
: undefined;
|
|
716
|
+
parts = typed === undefined
|
|
717
|
+
? [`fieldId: unsafePlatformId(${quote(fieldId)})`]
|
|
718
|
+
: [`field: catalog.${catalogRefForFieldOwner(typed.ownerRefName, foreignAppRefNamespaces, foreignElementRefNamespaces)}.fields.${typed.fieldKey}`];
|
|
719
|
+
if (typed === undefined) {
|
|
720
|
+
todo = " // TODO: unresolved search-table field id - pull the target element recursively to recover its catalog field";
|
|
721
|
+
}
|
|
722
|
+
}
|
|
697
723
|
if (f.name !== undefined)
|
|
698
724
|
parts.push(`name: ${quote(f.name)}`);
|
|
699
725
|
if (f.description !== undefined)
|
|
700
726
|
parts.push(`description: ${quote(f.description)}`);
|
|
701
|
-
const todo = typed === undefined
|
|
702
|
-
? " // TODO: unresolved search-table field id - pull the target element recursively to recover its catalog field"
|
|
703
|
-
: "";
|
|
704
727
|
lines.push(` { ${parts.join(", ")} },${todo}`);
|
|
705
728
|
}
|
|
706
729
|
lines.push(" ],");
|
|
@@ -710,12 +733,12 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
710
733
|
lines.push(" returnFields: [");
|
|
711
734
|
for (const f of tool.returnFields) {
|
|
712
735
|
const resolved = foreignFieldRefsById?.get(f.fieldId);
|
|
713
|
-
const typed = searchTableFieldMatchesTarget(f.fieldId, targetOwner, foreignFieldRefsById)
|
|
736
|
+
const typed = searchTableFieldMatchesTarget(f.fieldId, targetOwner, foreignFieldRefsById, foreignAppRefNamespaces, foreignElementRefNamespaces)
|
|
714
737
|
? resolved
|
|
715
738
|
: undefined;
|
|
716
739
|
const parts = typed === undefined
|
|
717
740
|
? [`fieldId: unsafePlatformId(${quote(f.fieldId)})`]
|
|
718
|
-
: [`field: catalog.${typed.ownerRefName}.fields.${typed.fieldKey}`];
|
|
741
|
+
: [`field: catalog.${catalogRefForFieldOwner(typed.ownerRefName, foreignAppRefNamespaces, foreignElementRefNamespaces)}.fields.${typed.fieldKey}`];
|
|
719
742
|
if (f.name !== undefined)
|
|
720
743
|
parts.push(`name: ${quote(f.name)}`);
|
|
721
744
|
if (f.displayName !== undefined)
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* shape `printAgentV2` consumes. Platform ids come only from the stream's
|
|
7
7
|
* import blocks and stay data-side — they never reach printed source.
|
|
8
8
|
*/
|
|
9
|
+
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
9
10
|
import { EntityTfError } from "../../engine/entity.js";
|
|
10
|
-
import { dataRefLabel, optionalBoolean, optionalString, plainObject, resourceRefLabel } from "../../engine/pull/context.js";
|
|
11
|
+
import { dataRefLabel, optionalBoolean, optionalString, ownerMismatchBlocker, plainObject, reportAuthoringBlocker, resourceRefLabel } from "../../engine/pull/context.js";
|
|
11
12
|
import { isTfExpr, isUuid, scopedLabelToBagKey, } from "../../engine/tf/index.js";
|
|
12
13
|
import { a2aSkillFromTf } from "../agent-a2a-skill/from-tf.js";
|
|
13
14
|
import { toolFromTf } from "../agent-tool/from-tf.js";
|
|
@@ -173,7 +174,12 @@ function parseJwtAuthentication(value, where, ctx) {
|
|
|
173
174
|
function parseStartingActionValidation(value, where, ctx) {
|
|
174
175
|
const rec = plainObject(value);
|
|
175
176
|
if (rec === undefined) {
|
|
176
|
-
ctx.diagnostics.push(
|
|
177
|
+
ctx.diagnostics.push(typedCoverageGap({
|
|
178
|
+
kind: "dropped",
|
|
179
|
+
entity: where,
|
|
180
|
+
detail: "validation has an unrecognized shape; dropped",
|
|
181
|
+
consequence: "the pulled source has no validation for this variable, so the next apply removes the live check",
|
|
182
|
+
}));
|
|
177
183
|
return undefined;
|
|
178
184
|
}
|
|
179
185
|
const pattern = optionalString(rec, "pattern", where, ctx);
|
|
@@ -380,7 +386,9 @@ export function agentFromTf(agentBlock, toolBlocks, appLabel, _appRefName, ctx,
|
|
|
380
386
|
}
|
|
381
387
|
}
|
|
382
388
|
if (resourceRefLabel(attrs["app_id"], APP_RESOURCE_TYPE) !== appLabel) {
|
|
383
|
-
|
|
389
|
+
const reason = `${where}: app_id does not reference ${APP_RESOURCE_TYPE}.${appLabel}`;
|
|
390
|
+
reportAuthoringBlocker(ctx, ownerMismatchBlocker(`${AGENT_RESOURCE_TYPE}.${label}`, reason, "agent"));
|
|
391
|
+
return { skippedReason: `${reason}; skipped` };
|
|
384
392
|
}
|
|
385
393
|
let connectorKey;
|
|
386
394
|
const connectorAttr = attrs["ai_provider_connector_id"];
|
|
@@ -102,6 +102,8 @@ export const agentModule = {
|
|
|
102
102
|
...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
|
|
103
103
|
...(opts.foreignElementRefNames !== undefined && { foreignElementRefNames: opts.foreignElementRefNames }),
|
|
104
104
|
...(opts.foreignTaskRefNames !== undefined && { foreignTaskRefNames: opts.foreignTaskRefNames }),
|
|
105
|
+
...(opts.foreignAppRefNamespaces !== undefined && { foreignAppRefNamespaces: opts.foreignAppRefNamespaces }),
|
|
106
|
+
...(opts.foreignElementRefNamespaces !== undefined && { foreignElementRefNamespaces: opts.foreignElementRefNamespaces }),
|
|
105
107
|
...(opts.foreignFieldRefsById !== undefined && { foreignFieldRefsById: opts.foreignFieldRefsById }),
|
|
106
108
|
...(opts.foreignSearchTableRefsByName !== undefined && {
|
|
107
109
|
foreignSearchTableRefsByName: opts.foreignSearchTableRefsByName,
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* still doesn't carry (temperature, reasoningEffort, …) degrade through
|
|
16
16
|
* `diagnostics` — reported, never silent (plan §4.3).
|
|
17
17
|
*/
|
|
18
|
+
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
18
19
|
import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
19
20
|
import { EntityTfError } from "../../engine/entity.js";
|
|
20
21
|
import { appScopedResourceLabel, expr, sanitizeName, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
@@ -50,7 +51,12 @@ function startingActionValidationValue(validation, variableKey, where, diagnosti
|
|
|
50
51
|
value["min_length"] = validation.minLength;
|
|
51
52
|
}
|
|
52
53
|
else {
|
|
53
|
-
diagnostics.push(
|
|
54
|
+
diagnostics.push(typedCoverageGap({
|
|
55
|
+
kind: "dropped",
|
|
56
|
+
entity: where,
|
|
57
|
+
detail: `starting action variable "${variableKey}" has non-integer validation minLength ${JSON.stringify(validation.minLength)}; dropped`,
|
|
58
|
+
consequence: "the minLength check is not enforced, so the agent accepts input of any length here",
|
|
59
|
+
}));
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
if (validation.maxLength !== undefined) {
|
|
@@ -58,7 +64,12 @@ function startingActionValidationValue(validation, variableKey, where, diagnosti
|
|
|
58
64
|
value["max_length"] = validation.maxLength;
|
|
59
65
|
}
|
|
60
66
|
else {
|
|
61
|
-
diagnostics.push(
|
|
67
|
+
diagnostics.push(typedCoverageGap({
|
|
68
|
+
kind: "dropped",
|
|
69
|
+
entity: where,
|
|
70
|
+
detail: `starting action variable "${variableKey}" has non-integer validation maxLength ${JSON.stringify(validation.maxLength)}; dropped`,
|
|
71
|
+
consequence: "the maxLength check is not enforced, so the agent accepts input of any length here",
|
|
72
|
+
}));
|
|
62
73
|
}
|
|
63
74
|
}
|
|
64
75
|
if (typeof validation.pattern === "string" && validation.pattern !== "")
|
|
@@ -438,7 +449,7 @@ export function agentToTf(entity, ctx) {
|
|
|
438
449
|
}
|
|
439
450
|
for (const knob of UNSUPPORTED_AGENT_KNOBS) {
|
|
440
451
|
if (elementum[knob] !== undefined) {
|
|
441
|
-
ctx.diagnostics.push(`${where}: ${knob} is not carried by the terraform path yet; dropped`);
|
|
452
|
+
ctx.diagnostics.push(`${where}: ${knob} is not carried by the terraform path yet; dropped (apply leaves the agent's live ${knob} unchanged)`);
|
|
442
453
|
}
|
|
443
454
|
}
|
|
444
455
|
const skillAccess = elementum.skillAccessConfig;
|
|
@@ -30,7 +30,14 @@ export interface NormalizedToolField {
|
|
|
30
30
|
* field registry before printing authored source.
|
|
31
31
|
*/
|
|
32
32
|
export interface NormalizedSearchTableField {
|
|
33
|
-
|
|
33
|
+
/** Raw platform field id (foreign/unexported target). Exactly one of `fieldId`/`key` is set. */
|
|
34
|
+
readonly fieldId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Target field bag key, when the export already resolved field_id to a field
|
|
37
|
+
* resource / lookup / system-field local (the tool targets an aspect in this
|
|
38
|
+
* export, so ResolveUUIDs rewrote the raw id). edk#1403.
|
|
39
|
+
*/
|
|
40
|
+
readonly key?: string;
|
|
34
41
|
readonly name?: string;
|
|
35
42
|
readonly description?: string;
|
|
36
43
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { EntityTfError } from "../../engine/entity.js";
|
|
8
8
|
import { dataRefLabel, optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
9
9
|
import { isTfExpr, sanitizeName, scopedLabelToBagKey, scopedResourceLabel, tfLabelToTsLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
10
|
-
import { resolveToolFieldKey } from "../shared/tool-field-ref.js";
|
|
10
|
+
import { droppedToolFieldDiagnostic, resolveToolFieldKey } from "../shared/tool-field-ref.js";
|
|
11
11
|
import { dataAspectDisplayName } from "../shared/aspect-target-from-tf.js";
|
|
12
12
|
import { KNOWN_TOOL_ATTRS, TOOL_SUB_TYPE_BY_RESOURCE } from "./types.js";
|
|
13
13
|
function runAsFromTf(attrs, owner, where, ctx) {
|
|
@@ -180,12 +180,18 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
180
180
|
continue;
|
|
181
181
|
}
|
|
182
182
|
const rec = item;
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
const rawId = typeof rec["field_id"] === "string" && rec["field_id"] !== "" ? rec["field_id"] : undefined;
|
|
184
|
+
// A tool whose target aspect is in this export has its field ids
|
|
185
|
+
// rewritten to references (custom-field resource, ref-only
|
|
186
|
+
// data.elementum_field, or system-field local). Resolve those to the
|
|
187
|
+
// target's field key instead of dropping them (edk#1403).
|
|
188
|
+
const key = rawId === undefined ? resolveToolFieldKey(rec["field_id"], fieldScopeLabel, fieldScope, ctx) : undefined;
|
|
189
|
+
if (rawId === undefined && key === undefined) {
|
|
190
|
+
ctx.diagnostics.push(droppedToolFieldDiagnostic(where, rec["field_id"], fieldScopeLabel, fieldScope));
|
|
185
191
|
continue;
|
|
186
192
|
}
|
|
187
193
|
searchTableFields.push({
|
|
188
|
-
fieldId:
|
|
194
|
+
...(rawId !== undefined ? { fieldId: rawId } : { key: key }),
|
|
189
195
|
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
190
196
|
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
191
197
|
});
|
|
@@ -208,7 +214,7 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
208
214
|
// rather than silently dropping the field.
|
|
209
215
|
const rawFieldId = fieldKey === undefined && typeof rec["field_id"] === "string" && rec["field_id"] !== "" ? rec["field_id"] : undefined;
|
|
210
216
|
if (fieldKey === undefined && rawFieldId === undefined) {
|
|
211
|
-
ctx.diagnostics.push(
|
|
217
|
+
ctx.diagnostics.push(droppedToolFieldDiagnostic(where, rec["field_id"], fieldScopeLabel, fieldScope));
|
|
212
218
|
continue;
|
|
213
219
|
}
|
|
214
220
|
fields.push({
|
|
@@ -34,5 +34,8 @@ export const agentToolModule = {
|
|
|
34
34
|
nestedAttribute: "field_id",
|
|
35
35
|
dataType: FIELD_DATA_RESOURCE_TYPE,
|
|
36
36
|
}],
|
|
37
|
+
// The provider reads an omitted `required` as false (edk#1429): the
|
|
38
|
+
// export leaves it out, the build may spell it out.
|
|
39
|
+
nestedOmittedDefaults: [{ attribute: "fields", defaults: { required: false } }],
|
|
37
40
|
},
|
|
38
41
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatic record sharing (#1596) — `autoShare` on apps and elements ↔ the
|
|
3
|
+
* provider's `auto_share` attribute on `elementum_app` / `elementum_element`.
|
|
4
|
+
*
|
|
5
|
+
* Every flag defaults to `false` on the platform. Omitting `autoShare`
|
|
6
|
+
* leaves the platform's current setting untouched (Optional+Computed);
|
|
7
|
+
* set a flag to `false` to turn it off.
|
|
8
|
+
*
|
|
9
|
+
* A flag left out of an authored `autoShare` object is `false`, so
|
|
10
|
+
* `autoShare: {}` turns every flag off — unlike omitting `autoShare`, which
|
|
11
|
+
* leaves the platform setting as it is.
|
|
12
|
+
*/
|
|
13
|
+
import type { TfValue } from "../../engine/tf/index.js";
|
|
14
|
+
/**
|
|
15
|
+
* Omitted flags are `false`: `autoShare: {}` turns every flag off, while
|
|
16
|
+
* omitting `autoShare` entirely leaves the platform setting untouched.
|
|
17
|
+
*/
|
|
18
|
+
export interface AutoShareOptions {
|
|
19
|
+
/** Share records with approvers. */
|
|
20
|
+
readonly approvals?: boolean;
|
|
21
|
+
/** Share records with assigned groups. */
|
|
22
|
+
readonly groupAssignees?: boolean;
|
|
23
|
+
/** Share records with assigned individuals. */
|
|
24
|
+
readonly individualAssignees?: boolean;
|
|
25
|
+
/** Share records with @mentioned users. */
|
|
26
|
+
readonly mentions?: boolean;
|
|
27
|
+
/** Share records with watchers. */
|
|
28
|
+
readonly watchers?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** SDK `autoShare` → provider `auto_share` object (only authored flags). */
|
|
31
|
+
export declare function autoShareToTf(opts: AutoShareOptions): Record<string, TfValue>;
|
|
32
|
+
/**
|
|
33
|
+
* Provider `auto_share` → SDK `autoShare`. Only enabled flags are kept, and an
|
|
34
|
+
* all-false object yields `undefined` so re-pulls of default aspects print nothing.
|
|
35
|
+
*/
|
|
36
|
+
export declare function autoShareFromTf(value: TfValue | undefined, where: string, diagnostics: string[]): AutoShareOptions | undefined;
|
|
37
|
+
/** Printer line for `autoShare`, e.g. ` autoShare: { watchers: true },`. */
|
|
38
|
+
export declare function printAutoShare(opts: AutoShareOptions | undefined, indent?: string): string | undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const AUTO_SHARE_KEYS = [
|
|
2
|
+
["approvals", "approvals"],
|
|
3
|
+
["groupAssignees", "group_assignees"],
|
|
4
|
+
["individualAssignees", "individual_assignees"],
|
|
5
|
+
["mentions", "mentions"],
|
|
6
|
+
["watchers", "watchers"],
|
|
7
|
+
];
|
|
8
|
+
/** SDK `autoShare` → provider `auto_share` object (only authored flags). */
|
|
9
|
+
export function autoShareToTf(opts) {
|
|
10
|
+
const out = {};
|
|
11
|
+
for (const [ts, tf] of AUTO_SHARE_KEYS) {
|
|
12
|
+
const v = opts[ts];
|
|
13
|
+
if (v !== undefined)
|
|
14
|
+
out[tf] = v;
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Provider `auto_share` → SDK `autoShare`. Only enabled flags are kept, and an
|
|
20
|
+
* all-false object yields `undefined` so re-pulls of default aspects print nothing.
|
|
21
|
+
*/
|
|
22
|
+
export function autoShareFromTf(value, where, diagnostics) {
|
|
23
|
+
if (value === undefined || value === null)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (typeof value !== "object" || Array.isArray(value) || "$expr" in value) {
|
|
26
|
+
diagnostics.push(`${where}: expected object "auto_share", got ${JSON.stringify(value)}; dropped`);
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const obj = value;
|
|
30
|
+
const out = {};
|
|
31
|
+
for (const [ts, tf] of AUTO_SHARE_KEYS) {
|
|
32
|
+
const v = obj[tf];
|
|
33
|
+
if (v === true)
|
|
34
|
+
out[ts] = true;
|
|
35
|
+
else if (v !== undefined && v !== false && v !== null) {
|
|
36
|
+
diagnostics.push(`${where}: expected boolean "auto_share.${tf}", got ${JSON.stringify(v)}; dropped`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
40
|
+
}
|
|
41
|
+
/** Printer line for `autoShare`, e.g. ` autoShare: { watchers: true },`. */
|
|
42
|
+
export function printAutoShare(opts, indent = " ") {
|
|
43
|
+
if (opts === undefined)
|
|
44
|
+
return undefined;
|
|
45
|
+
const parts = AUTO_SHARE_KEYS.filter(([ts]) => opts[ts] !== undefined).map(([ts]) => `${ts}: ${String(opts[ts])}`);
|
|
46
|
+
if (parts.length === 0)
|
|
47
|
+
return undefined;
|
|
48
|
+
return `${indent}autoShare: { ${parts.join(", ")} },`;
|
|
49
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* record-experience configuration with build/pull round-trip support.
|
|
13
13
|
*/
|
|
14
14
|
import type { AppAgentViewLayout, ViewBlocksLayout } from "../view/agent-view-layout.js";
|
|
15
|
+
import type { AutoShareOptions } from "./auto-share.js";
|
|
15
16
|
import { type AgentRef, type AppOrElementOrTaskRef, type AppOrElementRef, type AutomationCatalogRef, type CatalogRef, type ChartRef, type CloudLinkRef, type DashboardRef, type FieldRef, type ViewRef, type WidgetRef } from "../../catalog/index.js";
|
|
16
17
|
import type { WorkflowFieldType } from "../shared/types/field-types.js";
|
|
17
18
|
import { type SystemFieldKey } from "../../core/system-fields.js";
|
|
@@ -254,6 +255,12 @@ export interface AppSystemFields {
|
|
|
254
255
|
export type AppViewFieldRef = FieldRef | SystemFieldKey;
|
|
255
256
|
/** A typed reference to an app-owned widget for placement in a classic layout group. */
|
|
256
257
|
export type AppLayoutWidgetRef<Parent extends string = string, RefName extends string = string> = WidgetRef<Parent, RefName>;
|
|
258
|
+
/** Where a classic layout section renders: the main area or the record side panel. */
|
|
259
|
+
export declare const layoutSectionDisplayLocation: {
|
|
260
|
+
readonly center: "CENTER";
|
|
261
|
+
readonly right: "RIGHT";
|
|
262
|
+
};
|
|
263
|
+
export type LayoutSectionDisplayLocation = (typeof layoutSectionDisplayLocation)[keyof typeof layoutSectionDisplayLocation];
|
|
257
264
|
/**
|
|
258
265
|
* One section of a per-stage record layout (`elementum_layout`). The
|
|
259
266
|
* provider's own 9-value `type` enum (default `"group"`): only `"group"`
|
|
@@ -264,7 +271,7 @@ export type AppLayoutWidgetRef<Parent extends string = string, RefName extends s
|
|
|
264
271
|
*/
|
|
265
272
|
export interface AppLayoutSection {
|
|
266
273
|
readonly type?: "group" | "activityLog" | "approvals" | "attachments" | "status" | "surveys" | "relatedTasks" | "relationships" | "update";
|
|
267
|
-
readonly displayLocation?:
|
|
274
|
+
readonly displayLocation?: LayoutSectionDisplayLocation;
|
|
268
275
|
readonly displayOrder?: number;
|
|
269
276
|
readonly sideNavItem?: boolean;
|
|
270
277
|
/** `"group"` only (required by the provider). */
|
|
@@ -465,6 +472,8 @@ interface AppV2OptionsBase<F extends Record<string, AppField> = Record<string, A
|
|
|
465
472
|
readonly commentsEnabled?: boolean;
|
|
466
473
|
/** Locks the stage selector during record creation so lifecycle automations own initial progression. */
|
|
467
474
|
readonly lockStages?: boolean;
|
|
475
|
+
/** Automatic record sharing toggles. Omit to leave the platform setting untouched. */
|
|
476
|
+
readonly autoShare?: AutoShareOptions;
|
|
468
477
|
/** Fields keyed by ref name. At least one required by the compose API. */
|
|
469
478
|
readonly fields: F;
|
|
470
479
|
/**
|
|
@@ -637,6 +646,8 @@ export type AppSelfRef<F extends Record<string, AppField> = Record<string, AppFi
|
|
|
637
646
|
};
|
|
638
647
|
/** Reference-bearing app options that can safely be authored from `withRefs`. */
|
|
639
648
|
export type AppReferenceConfiguration = Pick<AppV2Options, "layouts" | "listViews" | "calendarViews" | "kanbanViews" | "dashboards" | "widgets" | "dashboardViews" | "agentViews" | "customViews" | "recordCreateForm" | "dynamicLayouts" | "relationships" | "viewOrder" | "accessPolicies">;
|
|
649
|
+
/** The view bags a `withRefs` configuration declares, so `ref().views` keeps their keys. */
|
|
650
|
+
type AppReferencedViewBags<W extends AppReferenceConfiguration> = Pick<W, Extract<keyof W, keyof AppViewBags>>;
|
|
640
651
|
/**
|
|
641
652
|
* The configured result of `app` — its reference surface (`ref()`) and
|
|
642
653
|
* its deployable entity (`def()`). Both take `refName` as a **call-time
|
|
@@ -650,8 +661,11 @@ export type AppReferenceConfiguration = Pick<AppV2Options, "layouts" | "listView
|
|
|
650
661
|
export interface AppConfigured<F extends Record<string, AppField> = Record<string, AppField>, R extends Record<string, FieldRef> = Record<never, never>, V extends AppViewBags = AppViewBags> {
|
|
651
662
|
ref<const RefName extends string>(refName: RefName): AppRef<F, R, RefName, V>;
|
|
652
663
|
def(refName: string): DeployableEntity;
|
|
653
|
-
/**
|
|
654
|
-
|
|
664
|
+
/**
|
|
665
|
+
* Configure self-referential record experiences without hand-building ref
|
|
666
|
+
* tokens. Bags returned here add to the same bags in `app({...})`.
|
|
667
|
+
*/
|
|
668
|
+
withRefs<const W extends AppReferenceConfiguration>(configure: (app: AppSelfRef<F, R, string, V>) => W): AppConfigured<F, R, V & AppReferencedViewBags<W>>;
|
|
655
669
|
}
|
|
656
670
|
/**
|
|
657
671
|
* Build a v2 app entity: org-owned, compose-body payload. Exposes
|
|
@@ -3,6 +3,11 @@ import { DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES, SYSTEM_FIELD_KEYS, SYSTEM_FIELD_REQU
|
|
|
3
3
|
import { serializeDisplayBlocks } from "./display-blocks.js";
|
|
4
4
|
import { assertCalculatedFieldRoot } from "../field/calc/runtime.js";
|
|
5
5
|
import { assertAttachmentMediaTypes } from "../field/media-types.js";
|
|
6
|
+
/** Where a classic layout section renders: the main area or the record side panel. */
|
|
7
|
+
export const layoutSectionDisplayLocation = {
|
|
8
|
+
center: "CENTER",
|
|
9
|
+
right: "RIGHT",
|
|
10
|
+
};
|
|
6
11
|
export { dashboardChartWidget, dashboardRecordsWidget, dashboardWidgetSize, } from "../dashboard/build.js";
|
|
7
12
|
/** The view bag each authoring property holds (see {@link ViewRef.viewType}). */
|
|
8
13
|
export const APP_VIEW_BAGS = {
|
|
@@ -267,6 +272,46 @@ export function serializeSystemFields(overrides) {
|
|
|
267
272
|
return serializeField(field, key);
|
|
268
273
|
});
|
|
269
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* The keyed bags `withRefs` can add to. Each merges with the same bag in
|
|
277
|
+
* `app({...})` rather than replacing it; a key declared in both places fails.
|
|
278
|
+
*/
|
|
279
|
+
const KEYED_REFERENCE_BAGS = [
|
|
280
|
+
"layouts",
|
|
281
|
+
"listViews",
|
|
282
|
+
"calendarViews",
|
|
283
|
+
"kanbanViews",
|
|
284
|
+
"dashboards",
|
|
285
|
+
"widgets",
|
|
286
|
+
"dashboardViews",
|
|
287
|
+
"agentViews",
|
|
288
|
+
"customViews",
|
|
289
|
+
"dynamicLayouts",
|
|
290
|
+
"relationships",
|
|
291
|
+
];
|
|
292
|
+
function mergeReferenceConfiguration(appName, base, referenced) {
|
|
293
|
+
const merged = { ...base, ...referenced };
|
|
294
|
+
// These are a single value or an array, not a key bag. A second declaration
|
|
295
|
+
// would replace the first; arrays cannot merge by key without becoming objects.
|
|
296
|
+
for (const key of ["recordCreateForm", "viewOrder", "accessPolicies"]) {
|
|
297
|
+
if (base[key] !== undefined && referenced[key] !== undefined) {
|
|
298
|
+
throw new Error(`app "${appName}": ${key} is declared both in app({...}) and in withRefs(...) (or in two withRefs calls). Declare it once.`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
for (const bag of KEYED_REFERENCE_BAGS) {
|
|
302
|
+
const declared = base[bag];
|
|
303
|
+
const added = referenced[bag];
|
|
304
|
+
if (declared === undefined || added === undefined)
|
|
305
|
+
continue;
|
|
306
|
+
for (const key of Object.keys(added)) {
|
|
307
|
+
if (Object.hasOwn(declared, key)) {
|
|
308
|
+
throw new Error(`app "${appName}": ${bag}.${key} is declared both in app({...}) and in withRefs(...) (or in two withRefs calls). Declare it once.`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
merged[bag] = { ...declared, ...added };
|
|
312
|
+
}
|
|
313
|
+
return merged;
|
|
314
|
+
}
|
|
270
315
|
/**
|
|
271
316
|
* Build a v2 app entity: org-owned, compose-body payload. Exposes
|
|
272
317
|
* `.ref(refName)` and `.def(refName)`.
|
|
@@ -410,14 +455,20 @@ export function app(opts) {
|
|
|
410
455
|
return self;
|
|
411
456
|
}
|
|
412
457
|
function withReferenceConfiguration(configure) {
|
|
458
|
+
const resolve = (refName) => app(mergeReferenceConfiguration(opts.name, opts, configure(makeRef(refName))));
|
|
413
459
|
return {
|
|
414
|
-
ref
|
|
460
|
+
ref(refName) {
|
|
461
|
+
return resolve(refName).ref(refName);
|
|
462
|
+
},
|
|
415
463
|
def(refName) {
|
|
416
|
-
|
|
417
|
-
return app({ ...opts, ...referenced }).def(refName);
|
|
464
|
+
return resolve(refName).def(refName);
|
|
418
465
|
},
|
|
419
466
|
withRefs(next) {
|
|
420
|
-
return withReferenceConfiguration((
|
|
467
|
+
return withReferenceConfiguration((self) => {
|
|
468
|
+
const earlier = configure(self);
|
|
469
|
+
const layered = app(mergeReferenceConfiguration(opts.name, opts, earlier)).ref(self.refName);
|
|
470
|
+
return mergeReferenceConfiguration(opts.name, earlier, next(layered));
|
|
471
|
+
});
|
|
421
472
|
},
|
|
422
473
|
};
|
|
423
474
|
}
|
|
@@ -454,6 +505,7 @@ export function app(opts) {
|
|
|
454
505
|
...(opts.cloudOptions !== undefined ? { cloudOptions: opts.cloudOptions } : {}),
|
|
455
506
|
...(opts.commentsEnabled !== undefined ? { commentsEnabled: opts.commentsEnabled } : {}),
|
|
456
507
|
...(opts.lockStages !== undefined ? { lockStages: opts.lockStages } : {}),
|
|
508
|
+
...(opts.autoShare !== undefined ? { autoShare: opts.autoShare } : {}),
|
|
457
509
|
fields: [
|
|
458
510
|
...serializeSystemFields(opts.systemFields),
|
|
459
511
|
...Object.entries(opts.fields).map(([bagKey, field]) => serializeField(field, bagKey)),
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* HCL streams instead (see `appFromTf`).
|
|
11
11
|
*/
|
|
12
12
|
import type { NormalizedAgentViewLayout } from "../../view/agent-view-layout-from-tf.js";
|
|
13
|
+
import type { AutoShareOptions } from "../auto-share.js";
|
|
13
14
|
import type { AppCategory, AppField, AppStage, AspectType } from "../../../core/types/app.js";
|
|
14
15
|
import type { DisplayBlock } from "../../../core/types/display-block.js";
|
|
15
16
|
import type { NormalizedAccessPolicy } from "../../access-policy/from-tf.js";
|
|
@@ -122,6 +123,8 @@ export interface NormalizedLayoutSection {
|
|
|
122
123
|
readonly maxColumns?: number;
|
|
123
124
|
readonly fields?: readonly string[];
|
|
124
125
|
readonly widgets?: readonly string[];
|
|
126
|
+
/** Widget bag key → index in the section's field list. Omitted when the widget is appended. */
|
|
127
|
+
readonly widgetAts?: Readonly<Record<string, number>>;
|
|
125
128
|
/** `group` only — the app-owned agent embedded in the section, by bag key. */
|
|
126
129
|
readonly agentKey?: string;
|
|
127
130
|
}
|
|
@@ -251,7 +254,7 @@ export type NormalizedWidget = {
|
|
|
251
254
|
readonly type: "runAutomation";
|
|
252
255
|
readonly name: string;
|
|
253
256
|
readonly automation: NormalizedWidgetRef | string;
|
|
254
|
-
readonly parameters
|
|
257
|
+
readonly parameters: readonly {
|
|
255
258
|
readonly name: string;
|
|
256
259
|
readonly fieldType: string;
|
|
257
260
|
readonly multiple: boolean;
|
|
@@ -356,6 +359,8 @@ export interface NormalizedApp {
|
|
|
356
359
|
/** Element only: the platform gave it audit fields (created/updated at/by). */
|
|
357
360
|
readonly auditFields?: boolean;
|
|
358
361
|
readonly lockStages?: boolean;
|
|
362
|
+
/** Automatic record sharing (#1596); only enabled flags. */
|
|
363
|
+
readonly autoShare?: AutoShareOptions;
|
|
359
364
|
readonly cloudOptions?: {
|
|
360
365
|
readonly snowflake?: {
|
|
361
366
|
readonly hybridTable?: boolean;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* identically for both pull paths. Platform ids come only from the stream's
|
|
8
8
|
* import blocks and stay data-side — they never reach printed source.
|
|
9
9
|
*/
|
|
10
|
+
import { autoShareFromTf } from "./auto-share.js";
|
|
10
11
|
import { DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES, SYSTEM_FIELD_KEYS, SYSTEM_FIELD_KEY_BY_HCL_KEY, SYSTEM_FIELD_TAG_BY_KEY, } from "../../core/system-fields.js";
|
|
11
12
|
import { EntityTfError } from "../../engine/entity.js";
|
|
12
13
|
import { dataRefLabel, optionalString, plainObject } from "../../engine/pull/context.js";
|
|
@@ -43,6 +44,7 @@ const KNOWN_APP_ATTRS = new Set([
|
|
|
43
44
|
"status_field_description",
|
|
44
45
|
"comments_enabled",
|
|
45
46
|
"lock_stages",
|
|
47
|
+
"auto_share",
|
|
46
48
|
"system_field_config",
|
|
47
49
|
]);
|
|
48
50
|
const SYSTEM_FIELD_TYPE_BY_KEY = {
|
|
@@ -110,6 +112,7 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
|
|
|
110
112
|
const statusFieldDescription = optionalString(attrs, "status_field_description", `app "${label}"`, ctx);
|
|
111
113
|
const commentsEnabled = typeof attrs["comments_enabled"] === "boolean" ? attrs["comments_enabled"] : undefined;
|
|
112
114
|
const lockStages = typeof attrs["lock_stages"] === "boolean" ? attrs["lock_stages"] : undefined;
|
|
115
|
+
const autoShare = autoShareFromTf(attrs["auto_share"], `app "${label}"`, ctx.diagnostics);
|
|
113
116
|
// --- Org data references (category / cloud link).
|
|
114
117
|
let category;
|
|
115
118
|
if (attrs["category_id"] !== undefined) {
|
|
@@ -258,6 +261,7 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
|
|
|
258
261
|
...(cloudLinkId !== undefined && { cloudLinkId }),
|
|
259
262
|
...(commentsEnabled !== undefined && { commentsEnabled }),
|
|
260
263
|
...(lockStages !== undefined && { lockStages }),
|
|
264
|
+
...(autoShare !== undefined && { autoShare }),
|
|
261
265
|
...(layouts.length > 0 && { layouts }),
|
|
262
266
|
...(listViews.length > 0 && { listViews }),
|
|
263
267
|
...(calendarViews.length > 0 && { calendarViews }),
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* `src/elements/build.ts`'s header for why apps and elements split into
|
|
6
6
|
* dedicated builders despite sharing this module's field/print internals.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type { AutoShareOptions } from "./auto-share.js";
|
|
9
|
+
export { app, type AppAgentView, type AppCustomView, type AppCalendarView, type AppDashboardView, type AppKanbanView, type AppListView, type AppCategory, type AppCloudOptions, type AppField, type AppPicklistConfig, type AppPicklistDynamicConfig, type AppPicklistDynamicSortOrder, type AppRecordCreateForm, type AppRecordCreateFormSection, type AppConfigured, type AppFieldRefs, type AppRef, type AppSelfRef, type AppReferenceConfiguration, type AppV2Options, layoutSectionDisplayLocation, type LayoutSectionDisplayLocation, } from "./build.js";
|
|
9
10
|
export { listViewDensity, managedViewSortAggregation, managedViewSortDirection, type ListViewDensity, type ManagedViewSort, type ManagedViewSortAggregation, type ManagedViewSortDirection, type ManagedViewSortField, type ManagedViewSortOrder, } from "../view/build.js";
|
|
10
11
|
export { runAutomationParameterValue, type AppWidget, type CreateRecordWidget, type LinkRecordsWidget, type RelatedRecordsWidget, type RunAutomationParameterValue, type RunAutomationWidget, type RunAutomationWidgetParameter, type WidgetButtonStyle, type WidgetButtonType, } from "../widget/build.js";
|
|
11
12
|
export { type DisplayBlock } from "./display-blocks.js";
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* v2 app authoring — `app`. Org-owned; deploys via the wire client's
|
|
3
|
-
* compose path. Standalone from v1's `src/aspects`. Elements author through
|
|
4
|
-
* the sibling `@elementumai/edk/elements` module (`element`) — see
|
|
5
|
-
* `src/elements/build.ts`'s header for why apps and elements split into
|
|
6
|
-
* dedicated builders despite sharing this module's field/print internals.
|
|
7
|
-
*/
|
|
8
|
-
export { app, } from "./build.js";
|
|
1
|
+
export { app, layoutSectionDisplayLocation, } from "./build.js";
|
|
9
2
|
export { listViewDensity, managedViewSortAggregation, managedViewSortDirection, } from "../view/build.js";
|
|
10
3
|
export { runAutomationParameterValue, } from "../widget/build.js";
|
|
11
4
|
export { dashboardChartWidget, dashboardRecordsWidget, dashboardWidgetSize, } from "../dashboard/build.js";
|
|
@@ -18,6 +18,12 @@ import { type ToTfContext } from "../../engine/build/context.js";
|
|
|
18
18
|
import type { BuildFieldMetadata } from "../../graph/types.js";
|
|
19
19
|
import { type DeployableEntity } from "../../engine/entity.js";
|
|
20
20
|
import { type TfBlock } from "../../engine/tf/index.js";
|
|
21
|
+
/**
|
|
22
|
+
* The named gap for a system-field tag with no canonical key (edk#1480).
|
|
23
|
+
* Defensive: every tag in SYSTEM_FIELD_TAGS maps today, so a new tag lands
|
|
24
|
+
* here until SYSTEM_FIELD_TAG_BY_KEY learns it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function unsupportedSystemTagGap(systemTag: string): string;
|
|
21
27
|
/** System-field tags that fold into the app resource instead of emitting a field resource. */
|
|
22
28
|
export declare const SYSTEM_FIELD_TAGS: ReadonlySet<string>;
|
|
23
29
|
export interface AppToTfResult {
|