@vibesdotdev/integrations-duckduckgo 0.0.0-stage → 1.0.0-rc.3
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 +126 -0
- package/README.md +14 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations-duckduckgo.plugin.d.ts +12 -0
- package/dist/integrations-duckduckgo.plugin.d.ts.map +1 -0
- package/dist/integrations-duckduckgo.plugin.js +20 -0
- package/dist/integrations-duckduckgo.plugin.js.map +1 -0
- package/dist/knowledge-search/duckduckgo.descriptor.d.ts +20 -0
- package/dist/knowledge-search/duckduckgo.descriptor.d.ts.map +1 -0
- package/dist/knowledge-search/duckduckgo.descriptor.js +19 -0
- package/dist/knowledge-search/duckduckgo.descriptor.js.map +1 -0
- package/dist/knowledge-search/duckduckgo.impl.browser.d.ts +12 -0
- package/dist/knowledge-search/duckduckgo.impl.browser.d.ts.map +1 -0
- package/dist/knowledge-search/duckduckgo.impl.browser.js +25 -0
- package/dist/knowledge-search/duckduckgo.impl.browser.js.map +1 -0
- package/dist/knowledge-search/local.d.ts +19 -0
- package/dist/knowledge-search/local.d.ts.map +1 -0
- package/dist/knowledge-search/local.js +75 -0
- package/dist/knowledge-search/local.js.map +1 -0
- package/dist/knowledge-search/server.d.ts +11 -0
- package/dist/knowledge-search/server.d.ts.map +1 -0
- package/dist/knowledge-search/server.js +12 -0
- package/dist/knowledge-search/server.js.map +1 -0
- package/package.json +84 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: VIBES DEV LLC
|
|
6
|
+
Licensed Work: @vibesdotdev/integrations-duckduckgo
|
|
7
|
+
The Licensed Work is (c) 2026 VIBES DEV LLC.
|
|
8
|
+
Additional Use Grant: In this grant, "Vibes Platform" means the hosted services VIBES DEV LLC
|
|
9
|
+
operates at vibes.dev and its subdomains.
|
|
10
|
+
|
|
11
|
+
You may make production use of the Licensed Work, including commercial
|
|
12
|
+
use, subject to the limits below. Permitted production use includes:
|
|
13
|
+
building, operating and selling your own applications, agents and services
|
|
14
|
+
on or with the Vibes Platform; self-hosting the Licensed Work for use inside
|
|
15
|
+
your own organization; and providing consulting, integration or development
|
|
16
|
+
services to clients who build on the Vibes Platform.
|
|
17
|
+
|
|
18
|
+
The production use permitted above does not include use that:
|
|
19
|
+
|
|
20
|
+
(a) offers third parties a hosted, managed or embedded service that
|
|
21
|
+
substitutes for the Vibes Platform or a material part of it (including
|
|
22
|
+
agent hosting; fleet, sandbox or container provisioning; package
|
|
23
|
+
registry; source hosting and continuous integration; and managed AI,
|
|
24
|
+
storage, secrets or messaging), where the Licensed Work provides a
|
|
25
|
+
material part of that service's value and that service earns more than
|
|
26
|
+
US$1,000,000 in gross revenue in any twelve-month period;
|
|
27
|
+
(b) sells, rents, sublicenses or white-labels the Licensed Work, or access
|
|
28
|
+
to Vibes Platform functionality, as a product in its own right;
|
|
29
|
+
(c) removes, disables or works around entitlement checks, usage metering,
|
|
30
|
+
quotas or plan limits, or reaches Vibes Platform features the user's
|
|
31
|
+
account is not entitled to;
|
|
32
|
+
(d) scrapes, bulk-exports or harvests data or content from the Vibes
|
|
33
|
+
Platform or its users other than through documented interfaces and
|
|
34
|
+
within their terms, or uses outputs or data obtained from the Vibes
|
|
35
|
+
Platform to train or improve a product that competes with it;
|
|
36
|
+
(e) violates applicable law, infringes anyone's rights, commits fraud or
|
|
37
|
+
deception, conducts unlawful surveillance or harassment, distributes
|
|
38
|
+
malware, or accesses systems without authorization; or
|
|
39
|
+
(f) violates applicable antitrust or competition law.
|
|
40
|
+
|
|
41
|
+
A written permission from the Licensor extends this grant.
|
|
42
|
+
Change Date: Four years from the date the Licensed Work is published.
|
|
43
|
+
Change License: MIT
|
|
44
|
+
|
|
45
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
46
|
+
contact VIBES DEV LLC through https://vibes.dev.
|
|
47
|
+
|
|
48
|
+
Notice
|
|
49
|
+
|
|
50
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
51
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
52
|
+
under an Open Source License, as stated in this License.
|
|
53
|
+
|
|
54
|
+
-----------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
Business Source License 1.1
|
|
57
|
+
|
|
58
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
59
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
60
|
+
|
|
61
|
+
Terms
|
|
62
|
+
|
|
63
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
64
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
65
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
66
|
+
production use.
|
|
67
|
+
|
|
68
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
69
|
+
available distribution of a specific version of the Licensed Work under this
|
|
70
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
71
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
72
|
+
above terminate.
|
|
73
|
+
|
|
74
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
75
|
+
currently in effect as described in this License, you must purchase a
|
|
76
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
77
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
78
|
+
|
|
79
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
80
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
81
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
82
|
+
for each version of the Licensed Work released by Licensor.
|
|
83
|
+
|
|
84
|
+
You must conspicuously display this License on each original or modified copy
|
|
85
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
86
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
87
|
+
License apply to your use of that work.
|
|
88
|
+
|
|
89
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
90
|
+
terminate your rights under this License for the current and all other
|
|
91
|
+
versions of the Licensed Work.
|
|
92
|
+
|
|
93
|
+
This License does not grant you any right in any trademark or logo of
|
|
94
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
95
|
+
Licensor as expressly required by this License).
|
|
96
|
+
|
|
97
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
98
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
99
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
100
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
101
|
+
TITLE.
|
|
102
|
+
|
|
103
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
104
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
105
|
+
as long as you comply with the Covenants of Licensor below.
|
|
106
|
+
|
|
107
|
+
Covenants of Licensor
|
|
108
|
+
|
|
109
|
+
In consideration of the right to use this License’s text and the “Business
|
|
110
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
111
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
112
|
+
|
|
113
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
114
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
115
|
+
where “compatible” means that software provided under the Change License can
|
|
116
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
117
|
+
later version. Licensor may specify additional Change Licenses without
|
|
118
|
+
limitation.
|
|
119
|
+
|
|
120
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
121
|
+
impose any additional restriction on the right granted in this License, as
|
|
122
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
123
|
+
|
|
124
|
+
3. To specify a Change Date.
|
|
125
|
+
|
|
126
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DuckDuckGo integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DuckDuckGo search procedure for `@vibesdotdev/knowledge`, via browser automation.
|
|
4
|
+
|
|
5
|
+
Compose the plugin beside knowledge's:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import knowledgePlugin from '@vibesdotdev/knowledge/plugin';
|
|
9
|
+
import duckduckgoPlugin from '@vibesdotdev/integrations-duckduckgo/plugin';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The `duckduckgo` procedure then resolves through the `knowledge/search-procedure`
|
|
13
|
+
kind. See [SPEC.md](./SPEC.md) for behavior and typed refusals.
|
|
14
|
+
|
|
15
|
+
Run `bun run check`, `bun run test`, `bun run build` and `bun run lint` here.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6CAA6C,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo search for knowledge: the `duckduckgo` `knowledge/search-procedure`.
|
|
3
|
+
* DuckDuckGo has no official API, so only the browser implementation exists; it
|
|
4
|
+
* receives its page from the caller and holds no consumer-only modules, so this
|
|
5
|
+
* plugin is safe in universal, cloud and browser bundles.
|
|
6
|
+
*
|
|
7
|
+
* Knowledge owns the open kind identity; this plugin contributes the procedure
|
|
8
|
+
* descriptor and its loader against it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const duckduckgoPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
|
|
11
|
+
export default duckduckgoPlugin;
|
|
12
|
+
//# sourceMappingURL=integrations-duckduckgo.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations-duckduckgo.plugin.d.ts","sourceRoot":"","sources":["../src/integrations-duckduckgo.plugin.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,6CAM3B,CAAC;AACH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
|
|
2
|
+
import duckduckgoDescriptor from "./knowledge-search/duckduckgo.descriptor.js";
|
|
3
|
+
/**
|
|
4
|
+
* DuckDuckGo search for knowledge: the `duckduckgo` `knowledge/search-procedure`.
|
|
5
|
+
* DuckDuckGo has no official API, so only the browser implementation exists; it
|
|
6
|
+
* receives its page from the caller and holds no consumer-only modules, so this
|
|
7
|
+
* plugin is safe in universal, cloud and browser bundles.
|
|
8
|
+
*
|
|
9
|
+
* Knowledge owns the open kind identity; this plugin contributes the procedure
|
|
10
|
+
* descriptor and its loader against it.
|
|
11
|
+
*/
|
|
12
|
+
export const duckduckgoPlugin = createRuntimePlugin({
|
|
13
|
+
id: 'integrations-duckduckgo',
|
|
14
|
+
name: 'Integrations DuckDuckGo',
|
|
15
|
+
dependencies: [],
|
|
16
|
+
descriptors: [duckduckgoDescriptor],
|
|
17
|
+
loaders: [loader(duckduckgoDescriptor.id, 'browser', () => import("./knowledge-search/duckduckgo.impl.browser.js"))]
|
|
18
|
+
});
|
|
19
|
+
export default duckduckgoPlugin;
|
|
20
|
+
//# sourceMappingURL=integrations-duckduckgo.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations-duckduckgo.plugin.js","sourceRoot":"","sources":["../src/integrations-duckduckgo.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;IACnD,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,yBAAyB;IAC/B,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,CAAC,oBAAoB,CAAC;IACnC,OAAO,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,+CAA+C,CAAC,CAAC,CAAC;CACpH,CAAC,CAAC;AACH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search Procedure Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Runtime asset descriptor for the DuckDuckGo search procedure.
|
|
5
|
+
* Supports local mode only (no official API).
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
kind: "knowledge/search-procedure";
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
hardware: string[];
|
|
13
|
+
supports: {
|
|
14
|
+
server: false;
|
|
15
|
+
local: true;
|
|
16
|
+
};
|
|
17
|
+
defaultOptions: {};
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=duckduckgo.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duckduckgo.descriptor.d.ts","sourceRoot":"","sources":["../../src/knowledge-search/duckduckgo.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;;;;AAIH,wBAWsC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search Procedure Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Runtime asset descriptor for the DuckDuckGo search procedure.
|
|
5
|
+
* Supports local mode only (no official API).
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
kind: 'knowledge/search-procedure',
|
|
9
|
+
id: 'duckduckgo',
|
|
10
|
+
name: 'DuckDuckGo Search',
|
|
11
|
+
description: 'Search using DuckDuckGo browser automation',
|
|
12
|
+
hardware: ['consumer', 'cloud'],
|
|
13
|
+
supports: {
|
|
14
|
+
server: false,
|
|
15
|
+
local: true
|
|
16
|
+
},
|
|
17
|
+
defaultOptions: {}
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=duckduckgo.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duckduckgo.descriptor.js","sourceRoot":"","sources":["../../src/knowledge-search/duckduckgo.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAe;IACd,IAAI,EAAE,4BAA4B;IAClC,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE;QACT,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,IAAI;KACX;IACD,cAAc,EAAE,EAAE;CACkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search Procedure Implementation
|
|
3
|
+
*
|
|
4
|
+
* DuckDuckGo only supports local mode (browser automation).
|
|
5
|
+
* Server mode is not supported (no official API).
|
|
6
|
+
*
|
|
7
|
+
* @surface browser
|
|
8
|
+
*/
|
|
9
|
+
import type { SearchProcedureImplementation } from '@vibesdotdev/knowledge/kinds/search-procedure';
|
|
10
|
+
declare const _default: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<SearchProcedureImplementation>;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=duckduckgo.impl.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duckduckgo.impl.browser.d.ts","sourceRoot":"","sources":["../../src/knowledge-search/duckduckgo.impl.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;;AAmBnG,wBAKG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search Procedure Implementation
|
|
3
|
+
*
|
|
4
|
+
* DuckDuckGo only supports local mode (browser automation).
|
|
5
|
+
* Server mode is not supported (no official API).
|
|
6
|
+
*
|
|
7
|
+
* @surface browser
|
|
8
|
+
*/
|
|
9
|
+
import { createRuntimeImplementation } from '@vibesdotdev/kernel';
|
|
10
|
+
import { executeLocalSearch } from "./local.js";
|
|
11
|
+
const impl = {
|
|
12
|
+
execute(_runtime, query, maxResults, options, page) {
|
|
13
|
+
if (!page) {
|
|
14
|
+
throw new Error('Browser page required for DuckDuckGo search');
|
|
15
|
+
}
|
|
16
|
+
return executeLocalSearch(query, maxResults, options, page);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export default createRuntimeImplementation({
|
|
20
|
+
kind: 'knowledge/search-procedure',
|
|
21
|
+
id: 'duckduckgo',
|
|
22
|
+
constraint: { surfaces: ['browser'] },
|
|
23
|
+
implementation: impl
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=duckduckgo.impl.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duckduckgo.impl.browser.js","sourceRoot":"","sources":["../../src/knowledge-search/duckduckgo.impl.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,IAAI,GAAkC;IAC3C,OAAO,CACN,QAAQ,EACR,KAAK,EACL,UAAU,EACV,OAAO,EACP,IAAI;QAEJ,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;CACD,CAAC;AAEF,eAAe,2BAA2B,CAAC;IAC1C,IAAI,EAAE,4BAA4B;IAClC,EAAE,EAAE,YAAY;IAChB,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE;IACrC,cAAc,EAAE,IAAI;CACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search - Local Mode
|
|
3
|
+
*
|
|
4
|
+
* Executes DuckDuckGo searches using browser automation.
|
|
5
|
+
* DuckDuckGo is more lenient with bot detection than Google.
|
|
6
|
+
*/
|
|
7
|
+
import type { SearchProcedureImplementation } from '@vibesdotdev/knowledge/kinds/search-procedure';
|
|
8
|
+
import type { SearchResult } from '@vibesdotdev/knowledge/ingest/searches/schemas/search-job';
|
|
9
|
+
/** The browser page the knowledge search-procedure kind hands to a local-mode implementation. */
|
|
10
|
+
type Page = NonNullable<Parameters<SearchProcedureImplementation['execute']>[4]>;
|
|
11
|
+
export interface DuckDuckGoLocalSearchOptions {
|
|
12
|
+
safeSearch?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Execute DuckDuckGo search using browser automation
|
|
16
|
+
*/
|
|
17
|
+
export declare function executeLocalSearch(query: string, maxResults: number, _options: DuckDuckGoLocalSearchOptions | undefined, page: Page): Promise<SearchResult[]>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/knowledge-search/local.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AACnG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AAE9F,iGAAiG;AACjG,KAAK,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,WAAW,4BAA4B;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,4BAA4B,GAAG,SAAS,EAClD,IAAI,EAAE,IAAI,GACR,OAAO,CAAC,YAAY,EAAE,CAAC,CA0EzB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search - Local Mode
|
|
3
|
+
*
|
|
4
|
+
* Executes DuckDuckGo searches using browser automation.
|
|
5
|
+
* DuckDuckGo is more lenient with bot detection than Google.
|
|
6
|
+
*/
|
|
7
|
+
import { CapabilityError, CaughtFailureSchema } from '@vibesdotdev/kernel';
|
|
8
|
+
/**
|
|
9
|
+
* Execute DuckDuckGo search using browser automation
|
|
10
|
+
*/
|
|
11
|
+
export async function executeLocalSearch(query, maxResults, _options, page) {
|
|
12
|
+
// Navigate to DuckDuckGo search
|
|
13
|
+
const searchUrl = `https://duckduckgo.com/?q=${encodeURIComponent(query)}`;
|
|
14
|
+
// DuckDuckGo loads quickly, use domcontentloaded
|
|
15
|
+
await page.goto(searchUrl, { waitUntil: 'domcontentloaded', timeout: 30000 });
|
|
16
|
+
// Wait for results to load
|
|
17
|
+
try {
|
|
18
|
+
// Wait for the results container
|
|
19
|
+
await page.waitForSelector('article[data-testid="result"]', { timeout: 15000 });
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
await page.screenshot({ path: `/tmp/ddg-search-fail-${Date.now()}.png` });
|
|
23
|
+
throw new CapabilityError('Failed to find DuckDuckGo search results container', 'UNAVAILABLE', {
|
|
24
|
+
reason: 'ddg-results-not-found',
|
|
25
|
+
cause: CaughtFailureSchema.parse(error)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// Extract search results from DOM
|
|
29
|
+
const results = await page.evaluate((max) => {
|
|
30
|
+
// DuckDuckGo uses article elements with data-testid="result"
|
|
31
|
+
const items = Array.from(document.querySelectorAll('article[data-testid="result"]'));
|
|
32
|
+
if (items.length === 0) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
return items.slice(0, max).map((item, idx) => {
|
|
36
|
+
// Try multiple selector patterns for the link
|
|
37
|
+
const linkEl = item.querySelector('a[data-testid="result-title-a"]') ||
|
|
38
|
+
item.querySelector('h2 a') ||
|
|
39
|
+
item.querySelector('a[href]');
|
|
40
|
+
// Get the title - try multiple patterns
|
|
41
|
+
let title = '';
|
|
42
|
+
const titleEl = linkEl?.querySelector('h2') ||
|
|
43
|
+
linkEl?.querySelector('[data-testid="result-title"]') ||
|
|
44
|
+
item.querySelector('h2');
|
|
45
|
+
if (titleEl) {
|
|
46
|
+
title = titleEl.textContent?.trim() || '';
|
|
47
|
+
}
|
|
48
|
+
else if (linkEl) {
|
|
49
|
+
title = linkEl.textContent?.trim() || '';
|
|
50
|
+
}
|
|
51
|
+
// Get the snippet - try multiple patterns
|
|
52
|
+
let snippet = '';
|
|
53
|
+
const snippetEl = item.querySelector('div[data-result="snippet"]') ||
|
|
54
|
+
item.querySelector('[data-testid="result-snippet"]') ||
|
|
55
|
+
item.querySelector('.result__snippet');
|
|
56
|
+
if (snippetEl) {
|
|
57
|
+
snippet = snippetEl.textContent?.trim() || '';
|
|
58
|
+
}
|
|
59
|
+
const url = linkEl instanceof HTMLAnchorElement ? linkEl.href : (linkEl?.getAttribute('href') ?? '');
|
|
60
|
+
return {
|
|
61
|
+
url,
|
|
62
|
+
title,
|
|
63
|
+
snippet,
|
|
64
|
+
source: 'duckduckgo',
|
|
65
|
+
rank: idx + 1,
|
|
66
|
+
metadata: {
|
|
67
|
+
domain: url ? new URL(url).hostname : ''
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}, maxResults);
|
|
72
|
+
const filtered = results.filter((r) => r.url && r.title);
|
|
73
|
+
return filtered;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/knowledge-search/local.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search - Server Mode
|
|
3
|
+
*
|
|
4
|
+
* DuckDuckGo doesn't have an official search API, so server mode is not supported.
|
|
5
|
+
*/
|
|
6
|
+
import type { SearchResult } from '@vibesdotdev/knowledge/ingest/searches/schemas/search-job';
|
|
7
|
+
export interface DuckDuckGoSearchOptions {
|
|
8
|
+
safeSearch?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function executeServerSearch(_query: string, _maxResults: number, _options?: DuckDuckGoSearchOptions): Promise<SearchResult[]>;
|
|
11
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/knowledge-search/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AAE9F,MAAM,WAAW,uBAAuB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,YAAY,EAAE,CAAC,CAIzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DuckDuckGo Search - Server Mode
|
|
3
|
+
*
|
|
4
|
+
* DuckDuckGo doesn't have an official search API, so server mode is not supported.
|
|
5
|
+
*/
|
|
6
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
7
|
+
export function executeServerSearch(_query, _maxResults, _options) {
|
|
8
|
+
throw new CapabilityError('DuckDuckGo server mode not supported - use local mode', 'UNAVAILABLE', {
|
|
9
|
+
reason: 'ddg-server-mode-unsupported'
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/knowledge-search/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAOtD,MAAM,UAAU,mBAAmB,CAClC,MAAc,EACd,WAAmB,EACnB,QAAkC;IAElC,MAAM,IAAI,eAAe,CAAC,uDAAuD,EAAE,aAAa,EAAE;QACjG,MAAM,EAAE,6BAA6B;KACrC,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,86 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibesdotdev/integrations-duckduckgo",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@vibesdotdev/kernel": "^1.0.0-rc.0",
|
|
6
|
+
"@vibesdotdev/knowledge": "^1.0.0-rc.0"
|
|
7
|
+
},
|
|
8
|
+
"gitHead": "319e9e534fac11da0c374ab44efeed6c9722d3ec",
|
|
9
|
+
"_vibes_source": {
|
|
10
|
+
"repo": "ssh://git@git.vibes.dev/vibesdotdev/integrations.git",
|
|
11
|
+
"sha": "319e9e534fac11da0c374ab44efeed6c9722d3ec",
|
|
12
|
+
"workspaceDigest": "sha256:65661b48ceacd36d195e4ee3444e76279dc51401cda129404b47378753d95057"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"bun": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./plugin": {
|
|
23
|
+
"bun": "./dist/integrations-duckduckgo.plugin.js",
|
|
24
|
+
"types": "./dist/integrations-duckduckgo.plugin.d.ts",
|
|
25
|
+
"import": "./dist/integrations-duckduckgo.plugin.js",
|
|
26
|
+
"default": "./dist/integrations-duckduckgo.plugin.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"!**/.turbo/**",
|
|
34
|
+
"!**/.svelte-kit/**",
|
|
35
|
+
"!**/.vibes/**",
|
|
36
|
+
"!**/__tests__/**",
|
|
37
|
+
"!**/__stubs__/**",
|
|
38
|
+
"!**/*.test.js",
|
|
39
|
+
"!**/*.test.mjs",
|
|
40
|
+
"!**/*.test.cjs",
|
|
41
|
+
"!**/*.test.jsx",
|
|
42
|
+
"!**/*.test.ts",
|
|
43
|
+
"!**/*.test.mts",
|
|
44
|
+
"!**/*.test.cts",
|
|
45
|
+
"!**/*.test.tsx",
|
|
46
|
+
"!**/*.spec.js",
|
|
47
|
+
"!**/*.spec.mjs",
|
|
48
|
+
"!**/*.spec.cjs",
|
|
49
|
+
"!**/*.spec.jsx",
|
|
50
|
+
"!**/*.spec.ts",
|
|
51
|
+
"!**/*.spec.mts",
|
|
52
|
+
"!**/*.spec.cts",
|
|
53
|
+
"!**/*.spec.tsx",
|
|
54
|
+
"!**/SPEC.md",
|
|
55
|
+
"!**/tsconfig.json",
|
|
56
|
+
"!**/tsconfig.*.json",
|
|
57
|
+
"!**/*.tsbuildinfo",
|
|
58
|
+
"!**/.build-ok.json",
|
|
59
|
+
"!**/*.tgz"
|
|
60
|
+
],
|
|
61
|
+
"scripts": {
|
|
62
|
+
"test": "${BUN:-bun} test",
|
|
63
|
+
"check": "${BUN:-bun} --bun tsc -p tsconfig.json --noEmit",
|
|
64
|
+
"build": "tsc -p tsconfig.build.json",
|
|
65
|
+
"lint": "node ../../node_modules/@vibesdotdev/internal-oxlint-toolchain/ratchet.mjs ."
|
|
66
|
+
},
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "ssh://git@git.vibes.dev/vibesdotdev/integrations.git",
|
|
70
|
+
"directory": "integrations/duckduckgo"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"registry": "https://packages.vibes.dev",
|
|
74
|
+
"access": "public"
|
|
75
|
+
},
|
|
76
|
+
"vibes": {
|
|
77
|
+
"visibility": "public",
|
|
78
|
+
"registry": {
|
|
79
|
+
"repositoryId": "70be51c9-5ab7-4d7e-9f47-801cb17720d8",
|
|
80
|
+
"directory": "integrations/duckduckgo"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"type": "module",
|
|
84
|
+
"types": "./dist/index.d.ts",
|
|
85
|
+
"license": "BUSL-1.1"
|
|
86
|
+
}
|