@bevel-software/platform-shared 0.14.0 → 0.15.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/git/types.d.ts +47 -1
- package/dist/git/types.d.ts.map +1 -1
- package/dist/workflow/events.d.ts +7 -0
- package/dist/workflow/events.d.ts.map +1 -1
- package/dist/workflow/events.js.map +1 -1
- package/dist/workflow/interface.d.ts +35 -2
- package/dist/workflow/interface.d.ts.map +1 -1
- package/dist/workflow/types.d.ts +44 -0
- package/dist/workflow/types.d.ts.map +1 -1
- package/dist/workspace/filename.d.ts.map +1 -1
- package/dist/workspace/filename.js +7 -3
- package/dist/workspace/filename.js.map +1 -1
- package/dist/workspace/kb-layout.d.ts +160 -21
- package/dist/workspace/kb-layout.d.ts.map +1 -1
- package/dist/workspace/kb-layout.js +291 -22
- package/dist/workspace/kb-layout.js.map +1 -1
- package/package.json +1 -1
- package/src/git/types.ts +46 -2
- package/src/workflow/events.ts +7 -0
- package/src/workflow/interface.ts +35 -2
- package/src/workflow/types.ts +27 -0
- package/src/workspace/filename.ts +7 -3
- package/src/workspace/kb-layout.ts +299 -26
package/dist/git/types.d.ts
CHANGED
|
@@ -44,10 +44,22 @@ export interface ValidationReport {
|
|
|
44
44
|
warnings: string[];
|
|
45
45
|
rawOutput: string;
|
|
46
46
|
}
|
|
47
|
+
/** What `IGitService.syncFromRemote` observed under its one hold of the clone. */
|
|
48
|
+
export interface RemoteSyncPullResult {
|
|
49
|
+
/** HEAD before the pull; null when the clone had no commits yet. */
|
|
50
|
+
before: string | null;
|
|
51
|
+
/** HEAD after the pull; null only when origin is still empty too. */
|
|
52
|
+
after: string | null;
|
|
53
|
+
/** Whether the working tree's CONTENT differs — tree ids, not commit ids. */
|
|
54
|
+
treeChanged: boolean;
|
|
55
|
+
/** Repo-relative paths whose content changed; empty unless `treeChanged`. */
|
|
56
|
+
changedPaths: string[];
|
|
57
|
+
}
|
|
47
58
|
export interface IGitService {
|
|
48
59
|
status(workspaceId: string): Promise<WorkingTreeStatus>;
|
|
49
60
|
listBranches(workspaceId: string, opts?: {
|
|
50
61
|
freshFetch?: boolean;
|
|
62
|
+
strictFetch?: boolean;
|
|
51
63
|
}): Promise<BranchInfo[]>;
|
|
52
64
|
createBranch(workspaceId: string, name: string, fromBase?: string): Promise<BranchInfo>;
|
|
53
65
|
/**
|
|
@@ -83,7 +95,41 @@ export interface IGitService {
|
|
|
83
95
|
systemAuthorized?: boolean;
|
|
84
96
|
}): Promise<void>;
|
|
85
97
|
fetch(workspaceId: string): Promise<void>;
|
|
86
|
-
|
|
98
|
+
/**
|
|
99
|
+
* `treeChanged` is whether the pull left the working tree holding different
|
|
100
|
+
* CONTENT than before the call — tree ids compared, not commit ids, so a
|
|
101
|
+
* pull that only moves HEAD across content-identical commits (an empty
|
|
102
|
+
* commit, a rebase that replays to the same result) reports false. Only the
|
|
103
|
+
* pull itself can answer that (it holds the workspace mutex across the
|
|
104
|
+
* rebase; any before/after probe a caller ran around it would race), and
|
|
105
|
+
* callers that announce "this tree changed" to the rest of the process need
|
|
106
|
+
* the distinction: an "already up to date" pull that broadcast anyway would
|
|
107
|
+
* drop every catalog cache and reload every attached browser for nothing.
|
|
108
|
+
*/
|
|
109
|
+
pull(workspaceId: string): Promise<{
|
|
110
|
+
treeChanged: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* The remote sync's pull, observed as ONE serialized operation: where HEAD
|
|
114
|
+
* was, the pull, where HEAD is, and which repo-relative paths changed
|
|
115
|
+
* (rename-aware: both ends). `pull` bracketed by separate reads would let a
|
|
116
|
+
* concurrent save land between them and be announced as the sync's own.
|
|
117
|
+
*
|
|
118
|
+
* Tolerant of an unborn HEAD (a clone of an empty upstream): `before` is
|
|
119
|
+
* null, and paths are diffed against the empty tree. Throws the typed
|
|
120
|
+
* pull-conflict error like `pull`, and a typed "remote branch gone" error
|
|
121
|
+
* when origin no longer has the branch — including for an unborn clone,
|
|
122
|
+
* once origin has any branch at all. The one exception: an unborn clone
|
|
123
|
+
* against an origin with NO branches (a fresh deployment nobody has pushed
|
|
124
|
+
* to) resolves to `after: null`, since there is nothing to sync and nothing
|
|
125
|
+
* stale.
|
|
126
|
+
*/
|
|
127
|
+
syncFromRemote(workspaceId: string): Promise<RemoteSyncPullResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Whether origin still has `branch` right now (`ls-remote`). Used to
|
|
130
|
+
* revalidate that a clone is still stale before it is retired.
|
|
131
|
+
*/
|
|
132
|
+
remoteBranchExists(workspaceId: string, branch: string): Promise<boolean>;
|
|
87
133
|
diffStat(workspaceId: string, base?: string): Promise<string[]>;
|
|
88
134
|
/**
|
|
89
135
|
* Paths in the working tree that the next commit would include — the set
|
package/dist/git/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/git/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IAIrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;CAKpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,OAAO,CAAC;IAKrB,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAMD,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,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AC,CAAC;IACnB;;;;;;;;;;OAUG;IACH,uBAAuB,CACrB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAAC;IAOnB;;;;OAIG;IACH,aAAa,CACX,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,iBAAiB,CACf,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GACtE,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAE9B;;;;OAIG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACnG"}
|
|
@@ -124,6 +124,13 @@ export interface GitSyncFailedEvent {
|
|
|
124
124
|
branch: string;
|
|
125
125
|
/** Sanitised git error — safe to display, tokens already redacted. */
|
|
126
126
|
reason: string;
|
|
127
|
+
/**
|
|
128
|
+
* Present when the failure is a REMOTE-SYNC CONFLICT (`POST /api/sync`
|
|
129
|
+
* found Hexis-side commits that contradict what landed on the host): the
|
|
130
|
+
* repo-relative files a person has to reconcile. Unlike a failing push,
|
|
131
|
+
* this is the author's to act on, so the banner offers to open them.
|
|
132
|
+
*/
|
|
133
|
+
conflictedPaths?: string[];
|
|
127
134
|
}
|
|
128
135
|
/**
|
|
129
136
|
* A push succeeded on a workspace whose previous push had failed — the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;CACZ;AAID;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iB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CAMnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/workflow/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA+QH,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAC/B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,oBAAoB,CAChC,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,YAAY,CAC1B,CAAuB;IAEvB,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,IAAI,KAAK,6BAA6B,CACzC,CAAC;AACJ,CAAC"}
|
|
@@ -17,15 +17,23 @@
|
|
|
17
17
|
* the final surface area.
|
|
18
18
|
*/
|
|
19
19
|
import type { AuthUser } from '../auth/types.js';
|
|
20
|
-
import type { AcquireLockResult, Branch, BranchWorkspaceStatus, CancelChangeRequestResult, Change, ChangeInput, ChangeRequest, ChangeRequestComment, ChangeRequestDetail, ChangeRequestState, ChangedFile, FileApproval, FileLock, MergeChangeRequestOutcome, OpenChangeRequestInput, PostChangeRequestCommentInput } from './types.js';
|
|
20
|
+
import type { AcquireLockResult, Branch, BranchSyncOutcome, BranchWorkspaceStatus, CancelChangeRequestResult, Change, ChangeInput, ChangeRequest, ChangeRequestComment, ChangeRequestDetail, ChangeRequestState, ChangedFile, FileApproval, FileLock, MergeChangeRequestOutcome, OpenChangeRequestInput, PostChangeRequestCommentInput } from './types.js';
|
|
21
21
|
export interface IWorkflowService {
|
|
22
|
+
/**
|
|
23
|
+
* `freshFetch` bypasses the fetch TTL; `strictFetch` makes a failed fetch
|
|
24
|
+
* throw instead of serving the stale refs — for a caller that uses the
|
|
25
|
+
* list to prove a branch ABSENT (a stale list proves nothing).
|
|
26
|
+
*/
|
|
22
27
|
listBranches(workspaceId: string, opts?: {
|
|
23
28
|
freshFetch?: boolean;
|
|
29
|
+
strictFetch?: boolean;
|
|
24
30
|
}): Promise<Branch[]>;
|
|
25
31
|
/**
|
|
26
32
|
* Create a new unprotected branch. Protected branches cannot be created
|
|
27
33
|
* via the workflow — the protected set is bootstrapped from the KB repo's
|
|
28
|
-
* initial state and never grown at runtime.
|
|
34
|
+
* initial state and never grown at runtime. Holds the branch-lifecycle
|
|
35
|
+
* lock for `name`, so creation is serialised with the branch's deletion
|
|
36
|
+
* and with the retirement of a stale clone under that name.
|
|
29
37
|
*/
|
|
30
38
|
createBranch(workspaceId: string, name: string, fromBase?: string): Promise<Branch>;
|
|
31
39
|
/**
|
|
@@ -70,6 +78,31 @@ export interface IWorkflowService {
|
|
|
70
78
|
* `user` when provided (falls back to the recovery bot).
|
|
71
79
|
*/
|
|
72
80
|
updateFromRemote(workspaceId: string, user?: AuthUser): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* The remote-sync step for ONE branch's clone, driven by a git host's
|
|
83
|
+
* webhook or a pipeline rather than by a person's save. Pulls with the same
|
|
84
|
+
* rebase-and-autostash `updateFromRemote` uses and, when HEAD moved,
|
|
85
|
+
* announces the new tree (`fs-tree-changed`, one `file-changed` per path)
|
|
86
|
+
* so open browsers, agents and the catalogues see it at once.
|
|
87
|
+
*
|
|
88
|
+
* On a conflict it does what `updateFromRemote` does — the divergence goes
|
|
89
|
+
* to the same background recovery ladder (attributed to the recovery bot,
|
|
90
|
+
* since no person triggered the sync) — and, because that is not resolved
|
|
91
|
+
* at request time, reports it as a `conflict` outcome naming the files, so
|
|
92
|
+
* the caller can fail and a person can step in if recovery does not clear
|
|
93
|
+
* it. Never throws for a per-branch failure; every failure is an outcome.
|
|
94
|
+
*/
|
|
95
|
+
syncWorkspaceFromRemote(workspaceId: string): Promise<BranchSyncOutcome>;
|
|
96
|
+
/**
|
|
97
|
+
* Retire the clone of a branch the host has deleted (a `remote-gone`
|
|
98
|
+
* outcome). Runs under the branch-lifecycle lock — the one `createBranch`
|
|
99
|
+
* and `deleteBranch` hold, so no Hexis operation can recreate the branch
|
|
100
|
+
* while the clone is examined and removed — revalidates against origin
|
|
101
|
+
* first, and backs off while a clone of the branch is being bootstrapped.
|
|
102
|
+
* A branch recreated in the meantime therefore keeps its clone. Returns
|
|
103
|
+
* whether the clone was removed.
|
|
104
|
+
*/
|
|
105
|
+
retireRemoteGoneClone(workspaceId: string): Promise<boolean>;
|
|
73
106
|
/**
|
|
74
107
|
* Hard-reset the workspace's checked-out branch to `origin/<branch>` (fetch
|
|
75
108
|
* first), discarding any local divergence. Break-glass primitive for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/workflow/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EACV,iBAAiB,EACjB,MAAM,EACN,qBAAqB,EACrB,yBAAyB,EACzB,MAAM,EACN,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAG/B,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,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,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,kBAAkB,EACzB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEtC;;;;;;;;;;OAUG;IACH,kBAAkB,CAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,YAAY,EAAE,EACzB,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACvC"}
|
package/dist/workflow/types.d.ts
CHANGED
|
@@ -137,4 +137,48 @@ export type MergeChangeRequestOutcome = {
|
|
|
137
137
|
kind: 'conflicts-need-resolution';
|
|
138
138
|
conflictedPaths: string[];
|
|
139
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* What a remote sync did to one branch's clone. One entry per branch in the
|
|
142
|
+
* `POST /api/sync` response, so a pipeline can read exactly which branch
|
|
143
|
+
* moved, which was already current, and which needs a person.
|
|
144
|
+
*
|
|
145
|
+
* - `updated` — the clone moved from `from` (null when it had no commits
|
|
146
|
+
* yet) to `to`.
|
|
147
|
+
* - `up-to-date` — origin had nothing new; `to` is the unchanged HEAD.
|
|
148
|
+
* - `not-cloned` — Hexis has no clone of this branch, so there is nothing
|
|
149
|
+
* to refresh (the first visit clones it fresh).
|
|
150
|
+
* - `remote-gone` — the branch no longer exists on the host; the stale clone
|
|
151
|
+
* is removed. Not a failure: a deleted branch has nothing
|
|
152
|
+
* to sync.
|
|
153
|
+
* - `conflict` — Hexis-side commits contradict what landed on the host.
|
|
154
|
+
* The clone is untouched; `error` is the message to show
|
|
155
|
+
* and `conflictedPaths` the files a person must reconcile.
|
|
156
|
+
* - `error` — the pull failed for another reason (origin unreachable,
|
|
157
|
+
* credential refused); `error` is the sanitised message.
|
|
158
|
+
*/
|
|
159
|
+
export type BranchSyncOutcome = {
|
|
160
|
+
branch: string;
|
|
161
|
+
outcome: 'updated';
|
|
162
|
+
from: string | null;
|
|
163
|
+
to: string;
|
|
164
|
+
} | {
|
|
165
|
+
branch: string;
|
|
166
|
+
outcome: 'up-to-date';
|
|
167
|
+
to: string;
|
|
168
|
+
} | {
|
|
169
|
+
branch: string;
|
|
170
|
+
outcome: 'not-cloned';
|
|
171
|
+
} | {
|
|
172
|
+
branch: string;
|
|
173
|
+
outcome: 'remote-gone';
|
|
174
|
+
} | {
|
|
175
|
+
branch: string;
|
|
176
|
+
outcome: 'conflict';
|
|
177
|
+
conflictedPaths: string[];
|
|
178
|
+
error: string;
|
|
179
|
+
} | {
|
|
180
|
+
branch: string;
|
|
181
|
+
outcome: 'error';
|
|
182
|
+
error: string;
|
|
183
|
+
};
|
|
140
184
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAI5B,qDAAqD;AACrD,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAItD;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,GAAG,iBAAiB,CAAC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AE,YAAY,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GACzC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,GAC1C;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filename.d.ts","sourceRoot":"","sources":["../../src/workspace/filename.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"filename.d.ts","sourceRoot":"","sources":["../../src/workspace/filename.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA0BH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA2B5D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBxE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAGlE"}
|
|
@@ -21,9 +21,13 @@ const WINDOWS_RESERVED_NAMES = new Set([
|
|
|
21
21
|
]);
|
|
22
22
|
/** Characters Windows forbids in any filename component. `/` is the path
|
|
23
23
|
* separator on Unix, included for the same reason. `\` is also a path
|
|
24
|
-
* separator on Windows. Control
|
|
24
|
+
* separator on Windows. Control characters are rejected with them: NUL and
|
|
25
|
+
* 0x01–0x1F because Windows refuses them, and DEL (0x7F) — which every
|
|
26
|
+
* filesystem would write — as a matter of hygiene: a name carrying a
|
|
27
|
+
* character nobody can see or type is not a name people can share, and the
|
|
28
|
+
* knowledge-base root names are validated by this same rule. */
|
|
25
29
|
// eslint-disable-next-line no-control-regex
|
|
26
|
-
const FORBIDDEN_CHARS = /[<>:"/\\|?*\x00-\x1F]/;
|
|
30
|
+
const FORBIDDEN_CHARS = /[<>:"/\\|?*\x00-\x1F\x7F]/;
|
|
27
31
|
/** Per-component byte limit: NTFS = 255 UTF-16 units, ext4 = 255 bytes,
|
|
28
32
|
* APFS = 255 UTF-8 bytes. Use UTF-8 bytes — the strictest of the three. */
|
|
29
33
|
const MAX_NAME_BYTES = 255;
|
|
@@ -43,7 +47,7 @@ export function validateFilename(name) {
|
|
|
43
47
|
if (name === '.' || name === '..')
|
|
44
48
|
return 'Name cannot be "." or ".."';
|
|
45
49
|
if (FORBIDDEN_CHARS.test(name)) {
|
|
46
|
-
return 'Name cannot contain any of
|
|
50
|
+
return 'Name cannot contain control characters or any of: < > : " / \\ | ? *';
|
|
47
51
|
}
|
|
48
52
|
// Windows trims trailing dots and spaces silently — a name ending in either
|
|
49
53
|
// becomes a different filename on disk, breaking sync between OSes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filename.js","sourceRoot":"","sources":["../../src/workspace/filename.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;+EAC+E;AAC/E,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IAC1B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9E,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAC/E,CAAC,CAAC;AAEH
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C;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB;IAC1D,MAAM,MAAM,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAClD,IAAI,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,MAAM,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* <kbDirName>/
|
|
8
8
|
* ├── KnowledgeBase/ ← all team ontologies live here (the knowledge graph)
|
|
9
|
-
* ├──
|
|
9
|
+
* ├── Skills/ ← shared skills, organised by ownership; plugins LINK to them
|
|
10
|
+
* ├── Plugins/ ← one folder per plugin: manifest, MCP servers, tools, links
|
|
10
11
|
* ├── Data/ ← agent-produced records; parsed like KnowledgeBase/
|
|
11
12
|
* ├── Agents/ ← .agent files — agent role configurations (not the graph)
|
|
12
13
|
* ├── Pipelines/ ← .pipeline files — execution-layer processes (not the graph)
|
|
@@ -22,21 +23,44 @@
|
|
|
22
23
|
*
|
|
23
24
|
* These names are the single source of truth for both sides of the app:
|
|
24
25
|
* - Backend: the graph parser discovers ontologies under the
|
|
25
|
-
* {@link
|
|
26
|
+
* {@link ontologyRoots} (`KnowledgeBase/` and `Data/`); `Plugins/`,
|
|
26
27
|
* `Agents/`, `Pipelines/` (and anything else at the root) are ignored by
|
|
27
28
|
* parsing, validation, and the diagram.
|
|
28
29
|
* - Frontend: the file tree renders these root folders as distinct
|
|
29
30
|
* top-level sections.
|
|
30
31
|
*
|
|
31
32
|
* Don't hard-code these strings elsewhere — import them from here.
|
|
33
|
+
*
|
|
34
|
+
* CONFIGURABLE, WITH DEFAULTS. The three roots a deployment may rename
|
|
35
|
+
* (`KnowledgeBase/`, `Skills/`, `Plugins/`) are `let` bindings applied by
|
|
36
|
+
* {@link configureKbLayout} — the backend from its deployment settings, the
|
|
37
|
+
* browser from `GET /api/config` — the same live-binding pattern as the branch
|
|
38
|
+
* model in `git/protected.ts`. Unlike the branch model they carry defaults, so
|
|
39
|
+
* nothing has to wait for configuration; but the same rule applies: read them
|
|
40
|
+
* inside a function body, never capture one at module scope.
|
|
32
41
|
*/
|
|
33
42
|
/** Folder under the repo root that contains all team ontologies. */
|
|
34
|
-
export declare
|
|
43
|
+
export declare let KNOWLEDGE_BASE_DIR: string;
|
|
44
|
+
/**
|
|
45
|
+
* Folder under the repo root that holds SHARED skills, organised by ownership:
|
|
46
|
+
*
|
|
47
|
+
* Skills/<scope>/…/<skill>/SKILL.md a skill, at any depth
|
|
48
|
+
* Skills/<scope>/access.md who owns / may read the scope
|
|
49
|
+
*
|
|
50
|
+
* A skill's readability comes from ITS OWN path walk — the scope folders'
|
|
51
|
+
* `access.md` files — never from the plugins that link it. Plugins point at
|
|
52
|
+
* skills here by path (see `HEXIS_LINKED_SKILLS_KEY`), so one definition can
|
|
53
|
+
* ship in several plugins, and a skill in no plugin at all is a normal state.
|
|
54
|
+
* Inline skills under `Plugins/<Plugin>/skills/` remain supported (personal
|
|
55
|
+
* folders, legacy layouts); the catalog is the union of both trees.
|
|
56
|
+
*/
|
|
57
|
+
export declare let SKILLS_DIR: string;
|
|
35
58
|
/**
|
|
36
59
|
* Folder under the repo root that holds the plugins.
|
|
37
60
|
*
|
|
38
|
-
* Plugins/<Plugin>/plugin.json the Agent Plugins manifest
|
|
39
|
-
*
|
|
61
|
+
* Plugins/<Plugin>/plugin.json the Agent Plugins manifest; its
|
|
62
|
+
* hexis extension lists LINKED skills
|
|
63
|
+
* Plugins/<Plugin>/skills/<skill>/SKILL.md an inline skill
|
|
40
64
|
* Plugins/<Plugin>/mcp.json MCP servers
|
|
41
65
|
* Plugins/<Plugin>/software.bevel.hexis/tools/ http + inline `.tool` manuals
|
|
42
66
|
* Plugins/<Plugin>/access.md who can read/write the plugin
|
|
@@ -55,10 +79,11 @@ export declare const KNOWLEDGE_BASE_DIR = "KnowledgeBase";
|
|
|
55
79
|
* `inline` types the spec has no slot for. `mcp`-type manuals are emitted as
|
|
56
80
|
* real `mcp.json` entries instead, so the portable half stays portable.
|
|
57
81
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
82
|
+
* A plugin's own `access.md` governs what the plugin FOLDER holds: the
|
|
83
|
+
* manifest, the MCP servers, the tools, and any inline skills. Shared skills
|
|
84
|
+
* under `Skills/` are governed by their own scope and are made visible to a
|
|
85
|
+
* plugin's members by granting the plugin's principal (`plugin/<Name>/read`)
|
|
86
|
+
* on the skill — ownership decides, the plugin is a view.
|
|
62
87
|
*
|
|
63
88
|
* A plugin is not a registry of unique names — it is a folder. The same
|
|
64
89
|
* integration may exist in several plugins as separate files (`Everyone/…/
|
|
@@ -70,7 +95,47 @@ export declare const KNOWLEDGE_BASE_DIR = "KnowledgeBase";
|
|
|
70
95
|
* display casing. The lowercase slug the spec does constrain lives in the
|
|
71
96
|
* manifest's `name` field.
|
|
72
97
|
*/
|
|
73
|
-
export declare
|
|
98
|
+
export declare let PLUGINS_DIR: string;
|
|
99
|
+
/** The three renameable roots, as a deployment declares them and `/api/config` serves them. */
|
|
100
|
+
export interface KbLayout {
|
|
101
|
+
knowledgeBaseDir: string;
|
|
102
|
+
skillsDir: string;
|
|
103
|
+
pluginsDir: string;
|
|
104
|
+
}
|
|
105
|
+
/** The layout a deployment gets when it names nothing. */
|
|
106
|
+
export declare const DEFAULT_KB_LAYOUT: Readonly<KbLayout>;
|
|
107
|
+
/**
|
|
108
|
+
* What is wrong with one root name, or null. A root is joined onto the repo
|
|
109
|
+
* root and onto `<dir>/.gitkeep`, so a separator or `..` would write outside
|
|
110
|
+
* the repository; a dot-prefixed name would be skipped by every scanner that
|
|
111
|
+
* treats dot-entries as bookkeeping; `.git` in any case would corrupt the clone.
|
|
112
|
+
*/
|
|
113
|
+
export declare function validateKbRootName(name: string): string | null;
|
|
114
|
+
/**
|
|
115
|
+
* What is wrong with a layout, or null — the same rule {@link configureKbLayout}
|
|
116
|
+
* enforces, without applying anything. Separate so the setup screen can judge a
|
|
117
|
+
* proposed layout before it is saved. The three names must differ, compared
|
|
118
|
+
* case-insensitively: the workspaces live on case-insensitive filesystems too,
|
|
119
|
+
* where `Skills` and `skills` are one folder.
|
|
120
|
+
*/
|
|
121
|
+
export declare function validateKbLayout(layout: KbLayout): string | null;
|
|
122
|
+
/**
|
|
123
|
+
* Apply the layout. Called once during boot on each side; throws on an invalid
|
|
124
|
+
* one so a bad deployment setting fails beside the rest of the wiring rather
|
|
125
|
+
* than scattering a half-renamed tree. Applying the defaults is a no-op.
|
|
126
|
+
*/
|
|
127
|
+
export declare function configureKbLayout(layout: KbLayout): void;
|
|
128
|
+
/** The layout currently in effect. */
|
|
129
|
+
export declare function currentKbLayout(): KbLayout;
|
|
130
|
+
/**
|
|
131
|
+
* Render the layout placeholders a managed template carries —
|
|
132
|
+
* `{{knowledgeBaseDir}}`, `{{skillsDir}}`, `{{pluginsDir}}` — with the
|
|
133
|
+
* names in effect. The packaged `AGENTS.md` and `.bevelignore` are written
|
|
134
|
+
* this way so a deployment that renamed its roots hands the agent a guide
|
|
135
|
+
* that names the folders it will actually find. Text without placeholders
|
|
136
|
+
* passes through unchanged.
|
|
137
|
+
*/
|
|
138
|
+
export declare function renderKbLayoutPlaceholders(text: string, layout?: KbLayout): string;
|
|
74
139
|
/**
|
|
75
140
|
* The pre-rename name of {@link PLUGINS_DIR}. Referenced ONLY by the migration
|
|
76
141
|
* that renames it — every other consumer should be reading the new name, and a
|
|
@@ -93,6 +158,46 @@ export declare const PLUGIN_SKILLS_DIR = "skills";
|
|
|
93
158
|
export declare const HEXIS_EXTENSION_NS = "software.bevel.hexis";
|
|
94
159
|
/** UTCP manuals whose `http`/`inline` types the spec cannot express. */
|
|
95
160
|
export declare const HEXIS_TOOLS_DIR = "software.bevel.hexis/tools";
|
|
161
|
+
/**
|
|
162
|
+
* The manifest key under which a plugin LINKS shared skills:
|
|
163
|
+
*
|
|
164
|
+
* plugin.json → extensions["software.bevel.hexis"].skills: [
|
|
165
|
+
* "Skills/Engineering/deploy", ← one skill folder
|
|
166
|
+
* "Skills/Sales" ← a folder of skills: every skill beneath
|
|
167
|
+
* ]
|
|
168
|
+
*
|
|
169
|
+
* Entries are repo-root-relative folder paths. A plugin's effective skill set
|
|
170
|
+
* is its inline `skills/` folder PLUS everything these roots resolve to. The
|
|
171
|
+
* spec reserves `extensions` for exactly this kind of client-specific data, so
|
|
172
|
+
* a conformant client that ignores it still gets a valid manifest; the
|
|
173
|
+
* compiled distribution copies the linked skills in for it.
|
|
174
|
+
*
|
|
175
|
+
* Linking is a reference, not a grant: a member of the plugin can read a
|
|
176
|
+
* linked skill only because the skill's own access rules name the plugin's
|
|
177
|
+
* principal (`plugin/<Name>/read`). The link service writes both together.
|
|
178
|
+
*/
|
|
179
|
+
export declare const HEXIS_LINKED_SKILLS_KEY = "skills";
|
|
180
|
+
/**
|
|
181
|
+
* Normalise a linked-skill root, or null when it cannot be one: a
|
|
182
|
+
* repo-root-relative POSIX folder path with no `..`, no leading slash, no
|
|
183
|
+
* backslashes and no empty segments. Trailing slashes are dropped.
|
|
184
|
+
*/
|
|
185
|
+
export declare function normalizeSkillRoot(raw: string): string | null;
|
|
186
|
+
/**
|
|
187
|
+
* The linked-skill roots a parsed manifest declares — invalid entries are
|
|
188
|
+
* dropped, duplicates collapsed, order kept. A manifest with no extension
|
|
189
|
+
* block links nothing.
|
|
190
|
+
*/
|
|
191
|
+
export declare function linkedSkillRoots(manifest: unknown): string[];
|
|
192
|
+
/**
|
|
193
|
+
* The manifest with its linked-skill roots REPLACED by `roots`, every other
|
|
194
|
+
* byte of the object preserved (the MCP extension block beside it, the
|
|
195
|
+
* portable fields above it). An empty list removes the key rather than
|
|
196
|
+
* leaving `skills: []` behind.
|
|
197
|
+
*/
|
|
198
|
+
export declare function withLinkedSkillRoots(manifest: Record<string, unknown>, roots: readonly string[]): Record<string, unknown>;
|
|
199
|
+
/** Whether `skillPath` (a skill folder) falls under `root` (a skill folder or a folder of skills). */
|
|
200
|
+
export declare function skillUnderRoot(skillPath: string, root: string): boolean;
|
|
96
201
|
/**
|
|
97
202
|
* The manifest `name` for a plugin folder: lowercased, anything outside
|
|
98
203
|
* `[a-z0-9.-]` folded to `-`, runs collapsed, ends trimmed to alphanumerics.
|
|
@@ -109,16 +214,35 @@ export declare const AGENT_PLUGINS_SCHEMA_VERSION = "1.0.0";
|
|
|
109
214
|
export declare const PLUGIN_MANIFEST_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
110
215
|
export declare const PLUGIN_MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
111
216
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*
|
|
217
|
+
* The Agent Plugins `name`: a kebab-case identifier — lowercase letters and
|
|
218
|
+
* digits in hyphen-separated runs, nothing else. It is the plugin's IDENTITY:
|
|
219
|
+
* what the marketplace publishes it as, what the access principals are
|
|
220
|
+
* spelled from (`plugin/<name>/<verb>`), what the catalog and the URLs key
|
|
221
|
+
* on. `pluginManifestName` folds any spelling into one of these.
|
|
222
|
+
*/
|
|
223
|
+
export declare const PLUGIN_IDENTIFIER_RE: RegExp;
|
|
224
|
+
export declare function isPluginIdentifier(name: unknown): name is string;
|
|
225
|
+
/**
|
|
226
|
+
* The identity of a plugin folder: the manifest's `name` when it IS an
|
|
227
|
+
* identifier, else the folder name folded into one. A manifest naming
|
|
228
|
+
* something that cannot be an identifier is not silently reinterpreted; the
|
|
229
|
+
* folder stands in, and discovery says so.
|
|
230
|
+
*/
|
|
231
|
+
export declare function pluginIdentityOf(manifest: Record<string, unknown> | null, folderName: string): string;
|
|
232
|
+
/**
|
|
233
|
+
* What a person sees the plugin called: the manifest's `displayName` (the
|
|
234
|
+
* vendor field Claude Code shows in its picker; any casing, spaces allowed),
|
|
235
|
+
* else the folder name — which is what every plugin made before this field
|
|
236
|
+
* existed was called, so nothing renames itself on upgrade.
|
|
237
|
+
*/
|
|
238
|
+
export declare function pluginDisplayNameOf(manifest: Record<string, unknown> | null, folderName: string): string;
|
|
239
|
+
/**
|
|
240
|
+
* A minimal, valid `plugin.json` for a plugin folder: the identifier the
|
|
241
|
+
* folder name folds into, and — when the folder is spelled differently — the
|
|
242
|
+
* folder's spelling as `displayName`, so a client's picker shows "Sales
|
|
243
|
+
* Team" for `sales-team`. Nothing else: `version`, `license` and the rest
|
|
244
|
+
* are metadata about a DISTRIBUTED package, and inventing values for a
|
|
245
|
+
* folder someone just made in the app would be asserting things nobody said.
|
|
122
246
|
*/
|
|
123
247
|
export declare function renderPluginManifest(folderName: string): string;
|
|
124
248
|
/**
|
|
@@ -144,6 +268,14 @@ export declare const PERSONAL_PLUGIN_PREFIX = "personal-";
|
|
|
144
268
|
export declare function personalPluginFolderName(userId: string): string;
|
|
145
269
|
/** Whether a `Plugins/` child is somebody's personal folder. */
|
|
146
270
|
export declare function isPersonalPluginFolder(folderName: string): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* THE structural rule for a personal shelf: a repo-relative folder that is a
|
|
273
|
+
* DIRECT child of the plugins root and carries the personal prefix. A deeper
|
|
274
|
+
* folder so named is just a name, and a plugin whose manifest name happens
|
|
275
|
+
* to start with the prefix is a plugin — discovery, the principal picker and
|
|
276
|
+
* the item pages all ask this one question of the FOLDER.
|
|
277
|
+
*/
|
|
278
|
+
export declare function isPersonalPluginDir(repoRelDir: string): boolean;
|
|
147
279
|
/**
|
|
148
280
|
* The plugin a repo-root-relative path belongs to, or `null` for content that
|
|
149
281
|
* sits outside any plugin.
|
|
@@ -171,8 +303,15 @@ export declare const PIPELINES_DIR = "Pipelines";
|
|
|
171
303
|
/**
|
|
172
304
|
* The roots whose subfolders are discovered as ontologies by the graph parser
|
|
173
305
|
* (each subfolder with both `NodeTypes/` and `Knowledge/` is an ontology).
|
|
306
|
+
* A function, not a constant: `KNOWLEDGE_BASE_DIR` is configurable, and a
|
|
307
|
+
* module-scope array would snapshot the default before configuration.
|
|
308
|
+
*/
|
|
309
|
+
export declare function ontologyRoots(): readonly string[];
|
|
310
|
+
/**
|
|
311
|
+
* Every reserved root name, as currently configured — the set the file tree
|
|
312
|
+
* renders as its own sections rather than folding into Knowledge.
|
|
174
313
|
*/
|
|
175
|
-
export declare
|
|
314
|
+
export declare function reservedRootDirNames(): ReadonlySet<string>;
|
|
176
315
|
/** The `Knowledge/` marker subfolder of an ontology (holds the graph nodes). */
|
|
177
316
|
export declare const KNOWLEDGE_DIR = "Knowledge";
|
|
178
317
|
/** The `NodeTypes/` marker subfolder of an ontology (holds the type definitions). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kb-layout.d.ts","sourceRoot":"","sources":["../../src/workspace/kb-layout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kb-layout.d.ts","sourceRoot":"","sources":["../../src/workspace/kb-layout.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,oEAAoE;AACpE,eAAO,IAAI,kBAAkB,QAAkB,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,eAAO,IAAI,UAAU,QAAW,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,IAAI,WAAW,QAAY,CAAC;AAEnC,+FAA+F;AAC/F,MAAM,WAAW,QAAQ;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAI/C,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG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