@rackbops/ac-plugin-contract 2.0.0-alpha.37 → 2.0.0-alpha.38
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/AUTHORING.md +5 -0
- package/dist/host-api.d.ts +13 -0
- package/package.json +1 -1
package/AUTHORING.md
CHANGED
|
@@ -192,6 +192,11 @@ export const createPlugin: CreatePlugin = (host) => ({
|
|
|
192
192
|
agent's text with a storage error of your own.
|
|
193
193
|
- **Setting** — read/write with `host.settings.get(key)` / `host.settings.set(key, value)`. Both are async;
|
|
194
194
|
`get` returns the manifest `default` when unset.
|
|
195
|
+
- **Console settings** (#506) — `host.consoleSettings?.get(key)`, read-only, optional. Unlike `Setting`
|
|
196
|
+
above (per-plugin), this reads the console-WIDE settings an operator edits in Admin's Settings card
|
|
197
|
+
(`repo_owners`, `layout_file`, `tab_order`, `plan_default_machine`, `repo_pins`) -- but only a key on
|
|
198
|
+
that editable-settings whitelist; anything else resolves to `undefined`. `plugins/provider-github`
|
|
199
|
+
is the reference consumer (`repo_owners`/`repo_pins`, its own repo-set resolution).
|
|
195
200
|
|
|
196
201
|
`createPlugin` must import from `@ac/contract` **type-only** (`import type`), so the compiled `dist/server.js`
|
|
197
202
|
has no runtime imports — see §6.
|
package/dist/host-api.d.ts
CHANGED
|
@@ -14,6 +14,16 @@ export interface SettingsService {
|
|
|
14
14
|
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
15
15
|
set(key: string, value: unknown): Promise<void>;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Read-only view of the console-WIDE settings an operator edits in Admin's Settings card (#506) --
|
|
19
|
+
* distinct from `SettingsService` above, which is per-plugin. Only a key on the editable-settings
|
|
20
|
+
* whitelist (`settings-schema.ts`) is readable here; any other key resolves to `undefined`, so a
|
|
21
|
+
* plugin can never reach an arbitrary host-global key through this surface. The value returned is
|
|
22
|
+
* the EFFECTIVE one (an `AC_<KEY>` env override included), the same value the Settings card shows.
|
|
23
|
+
*/
|
|
24
|
+
export interface ConsoleSettingsService {
|
|
25
|
+
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
26
|
+
}
|
|
17
27
|
/** Per-plugin durable storage: a SQLite table scoped to the plugin, with atomic JSON helpers. */
|
|
18
28
|
export interface StorageService {
|
|
19
29
|
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
@@ -203,6 +213,9 @@ export interface HostApi {
|
|
|
203
213
|
plugins?: PluginJobsService;
|
|
204
214
|
/** #84: see `SlotRegistry`. */
|
|
205
215
|
slots: SlotRegistry;
|
|
216
|
+
/** #506: see `ConsoleSettingsService`. Optional so an out-of-repo plugin's own test fake still
|
|
217
|
+
* compiles. */
|
|
218
|
+
consoleSettings?: ConsoleSettingsService;
|
|
206
219
|
}
|
|
207
220
|
/**
|
|
208
221
|
* The context the host passes to `Plugin.runJob` for one job run (#31). `jobId` selects which
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rackbops/ac-plugin-contract",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.38",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The artifact-console plugin ABI for out-of-repo plugin authors: HostApi, the acPlugin manifest contribution points, the generated manifest JSON Schema, and the @ac/host ambient browser declaration.",
|