dsh-querit 1.0.6 → 1.1.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/lib/client.js CHANGED
@@ -9,6 +9,8 @@
9
9
  import { sanitizeUntrustedText } from "./sanitize.js";
10
10
  export const QUERIT_API_BASE_URL = "https://api.querit.ai";
11
11
  export const DEFAULT_REQUEST_TIMEOUT_MS = 70_000;
12
+ /** Attribution header sent on every request. Bump with the package version. */
13
+ const USER_AGENT = "dsh-querit/1.1.0";
12
14
  const SEARCH_RESPONSE_MAX_BYTES = 2 * 1024 * 1024;
13
15
  const CONTENTS_RESPONSE_MAX_BYTES = 10 * 1024 * 1024;
14
16
  const ERROR_RESPONSE_MAX_BYTES = 8 * 1024;
@@ -56,6 +58,7 @@ export class QueritClient {
56
58
  Accept: "application/json",
57
59
  Authorization: `Bearer ${this.apiKey}`,
58
60
  "Content-Type": "application/json",
61
+ "User-Agent": USER_AGENT,
59
62
  },
60
63
  body: JSON.stringify(requestBody),
61
64
  signal,
package/lib/index.d.ts CHANGED
@@ -4,13 +4,16 @@
4
4
  * `POST /v1/contents`) with a Bearer key resolved per operation from the
5
5
  * launching environment, then optional `ctx.credentials`, then literal config.
6
6
  * The agent preset registers model-facing `web_search`; this package does not.
7
- * By default, it reuses the official `applyWebFetchTool` helper to register
8
- * `web_fetch`, and both tools route through the seam.
7
+ * Both model-facing web tools route through the seam, so once it selects Querit
8
+ * neither needs a registration here; `fetch: true` opts into registering
9
+ * `web_fetch` via the official `applyWebFetchTool` helper for compositions
10
+ * where no `tool-web` row provides it.
9
11
  * @module dsh-querit
10
12
  */
11
13
  import type { Context } from "@deepseek-ai/cordis";
12
14
  import z from "@deepseek-ai/schemastery";
13
15
  import { type CredentialRef } from "@deepseek-ai/dsh-credentials";
16
+ import type { SettingsNamespace } from "@deepseek-ai/dsh-settings";
14
17
  import { type QueritProviderOptions } from "./provider.js";
15
18
  export { COUNTRY_VALUES, LANGUAGE_VALUES, QUERIT_PROVIDER_ID, TIME_RANGE_PATTERN, QueritFetchProvider, QueritSearchProvider, } from "./provider.js";
16
19
  export type { QueritClientLike, QueritProviderOptions } from "./provider.js";
@@ -56,8 +59,10 @@ export interface Config {
56
59
  fetchMaxChars?: number;
57
60
  /**
58
61
  * Register the model-facing `web_fetch` tool (via `dsh-tool-web`'s
59
- * `applyWebFetchTool`). Defaults to true; set false when another row
60
- * already registers `web_fetch` in the same scope.
62
+ * `applyWebFetchTool`). Defaults to false since dsh 0.1.2: the base and
63
+ * agent-preset `tool-web` rows register `web_fetch` themselves (both routing
64
+ * through `ctx.web`, hence Querit); enable only for compositions where no
65
+ * other row provides the tool.
61
66
  */
62
67
  fetch?: boolean;
63
68
  /** Cooperative tool-call timeout budget (ms) for `web_fetch`. Defaults to 30000. */
@@ -67,7 +72,7 @@ export interface Config {
67
72
  }
68
73
  export declare const Config: z<Config>;
69
74
  /** Settings namespace carrying this provider's endpoint, key reference, and search defaults. */
70
- export declare const WEB_SEARCH_QUERIT_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
75
+ export declare const WEB_SEARCH_QUERIT_SETTINGS_NAMESPACE: SettingsNamespace;
71
76
  /**
72
77
  * Project one resolved section into the options both providers serve their
73
78
  * next operation with. Environment fallbacks stay here rather than in the
package/lib/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
2
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
3
- import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
4
3
  import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
5
4
  import { DEFAULT_FETCH_MAX_OUTPUT_CHARS, DEFAULT_WEB_TOOL_TIMEOUT_MS, applyWebFetchTool, } from "@deepseek-ai/dsh-tool-web";
6
5
  import { DEFAULT_REQUEST_TIMEOUT_MS, QUERIT_API_BASE_URL } from "./client.js";
@@ -31,12 +30,12 @@ export const Config = z.object({
31
30
  fetchFormat: z.union([z.const("markdown"), z.const("text"), z.const("html")]).default("markdown"),
32
31
  fetchCrawlTimeout: z.number().step(1).min(1).max(60).default(10),
33
32
  fetchMaxChars: z.number().step(1).min(256).default(8_000),
34
- fetch: z.boolean().default(true),
33
+ fetch: z.boolean().default(false),
35
34
  fetchTimeoutMs: z.number().step(1).min(1_000).default(DEFAULT_WEB_TOOL_TIMEOUT_MS),
36
35
  fetchMaxOutputChars: z.number().step(1).min(256).default(DEFAULT_FETCH_MAX_OUTPUT_CHARS),
37
36
  });
38
37
  /** Settings namespace carrying this provider's endpoint, key reference, and search defaults. */
39
- export const WEB_SEARCH_QUERIT_SETTINGS_NAMESPACE = settingsNamespace("web-search-querit");
38
+ export const WEB_SEARCH_QUERIT_SETTINGS_NAMESPACE = "web-search-querit";
40
39
  /**
41
40
  * Project one resolved section into the options both providers serve their
42
41
  * next operation with. Environment fallbacks stay here rather than in the
@@ -69,20 +68,25 @@ export function resolveOptions(ctx, config) {
69
68
  /** Register both Querit providers with `ctx.web`, the `web_fetch` tool, and the first-load key check. */
70
69
  export async function apply(ctx, config) {
71
70
  let current = () => config;
72
- installSettingsSection(ctx, WEB_SEARCH_QUERIT_SETTINGS_NAMESPACE, Config, config, {
73
- setSource: (source) => {
74
- current = source;
75
- },
76
- onChange: () => { },
77
- validate: (value) => validateSection(value),
71
+ // Optional settings service: absent, the plugin keeps running on its entry
72
+ // config exactly as composed; present, the row becomes the namespace's base
73
+ // layer and user edits reach the next operation through `current`.
74
+ ctx.inject(["settings"], (settingsCtx) => {
75
+ settingsCtx.settings.installSection(ctx, WEB_SEARCH_QUERIT_SETTINGS_NAMESPACE, Config, config, {
76
+ setSource: (source) => {
77
+ current = source;
78
+ },
79
+ onChange: () => { },
80
+ validate: (value) => validateSection(value),
81
+ });
78
82
  });
79
83
  ctx.web.registerSearchProvider(new QueritSearchProvider(() => resolveOptions(ctx, current())));
80
84
  ctx.web.registerFetchProvider(new QueritFetchProvider(() => resolveOptions(ctx, current())));
81
- // The model-facing web_fetch tool. In this deployment's web app the host
82
- // `tool-web` row is disabled and the shipped presets keep `fetch: false`, so
83
- // this package owns the one global registration; `fetch: false` opts out when
84
- // a preset already registers it.
85
- if (config.fetch !== false) {
85
+ // The model-facing web_fetch tool. Since dsh 0.1.2 the base composition and
86
+ // agent presets register `web_fetch` through their own `tool-web` rows (both
87
+ // web tools route through `ctx.web`, hence Querit), so this opt-in covers
88
+ // only compositions where no other row provides the tool.
89
+ if (config.fetch === true) {
86
90
  applyWebFetchTool(ctx, config.fetchTimeoutMs ?? DEFAULT_WEB_TOOL_TIMEOUT_MS, config.fetchMaxOutputChars ?? DEFAULT_FETCH_MAX_OUTPUT_CHARS);
87
91
  }
88
92
  // First-load configuration prompt: this deployment has no settings page for
package/lib/provider.d.ts CHANGED
@@ -9,8 +9,8 @@
9
9
  import type { WebFetchProvider, WebFetchResult, WebSearchProvider, WebSearchResult } from "@deepseek-ai/dsh-web";
10
10
  import type { CredentialRef } from "@deepseek-ai/dsh-credentials";
11
11
  import { type QueritClientOptions, type QueritContentsRequest, type QueritContentsResponse, type QueritSearchRequest, type QueritSearchResponse } from "./client.js";
12
- /** Stable id both providers register under. */
13
- export declare const QUERIT_PROVIDER_ID = "querit";
12
+ /** Stable id both providers register under, mirroring the native `web-search-deepseek` row naming. */
13
+ export declare const QUERIT_PROVIDER_ID = "web-search-querit";
14
14
  export declare const COUNTRY_VALUES: readonly ["argentina", "australia", "brazil", "canada", "colombia", "france", "germany", "india", "indonesia", "japan", "mexico", "nigeria", "philippines", "south korea", "spain", "united kingdom", "united states"];
15
15
  export declare const LANGUAGE_VALUES: readonly ["english", "japanese", "korean", "german", "french", "spanish", "portuguese"];
16
16
  /** `dN`/`wN`/`mN`/`yN` (N ≥ 1) or an inclusive `YYYY-MM-DDtoYYYY-MM-DD` range. */
@@ -64,7 +64,7 @@ export declare function normalizeDomains(values: readonly string[] | undefined):
64
64
  export declare function normalizeHostname(value: string): string | undefined;
65
65
  export declare class QueritSearchProvider implements WebSearchProvider {
66
66
  private readonly resolveOptions;
67
- readonly id = "querit";
67
+ readonly id = "web-search-querit";
68
68
  /**
69
69
  * @param resolveOptions - options for the NEXT operation, snapshotted once
70
70
  * at each operation's entry so one search never mixes two settings sections.
@@ -79,7 +79,7 @@ export declare class QueritSearchProvider implements WebSearchProvider {
79
79
  }
80
80
  export declare class QueritFetchProvider implements WebFetchProvider {
81
81
  private readonly resolveOptions;
82
- readonly id = "querit";
82
+ readonly id = "web-search-querit";
83
83
  constructor(resolveOptions: () => QueritProviderOptions);
84
84
  available(): boolean;
85
85
  fetch(request: {
package/lib/provider.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WebError } from "@deepseek-ai/dsh-web";
2
2
  import { QueritApiError, QueritClient, } from "./client.js";
3
- /** Stable id both providers register under. */
4
- export const QUERIT_PROVIDER_ID = "querit";
3
+ /** Stable id both providers register under, mirroring the native `web-search-deepseek` row naming. */
4
+ export const QUERIT_PROVIDER_ID = "web-search-querit";
5
5
  export const COUNTRY_VALUES = [
6
6
  "argentina",
7
7
  "australia",
package/package.json CHANGED
@@ -1,136 +1,136 @@
1
- {
2
- "name": "dsh-querit",
3
- "description": "Querit-backed search and fetch providers for the DeepSeek Harness web capability seam (ctx.web)",
4
- "version": "1.0.6",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/index.d.ts",
11
- "default": "./lib/index.js"
12
- },
13
- "./invariant": {
14
- "types": "./lib/invariant.d.ts",
15
- "default": "./lib/invariant.js"
16
- },
17
- "./client": {
18
- "default": "./lib/card.js"
19
- },
20
- "./package.json": "./package.json"
21
- },
22
- "files": [
23
- "lib",
24
- "cordis.patch.yml",
25
- "README.md",
26
- "LICENSE"
27
- ],
28
- "license": "MIT",
29
- "dsh": {
30
- "bundle": {
31
- "patch": "./cordis.patch.yml"
32
- },
33
- "client": {
34
- "platform": "web",
35
- "inject": [
36
- "@deepseek-ai/dsh-client-connection",
37
- "@deepseek-ai/dsh-client-locale",
38
- "@deepseek-ai/dsh-client-ui-settings",
39
- "@deepseek-ai/dsh-api-remotes"
40
- ]
41
- }
42
- },
43
- "repository": {
44
- "type": "git",
45
- "url": "git+https://github.com/querit-ai/querit-plugins.git"
46
- },
47
- "bugs": {
48
- "url": "https://github.com/querit-ai/querit-plugins/issues"
49
- },
50
- "keywords": [
51
- "dsh-plugin",
52
- "deepseek-harness",
53
- "querit",
54
- "web-search",
55
- "web-fetch"
56
- ],
57
- "scripts": {
58
- "check": "tsc -p tsconfig.check.json",
59
- "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
60
- "test": "vitest run tests",
61
- "pack:check": "npm pack --dry-run",
62
- "prepack": "npm run check && npm test && npm run build"
63
- },
64
- "peerDependencies": {
65
- "@deepseek-ai/cordis": "^4.0.1",
66
- "@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.6",
67
- "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6",
68
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
69
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
70
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
71
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
72
- "@deepseek-ai/dsh-launch-environment": "^0.1.0-rc.6",
73
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
74
- "@deepseek-ai/dsh-tool-web": "^0.1.0-rc.6",
75
- "@deepseek-ai/dsh-web": "^0.1.0-rc.6",
76
- "react": "^18.2.0"
77
- },
78
- "peerDependenciesMeta": {
79
- "@deepseek-ai/cordis": {
80
- "optional": true
81
- },
82
- "@deepseek-ai/dsh-credentials": {
83
- "optional": true
84
- },
85
- "@deepseek-ai/dsh-invariants": {
86
- "optional": true
87
- },
88
- "@deepseek-ai/dsh-launch-environment": {
89
- "optional": true
90
- },
91
- "@deepseek-ai/dsh-settings": {
92
- "optional": true
93
- },
94
- "@deepseek-ai/dsh-tool-web": {
95
- "optional": true
96
- },
97
- "@deepseek-ai/dsh-web": {
98
- "optional": true
99
- },
100
- "@deepseek-ai/dsh-api-remotes": {
101
- "optional": true
102
- },
103
- "@deepseek-ai/dsh-client-connection": {
104
- "optional": true
105
- },
106
- "@deepseek-ai/dsh-client-locale": {
107
- "optional": true
108
- },
109
- "@deepseek-ai/dsh-client-ui-settings": {
110
- "optional": true
111
- },
112
- "react": {
113
- "optional": true
114
- }
115
- },
116
- "dependencies": {
117
- "@deepseek-ai/schemastery": "^3.18.1"
118
- },
119
- "devDependencies": {
120
- "@deepseek-ai/cordis": "^4.0.1",
121
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
122
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
123
- "@deepseek-ai/dsh-launch-environment": "^0.1.0-rc.6",
124
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
125
- "@deepseek-ai/dsh-tool-web": "^0.1.0-rc.6",
126
- "@deepseek-ai/dsh-web": "^0.1.0-rc.6",
127
- "@types/node": "^22.0.0",
128
- "react": "^18.2.0",
129
- "react-dom": "^18.3.1",
130
- "typescript": "^5.9.0",
131
- "vitest": "^4.0.0"
132
- },
133
- "engines": {
134
- "node": ">=22.19.0"
135
- }
136
- }
1
+ {
2
+ "name": "dsh-querit",
3
+ "description": "Querit-backed search and fetch providers for the DeepSeek Harness web capability seam (ctx.web)",
4
+ "version": "1.1.0",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./invariant": {
14
+ "types": "./lib/invariant.d.ts",
15
+ "default": "./lib/invariant.js"
16
+ },
17
+ "./client": {
18
+ "default": "./lib/card.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "lib",
24
+ "cordis.patch.yml",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "license": "MIT",
29
+ "dsh": {
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "client": {
34
+ "platform": "web",
35
+ "inject": [
36
+ "@deepseek-ai/dsh-client-connection",
37
+ "@deepseek-ai/dsh-client-locale",
38
+ "@deepseek-ai/dsh-client-ui-settings",
39
+ "@deepseek-ai/dsh-api-remotes"
40
+ ]
41
+ }
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/querit-ai/querit-plugins.git"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/querit-ai/querit-plugins/issues"
49
+ },
50
+ "keywords": [
51
+ "dsh-plugin",
52
+ "deepseek-harness",
53
+ "querit",
54
+ "web-search",
55
+ "web-fetch"
56
+ ],
57
+ "scripts": {
58
+ "check": "tsc -p tsconfig.check.json",
59
+ "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
60
+ "test": "vitest run tests",
61
+ "pack:check": "npm pack --dry-run",
62
+ "prepack": "npm run check && npm test && npm run build"
63
+ },
64
+ "peerDependencies": {
65
+ "@deepseek-ai/cordis": "^4.0.1",
66
+ "@deepseek-ai/dsh-api-remotes": "^0.1.2-rc.1",
67
+ "@deepseek-ai/dsh-client-connection": "^0.1.2-rc.1",
68
+ "@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
69
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.2-rc.1",
70
+ "@deepseek-ai/dsh-credentials": "^0.1.2-rc.1",
71
+ "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1",
72
+ "@deepseek-ai/dsh-launch-environment": "^0.1.2-rc.1",
73
+ "@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
74
+ "@deepseek-ai/dsh-tool-web": "^0.1.2-rc.1",
75
+ "@deepseek-ai/dsh-web": "^0.1.2-rc.1",
76
+ "react": "^18.2.0"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "@deepseek-ai/cordis": {
80
+ "optional": true
81
+ },
82
+ "@deepseek-ai/dsh-credentials": {
83
+ "optional": true
84
+ },
85
+ "@deepseek-ai/dsh-invariants": {
86
+ "optional": true
87
+ },
88
+ "@deepseek-ai/dsh-launch-environment": {
89
+ "optional": true
90
+ },
91
+ "@deepseek-ai/dsh-settings": {
92
+ "optional": true
93
+ },
94
+ "@deepseek-ai/dsh-tool-web": {
95
+ "optional": true
96
+ },
97
+ "@deepseek-ai/dsh-web": {
98
+ "optional": true
99
+ },
100
+ "@deepseek-ai/dsh-api-remotes": {
101
+ "optional": true
102
+ },
103
+ "@deepseek-ai/dsh-client-connection": {
104
+ "optional": true
105
+ },
106
+ "@deepseek-ai/dsh-client-locale": {
107
+ "optional": true
108
+ },
109
+ "@deepseek-ai/dsh-client-ui-settings": {
110
+ "optional": true
111
+ },
112
+ "react": {
113
+ "optional": true
114
+ }
115
+ },
116
+ "dependencies": {
117
+ "@deepseek-ai/schemastery": "^3.18.1"
118
+ },
119
+ "devDependencies": {
120
+ "@deepseek-ai/cordis": "^4.0.1",
121
+ "@deepseek-ai/dsh-credentials": "^0.1.2-rc.1",
122
+ "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1",
123
+ "@deepseek-ai/dsh-launch-environment": "^0.1.2-rc.1",
124
+ "@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
125
+ "@deepseek-ai/dsh-tool-web": "^0.1.2-rc.1",
126
+ "@deepseek-ai/dsh-web": "^0.1.2-rc.1",
127
+ "@types/node": "^22.0.0",
128
+ "react": "^18.2.0",
129
+ "react-dom": "^18.3.1",
130
+ "typescript": "^5.9.0",
131
+ "vitest": "^4.0.0"
132
+ },
133
+ "engines": {
134
+ "node": ">=22.19.0"
135
+ }
136
+ }