@vibedev-si/dsh-vibedev 0.6.0 → 0.7.1
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 +34 -1
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/client/client.account-center.js +465 -5
- package/client/client.js +533 -30
- package/lib/announcements/routes.d.ts +70 -0
- package/lib/contracts.d.ts +2 -2
- package/lib/index.d.ts +4 -0
- package/lib/index.js +346 -75
- package/lib/llm/catalog.d.ts +2 -0
- package/lib/llm/context-budget.d.ts +45 -0
- package/lib/llm/stream.d.ts +6 -0
- package/lib/runtime.d.ts +2 -0
- package/lib/tools/image.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 消息 page's Host routes, read from the gateway under the VibeDev account:
|
|
3
|
+
*
|
|
4
|
+
* - `GET /api/dsh-vibedev/announcements` — what this account may see right now, and how
|
|
5
|
+
* many of them it has not read. The gateway owns the targeting (subscription, balance)
|
|
6
|
+
* and the time window; this route only allowlists the fields the page renders and turns
|
|
7
|
+
* an endpoint the gateway has not shipped yet into `available: false`, so the page and
|
|
8
|
+
* the sidebar stay quiet instead of showing an error nobody can act on.
|
|
9
|
+
* - `POST /api/dsh-vibedev/announcements/read` — the read receipt for one message, with
|
|
10
|
+
* `{"id": <number>}` in the body. The Host's Fetch routes match an exact pathname (there
|
|
11
|
+
* are no `:id` patterns), so the identifier travels in the body, never in the path.
|
|
12
|
+
* Closing a dialog is not a receipt: the page sends this only when the person opened
|
|
13
|
+
* the message or pressed 「知道了」.
|
|
14
|
+
*
|
|
15
|
+
* Answers are never cached, because the unread count drives a badge.
|
|
16
|
+
* @module dsh-vibedev/announcements/routes
|
|
17
|
+
*/
|
|
18
|
+
import type { ConnectionFetchRoute } from '@deepseek-ai/dsh-client-connection';
|
|
19
|
+
import type { AccountService } from '../account/index.js';
|
|
20
|
+
import type { GatewayHttp } from '../gateway/http.js';
|
|
21
|
+
/** The Host route the renderer polls. */
|
|
22
|
+
export declare const ANNOUNCEMENTS_ROUTE = "/api/dsh-vibedev/announcements";
|
|
23
|
+
/**
|
|
24
|
+
* The receipt's own Host route. A Host Fetch route owns one exact pathname, so this is a
|
|
25
|
+
* sibling of the list rather than a `:id` child of it; the id is in the request body.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ANNOUNCEMENTS_READ_ROUTE = "/api/dsh-vibedev/announcements/read";
|
|
28
|
+
/**
|
|
29
|
+
* Where the gateway serves the same list. Every account read goes to `/v1/account/*`
|
|
30
|
+
* (`auth/me`, `entitlements`, `model-plaza`, `payment/*`, and our own `feedback`), so
|
|
31
|
+
* announcements belong beside them; `/api/v1/vibedev/*` is only the sign-in and
|
|
32
|
+
* device-authorization surface (`app-token/*`, `link/redeem`).
|
|
33
|
+
*/
|
|
34
|
+
export declare const GATEWAY_ANNOUNCEMENTS_PATH = "/v1/account/announcements";
|
|
35
|
+
/** One announcement, as the page renders it. */
|
|
36
|
+
export interface Announcement {
|
|
37
|
+
readonly id: number;
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly content: string;
|
|
40
|
+
/** `popup` may interrupt at start-up once; `silent` only ever appears in the list. */
|
|
41
|
+
readonly notifyMode: 'popup' | 'silent';
|
|
42
|
+
readonly startsAt?: string;
|
|
43
|
+
readonly endsAt?: string;
|
|
44
|
+
/** `null` while unread. */
|
|
45
|
+
readonly readAt: string | null;
|
|
46
|
+
readonly createdAt: string;
|
|
47
|
+
}
|
|
48
|
+
/** One answer of the list route. `available: false` means this gateway cannot serve messages yet. */
|
|
49
|
+
export interface AnnouncementListing {
|
|
50
|
+
readonly available: boolean;
|
|
51
|
+
readonly items: readonly Announcement[];
|
|
52
|
+
readonly unread: number;
|
|
53
|
+
}
|
|
54
|
+
/** What the routes need. */
|
|
55
|
+
export interface AnnouncementRouteOptions {
|
|
56
|
+
readonly http: GatewayHttp;
|
|
57
|
+
readonly account: AccountService;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* One announcement from the wire, with every field it needs and nothing else.
|
|
61
|
+
* @param value - one entry of the gateway's list.
|
|
62
|
+
* @returns the announcement, or undefined when the entry cannot be rendered.
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseAnnouncement(value: unknown): Announcement | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Both routes.
|
|
67
|
+
* @param options - the gateway client and the account whose credential the reads go with.
|
|
68
|
+
* @returns routes for the client connection.
|
|
69
|
+
*/
|
|
70
|
+
export declare function announcementRoutes({ http, account }: AnnouncementRouteOptions): ConnectionFetchRoute[];
|
package/lib/contracts.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ export interface BillingSource {
|
|
|
8
8
|
readonly kind: 'balance' | 'subscription';
|
|
9
9
|
readonly subscriptionId?: string | null;
|
|
10
10
|
}
|
|
11
|
-
export declare const ACCOUNT_PAGES: readonly ["dashboard", "usage", "subscriptions", "available_channels", "channel_status", "model_prices", "recharge", "orders", "redeem", "affiliate", "profile"];
|
|
11
|
+
export declare const ACCOUNT_PAGES: readonly ["dashboard", "usage", "subscriptions", "available_channels", "channel_status", "model_prices", "recharge", "orders", "redeem", "affiliate", "profile", "messages"];
|
|
12
12
|
export type AccountCenterPage = typeof ACCOUNT_PAGES[number];
|
|
13
|
-
export declare const NATIVE_ACCOUNT_PAGES: Set<"dashboard" | "usage" | "subscriptions" | "available_channels" | "channel_status" | "model_prices" | "recharge" | "orders" | "redeem" | "affiliate" | "profile">;
|
|
13
|
+
export declare const NATIVE_ACCOUNT_PAGES: Set<"dashboard" | "usage" | "subscriptions" | "available_channels" | "channel_status" | "model_prices" | "recharge" | "orders" | "redeem" | "affiliate" | "profile" | "messages">;
|
|
14
14
|
export declare function normalizeAccountPage(page: AccountCenterPage): AccountCenterPage;
|
|
15
15
|
export interface MediaAccountContext {
|
|
16
16
|
readonly gatewayOrigin: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export interface Config {
|
|
|
76
76
|
reconcileAttempts: number;
|
|
77
77
|
/** Ask the user before each paid request. */
|
|
78
78
|
confirmSpending: Volatile<boolean>;
|
|
79
|
+
/** Send the generated images to the model; off by default, so a result is the saved paths. */
|
|
80
|
+
imagesInContext: Volatile<boolean>;
|
|
79
81
|
/** Output folder, relative to the workspace (or absolute). */
|
|
80
82
|
outputDir: Volatile<string>;
|
|
81
83
|
/** Pinned models; empty lets the agent choose from the catalog. */
|
|
@@ -112,6 +114,7 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
112
114
|
submitAttempts: Schema<number, number, "defined">;
|
|
113
115
|
reconcileAttempts: Schema<number, number, "defined">;
|
|
114
116
|
confirmSpending: Schema<boolean, boolean, "volatile-defined">;
|
|
117
|
+
imagesInContext: Schema<boolean, boolean, "volatile-defined">;
|
|
115
118
|
outputDir: Schema<string, string, "volatile-defined">;
|
|
116
119
|
imageModel: Schema<string, string, "volatile-defined">;
|
|
117
120
|
videoModel: Schema<string, string, "volatile-defined">;
|
|
@@ -136,6 +139,7 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
136
139
|
submitAttempts: Schema<number, number, "defined">;
|
|
137
140
|
reconcileAttempts: Schema<number, number, "defined">;
|
|
138
141
|
confirmSpending: Schema<boolean, boolean, "volatile-defined">;
|
|
142
|
+
imagesInContext: Schema<boolean, boolean, "volatile-defined">;
|
|
139
143
|
outputDir: Schema<string, string, "volatile-defined">;
|
|
140
144
|
imageModel: Schema<string, string, "volatile-defined">;
|
|
141
145
|
videoModel: Schema<string, string, "volatile-defined">;
|