@skaile/forge-settings 0.0.0-stage → 1.0.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/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +94 -2
- package/dist/module.d.mts +17 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +23 -0
- package/dist/runtime/ai-sdk/index.d.ts +45 -0
- package/dist/runtime/ai-sdk/index.js +39 -0
- package/dist/runtime/components/ForgeProvidersPanel.d.vue.ts +21 -0
- package/dist/runtime/components/ForgeProvidersPanel.vue +435 -0
- package/dist/runtime/components/ForgeProvidersPanel.vue.d.ts +21 -0
- package/dist/runtime/editor/index.d.ts +58 -0
- package/dist/runtime/editor/index.js +83 -0
- package/dist/runtime/model/errors.d.ts +24 -0
- package/dist/runtime/model/errors.js +10 -0
- package/dist/runtime/server/credential-policy.d.ts +60 -0
- package/dist/runtime/server/credential-policy.js +64 -0
- package/dist/runtime/server/credential-store.d.ts +184 -0
- package/dist/runtime/server/credential-store.js +234 -0
- package/dist/runtime/server/env-layers.d.ts +62 -0
- package/dist/runtime/server/env-layers.js +185 -0
- package/dist/runtime/server/env.d.ts +30 -0
- package/dist/runtime/server/env.js +15 -0
- package/dist/runtime/server/harness-settings.d.ts +150 -0
- package/dist/runtime/server/harness-settings.js +166 -0
- package/dist/runtime/server/index.d.ts +23 -0
- package/dist/runtime/server/index.js +14 -0
- package/dist/runtime/server/provider-discovery.d.ts +73 -0
- package/dist/runtime/server/provider-discovery.js +77 -0
- package/dist/runtime/server/provider-layers.d.ts +27 -0
- package/dist/runtime/server/provider-layers.js +37 -0
- package/dist/runtime/server/provider-service.d.ts +126 -0
- package/dist/runtime/server/provider-service.js +87 -0
- package/dist/runtime/server/provider-settings.d.ts +78 -0
- package/dist/runtime/server/provider-settings.js +81 -0
- package/dist/runtime/server/provider-write.d.ts +154 -0
- package/dist/runtime/server/provider-write.js +223 -0
- package/dist/runtime/server/settings-defaults.d.ts +26 -0
- package/dist/runtime/server/settings-defaults.js +46 -0
- package/dist/runtime/shared/env-vars.d.ts +55 -0
- package/dist/runtime/shared/env-vars.js +22 -0
- package/dist/runtime/shared/harness-providers.d.ts +62 -0
- package/dist/runtime/shared/harness-providers.js +38 -0
- package/dist/runtime/shared/harnesses.d.ts +19 -0
- package/dist/runtime/shared/harnesses.js +15 -0
- package/dist/runtime/shared/provider-registry.d.ts +255 -0
- package/dist/runtime/shared/provider-registry.js +112 -0
- package/dist/runtime/shared/settings-types.d.ts +84 -0
- package/dist/runtime/shared/settings-types.js +0 -0
- package/dist/runtime/shims-vue.d.ts +8 -0
- package/dist/runtime/vue/index.d.ts +14 -0
- package/dist/runtime/vue/index.js +6 -0
- package/dist/runtime/vue/settings-modal-scope.d.ts +62 -0
- package/dist/runtime/vue/settings-modal-scope.js +2 -0
- package/dist/runtime/vue/useProvidersPanel.d.ts +232 -0
- package/dist/runtime/vue/useProvidersPanel.js +655 -0
- package/dist/types.d.mts +9 -0
- package/package.json +117 -4
- package/src/runtime/ai-sdk/index.ts +91 -0
- package/src/runtime/components/ForgeProvidersPanel.vue +449 -0
- package/src/runtime/editor/index.ts +157 -0
- package/src/runtime/model/errors.ts +31 -0
- package/src/runtime/server/credential-policy.ts +137 -0
- package/src/runtime/server/credential-store.ts +473 -0
- package/src/runtime/server/env-layers.ts +290 -0
- package/src/runtime/server/env.ts +46 -0
- package/src/runtime/server/harness-settings.ts +373 -0
- package/src/runtime/server/index.ts +24 -0
- package/src/runtime/server/provider-discovery.ts +164 -0
- package/src/runtime/server/provider-layers.ts +70 -0
- package/src/runtime/server/provider-service.ts +244 -0
- package/src/runtime/server/provider-settings.ts +192 -0
- package/src/runtime/server/provider-write.ts +438 -0
- package/src/runtime/server/settings-defaults.ts +87 -0
- package/src/runtime/shared/env-vars.ts +82 -0
- package/src/runtime/shared/harness-providers.ts +118 -0
- package/src/runtime/shared/harnesses.ts +34 -0
- package/src/runtime/shared/provider-registry.ts +391 -0
- package/src/runtime/shared/settings-types.ts +87 -0
- package/src/runtime/shims-vue.d.ts +8 -0
- package/src/runtime/vue/index.ts +15 -0
- package/src/runtime/vue/settings-modal-scope.ts +66 -0
- package/src/runtime/vue/useProvidersPanel.ts +1087 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tier a settings modal edits, and the URLs of its routes.
|
|
3
|
+
*
|
|
4
|
+
* The URL protocol is the host's: every field names a route the host serves,
|
|
5
|
+
* and no component builds a URL from an id or a slug. `ForgeProvidersPanel`
|
|
6
|
+
* takes the `providers*` / `environmentUrl` / `providersLayer` fields of this
|
|
7
|
+
* record as its props; the rest belong to the host's own modal tabs (harness,
|
|
8
|
+
* voice, workspace), which stay in the host.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Which settings tier a modal edits. */
|
|
12
|
+
export type SettingsModalSettingsScope = "instance" | "workspace";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The tier the modal edits: the instance (app-wide defaults) or one
|
|
16
|
+
* workspace. The caller owns every route: the modal never builds a URL from an
|
|
17
|
+
* id or slug.
|
|
18
|
+
*/
|
|
19
|
+
export interface SettingsModalScope {
|
|
20
|
+
/** Dialog header text, e.g. the workspace name. */
|
|
21
|
+
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* `"instance"`: the Harness tab edits the instance defaults
|
|
24
|
+
* (`PUT /api/settings?scope=instance`); `"workspace"`: it edits this
|
|
25
|
+
* workspace's overrides through {@link settingsUrl}.
|
|
26
|
+
*/
|
|
27
|
+
settingsScope: SettingsModalSettingsScope;
|
|
28
|
+
/**
|
|
29
|
+
* `GET`/`PUT` endpoint of this scope's settings: `/api/settings` for the
|
|
30
|
+
* instance, the workspace's override row (`{ harness, model }`) otherwise.
|
|
31
|
+
*/
|
|
32
|
+
settingsUrl: string;
|
|
33
|
+
/** Base URL for the Workspace + Connectors tabs' config API calls. */
|
|
34
|
+
workspaceApiBaseUrl: string;
|
|
35
|
+
/** `GET` model catalog of this scope's registry, queried with `?harness=<id>`. */
|
|
36
|
+
modelsUrl: string;
|
|
37
|
+
/** Provider registry write base: `PUT|DELETE <url>/:id`, `GET <url>/detected`. */
|
|
38
|
+
providersWriteUrl: string;
|
|
39
|
+
/**
|
|
40
|
+
* `GET` endpoint of this scope's `.env` layer, which the Providers tab reads and
|
|
41
|
+
* writes. Defaults to the instance layer, `/api/settings/env`.
|
|
42
|
+
*/
|
|
43
|
+
environmentUrl?: string;
|
|
44
|
+
/**
|
|
45
|
+
* `GET` endpoint listing registry entries with their credential status
|
|
46
|
+
* resolved against this scope's environment. Defaults to `/api/providers`.
|
|
47
|
+
*/
|
|
48
|
+
providersUrl?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The registry document the Providers tab edits, when it differs from
|
|
51
|
+
* {@link settingsScope}. A single-workspace app keeps instance settings but
|
|
52
|
+
* writes the workspace registry over a user-level one: `"workspace"` there
|
|
53
|
+
* makes the lower document's entries inherited and patchable.
|
|
54
|
+
*/
|
|
55
|
+
providersLayer?: SettingsModalSettingsScope;
|
|
56
|
+
/** Workspace name for workspace-scope copy (the harness-change confirm); defaults to {@link label}. */
|
|
57
|
+
workspaceName?: string;
|
|
58
|
+
/** The caller may read but not write this scope (e.g. a `readonly` user, another owner's workspace). */
|
|
59
|
+
readOnly?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Default `GET` route of the merged provider list. */
|
|
63
|
+
export const DEFAULT_PROVIDERS_URL = "/api/providers";
|
|
64
|
+
|
|
65
|
+
/** Default `GET`/`PUT` route of the instance `.env` layer. */
|
|
66
|
+
export const DEFAULT_ENVIRONMENT_URL = "/api/settings/env";
|