@dan-ai-studio/dshopencodego 0.1.91 → 0.1.93

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.
@@ -22,11 +22,12 @@ import type { WireProtocol } from './protocol.ts';
22
22
  * same path and is tried when GitHub itself is unreachable.
23
23
  *
24
24
  * The path is the provider's own, and it moves: `go.mdx` used to live at
25
- * `packages/web/src/content/docs/go.mdx` and the `packages/web` tree was
26
- * restructured, after which every request answered 404. A document that cannot
27
- * be read costs the endpoint table — the provider's own statement of each
28
- * model's protocol — so the path is asserted against the live repository by
29
- * `tests/go-doc-url.spec.ts` rather than left to rot unnoticed.
25
+ * `packages/web/src/content/docs/go.mdx`, then at
26
+ * `services/www/src/docs/content/console/go.mdx`, and the `www` tree was
27
+ * renamed to `site` — after which both mirrors answered 404 again. A document
28
+ * that cannot be read costs the endpoint table — the provider's own statement
29
+ * of each model's protocol — so the path is asserted against the live
30
+ * repository by `tests/go-doc-url.spec.ts` rather than left to rot unnoticed.
30
31
  */
31
32
  export declare const GO_DOC_URLS: readonly string[];
32
33
  /** What one parse of the document yields. */
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Wire contract for the desktop Remote.
3
+ *
4
+ * `readDesktop` answers which installer the desktop download host publishes
5
+ * right now, and where it lives. The reading is advisory: the page shows the
6
+ * address so a human can copy it or open it in a browser, and nothing here
7
+ * downloads or installs anything.
8
+ *
9
+ * @module @dan-ai-studio/dshopencodego/desktop/contract
10
+ */
11
+ import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
12
+ import type { DesktopReading } from './feed.ts';
13
+ export type { DesktopReading, DesktopRelease } from './feed.ts';
14
+ /** Validate a desktop reading crossing the wire. */
15
+ export declare function parseDesktopReading(value: unknown): DesktopReading;
16
+ declare module '@deepseek-ai/dsh-typert-protocol' {
17
+ interface TypertRemoteNamespaceMap {
18
+ opencodeGoDesktop: {
19
+ readDesktop(): Promise<RemoteResult<DesktopReading>>;
20
+ refreshDesktop(): Promise<RemoteResult<DesktopReading>>;
21
+ };
22
+ }
23
+ }
24
+ /** Remote methods this package owns, mounted together by the plugin. */
25
+ export declare const desktopRemote: TypertRemoteContribution;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The desktop app's release feed.
3
+ *
4
+ * The Harness desktop build publishes one small YAML document per platform and
5
+ * channel under `download.deepseek.com/dsh-desk/feeds/`. Reading it answers a
6
+ * single question — which installer is the newest one published right now, and
7
+ * where does it live? — without asking the user to curl the feed by hand.
8
+ *
9
+ * This module only *reads*. It never downloads, verifies, or runs the
10
+ * installer: the address is surfaced so the page can show, copy, or open it,
11
+ * and the decision to install stays with the human. Verifying the published
12
+ * `sha512` would mean fetching a ~286 MB payload, which is not something a
13
+ * settings-page click may do unasked.
14
+ *
15
+ * Only `win-x64/nightly` exists today — every other platform directory answers
16
+ * 404 — so platform and channel are constants rather than a matrix. A feed that
17
+ * starts publishing elsewhere gets its own constant here.
18
+ *
19
+ * @module @dan-ai-studio/dshopencodego/desktop/feed
20
+ */
21
+ /** Platform directory of the published feed. */
22
+ export declare const DESKTOP_FEED_PLATFORM = "win-x64";
23
+ /** Release channel of the published feed. */
24
+ export declare const DESKTOP_FEED_CHANNEL = "nightly";
25
+ /** Document answering the newest installer for that platform and channel. */
26
+ export declare const DESKTOP_FEED_URL = "https://download.deepseek.com/dsh-desk/feeds/win-x64/nightly.yml";
27
+ /** How long one reading answers for before the feed is asked again. */
28
+ export declare const DESKTOP_CACHE_MS: number;
29
+ /** Bound on one feed round trip; expiry fails silent, never throws. */
30
+ export declare const DESKTOP_TIMEOUT_MS = 10000;
31
+ /** One published installer, as the feed describes it. */
32
+ export interface DesktopRelease {
33
+ /** Version the installer carries, e.g. `0.2.2-rc.3`. */
34
+ readonly version: string;
35
+ /** Absolute address of the installer. */
36
+ readonly url: string;
37
+ /** Size in bytes, when the feed states one. */
38
+ readonly size?: number;
39
+ /** Base64 SHA-512 of the payload, when the feed states one. */
40
+ readonly sha512?: string;
41
+ /** Share of clients this build is offered to, when the feed states one. */
42
+ readonly stagingPercentage?: number;
43
+ /** ISO timestamp of the publication, when the feed states one. */
44
+ readonly releaseDate?: string;
45
+ }
46
+ /** What the settings page renders. */
47
+ export interface DesktopReading {
48
+ /**
49
+ * Whether the feed actually answered.
50
+ *
51
+ * `false` means the reading is a placeholder for a failed lookup: "no
52
+ * installer known", which is not the same fact as "nothing published". The
53
+ * page must not render the two alike.
54
+ */
55
+ readonly checked: boolean;
56
+ /** Milliseconds since the epoch of the lookup backing this reading. */
57
+ readonly checkedAt: number;
58
+ /** Platform the reading describes. */
59
+ readonly platform: string;
60
+ /** Channel the reading describes. */
61
+ readonly channel: string;
62
+ /** The newest installer, when the feed answered with one. */
63
+ readonly release?: DesktopRelease;
64
+ }
65
+ /**
66
+ * Read the newest installer out of one feed document.
67
+ *
68
+ * The top-level `path`/`sha512` pair is what the updater itself follows, so it
69
+ * wins over the `files:` list; that list is the fallback for a feed that only
70
+ * spells the payload out there. A document without both a version and an
71
+ * address is not a release this page can offer, and reads as `undefined`
72
+ * rather than as a half-filled row.
73
+ *
74
+ * @param source - the feed document as served.
75
+ * @returns the release it describes, or `undefined` when it describes none.
76
+ */
77
+ export declare function parseDesktopFeed(source: string): DesktopRelease | undefined;
78
+ /** Dependencies the reader needs, injectable for tests. */
79
+ interface DesktopFeedDeps {
80
+ /** Fetch implementation; defaults to the global one. */
81
+ readonly fetchImpl?: typeof fetch;
82
+ /** Clock; defaults to `Date.now`. */
83
+ readonly now?: () => number;
84
+ }
85
+ /**
86
+ * Ask the feed for the newest installer, cached per process.
87
+ *
88
+ * Concurrent callers share one in-flight lookup. A lookup that fails for any
89
+ * reason — network, timeout, a 404, a document without a release — resolves as
90
+ * "no installer known" rather than rejecting, so the settings page never
91
+ * breaks because the download host is unreachable.
92
+ */
93
+ export declare function createDesktopFeedReader(deps?: DesktopFeedDeps): {
94
+ read(force?: boolean): Promise<DesktopReading>;
95
+ };
96
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The desktop app's download feed (advisory only).
3
+ *
4
+ * @module @dan-ai-studio/dshopencodego/desktop
5
+ */
6
+ export { DESKTOP_CACHE_MS, DESKTOP_FEED_CHANNEL, DESKTOP_FEED_PLATFORM, DESKTOP_FEED_URL, DESKTOP_TIMEOUT_MS, } from './feed.ts';
7
+ export type { DesktopReading, DesktopRelease } from './feed.ts';
8
+ export { createDesktopFeedReader, parseDesktopFeed } from './feed.ts';
9
+ export { OpencodeGoDesktopService } from './service.ts';
10
+ export { desktopRemote, parseDesktopReading } from './contract.ts';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Host half of the desktop Remote.
3
+ *
4
+ * One question: which installer does the desktop download host publish right
5
+ * now? The service answers from the cached feed reader in `./feed.ts`, so the
6
+ * settings page learns the address without the model path ever touching the
7
+ * network. Downloading and installing are intentionally absent — this only
8
+ * reports where the installer lives.
9
+ *
10
+ * @module @dan-ai-studio/dshopencodego/desktop/service
11
+ */
12
+ import type { Context } from '@deepseek-ai/cordis';
13
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
14
+ import type { DesktopReading } from './feed.ts';
15
+ /** Desktop Remote: the cached feed reading for the settings page. */
16
+ export declare class OpencodeGoDesktopService extends TypertRemoteService {
17
+ private readonly read;
18
+ constructor(ctx: Context);
19
+ /**
20
+ * The newest published installer (cached reading).
21
+ *
22
+ * The wire method takes no arguments — the gateway client rejects any call
23
+ * whose positional arity differs from the descriptor's `parameters`, so a
24
+ * `force` flag cannot ride this call. Forced revalidation is the separate
25
+ * `refreshDesktop` method below, mirroring the update Remote's pair.
26
+ */
27
+ readDesktop(): Promise<DesktopReading>;
28
+ /** Revalidate against the feed, bypassing the cache. */
29
+ refreshDesktop(): Promise<DesktopReading>;
30
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Raising this package's own LLM failures.
3
+ *
4
+ * `LlmError`'s constructor narrowed `code` to DSH's built-in union in
5
+ * `0.2.2-rc.2`, and that release added `LlmError.fromFailure` for a code any
6
+ * provider may have chosen. This package's side-channel codes
7
+ * (`USAGE_UNAVAILABLE`, `DOCUMENT_UNAVAILABLE`, `MODEL_METADATA_UNAVAILABLE`)
8
+ * are deliberately outside that union: they describe a usage probe or a
9
+ * document fetch, not a model request, and the built-in taxonomy has no word
10
+ * for them.
11
+ *
12
+ * Both paths are tried, because the declared peer range reaches back before
13
+ * `fromFailure` existed: the running build's method wins when present, and the
14
+ * constructor otherwise — its runtime check only requires a non-empty string,
15
+ * which is what `0.2.0-rc.1` through `0.2.2-rc.1` relied on.
16
+ *
17
+ * @module @dan-ai-studio/dshopencodego/llm-error
18
+ */
19
+ import { LlmError } from '@deepseek-ai/dsh-llm';
20
+ /**
21
+ * Build an {@link LlmError} carrying a code this package chose.
22
+ * @param message - human-readable failure text.
23
+ * @param code - this package's stable machine code.
24
+ * @param options - optional cause.
25
+ * @returns the error to throw.
26
+ */
27
+ export declare function llmFailure(message: string, code: string, options?: ErrorOptions): LlmError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-ai-studio/dshopencodego",
3
- "version": "0.1.91",
3
+ "version": "0.1.93",
4
4
  "description": "OpenCode Go provider for DeepSeek Harness: live gateway catalog, per-conversation session header, usage",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -126,30 +126,30 @@
126
126
  "@deepseek-ai/cordis": "4.1.0",
127
127
  "@deepseek-ai/cordis-plugin-include": "1.1.0",
128
128
  "@deepseek-ai/cordis-plugin-loader": "1.1.0",
129
- "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.1",
130
- "@deepseek-ai/dsh-attachment": "0.2.2-rc.1",
131
- "@deepseek-ai/dsh-brand": "0.2.2-rc.1",
132
- "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
133
- "@deepseek-ai/dsh-client-store": "0.2.2-rc.1",
134
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
135
- "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.1",
136
- "@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.1",
137
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
138
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
139
- "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
140
- "@deepseek-ai/dsh-client-ui-sidebar": "0.2.2-rc.1",
141
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
142
- "@deepseek-ai/dsh-credentials": "0.2.2-rc.1",
143
- "@deepseek-ai/dsh-fs": "0.2.2-rc.1",
144
- "@deepseek-ai/dsh-launch-environment": "0.2.2-rc.1",
145
- "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
146
- "@deepseek-ai/dsh-sandbox": "0.2.2-rc.1",
147
- "@deepseek-ai/dsh-scope": "0.2.2-rc.1",
148
- "@deepseek-ai/dsh-session": "0.2.2-rc.1",
149
- "@deepseek-ai/dsh-settings": "0.2.2-rc.1",
150
- "@deepseek-ai/dsh-timeout": "0.2.2-rc.1",
151
- "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
152
- "@deepseek-ai/dsh-typert-registry": "0.2.2-rc.1",
129
+ "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.3",
130
+ "@deepseek-ai/dsh-attachment": "0.2.2-rc.3",
131
+ "@deepseek-ai/dsh-brand": "0.2.2-rc.3",
132
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.3",
133
+ "@deepseek-ai/dsh-client-store": "0.2.2-rc.3",
134
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.3",
135
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.3",
136
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.3",
137
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.3",
138
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.3",
139
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.3",
140
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.2.2-rc.3",
141
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.3",
142
+ "@deepseek-ai/dsh-credentials": "0.2.2-rc.3",
143
+ "@deepseek-ai/dsh-fs": "0.2.2-rc.3",
144
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-rc.3",
145
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.3",
146
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.3",
147
+ "@deepseek-ai/dsh-scope": "0.2.2-rc.3",
148
+ "@deepseek-ai/dsh-session": "0.2.2-rc.3",
149
+ "@deepseek-ai/dsh-settings": "0.2.2-rc.3",
150
+ "@deepseek-ai/dsh-timeout": "0.2.2-rc.3",
151
+ "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.3",
152
+ "@deepseek-ai/dsh-typert-registry": "0.2.2-rc.3",
153
153
  "@deepseek-ai/schemastery": "~3.19.0",
154
154
  "@earendil-works/pi-ai": "1.5.0",
155
155
  "@testing-library/dom": "^10.4.1",