@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.
Files changed (83) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +94 -2
  4. package/dist/module.d.mts +17 -0
  5. package/dist/module.json +9 -0
  6. package/dist/module.mjs +23 -0
  7. package/dist/runtime/ai-sdk/index.d.ts +45 -0
  8. package/dist/runtime/ai-sdk/index.js +39 -0
  9. package/dist/runtime/components/ForgeProvidersPanel.d.vue.ts +21 -0
  10. package/dist/runtime/components/ForgeProvidersPanel.vue +435 -0
  11. package/dist/runtime/components/ForgeProvidersPanel.vue.d.ts +21 -0
  12. package/dist/runtime/editor/index.d.ts +58 -0
  13. package/dist/runtime/editor/index.js +83 -0
  14. package/dist/runtime/model/errors.d.ts +24 -0
  15. package/dist/runtime/model/errors.js +10 -0
  16. package/dist/runtime/server/credential-policy.d.ts +60 -0
  17. package/dist/runtime/server/credential-policy.js +64 -0
  18. package/dist/runtime/server/credential-store.d.ts +184 -0
  19. package/dist/runtime/server/credential-store.js +234 -0
  20. package/dist/runtime/server/env-layers.d.ts +62 -0
  21. package/dist/runtime/server/env-layers.js +185 -0
  22. package/dist/runtime/server/env.d.ts +30 -0
  23. package/dist/runtime/server/env.js +15 -0
  24. package/dist/runtime/server/harness-settings.d.ts +150 -0
  25. package/dist/runtime/server/harness-settings.js +166 -0
  26. package/dist/runtime/server/index.d.ts +23 -0
  27. package/dist/runtime/server/index.js +14 -0
  28. package/dist/runtime/server/provider-discovery.d.ts +73 -0
  29. package/dist/runtime/server/provider-discovery.js +77 -0
  30. package/dist/runtime/server/provider-layers.d.ts +27 -0
  31. package/dist/runtime/server/provider-layers.js +37 -0
  32. package/dist/runtime/server/provider-service.d.ts +126 -0
  33. package/dist/runtime/server/provider-service.js +87 -0
  34. package/dist/runtime/server/provider-settings.d.ts +78 -0
  35. package/dist/runtime/server/provider-settings.js +81 -0
  36. package/dist/runtime/server/provider-write.d.ts +154 -0
  37. package/dist/runtime/server/provider-write.js +223 -0
  38. package/dist/runtime/server/settings-defaults.d.ts +26 -0
  39. package/dist/runtime/server/settings-defaults.js +46 -0
  40. package/dist/runtime/shared/env-vars.d.ts +55 -0
  41. package/dist/runtime/shared/env-vars.js +22 -0
  42. package/dist/runtime/shared/harness-providers.d.ts +62 -0
  43. package/dist/runtime/shared/harness-providers.js +38 -0
  44. package/dist/runtime/shared/harnesses.d.ts +19 -0
  45. package/dist/runtime/shared/harnesses.js +15 -0
  46. package/dist/runtime/shared/provider-registry.d.ts +255 -0
  47. package/dist/runtime/shared/provider-registry.js +112 -0
  48. package/dist/runtime/shared/settings-types.d.ts +84 -0
  49. package/dist/runtime/shared/settings-types.js +0 -0
  50. package/dist/runtime/shims-vue.d.ts +8 -0
  51. package/dist/runtime/vue/index.d.ts +14 -0
  52. package/dist/runtime/vue/index.js +6 -0
  53. package/dist/runtime/vue/settings-modal-scope.d.ts +62 -0
  54. package/dist/runtime/vue/settings-modal-scope.js +2 -0
  55. package/dist/runtime/vue/useProvidersPanel.d.ts +232 -0
  56. package/dist/runtime/vue/useProvidersPanel.js +655 -0
  57. package/dist/types.d.mts +9 -0
  58. package/package.json +117 -4
  59. package/src/runtime/ai-sdk/index.ts +91 -0
  60. package/src/runtime/components/ForgeProvidersPanel.vue +449 -0
  61. package/src/runtime/editor/index.ts +157 -0
  62. package/src/runtime/model/errors.ts +31 -0
  63. package/src/runtime/server/credential-policy.ts +137 -0
  64. package/src/runtime/server/credential-store.ts +473 -0
  65. package/src/runtime/server/env-layers.ts +290 -0
  66. package/src/runtime/server/env.ts +46 -0
  67. package/src/runtime/server/harness-settings.ts +373 -0
  68. package/src/runtime/server/index.ts +24 -0
  69. package/src/runtime/server/provider-discovery.ts +164 -0
  70. package/src/runtime/server/provider-layers.ts +70 -0
  71. package/src/runtime/server/provider-service.ts +244 -0
  72. package/src/runtime/server/provider-settings.ts +192 -0
  73. package/src/runtime/server/provider-write.ts +438 -0
  74. package/src/runtime/server/settings-defaults.ts +87 -0
  75. package/src/runtime/shared/env-vars.ts +82 -0
  76. package/src/runtime/shared/harness-providers.ts +118 -0
  77. package/src/runtime/shared/harnesses.ts +34 -0
  78. package/src/runtime/shared/provider-registry.ts +391 -0
  79. package/src/runtime/shared/settings-types.ts +87 -0
  80. package/src/runtime/shims-vue.d.ts +8 -0
  81. package/src/runtime/vue/index.ts +15 -0
  82. package/src/runtime/vue/settings-modal-scope.ts +66 -0
  83. 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";