@bevel-software/platform-shared 0.20.0 → 0.21.0

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.
@@ -3,37 +3,77 @@
3
3
  * their user-visible display names. Single source of truth for BOTH sides of
4
4
  * the app, so backend enforcement and frontend affordances can never drift.
5
5
  *
6
- * CONFIGURED, NOT IMPORTED. This module used to read `process.env` at import
7
- * time and throw when it found nothing — which made the branch model something
8
- * a deployment had to know before any code could load. On the frontend that
9
- * meant baking it into the bundle at build time (Vite `define`), so the same
10
- * artifact could not serve two deployments and changing a branch name meant a
11
- * rebuild. Both sides now CALL {@link configureBranchModel} during boot:
12
- * the backend from its environment, the browser from `GET /api/config`.
6
+ * TWO SHAPES, ONE RULE SET.
13
7
  *
14
- * The exported bindings stay bindings — `DEFAULT_BRANCH` is still imported and
15
- * read exactly as before at every call site. ES module live bindings mean a
16
- * reader inside a function body sees whatever configuration has been applied by
17
- * the time it runs. What does NOT work is capturing one at module scope
18
- * (`const X = DEFAULT_BRANCH` in a file's top level), which snapshots the value
19
- * at import — before configuration. Use a function there instead.
8
+ * A VALUE ({@link BranchModelValue}), resolved by {@link resolveBranchModel}
9
+ * from the shape `/api/config` serves and the setup screen collects. The pure
10
+ * helpers below (`isProtectedBranch`, `protectedBranchDisplayName`) take the
11
+ * value they judge against, so a caller holding two deployments' models — a
12
+ * server hosting several knowledge bases in one process — asks about each by
13
+ * name. The backend uses ONLY this shape: every service is handed its
14
+ * knowledge base's model at construction and never reads a process-wide one.
15
+ *
16
+ * The BROWSER'S live bindings (`DEFAULT_BRANCH`, `PROTECTED_BRANCHES`, …),
17
+ * applied once by {@link configureBranchModel} from `GET /api/config` before
18
+ * React renders. A page shows one deployment, so one process-wide value is
19
+ * the right shape there, and the bindings let a component read the model
20
+ * without threading it through props. They are for the browser: the backend
21
+ * package forbids importing them (an ESLint rule names each one), and a
22
+ * server that configured them would be setting a value for every knowledge
23
+ * base it serves at once.
24
+ *
25
+ * Reading a live binding works inside a function body, which sees whatever
26
+ * configuration has been applied by the time it runs. What does NOT work is
27
+ * capturing one at module scope (`const X = DEFAULT_BRANCH` in a file's top
28
+ * level), which snapshots the value at import — before configuration.
29
+ */
30
+ /** The shape both sides configure from, and the shape `/api/config` serves. */
31
+ export interface BranchModel {
32
+ defaultBranch: string;
33
+ /** Slugs; a comma/space-separated string is accepted for env convenience. */
34
+ protectedBranches: string[] | string;
35
+ }
36
+ /**
37
+ * A branch model as a VALUE: the resolved, validated form of {@link BranchModel}
38
+ * that everything judging a branch is handed.
39
+ *
40
+ * `defaultBranch` is the branch a logged-in user lands on when they don't
41
+ * explicitly pick one, and the default destination for shared drafts. It is
42
+ * the empty string on the one model that is not configured yet
43
+ * ({@link UNCONFIGURED_BRANCH_MODEL}): a fresh deployment has no branch model
44
+ * until its setup screen is answered, and everything behind that gate reads
45
+ * the model only once it is.
46
+ */
47
+ export interface BranchModelValue {
48
+ readonly defaultBranch: string;
49
+ readonly protectedBranches: ReadonlySet<string>;
50
+ /** Slug → human-readable name, for every protected branch. */
51
+ readonly displayNames: Readonly<Record<string, string>>;
52
+ }
53
+ /**
54
+ * The model a deployment has before setup has answered for one: no default
55
+ * branch, nothing protected. {@link isBranchModelConfigured} is false for
56
+ * exactly this value.
20
57
  */
58
+ export declare const UNCONFIGURED_BRANCH_MODEL: BranchModelValue;
59
+ /**
60
+ * Whether a model has been configured — the frontend gates render on this, and
61
+ * the backend's setup gate keeps the app shut until it holds.
62
+ */
63
+ export declare function isBranchModelConfigured(model: BranchModelValue): boolean;
21
64
  /**
22
65
  * The branch a logged-in user lands on when they don't explicitly pick one, and
23
- * the default destination for shared drafts.
66
+ * the default destination for shared drafts. BROWSER-SIDE live binding — see
67
+ * this file's header; the backend reads its `BranchModelValue` instead.
24
68
  *
25
69
  * Empty until {@link configureBranchModel} runs. Read it inside a function, not
26
- * at module scope — see this file's header.
70
+ * at module scope.
27
71
  */
28
72
  export declare let DEFAULT_BRANCH: string;
73
+ /** Browser-side live binding — see this file's header. */
29
74
  export declare let PROTECTED_BRANCH_DISPLAY_NAMES: Readonly<Record<string, string>>;
75
+ /** Browser-side live binding — see this file's header. */
30
76
  export declare let PROTECTED_BRANCHES: ReadonlySet<string>;
31
- /** The shape both sides configure from, and the shape `/api/config` serves. */
32
- export interface BranchModel {
33
- defaultBranch: string;
34
- /** Slugs; a comma/space-separated string is accepted for env convenience. */
35
- protectedBranches: string[] | string;
36
- }
37
77
  /**
38
78
  * Apply the branch model. Called once during boot on each side, and validated
39
79
  * here rather than at either call site so the two cannot disagree about what
@@ -49,15 +89,32 @@ export declare function branchListOf(model: BranchModel): string[];
49
89
  * running app onto branches nobody has confirmed yet.
50
90
  */
51
91
  export declare function validateBranchModel(model: BranchModel): string | null;
92
+ /**
93
+ * Resolve a model into the value everything judges against. Throws on an
94
+ * invalid pair — the same rule {@link validateBranchModel} states — so a
95
+ * value, once held, is known to be a usable one.
96
+ */
97
+ export declare function resolveBranchModel(model: BranchModel): BranchModelValue;
98
+ /**
99
+ * Apply the model to the BROWSER'S live bindings. Called once during boot,
100
+ * from `GET /api/config`, before anything reads them. Validated by
101
+ * {@link resolveBranchModel}, so the bindings and a value resolved from the
102
+ * same model can never disagree.
103
+ */
52
104
  export declare function configureBranchModel(model: BranchModel): void;
53
- /** Whether {@link configureBranchModel} has run — the frontend gates render on this. */
54
- export declare function isBranchModelConfigured(): boolean;
105
+ /**
106
+ * The browser's model as a value — for the code paths that take a
107
+ * {@link BranchModelValue} and run in the browser, where the one model in
108
+ * effect is the configured one.
109
+ */
110
+ export declare function currentBranchModel(): BranchModelValue;
55
111
  /**
56
112
  * The model as the environment describes it. Node-side only; the browser has no
57
113
  * `process.env` to read and is served the same shape by `GET /api/config`.
58
114
  */
59
115
  export declare function branchModelFromEnv(): BranchModel;
60
- export declare function isProtectedBranch(name: string | null | undefined): boolean;
116
+ /** Whether `name` is one of `model`'s protected branches. */
117
+ export declare function isProtectedBranch(model: BranchModelValue, name: string | null | undefined): boolean;
61
118
  /**
62
119
  * Capitalised, human-readable name for a protected branch — e.g.
63
120
  * `current-company-state` → "Current company state".
@@ -70,5 +127,5 @@ export declare function isProtectedBranch(name: string | null | undefined): bool
70
127
  * Returns `null` for unknown / non-protected names so the caller can decide
71
128
  * whether to fall back to the raw string or hide the affordance.
72
129
  */
73
- export declare function protectedBranchDisplayName(name: string | null | undefined): string | null;
130
+ export declare function protectedBranchDisplayName(model: BranchModelValue, name: string | null | undefined): string | null;
74
131
  //# sourceMappingURL=protected.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protected.d.ts","sourceRoot":"","sources":["../../src/git/protected.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAsBH;;;;;;GAMG;AACH,eAAO,IAAI,cAAc,EAAE,MAAW,CAAC;AAEvC,eAAO,IAAI,8BAA8B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAqB,CAAC;AAEhG,eAAO,IAAI,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAqB,CAAC;AAEvE,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,iBAAiB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,CAIzD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAgBrE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAW7D;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAKhD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,S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M,GAAG,IAAI,CAgBrE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,gBAAgB,CASvE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAK7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAMrD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAKhD;AAED,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEnG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC9B,MAAM,GAAG,IAAI,CAKf"}
@@ -3,20 +3,29 @@
3
3
  * their user-visible display names. Single source of truth for BOTH sides of
4
4
  * the app, so backend enforcement and frontend affordances can never drift.
5
5
  *
6
- * CONFIGURED, NOT IMPORTED. This module used to read `process.env` at import
7
- * time and throw when it found nothing — which made the branch model something
8
- * a deployment had to know before any code could load. On the frontend that
9
- * meant baking it into the bundle at build time (Vite `define`), so the same
10
- * artifact could not serve two deployments and changing a branch name meant a
11
- * rebuild. Both sides now CALL {@link configureBranchModel} during boot:
12
- * the backend from its environment, the browser from `GET /api/config`.
6
+ * TWO SHAPES, ONE RULE SET.
13
7
  *
14
- * The exported bindings stay bindings — `DEFAULT_BRANCH` is still imported and
15
- * read exactly as before at every call site. ES module live bindings mean a
16
- * reader inside a function body sees whatever configuration has been applied by
17
- * the time it runs. What does NOT work is capturing one at module scope
18
- * (`const X = DEFAULT_BRANCH` in a file's top level), which snapshots the value
19
- * at import — before configuration. Use a function there instead.
8
+ * A VALUE ({@link BranchModelValue}), resolved by {@link resolveBranchModel}
9
+ * from the shape `/api/config` serves and the setup screen collects. The pure
10
+ * helpers below (`isProtectedBranch`, `protectedBranchDisplayName`) take the
11
+ * value they judge against, so a caller holding two deployments' models — a
12
+ * server hosting several knowledge bases in one process — asks about each by
13
+ * name. The backend uses ONLY this shape: every service is handed its
14
+ * knowledge base's model at construction and never reads a process-wide one.
15
+ *
16
+ * The BROWSER'S live bindings (`DEFAULT_BRANCH`, `PROTECTED_BRANCHES`, …),
17
+ * applied once by {@link configureBranchModel} from `GET /api/config` before
18
+ * React renders. A page shows one deployment, so one process-wide value is
19
+ * the right shape there, and the bindings let a component read the model
20
+ * without threading it through props. They are for the browser: the backend
21
+ * package forbids importing them (an ESLint rule names each one), and a
22
+ * server that configured them would be setting a value for every knowledge
23
+ * base it serves at once.
24
+ *
25
+ * Reading a live binding works inside a function body, which sees whatever
26
+ * configuration has been applied by the time it runs. What does NOT work is
27
+ * capturing one at module scope (`const X = DEFAULT_BRANCH` in a file's top
28
+ * level), which snapshots the value at import — before configuration.
20
29
  */
21
30
  function parseBranchList(raw) {
22
31
  return (raw ?? '')
@@ -35,15 +44,35 @@ function deriveDisplayName(slug) {
35
44
  return slug;
36
45
  return spaced.charAt(0).toUpperCase() + spaced.slice(1);
37
46
  }
47
+ /**
48
+ * The model a deployment has before setup has answered for one: no default
49
+ * branch, nothing protected. {@link isBranchModelConfigured} is false for
50
+ * exactly this value.
51
+ */
52
+ export const UNCONFIGURED_BRANCH_MODEL = Object.freeze({
53
+ defaultBranch: '',
54
+ protectedBranches: new Set(),
55
+ displayNames: Object.freeze({}),
56
+ });
57
+ /**
58
+ * Whether a model has been configured — the frontend gates render on this, and
59
+ * the backend's setup gate keeps the app shut until it holds.
60
+ */
61
+ export function isBranchModelConfigured(model) {
62
+ return model.defaultBranch !== '';
63
+ }
38
64
  /**
39
65
  * The branch a logged-in user lands on when they don't explicitly pick one, and
40
- * the default destination for shared drafts.
66
+ * the default destination for shared drafts. BROWSER-SIDE live binding — see
67
+ * this file's header; the backend reads its `BranchModelValue` instead.
41
68
  *
42
69
  * Empty until {@link configureBranchModel} runs. Read it inside a function, not
43
- * at module scope — see this file's header.
70
+ * at module scope.
44
71
  */
45
72
  export let DEFAULT_BRANCH = '';
73
+ /** Browser-side live binding — see this file's header. */
46
74
  export let PROTECTED_BRANCH_DISPLAY_NAMES = Object.freeze({});
75
+ /** Browser-side live binding — see this file's header. */
47
76
  export let PROTECTED_BRANCHES = new Set();
48
77
  /**
49
78
  * Apply the branch model. Called once during boot on each side, and validated
@@ -80,19 +109,45 @@ export function validateBranchModel(model) {
80
109
  }
81
110
  return null;
82
111
  }
83
- export function configureBranchModel(model) {
112
+ /**
113
+ * Resolve a model into the value everything judges against. Throws on an
114
+ * invalid pair — the same rule {@link validateBranchModel} states — so a
115
+ * value, once held, is known to be a usable one.
116
+ */
117
+ export function resolveBranchModel(model) {
84
118
  const problem = validateBranchModel(model);
85
119
  if (problem)
86
120
  throw new Error(problem);
87
- const defaultBranch = model.defaultBranch.trim();
88
121
  const list = branchListOf(model);
89
- DEFAULT_BRANCH = defaultBranch;
90
- PROTECTED_BRANCH_DISPLAY_NAMES = Object.freeze(Object.fromEntries(list.map((slug) => [slug, deriveDisplayName(slug)])));
91
- PROTECTED_BRANCHES = new Set(list);
122
+ return Object.freeze({
123
+ defaultBranch: model.defaultBranch.trim(),
124
+ protectedBranches: new Set(list),
125
+ displayNames: Object.freeze(Object.fromEntries(list.map((slug) => [slug, deriveDisplayName(slug)]))),
126
+ });
127
+ }
128
+ /**
129
+ * Apply the model to the BROWSER'S live bindings. Called once during boot,
130
+ * from `GET /api/config`, before anything reads them. Validated by
131
+ * {@link resolveBranchModel}, so the bindings and a value resolved from the
132
+ * same model can never disagree.
133
+ */
134
+ export function configureBranchModel(model) {
135
+ const value = resolveBranchModel(model);
136
+ DEFAULT_BRANCH = value.defaultBranch;
137
+ PROTECTED_BRANCH_DISPLAY_NAMES = value.displayNames;
138
+ PROTECTED_BRANCHES = value.protectedBranches;
92
139
  }
93
- /** Whether {@link configureBranchModel} has run — the frontend gates render on this. */
94
- export function isBranchModelConfigured() {
95
- return DEFAULT_BRANCH !== '';
140
+ /**
141
+ * The browser's model as a value — for the code paths that take a
142
+ * {@link BranchModelValue} and run in the browser, where the one model in
143
+ * effect is the configured one.
144
+ */
145
+ export function currentBranchModel() {
146
+ return {
147
+ defaultBranch: DEFAULT_BRANCH,
148
+ protectedBranches: PROTECTED_BRANCHES,
149
+ displayNames: PROTECTED_BRANCH_DISPLAY_NAMES,
150
+ };
96
151
  }
97
152
  /**
98
153
  * The model as the environment describes it. Node-side only; the browser has no
@@ -104,8 +159,9 @@ export function branchModelFromEnv() {
104
159
  protectedBranches: process.env.PROTECTED_BRANCHES ?? '',
105
160
  };
106
161
  }
107
- export function isProtectedBranch(name) {
108
- return !!name && Object.prototype.hasOwnProperty.call(PROTECTED_BRANCH_DISPLAY_NAMES, name);
162
+ /** Whether `name` is one of `model`'s protected branches. */
163
+ export function isProtectedBranch(model, name) {
164
+ return !!name && model.protectedBranches.has(name);
109
165
  }
110
166
  /**
111
167
  * Capitalised, human-readable name for a protected branch — e.g.
@@ -119,9 +175,11 @@ export function isProtectedBranch(name) {
119
175
  * Returns `null` for unknown / non-protected names so the caller can decide
120
176
  * whether to fall back to the raw string or hide the affordance.
121
177
  */
122
- export function protectedBranchDisplayName(name) {
178
+ export function protectedBranchDisplayName(model, name) {
123
179
  if (!name)
124
180
  return null;
125
- return PROTECTED_BRANCH_DISPLAY_NAMES[name] ?? null;
181
+ return Object.prototype.hasOwnProperty.call(model.displayNames, name)
182
+ ? model.displayNames[name]
183
+ : null;
126
184
  }
127
185
  //# sourceMappingURL=protected.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protected.js","sourceRoot":"","sources":["../../src/git/protected.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,SAAS,eAAe,CAAC,GAAuB;IAC9C,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;SACf,KAAK,CAAC,QAAQ,CAAC;SACf,GA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,kBAAkB;IAChC,OAAO;QACL,aAAa,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QACxD,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE;KACxD,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,IAA+B;IACxF,OAAO,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAuB,EACvB,IAA+B;IAE/B,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC;QACnE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAE;QAC3B,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
@@ -32,12 +32,19 @@
32
32
  * Don't hard-code these strings elsewhere — import them from here.
33
33
  *
34
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.
35
+ * (`KnowledgeBase/`, `Skills/`, `Plugins/`) and the guide's file name travel
36
+ * as a {@link KbLayout} VALUE: every helper below that depends on a name takes
37
+ * the layout it judges against, and the backend hands each knowledge base's
38
+ * layout to its services at construction — a server hosting several knowledge
39
+ * bases in one process holds one per knowledge base, never a process-wide one.
40
+ *
41
+ * The `let` bindings (`KNOWLEDGE_BASE_DIR`, …) are the BROWSER'S copy, applied
42
+ * once by {@link configureKbLayout} from `GET /api/config`, the same shape as
43
+ * the branch model in `git/protected.ts`: a page shows one deployment, so one
44
+ * process-wide value is right there. The backend package forbids importing
45
+ * them (an ESLint rule names each one). They carry defaults, so nothing waits
46
+ * for configuration; but read them inside a function body, never capture one
47
+ * at module scope.
41
48
  */
42
49
  /** Folder under the repo root that contains all team ontologies. */
43
50
  export declare let KNOWLEDGE_BASE_DIR: string;
@@ -190,7 +197,7 @@ export declare function gitignoreLiteral(name: string): string;
190
197
  * whether this sentence is present by searching for the RAW name — see
191
198
  * {@link mentionsAgentsFile}, which is how the startup step asks.
192
199
  */
193
- export declare function agentsFilePointerSentence(agentsFile?: string): string;
200
+ export declare function agentsFilePointerSentence(agentsFile: string): string;
194
201
  /**
195
202
  * `text` with every pointer sentence THE PLATFORM WROTE aimed at `agentsFile`
196
203
  * — or null when it holds none of ours.
@@ -207,7 +214,7 @@ export declare function agentsFilePointerSentence(agentsFile?: string): string;
207
214
  * answers, and only the caller knows that the second one means "consider
208
215
  * appending".
209
216
  */
210
- export declare function retargetAgentsFilePointer(text: string, agentsFile?: string): string | null;
217
+ export declare function retargetAgentsFilePointer(text: string, agentsFile: string): string | null;
211
218
  /**
212
219
  * Whether `text` already points at the guide — the ONE question the startup
213
220
  * step asks before appending {@link agentsFilePointerSentence} to a customer's
@@ -222,7 +229,7 @@ export declare function retargetAgentsFilePointer(text: string, agentsFile?: str
222
229
  * that one would append a second copy on the next boot, and a third on the
223
230
  * one after — the exact failure this feature exists to prevent.
224
231
  */
225
- export declare function mentionsAgentsFile(text: string, agentsFile?: string): boolean;
232
+ export declare function mentionsAgentsFile(text: string, agentsFile: string): boolean;
226
233
  /**
227
234
  * What is wrong with one root name, or null. A root is joined onto the repo
228
235
  * root and onto `<dir>/.gitkeep`, so a separator or `..` would write outside
@@ -254,7 +261,7 @@ export declare function validateKbRootName(name: string): string | null;
254
261
  * `roots` is the layout the name is judged against — the names this save would
255
262
  * put in effect, not necessarily the ones running now.
256
263
  */
257
- export declare function validateAgentsFileName(name: string, roots?: Pick<KbLayout, 'knowledgeBaseDir' | 'skillsDir' | 'pluginsDir'>): string | null;
264
+ export declare function validateAgentsFileName(name: string, roots: Pick<KbLayout, 'knowledgeBaseDir' | 'skillsDir' | 'pluginsDir'>): string | null;
258
265
  /**
259
266
  * What is wrong with a layout, or null — the same rule {@link configureKbLayout}
260
267
  * enforces, without applying anything. Separate so the setup screen can judge a
@@ -285,22 +292,29 @@ export declare function validateKbLayout(layout: KbLayout): string | null;
285
292
  */
286
293
  export declare function onKbLayoutApplied(listener: () => void): void;
287
294
  /**
288
- * Apply the layout. Called once during boot on each side; throws on an invalid
289
- * one so a bad deployment setting fails beside the rest of the wiring rather
290
- * than scattering a half-renamed tree. Applying the defaults is a no-op.
295
+ * A layout as the helpers hold it: validated, every name trimmed, the guide's
296
+ * name filled in from the default when absent. Throws on an invalid one so a
297
+ * bad deployment setting fails beside the rest of the wiring rather than
298
+ * scattering a half-renamed tree.
299
+ */
300
+ export declare function resolveKbLayout(layout: KbLayout): Required<KbLayout>;
301
+ /**
302
+ * Apply the layout to the BROWSER'S live bindings. Called once during boot
303
+ * from `GET /api/config`; validated by {@link resolveKbLayout}. Applying the
304
+ * defaults is a no-op.
291
305
  */
292
306
  export declare function configureKbLayout(layout: KbLayout): void;
293
- /** The layout currently in effect. */
307
+ /** The browser's layout as a value — what the live bindings currently hold. */
294
308
  export declare function currentKbLayout(): Required<KbLayout>;
295
309
  /**
296
- * Whether a layout — the one in effect, unless one is given — is the default
297
- * one. The setup-completing save applies the stored names while this holds,
298
- * the same "only from none to some" rule the branch model follows — and also
299
- * on a retry after its own failed initialization run, when the process holds
300
- * names setup applied but the app never opened (see `setup.routes.ts`). A
301
- * layout the process booted with is never replaced here.
310
+ * Whether a layout is the default one. The setup-completing save applies the
311
+ * stored names while this holds of the one in effect, the same "only from
312
+ * none to some" rule the branch model follows — and also on a retry after its
313
+ * own failed initialization run, when the process holds names setup applied
314
+ * but the app never opened (see `setup.routes.ts`). A layout the process
315
+ * booted with is never replaced there.
302
316
  */
303
- export declare function isDefaultKbLayout(layout?: KbLayout): boolean;
317
+ export declare function isDefaultKbLayout(layout: KbLayout): boolean;
304
318
  /**
305
319
  * Render the layout placeholders a managed template carries —
306
320
  * `{{knowledgeBaseDir}}`, `{{skillsDir}}`, `{{pluginsDir}}`, `{{agentsFile}}`
@@ -310,7 +324,7 @@ export declare function isDefaultKbLayout(layout?: KbLayout): boolean;
310
324
  * renamed the guide gets a guide naming the file it lives in. Text without
311
325
  * placeholders passes through unchanged.
312
326
  */
313
- export declare function renderKbLayoutPlaceholders(text: string, layout?: KbLayout): string;
327
+ export declare function renderKbLayoutPlaceholders(text: string, layout: KbLayout): string;
314
328
  /**
315
329
  * The pre-rename name of {@link PLUGINS_DIR}. Referenced ONLY by the migration
316
330
  * that renames it — every other consumer should be reading the new name, and a
@@ -472,7 +486,7 @@ export declare function isPersonalPluginFolder(folderName: string): boolean;
472
486
  * to start with the prefix is a plugin — discovery, the principal picker and
473
487
  * the item pages all ask this one question of the FOLDER.
474
488
  */
475
- export declare function isPersonalPluginDir(repoRelDir: string): boolean;
489
+ export declare function isPersonalPluginDir(repoRelDir: string, layout: KbLayout): boolean;
476
490
  /**
477
491
  * The plugin a repo-root-relative path belongs to, or `null` for content that
478
492
  * sits outside any plugin.
@@ -486,7 +500,7 @@ export declare function isPersonalPluginDir(repoRelDir: string): boolean;
486
500
  * have. Callers bucket by it; nothing requires it. A plugin-less skill is a
487
501
  * real, supported state — the prototype calls those "yours alone".
488
502
  */
489
- export declare function pluginOfPath(repoRelativePath: string): string | null;
503
+ export declare function pluginOfPath(repoRelativePath: string, layout: KbLayout): string | null;
490
504
  /**
491
505
  * Folder under the repo root for agent-produced records (pipeline instances,
492
506
  * work items, intermediate outputs). Parsed exactly like `KnowledgeBase/`:
@@ -500,25 +514,25 @@ export declare const PIPELINES_DIR = "Pipelines";
500
514
  /**
501
515
  * The roots whose subfolders are discovered as ontologies by the graph parser
502
516
  * (each subfolder with both `NodeTypes/` and `Knowledge/` is an ontology).
503
- * A function, not a constant: `KNOWLEDGE_BASE_DIR` is configurable, and a
504
- * module-scope array would snapshot the default before configuration.
517
+ * A function of the layout, not a constant: the knowledge-base root is
518
+ * configurable per deployment.
505
519
  */
506
- export declare function ontologyRoots(): readonly string[];
520
+ export declare function ontologyRoots(layout: KbLayout): readonly string[];
507
521
  /**
508
- * Every reserved root name, as currently configured — the set the file tree
509
- * renders as its own sections rather than folding into Knowledge.
522
+ * Every reserved root name under `layout` — the set the file tree renders as
523
+ * its own sections rather than folding into Knowledge.
510
524
  */
511
- export declare function reservedRootDirNames(): ReadonlySet<string>;
525
+ export declare function reservedRootDirNames(layout: KbLayout): ReadonlySet<string>;
512
526
  /**
513
527
  * The roots anyone may start a new folder in — knowledge, skills and plugins
514
528
  * — whatever the root's own `access.md` grants them. Everywhere else a change
515
529
  * needs read access to where it lands (the "read before write" rule); a new
516
530
  * folder directly under one of these three is the one place that rule does
517
531
  * not apply, because the new folder carries its creator's own grant. A
518
- * function, like {@link reservedRootDirNames}, because the names are
519
- * configurable.
532
+ * function of the layout, like {@link reservedRootDirNames}, because the
533
+ * names are configurable.
520
534
  */
521
- export declare function creatableRootDirNames(): ReadonlySet<string>;
535
+ export declare function creatableRootDirNames(layout: KbLayout): ReadonlySet<string>;
522
536
  /** The `Knowledge/` marker subfolder of an ontology (holds the graph nodes). */
523
537
  export declare const KNOWLEDGE_DIR = "Knowledge";
524
538
  /** 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":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,oEAAoE;AACpE,eAAO,IAAI,kBAAkB,QAAkB,CAAC;AAEhD;;;;;;;;;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