dsh-opencode-go 0.1.24 → 0.2.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.en.md +66 -12
- package/README.md +172 -79
- package/THIRD_PARTY_NOTICES.md +6 -2
- package/assets/icon.png +0 -0
- package/docs/advanced.en.md +32 -35
- package/docs/advanced.md +33 -35
- package/docs/assets/logo-dark.png +0 -0
- package/docs/assets/logo-light.png +0 -0
- package/docs/assets/usage-history-desktop.jpg +0 -0
- package/docs/assets/usage-history-mobile.jpg +0 -0
- package/docs/assets/usage-history-models.jpg +0 -0
- package/docs/development.md +61 -119
- package/docs/independent-package.md +4 -2
- package/docs/usage-analytics.en.md +57 -0
- package/docs/usage-analytics.md +57 -0
- package/docs/verification.md +51 -917
- package/lib/build-info.json +1 -1
- package/lib/client.js +3429 -2618
- package/lib/free-http-worker.js +32 -0
- package/lib/index.js +5135 -3746
- package/lib/types/accounts.d.ts +96 -31
- package/lib/types/adapter.d.ts +63 -51
- package/lib/types/analytics.d.ts +35 -0
- package/lib/types/catalog.d.ts +109 -44
- package/lib/types/client/AnalyticsDialog.d.ts +18 -0
- package/lib/types/client/Section.d.ts +41 -7
- package/lib/types/client/UsagePill.d.ts +15 -6
- package/lib/types/client/controller.d.ts +178 -0
- package/lib/types/client/dashboard-copy.d.ts +58 -0
- package/lib/types/client/index.d.ts +18 -12
- package/lib/types/client/{locales.d.ts → presentation.d.ts} +97 -9
- package/lib/types/config.d.ts +14 -15
- package/lib/types/contracts.d.ts +338 -0
- package/lib/types/conversion.d.ts +155 -0
- package/lib/types/free-channel.d.ts +21 -0
- package/lib/types/free-http-worker.d.ts +1 -0
- package/lib/types/free-policy.d.ts +4 -0
- package/lib/types/free-protocol.d.ts +16 -0
- package/lib/types/free-runtime.d.ts +2 -0
- package/lib/types/free-socks-tunnel.d.ts +4 -0
- package/lib/types/free-transport.d.ts +19 -0
- package/lib/types/index.d.ts +8 -40
- package/lib/types/pricing.d.ts +29 -0
- package/lib/types/sdk-types.d.ts +1540 -2902
- package/lib/types/transport.d.ts +71 -0
- package/lib/vendor-licenses.txt +55 -31
- package/package.json +77 -78
- package/docs/assets/usage-panel.png +0 -0
- package/docs/fork-review-2026-09-25.md +0 -191
- package/docs/native-call-comparison-v020-rc2.md +0 -116
- package/lib/types/account-manager.d.ts +0 -25
- package/lib/types/account-operations.d.ts +0 -31
- package/lib/types/account-policy.d.ts +0 -16
- package/lib/types/account-recovery.d.ts +0 -2
- package/lib/types/account-selection.d.ts +0 -30
- package/lib/types/account-service.d.ts +0 -12
- package/lib/types/accounts-contract.d.ts +0 -38
- package/lib/types/call-trace.d.ts +0 -54
- package/lib/types/catalog-manager.d.ts +0 -20
- package/lib/types/client/AccountsCard.d.ts +0 -19
- package/lib/types/client/ModelEditor.d.ts +0 -20
- package/lib/types/client/accounts-controller.d.ts +0 -71
- package/lib/types/client/hint-mark.d.ts +0 -17
- package/lib/types/client/host-compat.d.ts +0 -7
- package/lib/types/client/host-primitives.d.ts +0 -11
- package/lib/types/client/section-controller.d.ts +0 -202
- package/lib/types/client/settings.d.ts +0 -18
- package/lib/types/client/staged-form.d.ts +0 -201
- package/lib/types/client/usage.d.ts +0 -4
- package/lib/types/config-contract.d.ts +0 -70
- package/lib/types/conversion/config.d.ts +0 -4
- package/lib/types/conversion/context.d.ts +0 -56
- package/lib/types/conversion/image-offload.d.ts +0 -13
- package/lib/types/conversion/image-pool.d.ts +0 -24
- package/lib/types/conversion/index.d.ts +0 -5
- package/lib/types/conversion/replay.d.ts +0 -66
- package/lib/types/conversion/stream.d.ts +0 -44
- package/lib/types/gateway-diagnostics.d.ts +0 -23
- package/lib/types/gateway-error.d.ts +0 -2
- package/lib/types/gateway-url.d.ts +0 -6
- package/lib/types/google-fetch.d.ts +0 -6
- package/lib/types/host-settings.d.ts +0 -11
- package/lib/types/json-response.d.ts +0 -14
- package/lib/types/metadata-cache.d.ts +0 -12
- package/lib/types/model-metadata.d.ts +0 -21
- package/lib/types/models-contract.d.ts +0 -66
- package/lib/types/models.d.ts +0 -13
- package/lib/types/protocol-contract.d.ts +0 -5
- package/lib/types/protocol-policy.d.ts +0 -4
- package/lib/types/provider-identity.d.ts +0 -4
- package/lib/types/proxy-url.d.ts +0 -2
- package/lib/types/proxy.d.ts +0 -11
- package/lib/types/reasoning.d.ts +0 -40
- package/lib/types/remote-contract.d.ts +0 -3
- package/lib/types/remotes.d.ts +0 -3
- package/lib/types/request-budget.d.ts +0 -12
- package/lib/types/request-control.d.ts +0 -2
- package/lib/types/settings-bridge.d.ts +0 -22
- package/lib/types/usage-contract.d.ts +0 -35
- package/lib/types/usage-display.d.ts +0 -4
- package/lib/types/usage.d.ts +0 -27
- /package/lib/types/{google-generative-ai.d.ts → google.d.ts} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/free-http-worker.ts
|
|
2
|
+
var headersSent = false;
|
|
3
|
+
function write(bytes) {
|
|
4
|
+
return new Promise((resolve, reject) => process.stdout.write(bytes, (error) => error ? reject(error) : resolve()));
|
|
5
|
+
}
|
|
6
|
+
try {
|
|
7
|
+
const chunks = [];
|
|
8
|
+
for await (const chunk of process.stdin) chunks.push(Buffer.from(chunk));
|
|
9
|
+
const input = JSON.parse(Buffer.concat(chunks).toString());
|
|
10
|
+
const options = {
|
|
11
|
+
method: input.method,
|
|
12
|
+
headers: input.headers,
|
|
13
|
+
redirect: input.redirect,
|
|
14
|
+
...input.body === void 0 ? {} : { body: new Uint8Array(Buffer.from(input.body, "base64")) },
|
|
15
|
+
...input.proxy ? { proxy: input.proxy } : {}
|
|
16
|
+
};
|
|
17
|
+
const response = await fetch(input.url, options);
|
|
18
|
+
const metadata = {
|
|
19
|
+
status: response.status,
|
|
20
|
+
statusText: response.statusText,
|
|
21
|
+
headers: [...response.headers],
|
|
22
|
+
url: response.url,
|
|
23
|
+
redirected: response.redirected
|
|
24
|
+
};
|
|
25
|
+
await write(JSON.stringify(metadata) + "\n");
|
|
26
|
+
headersSent = true;
|
|
27
|
+
if (response.body) for await (const chunk of response.body) await write(chunk);
|
|
28
|
+
} catch {
|
|
29
|
+
if (!headersSent) await write(JSON.stringify({ error: "Free HTTP worker could not send the request" }) + "\n").catch(() => {
|
|
30
|
+
});
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
}
|