@duckcodeailabs/dql-core 1.13.1 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/app-build-draft.d.ts +236 -0
- package/dist/apps/app-build-draft.d.ts.map +1 -0
- package/dist/apps/app-build-draft.js +281 -0
- package/dist/apps/app-build-draft.js.map +1 -0
- package/dist/apps/dashboard-document.d.ts +48 -8
- package/dist/apps/dashboard-document.d.ts.map +1 -1
- package/dist/apps/dashboard-document.js +89 -6
- package/dist/apps/dashboard-document.js.map +1 -1
- package/dist/apps/index.d.ts +3 -1
- package/dist/apps/index.d.ts.map +1 -1
- package/dist/apps/index.js +1 -0
- package/dist/apps/index.js.map +1 -1
- package/dist/manifest/builder.d.ts.map +1 -1
- package/dist/manifest/builder.js +1 -0
- package/dist/manifest/builder.js.map +1 -1
- package/dist/manifest/dbt-first-authoring.d.ts +16 -0
- package/dist/manifest/dbt-first-authoring.d.ts.map +1 -1
- package/dist/manifest/dbt-first-authoring.js +43 -21
- package/dist/manifest/dbt-first-authoring.js.map +1 -1
- package/dist/manifest/dbt-first-modeling.d.ts +1 -0
- package/dist/manifest/dbt-first-modeling.d.ts.map +1 -1
- package/dist/manifest/dbt-first-modeling.js +3 -0
- package/dist/manifest/dbt-first-modeling.js.map +1 -1
- package/dist/manifest/domain-discovery.d.ts +25 -0
- package/dist/manifest/domain-discovery.d.ts.map +1 -1
- package/dist/manifest/domain-discovery.js +36 -20
- package/dist/manifest/domain-discovery.js.map +1 -1
- package/dist/manifest/index.d.ts +2 -2
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest/index.js +2 -2
- package/dist/manifest/index.js.map +1 -1
- package/dist/manifest/model-area-id.d.ts +31 -0
- package/dist/manifest/model-area-id.d.ts.map +1 -0
- package/dist/manifest/model-area-id.js +19 -0
- package/dist/manifest/model-area-id.js.map +1 -0
- package/dist/manifest/types.d.ts +10 -0
- package/dist/manifest/types.d.ts.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { DashboardDocument, DashboardFilter, DashboardGridItem, DashboardGridLayout } from './dashboard-document.js';
|
|
2
|
+
export type AppBuildAuthoringMode = 'ai' | 'manual';
|
|
3
|
+
export type AppBuildSourcePolicy = 'governed_only' | 'include_review_required';
|
|
4
|
+
export type AppBuildTemplateId = 'executive_brief' | 'operational_dashboard' | 'investigation' | 'blank';
|
|
5
|
+
export interface AppBuildClarification {
|
|
6
|
+
id: string;
|
|
7
|
+
question: string;
|
|
8
|
+
choices: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}>;
|
|
13
|
+
required: boolean;
|
|
14
|
+
answerId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AppBuildFrame {
|
|
17
|
+
goal: string;
|
|
18
|
+
decision?: string;
|
|
19
|
+
audience?: string;
|
|
20
|
+
metrics: string[];
|
|
21
|
+
dimensions: string[];
|
|
22
|
+
grain?: string;
|
|
23
|
+
timeRange?: string;
|
|
24
|
+
comparison?: string;
|
|
25
|
+
filters: string[];
|
|
26
|
+
desiredOutput?: string;
|
|
27
|
+
clarificationQuestions?: AppBuildClarification[];
|
|
28
|
+
}
|
|
29
|
+
export interface AppBuildRequirement {
|
|
30
|
+
id: string;
|
|
31
|
+
question: string;
|
|
32
|
+
role: 'kpi' | 'trend' | 'breakdown' | 'detail' | 'narrative' | 'evidence';
|
|
33
|
+
required: boolean;
|
|
34
|
+
measures: string[];
|
|
35
|
+
dimensions: string[];
|
|
36
|
+
filters: string[];
|
|
37
|
+
grain?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AppBuildRequirementCoverage {
|
|
40
|
+
requirementId: string;
|
|
41
|
+
status: 'covered' | 'partial' | 'gap';
|
|
42
|
+
sourceIds: string[];
|
|
43
|
+
componentIds: string[];
|
|
44
|
+
reasons: string[];
|
|
45
|
+
}
|
|
46
|
+
export type AppBuildDraftSourceKind = 'block' | 'certified_block' | 'governed_semantic' | 'review_block' | 'review_dql' | 'text'
|
|
47
|
+
/** v1 read compatibility; new drafts use governed_semantic. */
|
|
48
|
+
| 'semantic_query'
|
|
49
|
+
/** v1 read compatibility; generated exploration is materialized as review_dql. */
|
|
50
|
+
| 'exploratory_sql';
|
|
51
|
+
export type AppBuildSourceLifecycle = 'certified' | 'review' | 'draft' | 'pending_recertification' | 'deprecated' | 'unknown';
|
|
52
|
+
export interface AppBuildSourceCapabilities {
|
|
53
|
+
measures: string[];
|
|
54
|
+
dimensions: string[];
|
|
55
|
+
outputs: string[];
|
|
56
|
+
filters: string[];
|
|
57
|
+
grain?: string;
|
|
58
|
+
chartType?: string;
|
|
59
|
+
allowedVisualizations?: string[];
|
|
60
|
+
parameters: Array<{
|
|
61
|
+
name: string;
|
|
62
|
+
type?: string;
|
|
63
|
+
required: boolean;
|
|
64
|
+
hasDefault: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
export type AppBuildDraftSource = {
|
|
68
|
+
/** Canonical, path-disambiguated source id used by tiles and coverage. */
|
|
69
|
+
id: string;
|
|
70
|
+
kind: AppBuildDraftSourceKind;
|
|
71
|
+
/** Legacy display/execution reference retained for v1/v2 readers. */
|
|
72
|
+
sourceRef: string;
|
|
73
|
+
qualifiedIdentity?: string;
|
|
74
|
+
sourcePath?: string;
|
|
75
|
+
executionRef?: string;
|
|
76
|
+
snapshotId?: string;
|
|
77
|
+
sourceRevision?: string;
|
|
78
|
+
sourceFingerprint?: string;
|
|
79
|
+
receiptId?: string;
|
|
80
|
+
lifecycle?: AppBuildSourceLifecycle;
|
|
81
|
+
capabilities?: AppBuildSourceCapabilities;
|
|
82
|
+
trustState: 'certified' | 'review_required' | 'draft_ready';
|
|
83
|
+
reviewStatus: 'not_required' | 'required' | 'approved';
|
|
84
|
+
};
|
|
85
|
+
export interface AppBuildReviewTask {
|
|
86
|
+
id: string;
|
|
87
|
+
message: string;
|
|
88
|
+
status: 'open' | 'resolved';
|
|
89
|
+
sourceId?: string;
|
|
90
|
+
pageId?: string;
|
|
91
|
+
tileId?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface AppBuildRunReceipt {
|
|
94
|
+
id: string;
|
|
95
|
+
pageId: string;
|
|
96
|
+
revision: number;
|
|
97
|
+
snapshotId: string;
|
|
98
|
+
filterFingerprint: string;
|
|
99
|
+
resultFingerprint: string;
|
|
100
|
+
createdAt: string;
|
|
101
|
+
}
|
|
102
|
+
export interface AppBuildPreflightReceipt {
|
|
103
|
+
id: string;
|
|
104
|
+
revision: number;
|
|
105
|
+
proposalHash: string;
|
|
106
|
+
sourceFingerprint: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The one durable authoring aggregate for AI, manual, CLI, and Copilot work.
|
|
111
|
+
* Drafts are local-only. Git-owned App source is produced only by explicit
|
|
112
|
+
* Publish to Project and is never used as the mutable editor backing store.
|
|
113
|
+
*/
|
|
114
|
+
export interface AppBuildDraft {
|
|
115
|
+
version: 3;
|
|
116
|
+
id: string;
|
|
117
|
+
appId: string;
|
|
118
|
+
name: string;
|
|
119
|
+
baseApp?: {
|
|
120
|
+
appId: string;
|
|
121
|
+
fingerprint: string;
|
|
122
|
+
};
|
|
123
|
+
revision: number;
|
|
124
|
+
proposalHash: string;
|
|
125
|
+
authoringMode: AppBuildAuthoringMode;
|
|
126
|
+
template: AppBuildTemplateId;
|
|
127
|
+
sourcePolicy: AppBuildSourcePolicy;
|
|
128
|
+
state: 'local_draft' | 'clarification_required' | 'preflight_ready' | 'project_published';
|
|
129
|
+
frame: AppBuildFrame;
|
|
130
|
+
requirements: AppBuildRequirement[];
|
|
131
|
+
coverage: AppBuildRequirementCoverage[];
|
|
132
|
+
sources: AppBuildDraftSource[];
|
|
133
|
+
pages: DashboardDocument[];
|
|
134
|
+
reviewTasks: AppBuildReviewTask[];
|
|
135
|
+
/** One settled run receipt per page. Any content edit invalidates the set. */
|
|
136
|
+
previewReceipts?: AppBuildRunReceipt[];
|
|
137
|
+
/** @deprecated Early v2 alias for the most recently run page. */
|
|
138
|
+
previewReceipt?: AppBuildRunReceipt;
|
|
139
|
+
preflightReceipt?: AppBuildPreflightReceipt;
|
|
140
|
+
publishedFingerprint?: string;
|
|
141
|
+
createdAt: string;
|
|
142
|
+
updatedAt: string;
|
|
143
|
+
}
|
|
144
|
+
export type AppBuildDraftOperation = {
|
|
145
|
+
type: 'set_name';
|
|
146
|
+
name: string;
|
|
147
|
+
} | {
|
|
148
|
+
type: 'set_template';
|
|
149
|
+
template: AppBuildTemplateId;
|
|
150
|
+
} | {
|
|
151
|
+
type: 'set_frame';
|
|
152
|
+
frame: AppBuildFrame;
|
|
153
|
+
} | {
|
|
154
|
+
type: 'set_source_policy';
|
|
155
|
+
sourcePolicy: AppBuildSourcePolicy;
|
|
156
|
+
} | {
|
|
157
|
+
type: 'set_requirements';
|
|
158
|
+
requirements: AppBuildRequirement[];
|
|
159
|
+
coverage?: AppBuildRequirementCoverage[];
|
|
160
|
+
} | {
|
|
161
|
+
type: 'set_coverage';
|
|
162
|
+
coverage: AppBuildRequirementCoverage[];
|
|
163
|
+
} | {
|
|
164
|
+
type: 'upsert_source';
|
|
165
|
+
source: AppBuildDraftSource;
|
|
166
|
+
} | {
|
|
167
|
+
type: 'remove_source';
|
|
168
|
+
sourceId: string;
|
|
169
|
+
} | {
|
|
170
|
+
type: 'upsert_page';
|
|
171
|
+
page: DashboardDocument;
|
|
172
|
+
} | {
|
|
173
|
+
type: 'remove_page';
|
|
174
|
+
pageId: string;
|
|
175
|
+
} | {
|
|
176
|
+
type: 'add_tile';
|
|
177
|
+
pageId: string;
|
|
178
|
+
tile: DashboardGridItem;
|
|
179
|
+
} | {
|
|
180
|
+
type: 'update_tile';
|
|
181
|
+
pageId: string;
|
|
182
|
+
tileId: string;
|
|
183
|
+
patch: Partial<DashboardGridItem>;
|
|
184
|
+
} | {
|
|
185
|
+
type: 'remove_tile';
|
|
186
|
+
pageId: string;
|
|
187
|
+
tileId: string;
|
|
188
|
+
} | {
|
|
189
|
+
type: 'set_filter';
|
|
190
|
+
pageId: string;
|
|
191
|
+
filter: DashboardFilter;
|
|
192
|
+
} | {
|
|
193
|
+
type: 'remove_filter';
|
|
194
|
+
pageId: string;
|
|
195
|
+
filterId: string;
|
|
196
|
+
} | {
|
|
197
|
+
type: 'set_layout';
|
|
198
|
+
pageId: string;
|
|
199
|
+
layout: DashboardGridLayout & {
|
|
200
|
+
responsive?: DashboardDocument['layout']['responsive'];
|
|
201
|
+
};
|
|
202
|
+
} | {
|
|
203
|
+
type: 'set_review_task';
|
|
204
|
+
task: AppBuildReviewTask;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'remove_review_task';
|
|
207
|
+
taskId: string;
|
|
208
|
+
} | {
|
|
209
|
+
type: 'set_preview_receipt';
|
|
210
|
+
receipt: AppBuildRunReceipt;
|
|
211
|
+
};
|
|
212
|
+
export declare function createAppBuildDraft(input: {
|
|
213
|
+
id: string;
|
|
214
|
+
appId: string;
|
|
215
|
+
name?: string;
|
|
216
|
+
baseApp?: AppBuildDraft['baseApp'];
|
|
217
|
+
authoringMode: AppBuildAuthoringMode;
|
|
218
|
+
template?: AppBuildTemplateId;
|
|
219
|
+
sourcePolicy?: AppBuildSourcePolicy;
|
|
220
|
+
frame: AppBuildFrame;
|
|
221
|
+
requirements?: AppBuildRequirement[];
|
|
222
|
+
coverage?: AppBuildRequirementCoverage[];
|
|
223
|
+
sources?: AppBuildDraftSource[];
|
|
224
|
+
pages?: DashboardDocument[];
|
|
225
|
+
reviewTasks?: AppBuildReviewTask[];
|
|
226
|
+
now?: string;
|
|
227
|
+
}): AppBuildDraft;
|
|
228
|
+
export declare function applyAppBuildDraftOperations(draft: AppBuildDraft, expectedRevision: number, operations: AppBuildDraftOperation[], now?: string): AppBuildDraft;
|
|
229
|
+
export declare function appBuildDraftHash(value: unknown): string;
|
|
230
|
+
/**
|
|
231
|
+
* Produce a compact, non-overlapping row layout while preserving the author's
|
|
232
|
+
* visual reading order. App Studio uses this after every explicit edit so
|
|
233
|
+
* imported or stale geometry can never place a tile outside the active grid.
|
|
234
|
+
*/
|
|
235
|
+
export declare function packDashboardLayoutItems(items: DashboardDocument['layout']['items'], cols: number): DashboardDocument['layout']['items'];
|
|
236
|
+
//# sourceMappingURL=app-build-draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-build-draft.d.ts","sourceRoot":"","sources":["../../src/apps/app-build-draft.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE1H,MAAM,MAAM,qBAAqB,GAAG,IAAI,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,yBAAyB,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,uBAAuB,GAAG,eAAe,GAAG,OAAO,CAAC;AAEzG,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACn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MAAM,CAAC;CACd,GAAG,aAAa,CA0BhB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,aAAa,EACpB,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,sBAAsB,EAAE,EACpC,GAAG,SAA2B,GAC7B,aAAa,CA6Bf;AA8CD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAExD;AAgFD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAC3C,IAAI,EAAE,MAAM,GACX,iBAAiB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CA0BtC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
export function createAppBuildDraft(input) {
|
|
3
|
+
const now = input.now ?? new Date().toISOString();
|
|
4
|
+
const clarifications = input.frame.clarificationQuestions ?? [];
|
|
5
|
+
const needsClarification = clarifications.some((question) => question.required && !question.answerId);
|
|
6
|
+
const draftWithoutHash = {
|
|
7
|
+
version: 3,
|
|
8
|
+
id: input.id,
|
|
9
|
+
appId: input.appId,
|
|
10
|
+
name: input.name?.trim() || input.frame.goal.trim() || input.appId,
|
|
11
|
+
...(input.baseApp ? { baseApp: input.baseApp } : {}),
|
|
12
|
+
revision: 1,
|
|
13
|
+
authoringMode: input.authoringMode,
|
|
14
|
+
template: input.template ?? 'blank',
|
|
15
|
+
sourcePolicy: input.sourcePolicy ?? 'governed_only',
|
|
16
|
+
state: needsClarification ? 'clarification_required' : 'local_draft',
|
|
17
|
+
frame: input.frame,
|
|
18
|
+
requirements: input.requirements ?? [],
|
|
19
|
+
coverage: input.coverage ?? [],
|
|
20
|
+
sources: input.sources ?? [],
|
|
21
|
+
pages: input.pages ?? [],
|
|
22
|
+
reviewTasks: input.reviewTasks ?? [],
|
|
23
|
+
createdAt: now,
|
|
24
|
+
updatedAt: now,
|
|
25
|
+
};
|
|
26
|
+
assertAppBuildDraftPolicy(draftWithoutHash);
|
|
27
|
+
return { ...draftWithoutHash, proposalHash: appBuildDraftHash(draftWithoutHash) };
|
|
28
|
+
}
|
|
29
|
+
export function applyAppBuildDraftOperations(draft, expectedRevision, operations, now = new Date().toISOString()) {
|
|
30
|
+
if (draft.revision !== expectedRevision) {
|
|
31
|
+
throw new Error(`APP_BUILD_REVISION_CONFLICT: expected ${expectedRevision}, current ${draft.revision}`);
|
|
32
|
+
}
|
|
33
|
+
if (operations.length === 0)
|
|
34
|
+
return draft;
|
|
35
|
+
let next = structuredClone(draft);
|
|
36
|
+
for (const operation of operations)
|
|
37
|
+
next = applyOperation(next, operation);
|
|
38
|
+
next = reconcileCoverageReferences(next);
|
|
39
|
+
const contentChanged = operations.some((operation) => operation.type !== 'set_preview_receipt');
|
|
40
|
+
const settledDataChanged = operations.some((operation) => !operationPreservesSettledData(draft, operation));
|
|
41
|
+
next.updatedAt = now;
|
|
42
|
+
if (contentChanged) {
|
|
43
|
+
next.revision += 1;
|
|
44
|
+
if (settledDataChanged) {
|
|
45
|
+
delete next.previewReceipts;
|
|
46
|
+
delete next.previewReceipt;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
if (next.previewReceipts)
|
|
50
|
+
next.previewReceipts = next.previewReceipts.map((receipt) => ({ ...receipt, revision: next.revision }));
|
|
51
|
+
if (next.previewReceipt)
|
|
52
|
+
next.previewReceipt = { ...next.previewReceipt, revision: next.revision };
|
|
53
|
+
}
|
|
54
|
+
delete next.preflightReceipt;
|
|
55
|
+
delete next.publishedFingerprint;
|
|
56
|
+
const needsClarification = (next.frame.clarificationQuestions ?? [])
|
|
57
|
+
.some((question) => question.required && !question.answerId);
|
|
58
|
+
next.state = needsClarification ? 'clarification_required' : 'local_draft';
|
|
59
|
+
next.proposalHash = appBuildDraftHash({ ...next, proposalHash: undefined });
|
|
60
|
+
}
|
|
61
|
+
assertAppBuildDraftPolicy(next);
|
|
62
|
+
return next;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Coverage is part of the aggregate, not an independent planner memo. Keep its
|
|
66
|
+
* references aligned after source/page/tile mutations so a removed component
|
|
67
|
+
* can never remain reported as covered or block publication as a ghost gap.
|
|
68
|
+
*/
|
|
69
|
+
function reconcileCoverageReferences(draft) {
|
|
70
|
+
const sourceIds = new Set(draft.sources.map((source) => source.id));
|
|
71
|
+
const componentIds = new Set(draft.pages.flatMap((page) => page.layout.items.map((item) => item.i)));
|
|
72
|
+
return {
|
|
73
|
+
...draft,
|
|
74
|
+
coverage: draft.coverage.map((item) => {
|
|
75
|
+
const validSourceIds = item.sourceIds.filter((sourceId) => sourceIds.has(sourceId));
|
|
76
|
+
const validComponentIds = item.componentIds.filter((componentId) => componentIds.has(componentId));
|
|
77
|
+
return {
|
|
78
|
+
...item,
|
|
79
|
+
sourceIds: validSourceIds,
|
|
80
|
+
componentIds: validComponentIds,
|
|
81
|
+
status: validSourceIds.length > 0 && validComponentIds.length > 0 ? item.status : 'gap',
|
|
82
|
+
};
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function operationPreservesSettledData(draft, operation) {
|
|
87
|
+
if (operation.type === 'set_preview_receipt')
|
|
88
|
+
return true;
|
|
89
|
+
if (operation.type === 'update_tile') {
|
|
90
|
+
const presentationKeys = new Set(['title', 'viz', 'display', 'x', 'y', 'w', 'h', 'sectionId']);
|
|
91
|
+
return Object.keys(operation.patch).every((key) => presentationKeys.has(key));
|
|
92
|
+
}
|
|
93
|
+
if (operation.type !== 'set_layout')
|
|
94
|
+
return false;
|
|
95
|
+
const page = draft.pages.find((candidate) => candidate.id === operation.pageId);
|
|
96
|
+
if (!page || page.layout.items.length !== operation.layout.items.length)
|
|
97
|
+
return false;
|
|
98
|
+
const currentById = new Map(page.layout.items.map((item) => [item.i, item]));
|
|
99
|
+
return operation.layout.items.every((item) => {
|
|
100
|
+
const current = currentById.get(item.i);
|
|
101
|
+
return current !== undefined && JSON.stringify(withoutTileGeometry(item)) === JSON.stringify(withoutTileGeometry(current));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function withoutTileGeometry(item) {
|
|
105
|
+
const { x: _x, y: _y, w: _w, h: _h, ...contract } = item;
|
|
106
|
+
return contract;
|
|
107
|
+
}
|
|
108
|
+
export function appBuildDraftHash(value) {
|
|
109
|
+
return `sha256:${createHash('sha256').update(JSON.stringify(value)).digest('hex')}`;
|
|
110
|
+
}
|
|
111
|
+
function applyOperation(draft, operation) {
|
|
112
|
+
switch (operation.type) {
|
|
113
|
+
case 'set_name': {
|
|
114
|
+
const name = operation.name.trim();
|
|
115
|
+
if (!name)
|
|
116
|
+
throw new Error('App name is required');
|
|
117
|
+
return { ...draft, name };
|
|
118
|
+
}
|
|
119
|
+
case 'set_template': return { ...draft, template: operation.template };
|
|
120
|
+
case 'set_frame': return { ...draft, frame: operation.frame };
|
|
121
|
+
case 'set_source_policy': return { ...draft, sourcePolicy: operation.sourcePolicy };
|
|
122
|
+
case 'set_requirements': return { ...draft, requirements: operation.requirements, coverage: operation.coverage ?? draft.coverage };
|
|
123
|
+
case 'set_coverage': return { ...draft, coverage: operation.coverage };
|
|
124
|
+
case 'upsert_source': return { ...draft, sources: upsertById(draft.sources, operation.source) };
|
|
125
|
+
case 'remove_source': return {
|
|
126
|
+
...draft,
|
|
127
|
+
sources: draft.sources.filter((source) => source.id !== operation.sourceId),
|
|
128
|
+
coverage: draft.coverage.map((item) => ({ ...item, sourceIds: item.sourceIds.filter((id) => id !== operation.sourceId) })),
|
|
129
|
+
};
|
|
130
|
+
case 'upsert_page': return { ...draft, pages: upsertById(draft.pages, normalizeEditedPage(operation.page)) };
|
|
131
|
+
case 'remove_page': return { ...draft, pages: draft.pages.filter((page) => page.id !== operation.pageId) };
|
|
132
|
+
case 'set_review_task': return { ...draft, reviewTasks: upsertById(draft.reviewTasks, operation.task) };
|
|
133
|
+
case 'remove_review_task': return { ...draft, reviewTasks: draft.reviewTasks.filter((task) => task.id !== operation.taskId) };
|
|
134
|
+
case 'set_preview_receipt': return {
|
|
135
|
+
...draft,
|
|
136
|
+
previewReceipt: operation.receipt,
|
|
137
|
+
previewReceipts: upsertReceiptByPage(draft.previewReceipts ?? (draft.previewReceipt ? [draft.previewReceipt] : []), operation.receipt),
|
|
138
|
+
};
|
|
139
|
+
default:
|
|
140
|
+
return updatePage(draft, operation.pageId, (page) => {
|
|
141
|
+
if (operation.type === 'add_tile') {
|
|
142
|
+
if (page.layout.items.some((tile) => tile.i === operation.tile.i))
|
|
143
|
+
throw new Error(`Tile already exists: ${operation.tile.i}`);
|
|
144
|
+
return { ...page, layout: { ...page.layout, items: [...page.layout.items, operation.tile] } };
|
|
145
|
+
}
|
|
146
|
+
if (operation.type === 'update_tile') {
|
|
147
|
+
return { ...page, layout: { ...page.layout, items: page.layout.items.map((tile) => tile.i === operation.tileId ? { ...tile, ...operation.patch, i: tile.i } : tile) } };
|
|
148
|
+
}
|
|
149
|
+
if (operation.type === 'remove_tile') {
|
|
150
|
+
return { ...page, layout: { ...page.layout, items: page.layout.items.filter((tile) => tile.i !== operation.tileId) } };
|
|
151
|
+
}
|
|
152
|
+
if (operation.type === 'set_filter') {
|
|
153
|
+
return { ...page, filters: upsertById(page.filters ?? [], operation.filter) };
|
|
154
|
+
}
|
|
155
|
+
if (operation.type === 'remove_filter') {
|
|
156
|
+
return { ...page, filters: (page.filters ?? []).filter((filter) => filter.id !== operation.filterId) };
|
|
157
|
+
}
|
|
158
|
+
return { ...page, layout: operation.layout };
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function updatePage(draft, pageId, update) {
|
|
163
|
+
let found = false;
|
|
164
|
+
const pages = draft.pages.map((page) => {
|
|
165
|
+
if (page.id !== pageId)
|
|
166
|
+
return page;
|
|
167
|
+
found = true;
|
|
168
|
+
return normalizeEditedPage(update(page));
|
|
169
|
+
});
|
|
170
|
+
if (!found)
|
|
171
|
+
throw new Error(`Page not found: ${pageId}`);
|
|
172
|
+
return { ...draft, pages };
|
|
173
|
+
}
|
|
174
|
+
/** A v1 page is upgraded only when an explicit App Studio edit reaches it. */
|
|
175
|
+
function normalizeEditedPage(page) {
|
|
176
|
+
const items = packDashboardLayoutItems(page.layout.items, 12);
|
|
177
|
+
return {
|
|
178
|
+
...page,
|
|
179
|
+
version: 2,
|
|
180
|
+
layout: {
|
|
181
|
+
...page.layout,
|
|
182
|
+
items,
|
|
183
|
+
responsive: projectResponsiveLayouts(items, page.layout.rowHeight),
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Produce a compact, non-overlapping row layout while preserving the author's
|
|
189
|
+
* visual reading order. App Studio uses this after every explicit edit so
|
|
190
|
+
* imported or stale geometry can never place a tile outside the active grid.
|
|
191
|
+
*/
|
|
192
|
+
export function packDashboardLayoutItems(items, cols) {
|
|
193
|
+
const columnCount = Math.max(1, Math.floor(cols));
|
|
194
|
+
let x = 0;
|
|
195
|
+
let y = 0;
|
|
196
|
+
let currentRowHeight = 0;
|
|
197
|
+
return items
|
|
198
|
+
.map((item, index) => ({ item, index }))
|
|
199
|
+
.sort((left, right) => left.item.y - right.item.y || left.item.x - right.item.x || left.index - right.index)
|
|
200
|
+
.map(({ item }) => {
|
|
201
|
+
const width = Math.min(columnCount, Math.max(1, Math.floor(item.w)));
|
|
202
|
+
const height = Math.max(1, Math.floor(item.h));
|
|
203
|
+
if (x + width > columnCount) {
|
|
204
|
+
x = 0;
|
|
205
|
+
y += currentRowHeight || height;
|
|
206
|
+
currentRowHeight = 0;
|
|
207
|
+
}
|
|
208
|
+
const next = { ...item, x, y, w: width, h: height };
|
|
209
|
+
x += width;
|
|
210
|
+
currentRowHeight = Math.max(currentRowHeight, height);
|
|
211
|
+
if (x >= columnCount) {
|
|
212
|
+
x = 0;
|
|
213
|
+
y += currentRowHeight;
|
|
214
|
+
currentRowHeight = 0;
|
|
215
|
+
}
|
|
216
|
+
return next;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function projectResponsiveLayouts(items, rowHeight) {
|
|
220
|
+
const project = (cols) => {
|
|
221
|
+
const projected = items.map((item) => {
|
|
222
|
+
const width = cols === 1 ? 1 : Math.min(cols, Math.max(2, Math.ceil(item.w / 2)));
|
|
223
|
+
return { ...item, w: width };
|
|
224
|
+
});
|
|
225
|
+
return packDashboardLayoutItems(projected, cols);
|
|
226
|
+
};
|
|
227
|
+
return {
|
|
228
|
+
wide: { kind: 'grid', cols: 12, rowHeight, items: packDashboardLayoutItems(items, 12) },
|
|
229
|
+
medium: { kind: 'grid', cols: 6, rowHeight, items: project(6) },
|
|
230
|
+
narrow: { kind: 'grid', cols: 1, rowHeight, items: project(1) },
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function upsertById(values, next) {
|
|
234
|
+
return values.some((value) => value.id === next.id)
|
|
235
|
+
? values.map((value) => value.id === next.id ? next : value)
|
|
236
|
+
: [...values, next];
|
|
237
|
+
}
|
|
238
|
+
function upsertReceiptByPage(values, next) {
|
|
239
|
+
return values.some((value) => value.pageId === next.pageId)
|
|
240
|
+
? values.map((value) => value.pageId === next.pageId ? next : value)
|
|
241
|
+
: [...values, next];
|
|
242
|
+
}
|
|
243
|
+
function assertAppBuildDraftPolicy(draft) {
|
|
244
|
+
if (!draft.id.trim() || !draft.appId.trim())
|
|
245
|
+
throw new Error('App Build Draft requires id and appId');
|
|
246
|
+
if (!draft.name.trim())
|
|
247
|
+
throw new Error('App Build Draft requires a name');
|
|
248
|
+
if (!draft.frame.goal.trim())
|
|
249
|
+
throw new Error('App Build Frame requires a goal');
|
|
250
|
+
const sourceIds = new Set();
|
|
251
|
+
for (const source of draft.sources) {
|
|
252
|
+
if (sourceIds.has(source.id))
|
|
253
|
+
throw new Error(`Duplicate App source id: ${source.id}`);
|
|
254
|
+
sourceIds.add(source.id);
|
|
255
|
+
if (source.sourceRevision && source.sourceFingerprint && source.sourceRevision !== source.sourceFingerprint) {
|
|
256
|
+
throw new Error(`Source ${source.id} has conflicting revision fingerprints`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
for (const coverage of draft.coverage) {
|
|
260
|
+
for (const sourceId of coverage.sourceIds) {
|
|
261
|
+
if (!sourceIds.has(sourceId))
|
|
262
|
+
throw new Error(`Coverage ${coverage.requirementId} references missing source ${sourceId}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
for (const page of draft.pages) {
|
|
266
|
+
for (const tile of page.layout.items) {
|
|
267
|
+
if (tile.sourceId && !sourceIds.has(tile.sourceId)) {
|
|
268
|
+
throw new Error(`Tile ${page.id}/${tile.i} references missing source ${tile.sourceId}`);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (draft.sourcePolicy === 'governed_only') {
|
|
273
|
+
const reviewSource = draft.sources.find((source) => (source.kind === 'block' && source.trustState !== 'certified')
|
|
274
|
+
|| source.kind === 'review_block'
|
|
275
|
+
|| source.kind === 'review_dql'
|
|
276
|
+
|| source.kind === 'exploratory_sql');
|
|
277
|
+
if (reviewSource)
|
|
278
|
+
throw new Error(`Source ${reviewSource.id} requires include_review_required policy`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=app-build-draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-build-draft.js","sourceRoot":"","sources":["../../src/apps/app-build-draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAwLzC,MAAM,UAAU,mBAAmB,CAAC,KAenC;IACC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAClD,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC;IAChE,MAAM,kBAAkB,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,Q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,CAAC;QAC5H,CAAC;IACH,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACnD,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,8BAA8B,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1F,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,YAAY,KAAK,eAAe,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACjD,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,UAAU,KAAK,WAAW,CAAC;eAC3D,MAAM,CAAC,IAAI,KAAK,cAAc;eAC9B,MAAM,CAAC,IAAI,KAAK,YAAY;eAC5B,MAAM,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC;QACxC,IAAI,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,UAAU,YAAY,CAAC,EAAE,0CAA0C,CAAC,CAAC;IACzG,CAAC;AACH,CAAC"}
|
|
@@ -22,12 +22,34 @@ export type DashboardParam = {
|
|
|
22
22
|
};
|
|
23
23
|
export type DashboardFilter = {
|
|
24
24
|
id: string;
|
|
25
|
-
type: 'string' | 'number' | 'boolean' | 'date' | 'daterange' | 'select';
|
|
25
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'daterange' | 'relative_date' | 'select' | 'multiselect' | 'search' | 'number_range';
|
|
26
|
+
label?: string;
|
|
26
27
|
default?: unknown;
|
|
27
28
|
/** For 'select': allowed values. */
|
|
28
29
|
options?: string[];
|
|
29
30
|
/** Optional dimension reference the filter binds to. */
|
|
30
31
|
bindsTo?: string;
|
|
32
|
+
/** Qualified identity; display names alone are never sufficient binding proof. */
|
|
33
|
+
field?: {
|
|
34
|
+
name: string;
|
|
35
|
+
relation?: string;
|
|
36
|
+
semanticModel?: string;
|
|
37
|
+
provider?: string;
|
|
38
|
+
};
|
|
39
|
+
required?: boolean;
|
|
40
|
+
multiple?: boolean;
|
|
41
|
+
scope?: {
|
|
42
|
+
page?: string;
|
|
43
|
+
tileIds?: string[];
|
|
44
|
+
};
|
|
45
|
+
optionSource?: {
|
|
46
|
+
mode: 'static' | 'distinct_query';
|
|
47
|
+
sourceRef?: string;
|
|
48
|
+
field?: string;
|
|
49
|
+
snapshotId?: string;
|
|
50
|
+
limit?: number;
|
|
51
|
+
};
|
|
52
|
+
dependsOn?: string[];
|
|
31
53
|
};
|
|
32
54
|
export type DashboardBlockRef = {
|
|
33
55
|
blockId: string;
|
|
@@ -65,13 +87,15 @@ export type DashboardTileFilterBinding = {
|
|
|
65
87
|
/** Physical column/expression or semantic field this filter can bind to. */
|
|
66
88
|
binding?: string;
|
|
67
89
|
/** Whether this becomes a block parameter or an outer predicate at execution time. */
|
|
68
|
-
mode?: 'parameter' | 'predicate';
|
|
90
|
+
mode?: 'parameter' | 'predicate' | 'semantic';
|
|
69
91
|
/** Block parameter names controlled by this app filter. */
|
|
70
92
|
paramNames?: string[];
|
|
71
93
|
/** If true, the tile should warn when the filter is missing. */
|
|
72
94
|
required?: boolean;
|
|
73
95
|
/** Populated when a global filter intentionally does not apply to this tile. */
|
|
74
96
|
unsupportedReason?: string;
|
|
97
|
+
/** Explicit capability prevents a global filter from appearing silently partial. */
|
|
98
|
+
capability?: 'supported' | 'unsupported' | 'preflight_required';
|
|
75
99
|
};
|
|
76
100
|
export type DashboardTileParameterBinding = {
|
|
77
101
|
/** Block parameter name. */
|
|
@@ -193,6 +217,13 @@ export type DashboardGridItem = {
|
|
|
193
217
|
y: number;
|
|
194
218
|
w: number;
|
|
195
219
|
h: number;
|
|
220
|
+
/**
|
|
221
|
+
* Canonical AppBuildDraft source binding. App Studio v3 writes this for
|
|
222
|
+
* every data tile; legacy published dashboards remain readable without it.
|
|
223
|
+
*/
|
|
224
|
+
sourceId?: string;
|
|
225
|
+
/** Snapshot-bound source revision selected by App Studio. */
|
|
226
|
+
sourceRevision?: string;
|
|
196
227
|
/** Certified/shared block source. Existing dashboards use this shape. */
|
|
197
228
|
block?: DashboardBlockRef;
|
|
198
229
|
/** Local narrative/section text tile. */
|
|
@@ -236,8 +267,20 @@ export type DashboardSection = {
|
|
|
236
267
|
narrative?: string;
|
|
237
268
|
order: number;
|
|
238
269
|
};
|
|
270
|
+
export type DashboardGridLayout = {
|
|
271
|
+
kind: 'grid';
|
|
272
|
+
cols: number;
|
|
273
|
+
rowHeight: number;
|
|
274
|
+
items: DashboardGridItem[];
|
|
275
|
+
};
|
|
276
|
+
export type DashboardResponsiveLayouts = {
|
|
277
|
+
/** Canonical authoring geometry. Existing v1 layout is treated as `wide`. */
|
|
278
|
+
wide?: DashboardGridLayout;
|
|
279
|
+
medium?: DashboardGridLayout;
|
|
280
|
+
narrow?: DashboardGridLayout;
|
|
281
|
+
};
|
|
239
282
|
export interface DashboardDocument {
|
|
240
|
-
version: 1;
|
|
283
|
+
version: 1 | 2;
|
|
241
284
|
id: string;
|
|
242
285
|
metadata: {
|
|
243
286
|
title: string;
|
|
@@ -262,11 +305,8 @@ export interface DashboardDocument {
|
|
|
262
305
|
sections?: DashboardSection[];
|
|
263
306
|
/** Runtime story evidence contract. Result-specific prose is never persisted. */
|
|
264
307
|
story?: DashboardStoryEvidencePlan;
|
|
265
|
-
layout: {
|
|
266
|
-
|
|
267
|
-
cols: number;
|
|
268
|
-
rowHeight: number;
|
|
269
|
-
items: DashboardGridItem[];
|
|
308
|
+
layout: DashboardGridLayout & {
|
|
309
|
+
responsive?: DashboardResponsiveLayouts;
|
|
270
310
|
};
|
|
271
311
|
}
|
|
272
312
|
export interface DashboardParseError {
|