@principal-ai/subsystems-react 0.56.0 → 0.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/pierre/PierreTrailCodeView.d.ts +3 -3
- package/dist/pierre/PierreTrailCodeView.d.ts.map +1 -1
- package/dist/pierre/PierreTrailCodeView.js +16 -16
- package/dist/pierre/PierreTrailCodeView.js.map +1 -1
- package/dist/pierre/trailSnippet.d.ts +10 -0
- package/dist/pierre/trailSnippet.d.ts.map +1 -0
- package/dist/pierre/trailSnippet.js +22 -0
- package/dist/pierre/trailSnippet.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +0 -37
- package/src/pierre/PierreTrailCodeView.tsx +14 -23
- package/src/pierre/trailSnippet.test.ts +74 -0
- package/src/pierre/trailSnippet.ts +35 -0
- package/dist/subsystem/DecorationPanel.d.ts +0 -37
- package/dist/subsystem/DecorationPanel.d.ts.map +0 -1
- package/dist/subsystem/DecorationPanel.js +0 -147
- package/dist/subsystem/DecorationPanel.js.map +0 -1
- package/dist/subsystem/decoration.d.ts +0 -112
- package/dist/subsystem/decoration.d.ts.map +0 -1
- package/dist/subsystem/decoration.js +0 -54
- package/dist/subsystem/decoration.js.map +0 -1
- package/src/stories/Canvases/Subsystem/StepEmphasis.stories.tsx +0 -528
- package/src/stories/Components/DecorationPanel.stories.tsx +0 -160
- package/src/subsystem/DecorationPanel.test.tsx +0 -128
- package/src/subsystem/DecorationPanel.tsx +0 -334
- package/src/subsystem/decoration.test.ts +0 -72
- package/src/subsystem/decoration.ts +0 -151
- package/src/subsystem/stepEmphasis.test.ts +0 -110
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from '@principal-ade/industry-theme';
|
|
3
|
-
import { Box, Eye, EyeOff, Network, Route, Sparkles } from 'lucide-react';
|
|
4
|
-
import { IndustryMarkdownSlide } from 'themed-markdown';
|
|
5
|
-
import { decorationTrailId, groupDecorationTrailsByModel, } from './decoration';
|
|
6
|
-
export function DecorationPanel({ decoration, active, onToggleActive, onSelectTrail, onSelectDraftComponent, resolveTrail, modelLabels, }) {
|
|
7
|
-
const { theme } = useTheme();
|
|
8
|
-
const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
|
|
9
|
-
const secondary = theme.colors.textSecondary ?? muted;
|
|
10
|
-
const warning = theme.colors.warning ?? secondary;
|
|
11
|
-
const accent = theme.colors.accent ?? theme.colors.primary ?? theme.colors.text;
|
|
12
|
-
const groups = groupDecorationTrailsByModel(decoration.trails);
|
|
13
|
-
const draftComponents = decoration.draft?.components ?? [];
|
|
14
|
-
const draftEdges = decoration.draft?.edges ?? [];
|
|
15
|
-
const sectionLabel = {
|
|
16
|
-
fontFamily: theme.fonts.monospace,
|
|
17
|
-
fontSize: theme.fontSizes[0],
|
|
18
|
-
fontWeight: theme.fontWeights.semibold,
|
|
19
|
-
letterSpacing: '0.06em',
|
|
20
|
-
textTransform: 'uppercase',
|
|
21
|
-
};
|
|
22
|
-
return (_jsxs("div", { style: {
|
|
23
|
-
display: 'flex',
|
|
24
|
-
flexDirection: 'column',
|
|
25
|
-
width: '100%',
|
|
26
|
-
height: '100%',
|
|
27
|
-
minHeight: 0,
|
|
28
|
-
background: theme.colors.background,
|
|
29
|
-
color: theme.colors.text,
|
|
30
|
-
}, children: [_jsx("header", { style: {
|
|
31
|
-
flexShrink: 0,
|
|
32
|
-
padding: '14px 16px 10px',
|
|
33
|
-
borderBottom: `1px solid ${theme.colors.border}`,
|
|
34
|
-
}, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [_jsx(Sparkles, { size: 15, strokeWidth: 2, color: accent, "aria-hidden": true }), _jsx("h2", { style: {
|
|
35
|
-
flex: 1,
|
|
36
|
-
minWidth: 0,
|
|
37
|
-
margin: 0,
|
|
38
|
-
overflowWrap: 'anywhere',
|
|
39
|
-
fontFamily: theme.fonts.monospace,
|
|
40
|
-
fontSize: theme.fontSizes[2],
|
|
41
|
-
fontWeight: theme.fontWeights.semibold,
|
|
42
|
-
}, children: decoration.title }), _jsxs("button", { type: "button", "aria-pressed": active, "aria-label": active ? 'Turn decoration off' : 'Turn decoration on', title: active ? 'Turn decoration off' : 'Turn decoration on', onClick: () => onToggleActive(!active), style: {
|
|
43
|
-
display: 'inline-flex',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
gap: 4,
|
|
46
|
-
flexShrink: 0,
|
|
47
|
-
padding: '3px 8px',
|
|
48
|
-
borderRadius: 4,
|
|
49
|
-
border: `1px solid ${active ? accent : theme.colors.border}`,
|
|
50
|
-
background: active ? `${accent}18` : 'transparent',
|
|
51
|
-
color: active ? accent : muted,
|
|
52
|
-
fontFamily: theme.fonts.monospace,
|
|
53
|
-
fontSize: theme.fontSizes[0],
|
|
54
|
-
cursor: 'pointer',
|
|
55
|
-
}, children: [active ? _jsx(Eye, { size: 12, strokeWidth: 2 }) : _jsx(EyeOff, { size: 12, strokeWidth: 2 }), active ? 'On' : 'Off'] })] }) }), _jsxs("div", { style: { flex: 1, minHeight: 0, overflowY: 'auto', padding: '12px 16px 18px' }, children: [decoration.description && (_jsx("div", { style: { fontSize: theme.fontSizes[1], lineHeight: theme.lineHeights.body }, children: _jsx(IndustryMarkdownSlide, { content: decoration.description, slideIdPrefix: `decoration-${decoration.id}`, slideIndex: 0, isVisible: true, theme: theme, disableScroll: true, disableBasePadding: true, enableKeyboardScrolling: false, autoFocusOnVisible: false }) })), _jsxs("section", { style: {
|
|
56
|
-
marginTop: 16,
|
|
57
|
-
paddingTop: 14,
|
|
58
|
-
borderTop: `1px solid ${theme.colors.border}`,
|
|
59
|
-
}, children: [_jsxs("div", { style: { ...sectionLabel, color: secondary }, children: ["Trails \u00B7 ", decoration.trails.length] }), groups.map((group) => (_jsxs("div", { children: [_jsxs("div", { style: {
|
|
60
|
-
display: 'flex',
|
|
61
|
-
alignItems: 'center',
|
|
62
|
-
gap: 6,
|
|
63
|
-
margin: '12px 0 3px',
|
|
64
|
-
}, children: [_jsx(Network, { size: 14, strokeWidth: 2, color: secondary, "aria-hidden": true }), _jsx("span", { style: {
|
|
65
|
-
minWidth: 0,
|
|
66
|
-
overflow: 'hidden',
|
|
67
|
-
textOverflow: 'ellipsis',
|
|
68
|
-
whiteSpace: 'nowrap',
|
|
69
|
-
fontFamily: theme.fonts.monospace,
|
|
70
|
-
fontSize: theme.fontSizes[1],
|
|
71
|
-
fontWeight: theme.fontWeights.semibold,
|
|
72
|
-
color: theme.colors.text,
|
|
73
|
-
}, children: modelLabels?.get(group.modelId) ?? group.modelId })] }), group.trails.map((ref) => {
|
|
74
|
-
const meta = resolveTrail?.(ref);
|
|
75
|
-
const title = meta?.title ??
|
|
76
|
-
(ref.kind === 'draft' ? ref.trail.title : ref.trailId);
|
|
77
|
-
const stepCount = meta?.stepCount ??
|
|
78
|
-
(ref.kind === 'draft' ? ref.trail.steps.length : undefined);
|
|
79
|
-
return (_jsxs("button", { type: "button", onClick: () => onSelectTrail?.(ref), style: {
|
|
80
|
-
display: 'flex',
|
|
81
|
-
alignItems: 'center',
|
|
82
|
-
gap: 8,
|
|
83
|
-
width: '100%',
|
|
84
|
-
minWidth: 0,
|
|
85
|
-
padding: '6px 6px 6px 0',
|
|
86
|
-
border: 'none',
|
|
87
|
-
borderRadius: 4,
|
|
88
|
-
background: 'transparent',
|
|
89
|
-
color: theme.colors.text,
|
|
90
|
-
textAlign: 'left',
|
|
91
|
-
cursor: onSelectTrail ? 'pointer' : 'default',
|
|
92
|
-
}, children: [_jsx(Route, { size: 13, strokeWidth: 2, color: muted, "aria-hidden": true }), _jsx("span", { style: {
|
|
93
|
-
flex: 1,
|
|
94
|
-
minWidth: 0,
|
|
95
|
-
overflow: 'hidden',
|
|
96
|
-
textOverflow: 'ellipsis',
|
|
97
|
-
whiteSpace: 'nowrap',
|
|
98
|
-
fontFamily: theme.fonts.monospace,
|
|
99
|
-
fontSize: theme.fontSizes[1],
|
|
100
|
-
}, children: title }), ref.kind === 'draft' && (_jsx("span", { style: {
|
|
101
|
-
flexShrink: 0,
|
|
102
|
-
padding: '1px 5px',
|
|
103
|
-
borderRadius: 3,
|
|
104
|
-
border: `1px solid ${warning}`,
|
|
105
|
-
color: warning,
|
|
106
|
-
fontFamily: theme.fonts.monospace,
|
|
107
|
-
fontSize: theme.fontSizes[0],
|
|
108
|
-
}, children: "draft" })), stepCount != null && (_jsx("span", { style: {
|
|
109
|
-
flexShrink: 0,
|
|
110
|
-
fontFamily: theme.fonts.monospace,
|
|
111
|
-
fontSize: theme.fontSizes[0],
|
|
112
|
-
color: secondary,
|
|
113
|
-
}, children: stepCount }))] }, decorationTrailId(ref)));
|
|
114
|
-
})] }, group.modelId)))] }), (draftComponents.length > 0 || draftEdges.length > 0) && (_jsxs("section", { style: { marginTop: 18 }, children: [_jsx("div", { style: { ...sectionLabel, color: secondary }, children: "Draft structure \u00B7 not verified" }), draftComponents.map((component) => (_jsxs("button", { type: "button", onClick: () => onSelectDraftComponent?.(component), style: {
|
|
115
|
-
display: 'flex',
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
gap: 8,
|
|
118
|
-
width: '100%',
|
|
119
|
-
minWidth: 0,
|
|
120
|
-
padding: '6px 6px 6px 0',
|
|
121
|
-
border: 'none',
|
|
122
|
-
borderRadius: 4,
|
|
123
|
-
background: 'transparent',
|
|
124
|
-
color: theme.colors.text,
|
|
125
|
-
textAlign: 'left',
|
|
126
|
-
cursor: onSelectDraftComponent ? 'pointer' : 'default',
|
|
127
|
-
}, children: [_jsx(Box, { size: 13, strokeWidth: 2, color: muted, "aria-hidden": true }), _jsx("span", { style: {
|
|
128
|
-
flex: 1,
|
|
129
|
-
minWidth: 0,
|
|
130
|
-
overflow: 'hidden',
|
|
131
|
-
textOverflow: 'ellipsis',
|
|
132
|
-
whiteSpace: 'nowrap',
|
|
133
|
-
fontFamily: theme.fonts.monospace,
|
|
134
|
-
fontSize: theme.fontSizes[1],
|
|
135
|
-
}, children: component.name }), component.construct && (_jsx("span", { style: {
|
|
136
|
-
flexShrink: 0,
|
|
137
|
-
fontFamily: theme.fonts.monospace,
|
|
138
|
-
fontSize: theme.fontSizes[0],
|
|
139
|
-
color: secondary,
|
|
140
|
-
}, children: component.construct }))] }, component.alias))), draftEdges.length > 0 && (_jsxs("div", { style: {
|
|
141
|
-
marginTop: 4,
|
|
142
|
-
fontFamily: theme.fonts.monospace,
|
|
143
|
-
fontSize: theme.fontSizes[0],
|
|
144
|
-
color: secondary,
|
|
145
|
-
}, children: ["+ ", draftEdges.length, " draft edge", draftEdges.length === 1 ? '' : 's'] }))] }))] })] }));
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=DecorationPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DecorationPanel.js","sourceRoot":"","sources":["../../src/subsystem/DecorationPanel.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,4BAA4B,GAI7B,MAAM,cAAc,CAAC;AAyBtB,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,MAAM,EACN,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,WAAW,GACU;IACrB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;IACnE,MAAM,SA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,CAAC,SAAS;4CACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;yCAC7B,YAEA,SAAS,CAAC,IAAI,GACV,EACN,SAAS,CAAC,SAAS,IAAI,CACtB,eACE,KAAK,EAAE;4CACL,UAAU,EAAE,CAAC;4CACb,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS;4CACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;4CAC5B,KAAK,EAAE,SAAS;yCACjB,YAEA,SAAS,CAAC,SAAS,GACf,CACR,KA3CI,SAAS,CAAC,KAAK,CA4Cb,CACV,CAAC,EACD,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,eACE,KAAK,EAAE;oCACL,SAAS,EAAE,CAAC;oCACZ,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS;oCACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;oCAC5B,KAAK,EAAE,SAAS;iCACjB,mBAEE,UAAU,CAAC,MAAM,iBAAa,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAC/D,CACP,IACO,CACX,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subsystem decoration — PROTOTYPE contract for the ephemeral, unverified layer.
|
|
3
|
-
*
|
|
4
|
-
* A decoration composes trails from one or more models, carries a markdown
|
|
5
|
-
* description, and may add draft structure. The base model stays verified-only;
|
|
6
|
-
* a decoration is never audited against source.
|
|
7
|
-
*
|
|
8
|
-
* **Each trail ref names its own model.** There is no decoration-level `base`
|
|
9
|
-
* field: a decoration can mix models by construction, and a single-model
|
|
10
|
-
* decoration is just the case where every ref happens to share a `modelId`.
|
|
11
|
-
*
|
|
12
|
-
* A trail can be either:
|
|
13
|
-
* - `base` — a reference to a trail that already exists in a model; or
|
|
14
|
-
* - `draft` — a trail that only exists in the decoration. This is what
|
|
15
|
-
* migration needs when a base trail depends on draft components: the whole
|
|
16
|
-
* trail moves into the decoration rather than dangling in the base.
|
|
17
|
-
*
|
|
18
|
-
* The contract is deliberately host-local and not part of the portable
|
|
19
|
-
* subsystem document. If decorations become shareable, `modelId` needs a
|
|
20
|
-
* portable identity key (the local `sg-...` ids are re-minted).
|
|
21
|
-
*/
|
|
22
|
-
import type { SubsystemTrail, SubsystemTrailMechanism } from './model';
|
|
23
|
-
export interface DecorationStepAnchor {
|
|
24
|
-
/** Claim fingerprint of the anchored step (see `stepClaimKey`). */
|
|
25
|
-
stepKey: string;
|
|
26
|
-
/** Optional per-anchor note. The decoration description carries the prose. */
|
|
27
|
-
note?: string;
|
|
28
|
-
}
|
|
29
|
-
interface DecorationTrailRefBase {
|
|
30
|
-
/** Store-local model id. The trail id is only unique within this model. */
|
|
31
|
-
modelId: string;
|
|
32
|
-
/** Optional step-level anchors inside this trail. */
|
|
33
|
-
stepAnchors?: DecorationStepAnchor[];
|
|
34
|
-
}
|
|
35
|
-
/** A trail that already exists in the base model. */
|
|
36
|
-
export interface DecorationBaseTrailRef extends DecorationTrailRefBase {
|
|
37
|
-
kind: 'base';
|
|
38
|
-
trailId: string;
|
|
39
|
-
}
|
|
40
|
-
/** A speculative trail that exists only in the decoration. */
|
|
41
|
-
export interface DecorationDraftTrailRef extends DecorationTrailRefBase {
|
|
42
|
-
kind: 'draft';
|
|
43
|
-
trail: SubsystemTrail;
|
|
44
|
-
}
|
|
45
|
-
export type DecorationTrailRef = DecorationBaseTrailRef | DecorationDraftTrailRef;
|
|
46
|
-
/**
|
|
47
|
-
* Draft structure: a component that does not exist in source yet. No
|
|
48
|
-
* `file`/`symbol` — those are the verification coordinates the base model
|
|
49
|
-
* requires, and a draft component deliberately has none.
|
|
50
|
-
*/
|
|
51
|
-
export interface DecorationDraftComponent {
|
|
52
|
-
alias: string;
|
|
53
|
-
name: string;
|
|
54
|
-
/** Intended construct shape (`class`, `function`, …). */
|
|
55
|
-
construct?: string;
|
|
56
|
-
purpose?: string;
|
|
57
|
-
module?: string;
|
|
58
|
-
process?: string;
|
|
59
|
-
}
|
|
60
|
-
/** A speculative edge between base or draft aliases. */
|
|
61
|
-
export interface DecorationDraftEdge {
|
|
62
|
-
from: string;
|
|
63
|
-
to: string;
|
|
64
|
-
mechanism: SubsystemTrailMechanism;
|
|
65
|
-
}
|
|
66
|
-
export interface DecorationDraft {
|
|
67
|
-
components?: DecorationDraftComponent[];
|
|
68
|
-
edges?: DecorationDraftEdge[];
|
|
69
|
-
}
|
|
70
|
-
export interface DecorationProvenance {
|
|
71
|
-
source: 'author' | 'agent';
|
|
72
|
-
author?: string;
|
|
73
|
-
/** ISO timestamp. */
|
|
74
|
-
at: string;
|
|
75
|
-
}
|
|
76
|
-
export interface SubsystemDecoration {
|
|
77
|
-
version: 1;
|
|
78
|
-
id: string;
|
|
79
|
-
title: string;
|
|
80
|
-
/** Markdown, rendered like the model description. */
|
|
81
|
-
description: string;
|
|
82
|
-
/**
|
|
83
|
-
* Ordered trails the decoration cares about. Order is the reading order;
|
|
84
|
-
* `modelId` may vary from ref to ref. A trail is either a base ref or a
|
|
85
|
-
* draft trail that lives only here.
|
|
86
|
-
*/
|
|
87
|
-
trails: DecorationTrailRef[];
|
|
88
|
-
/** Optional draft delta. Absent = a pure reading path. */
|
|
89
|
-
draft?: DecorationDraft;
|
|
90
|
-
provenance: DecorationProvenance;
|
|
91
|
-
}
|
|
92
|
-
/** The trail id for either kind of ref. */
|
|
93
|
-
export declare function decorationTrailId(ref: DecorationTrailRef): string;
|
|
94
|
-
/** Stable key for a trail ref across models. `trailId` alone is not enough. */
|
|
95
|
-
export declare function decorationTrailKey(ref: Pick<DecorationTrailRef, 'modelId'> & {
|
|
96
|
-
trailId?: string;
|
|
97
|
-
trail?: SubsystemTrail;
|
|
98
|
-
}): string;
|
|
99
|
-
/**
|
|
100
|
-
* Group trail refs by their owning model, preserving first-seen model order
|
|
101
|
-
* and the authored trail order within each group. The UI uses this to render
|
|
102
|
-
* "which trails it cares about" without a separate model list.
|
|
103
|
-
*/
|
|
104
|
-
export declare function groupDecorationTrailsByModel(refs: readonly DecorationTrailRef[]): Array<{
|
|
105
|
-
modelId: string;
|
|
106
|
-
trails: DecorationTrailRef[];
|
|
107
|
-
}>;
|
|
108
|
-
/** The distinct models a decoration touches, in first-seen order. */
|
|
109
|
-
export declare function decorationModelIds(refs: readonly DecorationTrailRef[]): string[];
|
|
110
|
-
export declare function findDecorationTrail(refs: readonly DecorationTrailRef[], modelId: string, trailId: string): DecorationTrailRef | undefined;
|
|
111
|
-
export {};
|
|
112
|
-
//# sourceMappingURL=decoration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decoration.d.ts","sourceRoot":"","sources":["../../src/subsystem/decoration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,sBAAsB;IAC9B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACtC;AAED,qDAAqD;AACrD,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,uBAAuB,CAAC;AAE5B;;;;GAIG;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M,CAGR;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,SAAS,kBAAkB,EAAE,GAClC,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAAC,CAQ1D;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,kBAAkB,EAAE,GAClC,MAAM,EAAE,CAEV;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,kBAAkB,EAAE,EACnC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,kBAAkB,GAAG,SAAS,CAIhC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subsystem decoration — PROTOTYPE contract for the ephemeral, unverified layer.
|
|
3
|
-
*
|
|
4
|
-
* A decoration composes trails from one or more models, carries a markdown
|
|
5
|
-
* description, and may add draft structure. The base model stays verified-only;
|
|
6
|
-
* a decoration is never audited against source.
|
|
7
|
-
*
|
|
8
|
-
* **Each trail ref names its own model.** There is no decoration-level `base`
|
|
9
|
-
* field: a decoration can mix models by construction, and a single-model
|
|
10
|
-
* decoration is just the case where every ref happens to share a `modelId`.
|
|
11
|
-
*
|
|
12
|
-
* A trail can be either:
|
|
13
|
-
* - `base` — a reference to a trail that already exists in a model; or
|
|
14
|
-
* - `draft` — a trail that only exists in the decoration. This is what
|
|
15
|
-
* migration needs when a base trail depends on draft components: the whole
|
|
16
|
-
* trail moves into the decoration rather than dangling in the base.
|
|
17
|
-
*
|
|
18
|
-
* The contract is deliberately host-local and not part of the portable
|
|
19
|
-
* subsystem document. If decorations become shareable, `modelId` needs a
|
|
20
|
-
* portable identity key (the local `sg-...` ids are re-minted).
|
|
21
|
-
*/
|
|
22
|
-
/** The trail id for either kind of ref. */
|
|
23
|
-
export function decorationTrailId(ref) {
|
|
24
|
-
return ref.kind === 'base' ? ref.trailId : ref.trail.id;
|
|
25
|
-
}
|
|
26
|
-
/** Stable key for a trail ref across models. `trailId` alone is not enough. */
|
|
27
|
-
export function decorationTrailKey(ref) {
|
|
28
|
-
const trailId = ref.trailId ?? ref.trail?.id ?? '';
|
|
29
|
-
return `${ref.modelId}:${trailId}`;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Group trail refs by their owning model, preserving first-seen model order
|
|
33
|
-
* and the authored trail order within each group. The UI uses this to render
|
|
34
|
-
* "which trails it cares about" without a separate model list.
|
|
35
|
-
*/
|
|
36
|
-
export function groupDecorationTrailsByModel(refs) {
|
|
37
|
-
const groups = new Map();
|
|
38
|
-
for (const ref of refs) {
|
|
39
|
-
const existing = groups.get(ref.modelId);
|
|
40
|
-
if (existing)
|
|
41
|
-
existing.push(ref);
|
|
42
|
-
else
|
|
43
|
-
groups.set(ref.modelId, [ref]);
|
|
44
|
-
}
|
|
45
|
-
return [...groups].map(([modelId, trails]) => ({ modelId, trails }));
|
|
46
|
-
}
|
|
47
|
-
/** The distinct models a decoration touches, in first-seen order. */
|
|
48
|
-
export function decorationModelIds(refs) {
|
|
49
|
-
return [...new Set(refs.map((ref) => ref.modelId))];
|
|
50
|
-
}
|
|
51
|
-
export function findDecorationTrail(refs, modelId, trailId) {
|
|
52
|
-
return refs.find((ref) => ref.modelId === modelId && decorationTrailId(ref) === trailId);
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=decoration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decoration.js","sourceRoot":"","sources":["../../src/subsystem/decoration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAqFH,2CAA2C;AAC3C,MAAM,UAAU,iBAAiB,CAAC,GAAuB;IACvD,OAAO,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1D,CAAC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