dsh-querit 1.0.5 → 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/LICENSE +21 -21
- package/README.md +7 -5
- package/cordis.patch.yml +2 -2
- package/lib/card.js +172 -120
- package/lib/client.js +3 -0
- package/lib/index.d.ts +10 -5
- package/lib/index.js +18 -14
- package/lib/provider.d.ts +4 -4
- package/lib/provider.js +2 -2
- package/package.json +17 -17
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 dsh-querit contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-querit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ Querit-backed search and fetch providers for the DeepSeek Harness [web capabilit
|
|
|
6
6
|
|
|
7
7
|
Sign up on [Querit.ai](https://www.querit.ai) to get an API key with **1,000 free API calls per month** — no credit card required.
|
|
8
8
|
|
|
9
|
+
Since v1.1.0 the package targets **dsh 0.1.2+**: the host half registers its settings namespace through the `ctx.settings` service (`installSection`), and the settings card reads and writes the API key through the browser `remote.credentials` namespace. On older dsh hosts (0.1.0–0.1.1) install `dsh-querit@1.0.6` instead.
|
|
10
|
+
|
|
9
11
|
## Quick start
|
|
10
12
|
|
|
11
13
|
1. Install the package (see **Install and update** below). Since v1.0.3 the package ships as a *profile bundle*: `dsh plugin add` wires the provider row and the seam routing automatically — no `cordis.patch.yml` edits needed (see **Wire it up** for what it applies and how to override). Since v1.0.4 the bundle also disables the shipped DeepSeek search provider row, and removing the package restores it.
|
|
@@ -18,9 +20,9 @@ Sign up on [Querit.ai](https://www.querit.ai) to get an API key with **1,000 fre
|
|
|
18
20
|
|
|
19
21
|
If the plugin loads without any resolvable key, the host log prints a one-time warning; a search attempted before a key is configured fails with a `WEB_PROVIDER_CREDENTIAL_MISSING` error that spells out the same three options.
|
|
20
22
|
|
|
21
|
-
Since v1.0.4 the package also ships a browser half with a settings card: **Settings → Plugins → Plugin configuration** lists a "Querit web search" card that edits the `web-search-querit` namespace (credential reference, result count, time range, languages, countries, domain lists, content excerpts, fetch format) and can write the API key straight into the credentials domain. Its writes go through the same settings transport as `$DSH_HOME/settings.yaml` (see **Config**).
|
|
23
|
+
Since v1.0.4 the package also ships a browser half with a settings card: **Settings → Plugins → Plugin configuration** lists a "Querit web search" card that edits the `web-search-querit` namespace (credential reference, result count, time range, languages, countries, domain lists, content excerpts, fetch format) and can write the API key straight into the credentials domain. Its writes go through the same settings transport as `$DSH_HOME/settings.yaml` (see **Config**). Since v1.0.6 the card chrome (background, padding, font size, chevron toggle, button styles) matches the official plugin cards shipped by `@deepseek-ai/dsh-client-ui-settings-plugins`, so the entry sits flush with "Terminal", "Agent loop", and the DeepSeek "Web search" row. All colors and borders are sourced from the theme's alias tokens (`--dsw-alias-bg-layer-3`, `--dsw-alias-label-primary`, etc.), so the card follows the active light or dark palette without any package-local override.
|
|
22
24
|
|
|
23
|
-
This is an **implementation** package: it registers one search provider and one fetch provider into `ctx.web`. Per operation, it resolves the API key from the launching environment first, then the optional `ctx.credentials` seam, then literal config. It
|
|
25
|
+
This is an **implementation** package: it registers one search provider and one fetch provider into `ctx.web`. Per operation, it resolves the API key from the launching environment first, then the optional `ctx.credentials` seam, then literal config. It registers no model-facing tool itself: since dsh 0.1.2 the base composition and agent presets register both `web_search` and `web_fetch` through their `tool-web` rows, and both tools execute through `ctx.web` — so once the seam selects Querit, both tools are Querit-backed. (`fetch: true` opts into registering `web_fetch` via [`@deepseek-ai/dsh-tool-web`](https://www.npmjs.com/package/@deepseek-ai/dsh-tool-web)'s `applyWebFetchTool` for compositions that provide no `tool-web` row.) Both providers share the stable id `web-search-querit`, mirroring the native `web-search-deepseek` naming.
|
|
24
26
|
|
|
25
27
|
## Install and update
|
|
26
28
|
|
|
@@ -71,8 +73,8 @@ Since v1.0.3 the package ships as a profile bundle whose patch layer applies all
|
|
|
71
73
|
# Route the seam's search and fetch through Querit.
|
|
72
74
|
- id: web
|
|
73
75
|
config:
|
|
74
|
-
searchProvider: querit
|
|
75
|
-
fetchProvider: querit
|
|
76
|
+
searchProvider: web-search-querit
|
|
77
|
+
fetchProvider: web-search-querit
|
|
76
78
|
|
|
77
79
|
# This package IS the search backend: stop mounting the DeepSeek provider row.
|
|
78
80
|
# Re-enable with `disabled: false` in a later layer if you need it back.
|
|
@@ -105,7 +107,7 @@ If a preset ever registers `web_fetch` itself (its `tool-web` row with `fetch: t
|
|
|
105
107
|
| `fetchFormat` | `markdown` | Format requested from `/v1/contents` for fetch calls: `markdown`, `text`, or `html`. HTML bodies are labeled `kind: 'html'` so `dsh-tool-web` converts them to markdown. |
|
|
106
108
|
| `fetchCrawlTimeout` | `10` | Per-page crawl timeout in seconds (1–60). |
|
|
107
109
|
| `fetchMaxChars` | `8000` | Cap applied to one fetched page's decoded body, in chars; a cut body sets `truncated`. |
|
|
108
|
-
| `fetch` | `
|
|
110
|
+
| `fetch` | `false` | Opt in to registering the model-facing `web_fetch` tool (reused from `@deepseek-ai/dsh-tool-web`). Since dsh 0.1.2 the base and agent-preset `tool-web` rows register `web_fetch` themselves and route through the seam, so leave off unless no other row provides the tool. |
|
|
109
111
|
| `fetchTimeoutMs` | `30000` | Cooperative tool-call timeout budget (ms) attached to `web_fetch`. |
|
|
110
112
|
| `fetchMaxOutputChars` | `200000` | Cap on one `web_fetch` rendered output, in chars. |
|
|
111
113
|
|
package/cordis.patch.yml
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
- id: web
|
|
17
17
|
config:
|
|
18
|
-
searchProvider: querit
|
|
19
|
-
fetchProvider: querit
|
|
18
|
+
searchProvider: web-search-querit
|
|
19
|
+
fetchProvider: web-search-querit
|
|
20
20
|
|
|
21
21
|
# This package IS the search backend: stop mounting the DeepSeek provider row.
|
|
22
22
|
# Override with `- id: web-search-deepseek / disabled: false` in a later layer
|
package/lib/card.js
CHANGED
|
@@ -347,40 +347,44 @@ function makeStore(initial) {
|
|
|
347
347
|
var tagId = NS + '/card.css';
|
|
348
348
|
if (document.querySelector('style[data-plugin-css="' + tagId + '"]') !== null) return;
|
|
349
349
|
var css = [
|
|
350
|
-
'.qr-card{list-style:none;border:1px solid var(--dsw-alias-border-l2);
|
|
351
|
-
'.qr-
|
|
352
|
-
'.qr-
|
|
353
|
-
'.qr-
|
|
354
|
-
'.qr-
|
|
355
|
-
'.qr-
|
|
356
|
-
'.qr-
|
|
357
|
-
'.qr-
|
|
358
|
-
'.qr-
|
|
359
|
-
'.qr-
|
|
360
|
-
'.qr-
|
|
350
|
+
'.qr-card{list-style:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;transition:border-color .16s,background .16s}',
|
|
351
|
+
'.qr-card:hover{border-color:var(--dsw-alias-label-dimmed)}',
|
|
352
|
+
'.qr-card.qr-open{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}',
|
|
353
|
+
'.qr-header{appearance:none;display:flex;align-items:center;gap:12px;width:100%;padding:14px 16px;background:0 0;border:0;border-radius:12px;cursor:pointer;color:inherit;font:inherit;text-align:left}',
|
|
354
|
+
'.qr-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}',
|
|
355
|
+
'.qr-head{flex-direction:column;flex:1;min-width:0;gap:4px;display:flex}',
|
|
356
|
+
'.qr-name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}',
|
|
357
|
+
'.qr-desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}',
|
|
358
|
+
'.qr-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}',
|
|
359
|
+
'.qr-chev{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}',
|
|
360
|
+
'.qr-card.qr-open .qr-chev{transform:rotate(180deg)}',
|
|
361
|
+
'.qr-body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}',
|
|
362
|
+
'.qr-readonly{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}',
|
|
363
|
+
'.qr-field{display:flex;flex-direction:column;gap:6px;padding:12px 0}',
|
|
364
|
+
'.qr-field+.qr-field{border-top:1px solid var(--dsw-alias-border-l2)}',
|
|
361
365
|
'.qr-fhead{display:flex;align-items:center;gap:8px}',
|
|
362
|
-
'.qr-grow{flex:1}',
|
|
363
366
|
'.qr-label{flex:1;min-width:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:1.5}',
|
|
364
|
-
'.qr-
|
|
365
|
-
'.qr-tagOver{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;line-height:17px}',
|
|
366
|
-
'.qr-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:
|
|
367
|
+
'.qr-badges{align-items:center;gap:8px;display:inline-flex}',
|
|
368
|
+
'.qr-tagOver{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}',
|
|
369
|
+
'.qr-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}',
|
|
367
370
|
'.qr-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}',
|
|
368
371
|
'.qr-reset:disabled{cursor:default}',
|
|
369
372
|
'.qr-input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5;box-sizing:border-box}',
|
|
370
373
|
'.qr-input:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}',
|
|
371
374
|
'.qr-input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}',
|
|
375
|
+
'.qr-input-invalid{border-color:var(--dsw-alias-label-error)}',
|
|
372
376
|
'.qr-check{width:16px;height:16px;accent-color:var(--dsw-alias-brand-primary);cursor:pointer;flex:none}',
|
|
373
377
|
'.qr-check:disabled{cursor:default}',
|
|
374
|
-
'.qr-invalid{
|
|
375
|
-
'.qr-err{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}',
|
|
378
|
+
'.qr-invalid{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}',
|
|
376
379
|
'.qr-hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}',
|
|
377
|
-
'.qr-
|
|
378
|
-
'.qr-
|
|
379
|
-
'.qr-
|
|
380
|
-
'.qr-
|
|
381
|
-
'.qr-
|
|
382
|
-
'.qr-save{
|
|
383
|
-
'.qr-btn:disabled{opacity:.
|
|
380
|
+
'.qr-foot{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}',
|
|
381
|
+
'.qr-failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}',
|
|
382
|
+
'.qr-btn{appearance:none;font:inherit;cursor:pointer;border:1px solid transparent;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}',
|
|
383
|
+
'.qr-discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:transparent}',
|
|
384
|
+
'.qr-discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}',
|
|
385
|
+
'.qr-save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}',
|
|
386
|
+
'.qr-btn:disabled{opacity:.4;cursor:default}',
|
|
387
|
+
'.qr-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}'
|
|
384
388
|
].join('');
|
|
385
389
|
var tag = document.createElement('style');
|
|
386
390
|
tag.dataset.plugin = NS;
|
|
@@ -393,6 +397,8 @@ function makeStore(initial) {
|
|
|
393
397
|
title: 'Querit web search',
|
|
394
398
|
description: 'Querit-backed search and fetch provider.',
|
|
395
399
|
readOnly: 'This deployment stores settings read-only.',
|
|
400
|
+
expand: 'Show settings',
|
|
401
|
+
collapse: 'Hide settings',
|
|
396
402
|
pass: 'Password',
|
|
397
403
|
save: 'Save',
|
|
398
404
|
saving: 'Saving\u2026',
|
|
@@ -429,6 +435,8 @@ function makeStore(initial) {
|
|
|
429
435
|
title: 'Querit 网页搜索',
|
|
430
436
|
description: '基于 Querit 的搜索与抓取提供方。',
|
|
431
437
|
readOnly: '本部署的设置为只读。',
|
|
438
|
+
expand: '展开设置',
|
|
439
|
+
collapse: '收起设置',
|
|
432
440
|
pass: '密码',
|
|
433
441
|
save: '保存',
|
|
434
442
|
saving: '保存中\u2026',
|
|
@@ -469,9 +477,9 @@ function makeStore(initial) {
|
|
|
469
477
|
}
|
|
470
478
|
|
|
471
479
|
/** Bridges the web-search-querit scope and the credentials domain onto the card. */
|
|
472
|
-
function QueritCardController(scope,
|
|
480
|
+
function QueritCardController(scope, ctx) {
|
|
473
481
|
this.scope = scope;
|
|
474
|
-
this.
|
|
482
|
+
this.ctx = ctx;
|
|
475
483
|
this.credential = { ref: '', configured: false, writable: true };
|
|
476
484
|
this.form = new QueritFormModel(
|
|
477
485
|
scope,
|
|
@@ -522,16 +530,16 @@ function makeStore(initial) {
|
|
|
522
530
|
this.credential = { ref: ref, configured: false, writable: true };
|
|
523
531
|
this.store.set(this.projection());
|
|
524
532
|
}
|
|
525
|
-
this.
|
|
526
|
-
.describe(
|
|
533
|
+
this.ctx.remote.credentials
|
|
534
|
+
.describe([ref])
|
|
527
535
|
.then(function (response) {
|
|
528
|
-
if (!response ||
|
|
536
|
+
if (!response || response.ok !== true) return;
|
|
529
537
|
if (ref !== refOf(self.scope.getSnapshot())) return;
|
|
530
|
-
var view = response.
|
|
538
|
+
var view = response.value !== undefined ? response.value[ref] : undefined;
|
|
531
539
|
var next = {
|
|
532
540
|
ref: ref,
|
|
533
|
-
configured: view && view.configured === true,
|
|
534
|
-
writable:
|
|
541
|
+
configured: view !== undefined && view.configured === true,
|
|
542
|
+
writable: view === undefined || view.writable !== false
|
|
535
543
|
};
|
|
536
544
|
if (next.configured === self.credential.configured && next.writable === self.credential.writable) return;
|
|
537
545
|
self.credential = next;
|
|
@@ -547,8 +555,8 @@ function makeStore(initial) {
|
|
|
547
555
|
|
|
548
556
|
QueritCardController.prototype.writeKey = function (value) {
|
|
549
557
|
var self = this;
|
|
550
|
-
return this.
|
|
551
|
-
.set(
|
|
558
|
+
return this.ctx.remote.credentials
|
|
559
|
+
.set(refOf(this.scope.getSnapshot()), value)
|
|
552
560
|
.then(function () {
|
|
553
561
|
return self.readCredential();
|
|
554
562
|
})
|
|
@@ -567,32 +575,79 @@ function makeStore(initial) {
|
|
|
567
575
|
};
|
|
568
576
|
};
|
|
569
577
|
|
|
578
|
+
/** Chevron-down icon mirroring the official PluginCard toggle glyph. */
|
|
579
|
+
function ChevronDown(props) {
|
|
580
|
+
var className = props.className || '';
|
|
581
|
+
return React.createElement(
|
|
582
|
+
'svg',
|
|
583
|
+
{
|
|
584
|
+
className: className,
|
|
585
|
+
width: 14,
|
|
586
|
+
height: 14,
|
|
587
|
+
viewBox: '0 0 14 14',
|
|
588
|
+
fill: 'none',
|
|
589
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
590
|
+
'aria-hidden': true,
|
|
591
|
+
focusable: false
|
|
592
|
+
},
|
|
593
|
+
React.createElement('path', {
|
|
594
|
+
d: 'M3.5 5.25L7 8.75L10.5 5.25',
|
|
595
|
+
stroke: 'currentColor',
|
|
596
|
+
strokeWidth: 1.4,
|
|
597
|
+
strokeLinecap: 'round',
|
|
598
|
+
strokeLinejoin: 'round'
|
|
599
|
+
})
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
|
|
570
603
|
/** One labeled control row. `inline` puts the control on the label line (toggle rows). */
|
|
571
604
|
function FieldRow(props) {
|
|
572
605
|
var inline = props.inline === true;
|
|
606
|
+
var id = props.id;
|
|
607
|
+
var inputProps = Object.assign({}, props.inputProps || {});
|
|
608
|
+
var as = inputProps.as === 'select' ? 'select' : 'input';
|
|
609
|
+
delete inputProps.as;
|
|
610
|
+
var controlClass = 'qr-input' + (props.state && props.state.invalid ? ' qr-input-invalid' : '');
|
|
611
|
+
inputProps.id = id;
|
|
612
|
+
inputProps.className = controlClass;
|
|
613
|
+
var control;
|
|
614
|
+
if (as === 'select') {
|
|
615
|
+
control = React.createElement('select', inputProps, props.options || []);
|
|
616
|
+
} else {
|
|
617
|
+
control = React.createElement('input', inputProps);
|
|
618
|
+
}
|
|
619
|
+
var headChildren = [
|
|
620
|
+
inline
|
|
621
|
+
? React.createElement('label', { key: 'label', className: 'qr-label', htmlFor: id }, props.label)
|
|
622
|
+
: React.createElement('span', { key: 'label', className: 'qr-label' }, props.label),
|
|
623
|
+
props.state && props.state.overridden
|
|
624
|
+
? React.createElement(
|
|
625
|
+
'span',
|
|
626
|
+
{ key: 'badges', className: 'qr-badges' },
|
|
627
|
+
React.createElement('span', { className: 'qr-tagOver' }, props.overriddenLabel),
|
|
628
|
+
props.onReset
|
|
629
|
+
? React.createElement(
|
|
630
|
+
'button',
|
|
631
|
+
{ type: 'button', className: 'qr-reset', disabled: props.disabled || !props.state.overridden, onClick: props.onReset },
|
|
632
|
+
props.resetLabel
|
|
633
|
+
)
|
|
634
|
+
: null
|
|
635
|
+
)
|
|
636
|
+
: null,
|
|
637
|
+
inline ? props.children : null
|
|
638
|
+
];
|
|
639
|
+
var bodyChildren = inline ? null : control;
|
|
640
|
+
var help = props.state && props.state.invalid
|
|
641
|
+
? React.createElement('p', { className: 'qr-invalid' }, props.invalidLabel)
|
|
642
|
+
: props.hint
|
|
643
|
+
? React.createElement('p', { className: 'qr-hint' }, props.hint)
|
|
644
|
+
: null;
|
|
573
645
|
return React.createElement(
|
|
574
646
|
'div',
|
|
575
647
|
{ className: 'qr-field' },
|
|
576
|
-
React.createElement(
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
React.createElement('span', { className: 'qr-label' }, props.label),
|
|
580
|
-
props.state && props.state.overridden
|
|
581
|
-
? React.createElement('span', { className: 'qr-tagOver' }, props.overriddenLabel)
|
|
582
|
-
: null,
|
|
583
|
-
props.state && props.onReset
|
|
584
|
-
? React.createElement(
|
|
585
|
-
'button',
|
|
586
|
-
{ type: 'button', className: 'qr-reset', disabled: props.disabled || !props.state.overridden, onClick: props.onReset },
|
|
587
|
-
props.resetLabel
|
|
588
|
-
)
|
|
589
|
-
: null,
|
|
590
|
-
inline ? React.createElement('span', { className: 'qr-grow' }) : null,
|
|
591
|
-
inline ? props.children : null
|
|
592
|
-
),
|
|
593
|
-
inline ? null : props.children,
|
|
594
|
-
props.state && props.state.invalid ? React.createElement('p', { className: 'qr-err' }, props.invalidLabel) : null,
|
|
595
|
-
props.hint ? React.createElement('p', { className: 'qr-hint' }, props.hint) : null
|
|
648
|
+
React.createElement('div', { className: 'qr-fhead' }, headChildren),
|
|
649
|
+
bodyChildren,
|
|
650
|
+
help
|
|
596
651
|
);
|
|
597
652
|
}
|
|
598
653
|
|
|
@@ -613,67 +668,64 @@ function makeStore(initial) {
|
|
|
613
668
|
var text = function (control) {
|
|
614
669
|
return control.text;
|
|
615
670
|
};
|
|
671
|
+
var title = t('title');
|
|
616
672
|
return React.createElement(
|
|
617
673
|
'li',
|
|
618
674
|
{ className: 'qr-card' + (open ? ' qr-open' : '') },
|
|
619
675
|
React.createElement(
|
|
620
676
|
'button',
|
|
621
|
-
{
|
|
677
|
+
{
|
|
678
|
+
type: 'button',
|
|
679
|
+
className: 'qr-header',
|
|
680
|
+
'aria-expanded': open ? 'true' : 'false',
|
|
681
|
+
'aria-label': t(open ? 'collapse' : 'expand') + ': ' + title,
|
|
682
|
+
onClick: function () { setOpen(!open); }
|
|
683
|
+
},
|
|
622
684
|
React.createElement(
|
|
623
685
|
'span',
|
|
624
686
|
{ className: 'qr-head' },
|
|
625
|
-
React.createElement('span', { className: 'qr-name' },
|
|
687
|
+
React.createElement('span', { className: 'qr-name' }, title),
|
|
626
688
|
React.createElement('span', { className: 'qr-desc' }, t('description'))
|
|
627
689
|
),
|
|
628
|
-
state.dirty ? React.createElement('span', { className: 'qr-
|
|
629
|
-
React.createElement(
|
|
690
|
+
state.dirty ? React.createElement('span', { className: 'qr-pending' }, t('unsaved')) : null,
|
|
691
|
+
React.createElement(ChevronDown, { className: 'qr-chev' })
|
|
630
692
|
),
|
|
631
693
|
open
|
|
632
694
|
? React.createElement(
|
|
633
695
|
'div',
|
|
634
696
|
{ className: 'qr-body' },
|
|
635
|
-
disabled ? React.createElement('p', { className: 'qr-readonly' }, t('readOnly')) : null,
|
|
697
|
+
disabled ? React.createElement('p', { className: 'qr-readonly', role: 'status' }, t('readOnly')) : null,
|
|
636
698
|
React.createElement(
|
|
637
699
|
FieldRow,
|
|
638
700
|
{
|
|
701
|
+
id: 'plugin-config-querit-key',
|
|
639
702
|
label: t('keyLabel'),
|
|
640
|
-
hint:
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
invalidLabel: t('invalidNumber')
|
|
644
|
-
},
|
|
645
|
-
React.createElement('input', {
|
|
646
|
-
className: 'qr-input',
|
|
647
|
-
type: 'password',
|
|
648
|
-
autoComplete: 'new-password',
|
|
703
|
+
hint: state.apiKeyConfigured
|
|
704
|
+
? t('keySet') + ' ' + state.apiKeyRef + '.'
|
|
705
|
+
: t('keyUnset'),
|
|
649
706
|
disabled: disabled || !state.apiKeyWritable,
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
field(
|
|
661
|
-
props,
|
|
662
|
-
t('refLabel'),
|
|
663
|
-
t('refHint'),
|
|
664
|
-
state.apiKeyEnv,
|
|
665
|
-
'apiKeyEnv',
|
|
666
|
-
disabled
|
|
707
|
+
inputProps: {
|
|
708
|
+
className: 'qr-input',
|
|
709
|
+
type: 'password',
|
|
710
|
+
autoComplete: 'new-password',
|
|
711
|
+
disabled: disabled || !state.apiKeyWritable,
|
|
712
|
+
placeholder: state.apiKeyConfigured ? '\u2022\u2022\u2022\u2022\u2022\u2022' : '',
|
|
713
|
+
value: text(state.apiKey),
|
|
714
|
+
onChange: function (event) { props.edit('apiKey', event.target.value); }
|
|
715
|
+
}
|
|
716
|
+
}
|
|
667
717
|
),
|
|
668
|
-
field(props, t('
|
|
669
|
-
field(props, t('
|
|
670
|
-
field(props, t('
|
|
671
|
-
field(props, t('
|
|
672
|
-
field(props, t('
|
|
673
|
-
field(props, t('
|
|
718
|
+
field(props, t('refLabel'), t('refHint'), state.apiKeyEnv, 'apiKeyEnv', disabled, 'plugin-config-querit-env'),
|
|
719
|
+
field(props, t('countLabel'), t('countHint'), state.count, 'count', disabled, 'plugin-config-querit-count', true),
|
|
720
|
+
field(props, t('timeRangeLabel'), t('timeRangeHint'), state.timeRange, 'timeRange', disabled, 'plugin-config-querit-time'),
|
|
721
|
+
field(props, t('languagesLabel'), t('languagesHint'), state.languages, 'languages', disabled, 'plugin-config-querit-languages'),
|
|
722
|
+
field(props, t('countriesLabel'), t('countriesHint'), state.countries, 'countries', disabled, 'plugin-config-querit-countries'),
|
|
723
|
+
field(props, t('includeLabel'), t('includeHint'), state.includeDomains, 'includeDomains', disabled, 'plugin-config-querit-include'),
|
|
724
|
+
field(props, t('excludeLabel'), t('excludeHint'), state.excludeDomains, 'excludeDomains', disabled, 'plugin-config-querit-exclude'),
|
|
674
725
|
React.createElement(
|
|
675
726
|
FieldRow,
|
|
676
727
|
{
|
|
728
|
+
id: 'plugin-config-querit-content',
|
|
677
729
|
label: t('contentLabel'),
|
|
678
730
|
hint: t('contentHint'),
|
|
679
731
|
state: state.includeContent,
|
|
@@ -694,34 +746,32 @@ function makeStore(initial) {
|
|
|
694
746
|
React.createElement(
|
|
695
747
|
FieldRow,
|
|
696
748
|
{
|
|
749
|
+
id: 'plugin-config-querit-format',
|
|
697
750
|
label: t('formatLabel'),
|
|
698
751
|
hint: t('formatHint'),
|
|
699
752
|
state: state.fetchFormat,
|
|
700
753
|
disabled: disabled,
|
|
701
754
|
overriddenLabel: t('overridden'),
|
|
702
755
|
resetLabel: t('reset'),
|
|
703
|
-
onReset: function () { props.resetField('fetchFormat'); }
|
|
704
|
-
|
|
705
|
-
React.createElement(
|
|
706
|
-
'select',
|
|
707
|
-
{
|
|
708
|
-
className: 'qr-input',
|
|
756
|
+
onReset: function () { props.resetField('fetchFormat'); },
|
|
757
|
+
inputProps: {
|
|
709
758
|
disabled: disabled,
|
|
710
759
|
value: text(state.fetchFormat),
|
|
711
|
-
onChange: function (event) { props.edit('fetchFormat', event.target.value); }
|
|
760
|
+
onChange: function (event) { props.edit('fetchFormat', event.target.value); },
|
|
761
|
+
as: 'select'
|
|
712
762
|
},
|
|
713
|
-
FETCH_FORMATS.map(function (format) {
|
|
763
|
+
options: FETCH_FORMATS.map(function (format) {
|
|
714
764
|
return React.createElement('option', { key: format, value: format }, format);
|
|
715
765
|
})
|
|
716
|
-
|
|
766
|
+
}
|
|
717
767
|
),
|
|
718
768
|
React.createElement(
|
|
719
769
|
'div',
|
|
720
770
|
{ className: 'qr-foot' },
|
|
721
|
-
state.failed ? React.createElement('p', { className: 'qr-failed' }, t('saveFailed')) : null,
|
|
771
|
+
state.failed ? React.createElement('p', { className: 'qr-failed', role: 'status' }, t('saveFailed')) : null,
|
|
722
772
|
React.createElement(
|
|
723
773
|
'button',
|
|
724
|
-
{ type: 'button', className: 'qr-btn', disabled: (!state.dirty && !state.failed) || state.saving, onClick: props.discard },
|
|
774
|
+
{ type: 'button', className: 'qr-btn qr-discard', disabled: (!state.dirty && !state.failed) || state.saving, onClick: props.discard },
|
|
725
775
|
t('discard')
|
|
726
776
|
),
|
|
727
777
|
React.createElement(
|
|
@@ -736,31 +786,35 @@ function makeStore(initial) {
|
|
|
736
786
|
}
|
|
737
787
|
|
|
738
788
|
/** Extract one section field's row into a shared control render. */
|
|
739
|
-
function field(props, label, hint, state, name, disabled) {
|
|
789
|
+
function field(props, label, hint, state, name, disabled, id, numeric) {
|
|
790
|
+
var inputProps = {
|
|
791
|
+
className: 'qr-input' + (state.invalid ? ' qr-input-invalid' : ''),
|
|
792
|
+
type: numeric === true ? 'number' : 'text',
|
|
793
|
+
disabled: disabled,
|
|
794
|
+
value: state.text,
|
|
795
|
+
onChange: function (event) { props.edit(name, event.target.value); }
|
|
796
|
+
};
|
|
797
|
+
if (numeric === true) inputProps.inputMode = 'numeric';
|
|
798
|
+
if (state.invalid) inputProps['aria-invalid'] = true;
|
|
740
799
|
return React.createElement(
|
|
741
800
|
FieldRow,
|
|
742
801
|
{
|
|
802
|
+
id: id,
|
|
743
803
|
label: label,
|
|
744
804
|
hint: hint,
|
|
745
805
|
state: state,
|
|
746
806
|
disabled: disabled,
|
|
747
|
-
invalidLabel:
|
|
807
|
+
invalidLabel: props.t('invalidNumber'),
|
|
748
808
|
overriddenLabel: props.t('overridden'),
|
|
749
809
|
resetLabel: props.t('reset'),
|
|
750
|
-
onReset: function () { props.resetField(name); }
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
className: 'qr-input' + (state.invalid ? ' qr-invalid' : ''),
|
|
754
|
-
type: name === 'count' ? 'number' : 'text',
|
|
755
|
-
disabled: disabled,
|
|
756
|
-
value: state.text,
|
|
757
|
-
onChange: function (event) { props.edit(name, event.target.value); }
|
|
758
|
-
})
|
|
810
|
+
onReset: function () { props.resetField(name); },
|
|
811
|
+
inputProps: inputProps
|
|
812
|
+
}
|
|
759
813
|
);
|
|
760
814
|
}
|
|
761
815
|
|
|
762
|
-
/** Required services (cordis fiber inject). */
|
|
763
|
-
var inject = ['slots', '
|
|
816
|
+
/** Required services (cordis fiber inject); `remote.credentials` gates the card on the credentials namespace. */
|
|
817
|
+
var inject = ['slots', 'locale', 'remote', 'remote.credentials', 'settingsScope'];
|
|
764
818
|
|
|
765
819
|
/**
|
|
766
820
|
* Mount the Querit settings card into the plugins configuration tab.
|
|
@@ -770,9 +824,7 @@ function makeStore(initial) {
|
|
|
770
824
|
var slots = ctx.get('slots');
|
|
771
825
|
var scopeService = ctx.get('settingsScope');
|
|
772
826
|
var locale = ctx.get('locale');
|
|
773
|
-
|
|
774
|
-
if (slots === undefined || scopeService === undefined || locale === undefined || api === undefined) return;
|
|
775
|
-
api = api.api;
|
|
827
|
+
if (slots === undefined || scopeService === undefined || locale === undefined) return;
|
|
776
828
|
// Register the card dictionaries, then bind our own translator. The slot
|
|
777
829
|
// framework may also deliver a `t` seat from the entry's `locale` option,
|
|
778
830
|
// but binding here guarantees text resolves even if that seat is not yet
|
|
@@ -783,11 +835,11 @@ function makeStore(initial) {
|
|
|
783
835
|
}, 'dsh-querit: card dictionaries');
|
|
784
836
|
var t = locale.bind(NS);
|
|
785
837
|
var scope = scopeService.bind({ namespace: NAMESPACE });
|
|
786
|
-
var controller = new QueritCardController(scope,
|
|
838
|
+
var controller = new QueritCardController(scope, ctx);
|
|
787
839
|
var remote = ctx.get('remote');
|
|
788
840
|
if (remote !== undefined) {
|
|
789
841
|
ctx.effect(function () {
|
|
790
|
-
return remote.$on('credentials/updated', function (ref) {
|
|
842
|
+
return remote.$on('credentials/reference-updated', function (ref) {
|
|
791
843
|
controller.refreshCredential(ref);
|
|
792
844
|
});
|
|
793
845
|
}, 'dsh-querit: credential invalidations');
|
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
|
-
*
|
|
8
|
-
*
|
|
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
|
|
60
|
-
*
|
|
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:
|
|
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(
|
|
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 =
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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.
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
if (config.fetch
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-querit",
|
|
3
3
|
"description": "Querit-backed search and fetch providers for the DeepSeek Harness web capability seam (ctx.web)",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
66
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.
|
|
67
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.
|
|
68
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.
|
|
70
|
-
"@deepseek-ai/dsh-credentials": "^0.1.
|
|
71
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
72
|
-
"@deepseek-ai/dsh-launch-environment": "^0.1.
|
|
73
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
74
|
-
"@deepseek-ai/dsh-tool-web": "^0.1.
|
|
75
|
-
"@deepseek-ai/dsh-web": "^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
76
|
"react": "^18.2.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependenciesMeta": {
|
|
@@ -118,12 +118,12 @@
|
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
120
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
121
|
-
"@deepseek-ai/dsh-credentials": "^0.1.
|
|
122
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
123
|
-
"@deepseek-ai/dsh-launch-environment": "^0.1.
|
|
124
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
125
|
-
"@deepseek-ai/dsh-tool-web": "^0.1.
|
|
126
|
-
"@deepseek-ai/dsh-web": "^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
127
|
"@types/node": "^22.0.0",
|
|
128
128
|
"react": "^18.2.0",
|
|
129
129
|
"react-dom": "^18.3.1",
|