@vibedev-si/dsh-vibedev 0.5.0 → 0.5.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/README.md +80 -4
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/client/client.account-center.js +449 -32
- package/client/client.js +96 -8
- package/lib/account/center-business-contract.d.ts +1 -1
- package/lib/account/center-contract.d.ts +1 -1
- package/lib/fetch/host-web.d.ts +34 -0
- package/lib/fetch/provider.d.ts +125 -0
- package/lib/fetch/wiring.d.ts +124 -0
- package/lib/gateway/http.d.ts +20 -2
- package/lib/index.d.ts +10 -0
- package/lib/index.js +834 -105
- package/lib/search/provider.d.ts +28 -5
- package/package.json +32 -26
- package/scripts/verify-fetch-joint.mjs +72 -0
package/lib/search/provider.d.ts
CHANGED
|
@@ -6,15 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The gateway asks clients to send searches one at a time and to wait as
|
|
8
8
|
* `Retry-After` says, so the provider queues searches (`web_search` runs one
|
|
9
|
-
* call's queries in parallel)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* call's queries in parallel). Only explicitly retryable short 429/503 responses
|
|
10
|
+
* are retried, at most twice; platform-account and budget failures stop immediately.
|
|
11
|
+
* Genuine user-token refusals can renew that token once. Other failures preserve
|
|
12
|
+
* the signed-in account and their gateway code, category, field and retry facts.
|
|
12
13
|
*
|
|
13
14
|
* Ported from the VibeDev app's own search package
|
|
14
15
|
* (`@vibedev/dsh-web-search-gateway`, provider.ts); here the credential is the
|
|
15
16
|
* plugin's (host account, its own sign-in, or a development key).
|
|
16
17
|
* @module dsh-vibedev/search/provider
|
|
17
18
|
*/
|
|
19
|
+
import { WebError } from '@deepseek-ai/dsh-web';
|
|
18
20
|
import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web';
|
|
19
21
|
import type { GatewayCredential } from '../gateway/http.js';
|
|
20
22
|
/** Stable id the provider registers under; a profile selects it as `web.searchProvider`. */
|
|
@@ -40,6 +42,26 @@ export interface GatewaySearchOptions {
|
|
|
40
42
|
/** Delay used for `Retry-After`; defaults to a timer that the search's signal cancels. */
|
|
41
43
|
readonly sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
42
44
|
}
|
|
45
|
+
/** Safe search diagnostics; an absent Retry-After remains unknown. */
|
|
46
|
+
export interface SearchErrorDetails {
|
|
47
|
+
readonly status: number;
|
|
48
|
+
readonly code?: string;
|
|
49
|
+
readonly category?: string;
|
|
50
|
+
readonly retryable?: boolean;
|
|
51
|
+
readonly field?: string;
|
|
52
|
+
readonly maxCharacters?: number;
|
|
53
|
+
readonly retryAfterMs?: number;
|
|
54
|
+
}
|
|
55
|
+
/** A WebError that retains the gateway's search refusal and recovery facts. */
|
|
56
|
+
export declare class GatewaySearchError extends WebError {
|
|
57
|
+
readonly details: SearchErrorDetails;
|
|
58
|
+
/**
|
|
59
|
+
* @param message - sanitized refusal with a safe next action.
|
|
60
|
+
* @param code - exact gateway code, or the existing credential-specific fallback.
|
|
61
|
+
* @param details - status and explicitly supplied diagnostic facts, without credentials or query text.
|
|
62
|
+
*/
|
|
63
|
+
constructor(message: string, code: string, details: SearchErrorDetails);
|
|
64
|
+
}
|
|
43
65
|
/**
|
|
44
66
|
* Milliseconds a `Retry-After` header asks for: delta seconds or an HTTP date.
|
|
45
67
|
* @param header - the header value, or null when absent.
|
|
@@ -48,10 +70,11 @@ export interface GatewaySearchOptions {
|
|
|
48
70
|
*/
|
|
49
71
|
export declare function searchRetryAfterMs(header: string | null, now?: number): number | undefined;
|
|
50
72
|
/**
|
|
51
|
-
* The request body
|
|
52
|
-
*
|
|
73
|
+
* The request body contains only the query and an optional bounded result count.
|
|
74
|
+
* Filters remain in the expression; it is never truncated or split into more searches.
|
|
53
75
|
* @param request - the seam request.
|
|
54
76
|
* @returns the JSON body.
|
|
77
|
+
* @throws GatewaySearchError before dispatch if the complete expression exceeds 128 Unicode code points.
|
|
55
78
|
*/
|
|
56
79
|
export declare function requestBody(request: WebSearchRequest): string;
|
|
57
80
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedev-si/dsh-vibedev",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "VibeDev 账号与模型:在 DeepSeek Harness 里登录 VibeDev,与 DeepSeek 账号并存,使用 VibeDev 网关的模型(Claude、GPT 等),并生成图片、视频、音乐和播客 · VibeDev account and models for DeepSeek Harness: sign in to VibeDev next to the DeepSeek account and use the VibeDev gateway's models (Claude, GPT and more), plus image, video, music and podcast generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"icon.svg",
|
|
24
24
|
"cordis.patch.yml",
|
|
25
25
|
"README.md",
|
|
26
|
+
"scripts/verify-fetch-joint.mjs",
|
|
26
27
|
"LICENSE",
|
|
27
28
|
"THIRD-PARTY-NOTICES.txt"
|
|
28
29
|
],
|
|
@@ -91,37 +92,42 @@
|
|
|
91
92
|
"@deepseek-ai/dsh-timeout": ">=0.2.0-rc.2 <0.3.0",
|
|
92
93
|
"@deepseek-ai/dsh-tools": ">=0.2.0-rc.2 <0.3.0",
|
|
93
94
|
"@deepseek-ai/dsh-web": ">=0.2.0-rc.2 <0.3.0",
|
|
95
|
+
"@deepseek-ai/dsh-web-fetch-http": ">=0.2.0-rc.2 <0.3.0",
|
|
94
96
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
95
97
|
},
|
|
96
98
|
"bundleDependencies": [
|
|
97
99
|
"@vibedev-si/dsh-ecosystem"
|
|
98
100
|
],
|
|
99
101
|
"devDependencies": {
|
|
100
|
-
"@deepseek-ai/cordis": "4.0.
|
|
101
|
-
"@deepseek-ai/cordis-plugin-include": "1.0.
|
|
102
|
-
"@deepseek-ai/cordis-plugin-loader": "1.0.
|
|
103
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
104
|
-
"@deepseek-ai/dsh-attachment": "0.2.
|
|
105
|
-
"@deepseek-ai/dsh-brand": "0.2.
|
|
106
|
-
"@deepseek-ai/dsh-client-connection": "0.2.
|
|
107
|
-
"@deepseek-ai/dsh-client-store": "^0.2.
|
|
108
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.
|
|
109
|
-
"@deepseek-ai/dsh-command-feedback": "0.2.
|
|
110
|
-
"@deepseek-ai/dsh-credentials": "0.2.
|
|
111
|
-
"@deepseek-ai/dsh-deepseek-account": "0.2.
|
|
112
|
-
"@deepseek-ai/dsh-fs": "0.2.
|
|
113
|
-
"@deepseek-ai/dsh-jobs": "0.2.
|
|
114
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
115
|
-
"@deepseek-ai/dsh-message-feedback": "0.2.
|
|
116
|
-
"@deepseek-ai/dsh-
|
|
117
|
-
"@deepseek-ai/dsh-session
|
|
118
|
-
"@deepseek-ai/dsh-
|
|
119
|
-
"@deepseek-ai/dsh-
|
|
120
|
-
"@deepseek-ai/dsh-
|
|
121
|
-
"@deepseek-ai/dsh-
|
|
122
|
-
"@deepseek-ai/dsh-
|
|
123
|
-
"@deepseek-ai/dsh-
|
|
124
|
-
"@deepseek-ai/
|
|
102
|
+
"@deepseek-ai/cordis": "4.0.6-alpha.1",
|
|
103
|
+
"@deepseek-ai/cordis-plugin-include": "1.0.11-alpha.1",
|
|
104
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.7-alpha.1",
|
|
105
|
+
"@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
|
|
106
|
+
"@deepseek-ai/dsh-attachment": "0.2.2-alpha.2",
|
|
107
|
+
"@deepseek-ai/dsh-brand": "0.2.2-alpha.2",
|
|
108
|
+
"@deepseek-ai/dsh-client-connection": "0.2.2-alpha.2",
|
|
109
|
+
"@deepseek-ai/dsh-client-store": "^0.2.2-alpha.2",
|
|
110
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.2-alpha.2",
|
|
111
|
+
"@deepseek-ai/dsh-command-feedback": "0.2.2-alpha.2",
|
|
112
|
+
"@deepseek-ai/dsh-credentials": "0.2.2-alpha.2",
|
|
113
|
+
"@deepseek-ai/dsh-deepseek-account": "0.2.2-alpha.2",
|
|
114
|
+
"@deepseek-ai/dsh-fs": "0.2.2-alpha.2",
|
|
115
|
+
"@deepseek-ai/dsh-jobs": "0.2.2-alpha.2",
|
|
116
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
117
|
+
"@deepseek-ai/dsh-message-feedback": "0.2.2-alpha.2",
|
|
118
|
+
"@deepseek-ai/dsh-scope": "0.2.2-alpha.2",
|
|
119
|
+
"@deepseek-ai/dsh-session": "0.2.2-alpha.2",
|
|
120
|
+
"@deepseek-ai/dsh-session-persistence": "0.2.2-alpha.2",
|
|
121
|
+
"@deepseek-ai/dsh-settings": "0.2.2-alpha.2",
|
|
122
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.2",
|
|
123
|
+
"@deepseek-ai/dsh-timeout": "0.2.2-alpha.2",
|
|
124
|
+
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-alpha.2",
|
|
125
|
+
"@deepseek-ai/dsh-tool-testkit": "0.2.2-alpha.2",
|
|
126
|
+
"@deepseek-ai/dsh-tools": "0.2.2-alpha.2",
|
|
127
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-alpha.2",
|
|
128
|
+
"@deepseek-ai/dsh-web": "0.2.2-alpha.2",
|
|
129
|
+
"@deepseek-ai/dsh-web-fetch-http": "0.2.2-alpha.2",
|
|
130
|
+
"@deepseek-ai/schemastery": "3.18.6-alpha.1",
|
|
125
131
|
"@earendil-works/pi-ai": "0.87.1",
|
|
126
132
|
"@types/node": "^22.10.0",
|
|
127
133
|
"@types/qrcode": "^1.5.6",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Explicit, bounded SDK acceptance; never called by package install, build or plugin apply.
|
|
2
|
+
import { GatewayFetchProvider } from '../lib/index.js'
|
|
3
|
+
|
|
4
|
+
const token = process.env.VIBEDEV_FETCH_TEST_APP_TOKEN
|
|
5
|
+
const urls = process.argv.slice(2)
|
|
6
|
+
const blocked = reason => {
|
|
7
|
+
console.log(JSON.stringify({ status: 'blocked', reason, fetchPosts: 0, defaultProviderChanged: false }))
|
|
8
|
+
process.exitCode = 2
|
|
9
|
+
}
|
|
10
|
+
if (!token?.trim()) {
|
|
11
|
+
blocked('Inject a short-lived authorized VibeDevAppToken into VIBEDEV_FETCH_TEST_APP_TOKEN. Do not use a supplier Key or print the token.')
|
|
12
|
+
} else if (/^sk[-_]/i.test(token.trim())) {
|
|
13
|
+
blocked('This runner accepts an authorized VibeDevAppToken, not a supplier or API Key.')
|
|
14
|
+
} else if (urls.length < 1 || urls.length > 2) {
|
|
15
|
+
blocked('Provide one or two explicitly authorized public test URLs.')
|
|
16
|
+
} else {
|
|
17
|
+
const origin = 'https://api.vibedev.studio'
|
|
18
|
+
const endpoint = `${origin}/v1/vibedev/web-fetch`
|
|
19
|
+
// Snapshot of the frozen contract, not a claim that the gateway advertised the capability.
|
|
20
|
+
const capability = {
|
|
21
|
+
path: '/v1/vibedev/web-fetch', mode: 'extracted_content', content_format: 'markdown',
|
|
22
|
+
max_url_characters: 8192, max_body_characters: 100000, character_unit: 'unicode_code_point',
|
|
23
|
+
max_provider_response_bytes: 5242880, timeout_ms: 30000, allowed_ports: [80, 443],
|
|
24
|
+
security_scope: 'initial_url_precheck_provider_managed_fetch',
|
|
25
|
+
}
|
|
26
|
+
const signal = AbortSignal.timeout(80000)
|
|
27
|
+
let posts = 0
|
|
28
|
+
const evidence = []
|
|
29
|
+
const transport = async (input, init) => {
|
|
30
|
+
if (String(input) !== endpoint || init?.method !== 'POST' || ++posts > 2) throw new Error('Acceptance network budget or destination rejected')
|
|
31
|
+
return fetch(input, init)
|
|
32
|
+
}
|
|
33
|
+
const provider = new GatewayFetchProvider({
|
|
34
|
+
origin, userAgent: 'vibedev-fetch-joint-acceptance/2026-10-30.1', capability,
|
|
35
|
+
requestTimeoutMs: 40000, maxResponseBytes: 5242880, maxBodyCharacters: 100000,
|
|
36
|
+
resolveCredential: async () => ({ token, kind: 'plugin' }), fetch: transport,
|
|
37
|
+
})
|
|
38
|
+
for (const url of urls) {
|
|
39
|
+
let label
|
|
40
|
+
try {
|
|
41
|
+
const parsed = new URL(url)
|
|
42
|
+
if (parsed.username || parsed.password || !['http:', 'https:'].includes(parsed.protocol)) throw new Error('Unsupported acceptance URL')
|
|
43
|
+
label = `${parsed.origin}${parsed.pathname}`
|
|
44
|
+
} catch {
|
|
45
|
+
evidence.push({ status: 'blocked', reason: 'Invalid test URL' })
|
|
46
|
+
process.exitCode = 2
|
|
47
|
+
break
|
|
48
|
+
}
|
|
49
|
+
const before = posts
|
|
50
|
+
try {
|
|
51
|
+
const result = await provider.fetch({ url }, signal)
|
|
52
|
+
// An extraction never observed the target: its `url` and `statusCode` are placeholders, not evidence.
|
|
53
|
+
const extracted = result.contentSource === 'extracted'
|
|
54
|
+
evidence.push({
|
|
55
|
+
url: label, status: 'parsed', fetchPosts: posts - before,
|
|
56
|
+
finalUrl: extracted ? 'unknown' : result.url, targetStatus: extracted ? 'unknown' : result.statusCode,
|
|
57
|
+
contentSource: result.contentSource, contentFormat: result.bodyFormat, titlePresent: Boolean(result.title), characters: [...result.body.content].length,
|
|
58
|
+
truncated: result.truncated, sourceCompleteness: result.sourceCompleteness,
|
|
59
|
+
cached: result.gateway.cached, requestId: result.gateway.requestId,
|
|
60
|
+
})
|
|
61
|
+
} catch (error) {
|
|
62
|
+
// No headers, raw messages, causes, content or credentials enter the receipt.
|
|
63
|
+
evidence.push({ url: label, status: 'failed', fetchPosts: posts - before, code: error.code ?? 'CLIENT_FAILURE', requestId: error.details?.requestId, retryable: error.details?.retryable, safeToRetry: error.details?.safeToRetry })
|
|
64
|
+
process.exitCode = 1
|
|
65
|
+
break
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
console.log(JSON.stringify({
|
|
69
|
+
mode: 'explicit-manual-sdk-acceptance', contract: '2026-10-30.1', capabilitySource: 'frozen contract; not an advertisement',
|
|
70
|
+
capabilityNegotiationTested: false, defaultProviderChanged: false, fetchPosts: posts, retries: 0, evidence,
|
|
71
|
+
}, null, 2))
|
|
72
|
+
}
|