@dan-ai-studio/dshopencodego 0.1.24 → 0.1.25
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/lib/client.js +18 -3
- package/lib/index.js +24 -4
- package/lib/types/update/contract.d.ts +2 -1
- package/lib/types/update/contract.js +9 -0
- package/lib/types/update/service.d.ts +11 -2
- package/lib/types/update/service.js +14 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -186,6 +186,15 @@ var updateRemote = {
|
|
|
186
186
|
invocation: { kind: "direct" },
|
|
187
187
|
parameters: [],
|
|
188
188
|
result: codec2("@dan-ai-studio/dshopencodego#UpdateStatus", parseUpdateStatus)
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: "@dan-ai-studio/dshopencodego#opencodeGoUpdate/refreshUpdate",
|
|
192
|
+
service: "opencodeGoUpdate",
|
|
193
|
+
namespace: "opencodeGoUpdate",
|
|
194
|
+
method: "refreshUpdate",
|
|
195
|
+
invocation: { kind: "direct" },
|
|
196
|
+
parameters: [],
|
|
197
|
+
result: codec2("@dan-ai-studio/dshopencodego#UpdateStatus", parseUpdateStatus)
|
|
189
198
|
}
|
|
190
199
|
]
|
|
191
200
|
};
|
|
@@ -541,7 +550,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
|
|
|
541
550
|
style.textContent = ".d7lz0W_root{color:var(--dsw-alias-label-primary);flex-direction:column;gap:1.25rem;display:flex}.d7lz0W_title{margin:0;font-size:1.05rem}.d7lz0W_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:.8rem}.d7lz0W_warn{color:var(--dsw-alias-state-warn-primary);margin:0;font-size:.8rem}.d7lz0W_ok{color:var(--dsw-alias-state-success-primary);font-size:.8rem}.d7lz0W_block{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:.6rem;flex-direction:column;gap:.5rem;padding:.85rem;display:flex}.d7lz0W_row{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.d7lz0W_row>strong{margin-right:auto}.d7lz0W_input{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);min-width:10rem;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;flex:14rem;padding:.35rem .5rem;font-size:.85rem}.d7lz0W_button{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:.35rem;padding:.35rem .7rem;font-size:.8rem}.d7lz0W_button:disabled{color:var(--dsw-alias-state-idle-primary);cursor:default}.d7lz0W_number{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:5rem;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;padding:.25rem .4rem;font-size:.8rem}.d7lz0W_select{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:auto;max-width:100%;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;padding:.25rem .4rem;font-size:.8rem}.d7lz0W_list{flex-direction:column;display:flex}.d7lz0W_item{border-top:1px solid var(--dsw-alias-border-l1);align-items:flex-start;gap:.5rem;padding:.45rem .15rem;display:flex}.d7lz0W_item input[type=checkbox]{accent-color:var(--dsw-alias-brand-primary);margin-top:.15rem}.d7lz0W_itemBody{flex-direction:column;gap:.15rem;min-width:0;display:flex}.d7lz0W_itemMain{flex-wrap:wrap;align-items:baseline;gap:.6rem;display:flex}.d7lz0W_itemMeta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:.75rem;font-size:.75rem;display:flex}.d7lz0W_itemModalities{color:var(--dsw-alias-label-secondary);font-size:.75rem}.d7lz0W_name{color:var(--dsw-alias-label-primary)}.d7lz0W_mono{color:var(--dsw-alias-label-secondary);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.d7lz0W_badge{color:var(--dsw-alias-brand-primary)}";
|
|
542
551
|
document.head.appendChild(style);
|
|
543
552
|
}
|
|
544
|
-
var section_default = { "
|
|
553
|
+
var section_default = { "root": "d7lz0W_root", "mono": "d7lz0W_mono", "warn": "d7lz0W_warn", "badge": "d7lz0W_badge", "select": "d7lz0W_select", "number": "d7lz0W_number", "itemModalities": "d7lz0W_itemModalities", "hint": "d7lz0W_hint", "itemMeta": "d7lz0W_itemMeta", "button": "d7lz0W_button", "block": "d7lz0W_block", "itemMain": "d7lz0W_itemMain", "ok": "d7lz0W_ok", "itemBody": "d7lz0W_itemBody", "item": "d7lz0W_item", "row": "d7lz0W_row", "input": "d7lz0W_input", "list": "d7lz0W_list", "title": "d7lz0W_title", "name": "d7lz0W_name" };
|
|
545
554
|
|
|
546
555
|
// src/client/Section.tsx
|
|
547
556
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -643,12 +652,18 @@ var SectionController = class _SectionController {
|
|
|
643
652
|
* The Host answers from a cached registry reading and fails silent, so an
|
|
644
653
|
* unreachable registry hides the panel instead of erroring the page. Runs
|
|
645
654
|
* once with the page and again only on explicit refresh.
|
|
655
|
+
*
|
|
656
|
+
* Both wire methods take zero arguments: the gateway client rejects any
|
|
657
|
+
* call whose positional arity differs from the descriptor's `parameters`,
|
|
658
|
+
* so the cached read and the forced refresh are two methods (`readUpdate`
|
|
659
|
+
* / `refreshUpdate`), never one method with a flag.
|
|
646
660
|
*/
|
|
647
661
|
async checkUpdate(force) {
|
|
648
662
|
const previous = this.state.update;
|
|
649
663
|
this.set({ update: { ...previous, phase: "checking", message: void 0 } });
|
|
650
664
|
try {
|
|
651
|
-
const
|
|
665
|
+
const remote = this.services.remote.opencodeGoUpdate;
|
|
666
|
+
const result = force ? await remote.refreshUpdate() : await remote.readUpdate();
|
|
652
667
|
if (!result.ok) throw result.error;
|
|
653
668
|
const status = result.value;
|
|
654
669
|
this.set({
|
|
@@ -1271,7 +1286,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
|
|
|
1271
1286
|
style.textContent = ".mMNkkW_root{align-items:center;display:inline-flex;position:relative}.mMNkkW_trigger{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;white-space:nowrap;border-radius:999px;padding:.35rem .6rem;font-size:.8rem;line-height:1}.mMNkkW_trigger:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2)}.mMNkkW_panel{z-index:20;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-overlay);width:18rem;color:var(--dsw-alias-label-primary);border-radius:.6rem;flex-direction:column;gap:.6rem;padding:.75rem .85rem;display:flex;position:absolute;bottom:calc(100% + .5rem);right:0;box-shadow:0 8px 24px #0000002e}.mMNkkW_window{flex-direction:column;gap:.25rem;display:flex}.mMNkkW_row{justify-content:space-between;gap:.5rem;font-size:.85rem;display:flex}.mMNkkW_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:.75rem}.mMNkkW_progress{width:100%;height:.35rem;accent-color:var(--dsw-alias-brand-primary)}.mMNkkW_limited{color:var(--dsw-alias-state-warn-primary);font-size:.75rem}.mMNkkW_warning{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-label-primary);border-radius:.4rem;padding:.4rem .5rem;font-size:.75rem}.mMNkkW_retry{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:.35rem;align-self:flex-start;padding:.25rem .5rem;font-size:.75rem}.mMNkkW_local{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:.2rem;padding-top:.5rem;display:flex}";
|
|
1272
1287
|
document.head.appendChild(style);
|
|
1273
1288
|
}
|
|
1274
|
-
var pill_default = { "
|
|
1289
|
+
var pill_default = { "progress": "mMNkkW_progress", "panel": "mMNkkW_panel", "window": "mMNkkW_window", "hint": "mMNkkW_hint", "root": "mMNkkW_root", "limited": "mMNkkW_limited", "warning": "mMNkkW_warning", "retry": "mMNkkW_retry", "trigger": "mMNkkW_trigger", "row": "mMNkkW_row", "local": "mMNkkW_local" };
|
|
1275
1290
|
|
|
1276
1291
|
// src/client/UsagePill.tsx
|
|
1277
1292
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
package/lib/index.js
CHANGED
|
@@ -1801,6 +1801,15 @@ var updateRemote = {
|
|
|
1801
1801
|
invocation: { kind: "direct" },
|
|
1802
1802
|
parameters: [],
|
|
1803
1803
|
result: codec2("@dan-ai-studio/dshopencodego#UpdateStatus", parseUpdateStatus)
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
id: "@dan-ai-studio/dshopencodego#opencodeGoUpdate/refreshUpdate",
|
|
1807
|
+
service: "opencodeGoUpdate",
|
|
1808
|
+
namespace: "opencodeGoUpdate",
|
|
1809
|
+
method: "refreshUpdate",
|
|
1810
|
+
invocation: { kind: "direct" },
|
|
1811
|
+
parameters: [],
|
|
1812
|
+
result: codec2("@dan-ai-studio/dshopencodego#UpdateStatus", parseUpdateStatus)
|
|
1804
1813
|
}
|
|
1805
1814
|
]
|
|
1806
1815
|
};
|
|
@@ -2070,7 +2079,7 @@ function createUpdateChecker(deps) {
|
|
|
2070
2079
|
}
|
|
2071
2080
|
|
|
2072
2081
|
// src/update/version.ts
|
|
2073
|
-
var PLUGIN_VERSION = true ? "0.1.
|
|
2082
|
+
var PLUGIN_VERSION = true ? "0.1.25" : "0.0.0-dev";
|
|
2074
2083
|
|
|
2075
2084
|
// src/update/service.ts
|
|
2076
2085
|
import { TypertRemoteService as TypertRemoteService2 } from "@deepseek-ai/dsh-typert-protocol";
|
|
@@ -2081,9 +2090,20 @@ var OpencodeGoUpdateService = class extends TypertRemoteService2 {
|
|
|
2081
2090
|
const checker = createUpdateChecker({ currentVersion: options.currentVersion });
|
|
2082
2091
|
this.check = (force) => checker.check(force);
|
|
2083
2092
|
}
|
|
2084
|
-
/**
|
|
2085
|
-
|
|
2086
|
-
|
|
2093
|
+
/**
|
|
2094
|
+
* Whether a newer release is published (cached reading).
|
|
2095
|
+
*
|
|
2096
|
+
* The wire method takes no arguments — the gateway client rejects any call
|
|
2097
|
+
* whose positional arity differs from the descriptor's `parameters`, so a
|
|
2098
|
+
* `force` flag cannot ride this call. Forced revalidation is the separate
|
|
2099
|
+
* `refreshUpdate` method below, mirroring the catalog's read/refresh pair.
|
|
2100
|
+
*/
|
|
2101
|
+
readUpdate() {
|
|
2102
|
+
return this.check(false);
|
|
2103
|
+
}
|
|
2104
|
+
/** Revalidate against the registry, bypassing the cache. */
|
|
2105
|
+
refreshUpdate() {
|
|
2106
|
+
return this.check(true);
|
|
2087
2107
|
}
|
|
2088
2108
|
};
|
|
2089
2109
|
|
|
@@ -15,7 +15,8 @@ export declare function parseUpdateStatus(value: unknown): UpdateStatus;
|
|
|
15
15
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
16
16
|
interface TypertRemoteNamespaceMap {
|
|
17
17
|
opencodeGoUpdate: {
|
|
18
|
-
readUpdate(
|
|
18
|
+
readUpdate(): Promise<RemoteResult<UpdateStatus>>;
|
|
19
|
+
refreshUpdate(): Promise<RemoteResult<UpdateStatus>>;
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -48,5 +48,14 @@ export const updateRemote = {
|
|
|
48
48
|
parameters: [],
|
|
49
49
|
result: codec('@dan-ai-studio/dshopencodego#UpdateStatus', parseUpdateStatus),
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
id: '@dan-ai-studio/dshopencodego#opencodeGoUpdate/refreshUpdate',
|
|
53
|
+
service: 'opencodeGoUpdate',
|
|
54
|
+
namespace: 'opencodeGoUpdate',
|
|
55
|
+
method: 'refreshUpdate',
|
|
56
|
+
invocation: { kind: 'direct' },
|
|
57
|
+
parameters: [],
|
|
58
|
+
result: codec('@dan-ai-studio/dshopencodego#UpdateStatus', parseUpdateStatus),
|
|
59
|
+
},
|
|
51
60
|
],
|
|
52
61
|
};
|
|
@@ -23,6 +23,15 @@ export interface UpdateServiceOptions {
|
|
|
23
23
|
export declare class OpencodeGoUpdateService extends TypertRemoteService {
|
|
24
24
|
private readonly check;
|
|
25
25
|
constructor(ctx: Context, options: UpdateServiceOptions);
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Whether a newer release is published (cached reading).
|
|
28
|
+
*
|
|
29
|
+
* The wire method takes no arguments — the gateway client rejects any call
|
|
30
|
+
* whose positional arity differs from the descriptor's `parameters`, so a
|
|
31
|
+
* `force` flag cannot ride this call. Forced revalidation is the separate
|
|
32
|
+
* `refreshUpdate` method below, mirroring the catalog's read/refresh pair.
|
|
33
|
+
*/
|
|
34
|
+
readUpdate(): Promise<UpdateStatus>;
|
|
35
|
+
/** Revalidate against the registry, bypassing the cache. */
|
|
36
|
+
refreshUpdate(): Promise<UpdateStatus>;
|
|
28
37
|
}
|
|
@@ -21,8 +21,19 @@ export class OpencodeGoUpdateService extends TypertRemoteService {
|
|
|
21
21
|
const checker = createUpdateChecker({ currentVersion: options.currentVersion });
|
|
22
22
|
this.check = (force) => checker.check(force);
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Whether a newer release is published (cached reading).
|
|
26
|
+
*
|
|
27
|
+
* The wire method takes no arguments — the gateway client rejects any call
|
|
28
|
+
* whose positional arity differs from the descriptor's `parameters`, so a
|
|
29
|
+
* `force` flag cannot ride this call. Forced revalidation is the separate
|
|
30
|
+
* `refreshUpdate` method below, mirroring the catalog's read/refresh pair.
|
|
31
|
+
*/
|
|
32
|
+
readUpdate() {
|
|
33
|
+
return this.check(false);
|
|
34
|
+
}
|
|
35
|
+
/** Revalidate against the registry, bypassing the cache. */
|
|
36
|
+
refreshUpdate() {
|
|
37
|
+
return this.check(true);
|
|
27
38
|
}
|
|
28
39
|
}
|
package/package.json
CHANGED