@monotykamary/dsh-client-ui-settings-plugins 0.1.0-rc.10

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.
@@ -0,0 +1,91 @@
1
+ /**
2
+ * The web-search card's staged form over the `web-search-deepseek` settings
3
+ * namespace.
4
+ *
5
+ * The key is the one control that does not live in the section: its literal
6
+ * never rides a response, so the card learns only whether one is configured
7
+ * and writes it through the credentials domain, addressed by the reference the
8
+ * section names. It is still staged with the rest of the form, so one save
9
+ * covers everything the card shows.
10
+ */
11
+ import type { IApiClient } from '@monotykamary/dsh-client-connection/client';
12
+ import type { SettingsScope, SnapshotStore } from '@monotykamary/dsh-client-runtime/client';
13
+ import { type CardActions, type CardFieldState, type CardShell } from './card-form.ts';
14
+ /**
15
+ * Namespace of the DeepSeek search provider. Spelled here rather than
16
+ * imported: a client package must not depend on a Host package.
17
+ */
18
+ export declare const WEB_SEARCH_NS = "web-search-deepseek";
19
+ /** The search-provider fields this card edits. */
20
+ export interface WebSearchSettings {
21
+ /** Credential reference naming the environment key. */
22
+ apiKeyEnv?: string;
23
+ /** Provider endpoint; blank inherits the provider default. */
24
+ baseURL?: string;
25
+ /** Maximum searches served within one request. */
26
+ maxUses?: number;
27
+ }
28
+ /** What the web-search card renders. */
29
+ export interface WebSearchCardState extends CardShell {
30
+ /** Provider endpoint. */
31
+ baseURL: CardFieldState;
32
+ /** Searches allowed per request. */
33
+ maxUses: CardFieldState;
34
+ /** The staged credential, which starts blank on every load. */
35
+ apiKey: CardFieldState;
36
+ /** Whether the Host reports a credential configured for the referenced key. */
37
+ apiKeyConfigured: boolean;
38
+ /** Whether the credentials domain accepts a write for it; false disables the control. */
39
+ apiKeyWritable: boolean;
40
+ }
41
+ /** The registration-side face the web-search card's slot entry injects. */
42
+ export interface WebSearchCardFace extends CardActions {
43
+ hooks: {
44
+ /** Card snapshot bound by the renderer as useWebSearchCard. */
45
+ webSearchCard: SnapshotStore<WebSearchCardState>;
46
+ };
47
+ }
48
+ /** Bridges the `web-search-deepseek` scope and the credentials domain onto the card. */
49
+ export declare class WebSearchCardController {
50
+ private readonly scope;
51
+ private readonly api;
52
+ private readonly form;
53
+ private readonly store;
54
+ private credential;
55
+ /**
56
+ * @param scope - the bound settings scope for the `web-search-deepseek` namespace.
57
+ * @param api - wire face used for the credential the section references.
58
+ */
59
+ constructor(scope: SettingsScope<WebSearchSettings>, api: Pick<IApiClient, 'credentials'>);
60
+ private projection;
61
+ /**
62
+ * Ask the credentials domain about the reference the section currently names.
63
+ *
64
+ * The answer is stored with the reference it describes: `apiKeyEnv` can
65
+ * change between the request and its response, and two reads can settle out
66
+ * of order, so a response is published only while it still answers for the
67
+ * reference in force.
68
+ */
69
+ private readCredential;
70
+ /**
71
+ * Re-read after the Host reports a change to the reference this card watches.
72
+ *
73
+ * A key can be written from somewhere else — the Models page addresses the
74
+ * same reference — and the settings section does not change when it is, so
75
+ * without this the badge keeps reporting a state the Host already replaced.
76
+ * @param ref - the reference the Host reports as changed.
77
+ */
78
+ refreshCredential(ref: string): void;
79
+ /**
80
+ * Build the face the card's slot registration injects.
81
+ * @returns the card's snapshot and its form actions.
82
+ */
83
+ inject(): WebSearchCardFace;
84
+ /**
85
+ * Write the staged key, then re-read whether the Host now holds one.
86
+ * @param value - the staged credential literal.
87
+ * @returns whether the Host reports a configured credential afterwards.
88
+ */
89
+ private writeKey;
90
+ }
91
+ //# sourceMappingURL=web-search-card-controller.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Plugins settings surface, node half. The empty apply exists so the plugin
3
+ * appears in the host cordis.yml / Loader; the browser half owns the section
4
+ * and its configurable tab through exports["./client"], discovered from the
5
+ * package.json dsh.client declaration. Every section this page edits is owned
6
+ * by the Host plugin that registered it, so this package registers no
7
+ * namespace of its own.
8
+ */
9
+ /** Host plugin body — no host-side behavior for this surface plugin. */
10
+ export declare function apply(): void;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Package-owned invariant companion for `@monotykamary/dsh-client-ui-settings-plugins`.
3
+ * @module @monotykamary/dsh-client-ui-settings-plugins/invariant
4
+ */
5
+ import type { Context } from '@monotykamary/cordis';
6
+ /** Cordis companion plugin name. */
7
+ export declare const name = "client-ui-settings-plugins-invariant";
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Register this package's invariant companion.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns the installed registration's disposer after setup succeeds.
14
+ */
15
+ export declare const apply: (ctx: Context) => Promise<() => void>;
16
+ //# sourceMappingURL=invariant.d.ts.map
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@monotykamary/dsh-client-ui-settings-plugins",
3
+ "description": "Plugins settings section with feature-owned tabs and configurable host-plane plugin cards",
4
+ "version": "0.1.0-rc.10",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "packages/client/ui-settings-plugins"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./invariant": {
22
+ "types": "./lib/types/invariant.d.ts",
23
+ "default": "./lib/invariant.js"
24
+ },
25
+ "./client": {
26
+ "types": "./lib/types/client/index.d.ts",
27
+ "default": "./lib/client.js"
28
+ },
29
+ "./src/*": "./src/*",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "dsh": {
33
+ "client": {
34
+ "inject": [
35
+ "@monotykamary/dsh-client-connection",
36
+ "@monotykamary/dsh-client-locale",
37
+ "@monotykamary/dsh-client-runtime",
38
+ "@monotykamary/dsh-client-ui-settings",
39
+ "@monotykamary/dsh-api-remotes"
40
+ ],
41
+ "platform": "web"
42
+ }
43
+ },
44
+ "license": "MIT",
45
+ "peerDependencies": {
46
+ "react": "^18.2.0",
47
+ "@monotykamary/cordis": "^4.0.1",
48
+ "@monotykamary/dsh-client-locale": "^0.1.0-rc.10",
49
+ "@monotykamary/dsh-client-connection": "^0.1.0-rc.10",
50
+ "@monotykamary/dsh-client-runtime": "^0.1.0-rc.10",
51
+ "@monotykamary/dsh-client-ui-settings": "^0.1.0-rc.10",
52
+ "@monotykamary/dsh-api-remotes": "^0.1.0-rc.10",
53
+ "@monotykamary/dsh-client-ui-primitives": "^0.1.0-rc.10",
54
+ "@monotykamary/dsh-invariants": "^0.1.0-rc.10",
55
+ "@monotykamary/dsh-client-web-react": "^0.1.0-rc.10",
56
+ "@monotykamary/dsh-client-ui-slots": "^0.1.0-rc.10"
57
+ },
58
+ "devDependencies": {
59
+ "@types/react": "~18.3.1",
60
+ "react": "^18.2.0",
61
+ "@monotykamary/cordis": "^4.0.1",
62
+ "@monotykamary/dsh-api-remotes": "^0.1.0-rc.10",
63
+ "@monotykamary/dsh-client-runtime": "^0.1.0-rc.10",
64
+ "@monotykamary/dsh-client-locale": "^0.1.0-rc.10",
65
+ "@monotykamary/dsh-client-connection": "^0.1.0-rc.10",
66
+ "@monotykamary/dsh-client-test-runtime": "^0.1.0-rc.10",
67
+ "@monotykamary/dsh-client-ui-slots": "^0.1.0-rc.10",
68
+ "@monotykamary/dsh-client-ui-settings": "^0.1.0-rc.10",
69
+ "@monotykamary/dsh-client-ui-primitives": "^0.1.0-rc.10",
70
+ "@monotykamary/dsh-client-web-react": "^0.1.0-rc.10",
71
+ "@monotykamary/dsh-invariants": "^0.1.0-rc.10"
72
+ },
73
+ "files": [
74
+ "lib/index.js",
75
+ "lib/invariant.js",
76
+ "lib/client.js",
77
+ "lib/types/**/*.d.ts"
78
+ ],
79
+ "dependencies": {
80
+ "clsx": "^2.0.0"
81
+ },
82
+ "scripts": {
83
+ "bundle": "tsdown",
84
+ "watch": "tsdown --watch"
85
+ }
86
+ }