@fnndsc/brasa 0.53.0 → 0.54.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.
- package/dist/buildinfo.json +1 -1
- package/dist/builtins/res/plugin.d.ts +1 -9
- package/dist/builtins/res/plugin.js +18 -70
- package/dist/builtins/res/plugin.js.map +1 -1
- package/dist/builtins/res/plugin.sync.d.ts +129 -0
- package/dist/builtins/res/plugin.sync.js +456 -0
- package/dist/builtins/res/plugin.sync.js.map +1 -0
- package/dist/chris/help.js +23 -0
- package/dist/chris/help.js.map +1 -1
- package/dist/config/indexConfig.d.ts +104 -0
- package/dist/config/indexConfig.js +125 -0
- package/dist/config/indexConfig.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/notes.json +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Engine plugin-index configuration: which index `plugin sync` reads.
|
|
3
|
+
*
|
|
4
|
+
* Built the way the peer store's configuration is (`./storeConfig.ts`), as
|
|
5
|
+
* its own setting: an index is a list of descriptors in git, not a store a
|
|
6
|
+
* plugin is looked up in by name. The value lives here; where it is
|
|
7
|
+
* persisted is the host's concern, through the hook it installs. With none
|
|
8
|
+
* installed the override lives for the process.
|
|
9
|
+
*
|
|
10
|
+
* Key components:
|
|
11
|
+
* - DEFAULT_PLUGIN_INDEX: the index read when the operator has set none.
|
|
12
|
+
* - pluginIndex_get / pluginIndex_isDefault / pluginIndexOverride_get: read it.
|
|
13
|
+
* - pluginIndex_set / pluginIndex_clear: change it.
|
|
14
|
+
* - indexConfigPersist_install / indexConfig_persist: the host's persistence.
|
|
15
|
+
*
|
|
16
|
+
* Typical usage:
|
|
17
|
+
* ```ts
|
|
18
|
+
* pluginIndex_set('FNNDSC/chris-plugins@v2026.11');
|
|
19
|
+
* await indexConfig_persist();
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Dependencies: none.
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
26
|
+
/** The index read when the operator has set no override. */
|
|
27
|
+
export declare const DEFAULT_PLUGIN_INDEX: string;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the index in effect, falling back to the default.
|
|
30
|
+
*
|
|
31
|
+
* @returns The index source word.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* pluginIndex_get(); // 'FNNDSC/chris-plugins@main'
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function pluginIndex_get(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Reports whether the index in effect is the default.
|
|
41
|
+
*
|
|
42
|
+
* @returns True when no override is set.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* pluginIndex_isDefault(); // true
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function pluginIndex_isDefault(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the operator's override without applying the default.
|
|
52
|
+
*
|
|
53
|
+
* The persistence layer uses this so it writes only an explicit override.
|
|
54
|
+
*
|
|
55
|
+
* @returns The override, or undefined when none is set.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* pluginIndexOverride_get(); // undefined
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function pluginIndexOverride_get(): string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Sets the index override.
|
|
65
|
+
*
|
|
66
|
+
* @param source - The index source word (`owner/repo[@ref]`, `cube:<path>`, `host:<path>`).
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* pluginIndex_set('FNNDSC/chris-plugins@v2026.11');
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function pluginIndex_set(source: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Clears the index override, restoring the default.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* pluginIndex_clear();
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function pluginIndex_clear(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Installs the host's persistence hook.
|
|
85
|
+
*
|
|
86
|
+
* @param fn - Callback invoked to persist the current index configuration.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* indexConfigPersist_install(settings_save);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function indexConfigPersist_install(fn: () => Promise<void>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Persists the current index configuration through the installed hook.
|
|
96
|
+
*
|
|
97
|
+
* @returns A promise resolving once persistence completes.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* await indexConfig_persist();
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function indexConfig_persist(): Promise<void>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Engine plugin-index configuration: which index `plugin sync` reads.
|
|
3
|
+
*
|
|
4
|
+
* Built the way the peer store's configuration is (`./storeConfig.ts`), as
|
|
5
|
+
* its own setting: an index is a list of descriptors in git, not a store a
|
|
6
|
+
* plugin is looked up in by name. The value lives here; where it is
|
|
7
|
+
* persisted is the host's concern, through the hook it installs. With none
|
|
8
|
+
* installed the override lives for the process.
|
|
9
|
+
*
|
|
10
|
+
* Key components:
|
|
11
|
+
* - DEFAULT_PLUGIN_INDEX: the index read when the operator has set none.
|
|
12
|
+
* - pluginIndex_get / pluginIndex_isDefault / pluginIndexOverride_get: read it.
|
|
13
|
+
* - pluginIndex_set / pluginIndex_clear: change it.
|
|
14
|
+
* - indexConfigPersist_install / indexConfig_persist: the host's persistence.
|
|
15
|
+
*
|
|
16
|
+
* Typical usage:
|
|
17
|
+
* ```ts
|
|
18
|
+
* pluginIndex_set('FNNDSC/chris-plugins@v2026.11');
|
|
19
|
+
* await indexConfig_persist();
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Dependencies: none.
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
26
|
+
/** The index read when the operator has set no override. */
|
|
27
|
+
export const DEFAULT_PLUGIN_INDEX = 'FNNDSC/chris-plugins@main';
|
|
28
|
+
/** The operator's override, or undefined to use {@link DEFAULT_PLUGIN_INDEX}. */
|
|
29
|
+
let pluginIndex;
|
|
30
|
+
/** Host-installed persistence hook; the default keeps the value in memory. */
|
|
31
|
+
let persist = async () => {
|
|
32
|
+
// Headless default: the override lives for the process and is not persisted.
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Returns the index in effect, falling back to the default.
|
|
36
|
+
*
|
|
37
|
+
* @returns The index source word.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* pluginIndex_get(); // 'FNNDSC/chris-plugins@main'
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function pluginIndex_get() {
|
|
45
|
+
return pluginIndex ?? DEFAULT_PLUGIN_INDEX;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Reports whether the index in effect is the default.
|
|
49
|
+
*
|
|
50
|
+
* @returns True when no override is set.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* pluginIndex_isDefault(); // true
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export function pluginIndex_isDefault() {
|
|
58
|
+
return pluginIndex === undefined;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns the operator's override without applying the default.
|
|
62
|
+
*
|
|
63
|
+
* The persistence layer uses this so it writes only an explicit override.
|
|
64
|
+
*
|
|
65
|
+
* @returns The override, or undefined when none is set.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* pluginIndexOverride_get(); // undefined
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export function pluginIndexOverride_get() {
|
|
73
|
+
return pluginIndex;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Sets the index override.
|
|
77
|
+
*
|
|
78
|
+
* @param source - The index source word (`owner/repo[@ref]`, `cube:<path>`, `host:<path>`).
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* pluginIndex_set('FNNDSC/chris-plugins@v2026.11');
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export function pluginIndex_set(source) {
|
|
86
|
+
pluginIndex = source;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Clears the index override, restoring the default.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* pluginIndex_clear();
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export function pluginIndex_clear() {
|
|
97
|
+
pluginIndex = undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Installs the host's persistence hook.
|
|
101
|
+
*
|
|
102
|
+
* @param fn - Callback invoked to persist the current index configuration.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* indexConfigPersist_install(settings_save);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export function indexConfigPersist_install(fn) {
|
|
110
|
+
persist = fn;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Persists the current index configuration through the installed hook.
|
|
114
|
+
*
|
|
115
|
+
* @returns A promise resolving once persistence completes.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* await indexConfig_persist();
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export async function indexConfig_persist() {
|
|
123
|
+
await persist();
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=indexConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexConfig.js","sourceRoot":"","sources":["../../src/config/indexConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,oBAAoB,GAAW,2BAA2B,CAAC;AAExE,iFAAiF;AACjF,IAAI,WAA+B,CAAC;AAEpC,8EAA8E;AAC9E,IAAI,OAAO,GAAwB,KAAK,IAAmB,EAAE;IAC3D,6EAA6E;AAC/E,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,WAAW,IAAI,oBAAoB,CAAC;AAC7C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,WAAW,KAAK,SAAS,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,WAAW,GAAG,MAAM,CAAC;AACvB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CAAC,EAAuB;IAChE,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,OAAO,EAAE,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from './core/version.js';
|
|
|
28
28
|
export * from './session/index.js';
|
|
29
29
|
export * from './builtins/index.js';
|
|
30
30
|
export * from './config/storeConfig.js';
|
|
31
|
+
export * from './config/indexConfig.js';
|
|
31
32
|
export * from './lib/vfs/vfs.js';
|
|
32
33
|
export * from './lib/spinner.js';
|
|
33
34
|
export * from './logo/brain.js';
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ export * from './core/version.js';
|
|
|
38
38
|
export * from './session/index.js';
|
|
39
39
|
export * from './builtins/index.js';
|
|
40
40
|
export * from './config/storeConfig.js';
|
|
41
|
+
export * from './config/indexConfig.js';
|
|
41
42
|
export * from './lib/vfs/vfs.js';
|
|
42
43
|
export * from './lib/spinner.js';
|
|
43
44
|
export * from './logo/brain.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,kBAAkB,CAAC;AACjC,iEAAiE;AACjE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,uEAAuE;AACvE,4EAA4E;AAC5E,sBAAsB;AACtB,OAAO,EAAE,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,IAAI,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,0BAA0B,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACrD,wBAAwB,CAAC,YAAY,CAAC,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,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