@skaile/forge-settings 1.3.0 → 1.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.1
4
+
5
+ - `<ForgeProvidersPanel>` takes an optional `note` prop: a string replaces the line above the provider list, `false` hides it (Add provider stays, right-aligned). Absent keeps today's text, so existing hosts see no change.
6
+
3
7
  ## 1.3.0
4
8
 
5
9
  - Model roles (`/server` and `/vue`, browser-safe): `MODEL_ROLE_KINDS` (`chat`, `decision`, `image`, `tts`, `stt`), `ModelRoleDefinition`, `STANDARD_MODEL_ROLES` (`decision`, `image`, `tts`, `stt`), `validateModelRoleAssignments` (issues keyed by role id), `resolveModelRole` and `modelRoleAliases` (feeds `resolveRegistryLanguageModel({ roles })`). A dangling assignment throws `ModelResolutionError` (`unknown_selector`). omp naming: `decision` = `judge`, `tts` = `speech`, `stt` = `dictation`.
package/README.md CHANGED
@@ -86,6 +86,8 @@ The panel (`PUT|DELETE <writeUrl>/:id`, `GET <writeUrl>/detected`, `GET <provide
86
86
 
87
87
  Without URLs, pass `:client` (a `ProvidersPanelClient`: `list`, `detected`, `presets`, `upsert`, `remove`, `environment`, `updateEnvironment`, `models`, `test`) and the panel talks through it; the URL props then become optional. A passed client also turns on the per-provider Test button. `urlProvidersClient({ providersUrl, providersWriteUrl, … })` is the client the URL props build; its `models(id)` and `test(id)` call `GET|POST <writeUrl>/:id/models|test`, routes only a host that wants those features serves.
88
88
 
89
+ `note` sets the line above the list: absent keeps the panel's text for `layer`, a string replaces it, `false` hides it (the Add provider button stays, right-aligned).
90
+
89
91
  ## Model roles
90
92
 
91
93
  A *model role* is a named purpose a host picks a model for. The host declares roles and stores the assignments (role id to selector); this package supplies the vocabulary, validation, resolution and a picker.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@skaile/forge-settings",
3
3
  "configKey": "forgeSettings",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "3.6.1"
@@ -20,6 +20,8 @@ type __VLS_Props = {
20
20
  layer: ProvidersPanelLayer;
21
21
  /** Disables add, edit and delete. */
22
22
  readOnly?: boolean;
23
+ /** The line above the list. Absent: the default text for `layer`; a string replaces it; `false` hides it. */
24
+ note?: string | false;
23
25
  };
24
26
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
27
  changed: () => any;
@@ -27,5 +29,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
27
29
  onChanged?: (() => any) | undefined;
28
30
  }>, {
29
31
  environmentEnabled: boolean;
32
+ note: string | false;
30
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
34
  export default _default;
@@ -29,10 +29,9 @@
29
29
  <p v-if="detectedError" class="text-xs text-error-500">{{ detectedError }}</p>
30
30
  </div>
31
31
 
32
- <div class="flex items-center gap-2">
33
- <p class="text-xs text-foreground-muted leading-relaxed flex-1">
34
- {{ props.layer === "workspace" ? "Entries of this workspace's providers.yml can be changed here; instance entries are inherited." : "The instance registry, $FORGE_HOME/.skaile/providers.yml." }}
35
- Keys stay in the environment; an entry only references them.
32
+ <div class="flex items-center gap-2" :class="{ 'justify-end': noteText === null }">
33
+ <p v-if="noteText !== null" class="text-xs text-foreground-muted leading-relaxed flex-1">
34
+ {{ noteText }}
36
35
  </p>
37
36
  <UButton
38
37
  v-if="!props.readOnly"
@@ -390,6 +389,8 @@
390
389
  </template>
391
390
 
392
391
  <script setup>
392
+ import { computed } from "vue";
393
+ import { providersPanelNote } from "../vue/providers-panel-model";
393
394
  import { useProvidersPanel } from "../vue/useProvidersPanel";
394
395
  const props = defineProps({
395
396
  client: { type: Object, required: false },
@@ -399,8 +400,10 @@ const props = defineProps({
399
400
  environmentUrl: { type: String, required: false },
400
401
  environmentEnabled: { type: Boolean, required: false, default: void 0 },
401
402
  layer: { type: String, required: true },
402
- readOnly: { type: Boolean, required: false }
403
+ readOnly: { type: Boolean, required: false },
404
+ note: { type: [String, Boolean], required: false, default: void 0 }
403
405
  });
406
+ const noteText = computed(() => providersPanelNote(props.note, props.layer));
404
407
  const emit = defineEmits(["changed"]);
405
408
  const {
406
409
  rows,
@@ -20,6 +20,8 @@ type __VLS_Props = {
20
20
  layer: ProvidersPanelLayer;
21
21
  /** Disables add, edit and delete. */
22
22
  readOnly?: boolean;
23
+ /** The line above the list. Absent: the default text for `layer`; a string replaces it; `false` hides it. */
24
+ note?: string | false;
23
25
  };
24
26
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
27
  changed: () => any;
@@ -27,5 +29,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
27
29
  onChanged?: (() => any) | undefined;
28
30
  }>, {
29
31
  environmentEnabled: boolean;
32
+ note: string | false;
30
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
34
  export default _default;
@@ -38,6 +38,11 @@ export interface ProvidersPanelProps {
38
38
  layer: ProvidersPanelLayer;
39
39
  /** Disables every write (non-admin at instance scope; provider lock). */
40
40
  readOnly?: boolean;
41
+ /**
42
+ * The line above the provider list. Absent: the panel's own text for
43
+ * `layer`; a string replaces it; `false` hides it (Add provider stays).
44
+ */
45
+ note?: string | false;
41
46
  }
42
47
  /** Emits both variants declare. */
43
48
  export type ProvidersPanelEmit = (event: "changed") => void;
@@ -142,6 +147,8 @@ export declare const CREDENTIAL_OTHER_REF = "__other_ref__";
142
147
  /** Registry ids the write routes accept (`isSafeProviderId` upstream). */
143
148
  export declare const PROVIDER_ID_PATTERN: RegExp;
144
149
  export declare const DEFAULT_PRESETS_URL = "/api/providers/presets";
150
+ /** The line `ForgeProvidersPanel` shows above its list; `null` = none. */
151
+ export declare function providersPanelNote(note: string | false | undefined, layer: ProvidersPanelLayer): string | null;
145
152
  /** An `env:NAME` credential reference; group 1 is the variable name. */
146
153
  export declare const ENV_REF_PATTERN: RegExp;
147
154
  /** The credential kind a written reference gets when the row states none. */
@@ -3,6 +3,11 @@ export const CREDENTIAL_ENTER_KEY = "__enter_key__";
3
3
  export const CREDENTIAL_OTHER_REF = "__other_ref__";
4
4
  export const PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
5
5
  export const DEFAULT_PRESETS_URL = "/api/providers/presets";
6
+ export function providersPanelNote(note, layer) {
7
+ if (note === false) return null;
8
+ if (note !== void 0) return note;
9
+ return layer === "workspace" ? "Entries of this workspace's providers.yml can be changed here; instance entries are inherited. Keys stay in the environment; an entry only references them." : "The instance registry, $FORGE_HOME/.skaile/providers.yml. Keys stay in the environment; an entry only references them.";
10
+ }
6
11
  export const ENV_REF_PATTERN = /^env:(.+)$/;
7
12
  export const FALLBACK_CREDENTIAL_KIND = "api_key_header";
8
13
  export const ENV_SOURCE_LABEL = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skaile/forge-settings",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Provider and settings operations for Skaile forge apps: provider registry layers, credential store, env layers, model discovery, the providers panel, and editor / AI SDK model adapters.",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.9",
@@ -29,12 +29,9 @@
29
29
  <p v-if="detectedError" class="text-xs text-error-500">{{ detectedError }}</p>
30
30
  </div>
31
31
 
32
- <div class="flex items-center gap-2">
33
- <p class="text-xs text-foreground-muted leading-relaxed flex-1">
34
- {{ props.layer === 'workspace'
35
- ? 'Entries of this workspace\'s providers.yml can be changed here; instance entries are inherited.'
36
- : 'The instance registry, $FORGE_HOME/.skaile/providers.yml.' }}
37
- Keys stay in the environment; an entry only references them.
32
+ <div class="flex items-center gap-2" :class="{ 'justify-end': noteText === null }">
33
+ <p v-if="noteText !== null" class="text-xs text-foreground-muted leading-relaxed flex-1">
34
+ {{ noteText }}
38
35
  </p>
39
36
  <UButton
40
37
  v-if="!props.readOnly"
@@ -392,7 +389,9 @@
392
389
  </template>
393
390
 
394
391
  <script setup lang="ts">
392
+ import { computed } from "vue";
395
393
  import type { ProvidersPanelClient } from "../vue/providers-client";
394
+ import { providersPanelNote } from "../vue/providers-panel-model";
396
395
  import { type ProvidersPanelLayer, useProvidersPanel } from "../vue/useProvidersPanel";
397
396
 
398
397
  const props = withDefaults(
@@ -416,11 +415,15 @@ const props = withDefaults(
416
415
  layer: ProvidersPanelLayer;
417
416
  /** Disables add, edit and delete. */
418
417
  readOnly?: boolean;
418
+ /** The line above the list. Absent: the default text for `layer`; a string replaces it; `false` hides it. */
419
+ note?: string | false;
419
420
  }>(),
420
421
  // Without a default Vue casts an absent boolean to `false`; the panel tells absent from `false`.
421
- { environmentEnabled: undefined },
422
+ { environmentEnabled: undefined, note: undefined },
422
423
  );
423
424
 
425
+ const noteText = computed(() => providersPanelNote(props.note, props.layer));
426
+
424
427
  const emit = defineEmits<{
425
428
  /** After every successful `PUT`/`DELETE`. */
426
429
  (event: "changed"): void;
@@ -45,6 +45,11 @@ export interface ProvidersPanelProps {
45
45
  layer: ProvidersPanelLayer;
46
46
  /** Disables every write (non-admin at instance scope; provider lock). */
47
47
  readOnly?: boolean;
48
+ /**
49
+ * The line above the provider list. Absent: the panel's own text for
50
+ * `layer`; a string replaces it; `false` hides it (Add provider stays).
51
+ */
52
+ note?: string | false;
48
53
  }
49
54
 
50
55
  /** Emits both variants declare. */
@@ -161,6 +166,18 @@ export const PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
161
166
 
162
167
  export const DEFAULT_PRESETS_URL = "/api/providers/presets";
163
168
 
169
+ /** The line `ForgeProvidersPanel` shows above its list; `null` = none. */
170
+ export function providersPanelNote(
171
+ note: string | false | undefined,
172
+ layer: ProvidersPanelLayer,
173
+ ): string | null {
174
+ if (note === false) return null;
175
+ if (note !== undefined) return note;
176
+ return layer === "workspace"
177
+ ? "Entries of this workspace's providers.yml can be changed here; instance entries are inherited. Keys stay in the environment; an entry only references them."
178
+ : "The instance registry, $FORGE_HOME/.skaile/providers.yml. Keys stay in the environment; an entry only references them.";
179
+ }
180
+
164
181
  /** An `env:NAME` credential reference; group 1 is the variable name. */
165
182
  export const ENV_REF_PATTERN = /^env:(.+)$/;
166
183