dsh-deeppilot 0.9.4 → 0.9.5
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/COMPATIBILITY.md +52 -11
- package/PRIVACY.md +2 -2
- package/README.md +26 -33
- package/README.zh-CN.md +19 -24
- package/SECURITY.md +2 -1
- package/cordis.patch.yml +1 -1
- package/docs/DEVICE_REGISTRY_RECOVERY.md +87 -0
- package/docs/DEVICE_REGISTRY_RECOVERY.zh-CN.md +73 -0
- package/docs/DSH_RELEASE_MEMORY.md +329 -12
- package/docs/NPM_PUBLISHING.md +83 -0
- package/docs/SECURITY_ROADMAP.md +9 -4
- package/docs/SECURITY_ROADMAP.zh-CN.md +9 -4
- package/lib/client.js +5 -5
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +57 -6
- package/lib/index.js.map +1 -1
- package/locale/en.json +1 -1
- package/package.json +17 -14
package/lib/index.d.ts
CHANGED
|
@@ -1048,7 +1048,7 @@ interface Config {
|
|
|
1048
1048
|
maxConnectionsPerSource?: number;
|
|
1049
1049
|
};
|
|
1050
1050
|
/**
|
|
1051
|
-
* Offline push (F-9). `apns` sends directly from the
|
|
1051
|
+
* Offline push (F-9). `apns` sends directly from the computer with the user's
|
|
1052
1052
|
* Apple credentials. `relay` sends notify projections to an operator-run
|
|
1053
1053
|
* relay for distributed builds. The device reports its own APNs environment,
|
|
1054
1054
|
* so development and TestFlight/App Store devices may coexist.
|
package/lib/index.js
CHANGED
|
@@ -6908,6 +6908,25 @@ function projectSessionModels(value) {
|
|
|
6908
6908
|
function inProcessRemoteRequest(input, init) {
|
|
6909
6909
|
return new Request(new URL(input, "http://localhost/"), init);
|
|
6910
6910
|
}
|
|
6911
|
+
/**
|
|
6912
|
+
* Install the Connection service on the resident Client.
|
|
6913
|
+
*
|
|
6914
|
+
* alpha.3 selects `interactions: 'none'` for any caller that supplies no page
|
|
6915
|
+
* location, and that mode forbids the forwarded-event stream this resident
|
|
6916
|
+
* client exists to answer. Only the explicit installer can name the
|
|
6917
|
+
* participation, so it takes precedence; `apply` stays for a host older than
|
|
6918
|
+
* the installer, reading the carrier from the process global set around it.
|
|
6919
|
+
*/
|
|
6920
|
+
function installResidentConnection(connection, ctx, transport) {
|
|
6921
|
+
if (typeof connection.installConnection === "function") {
|
|
6922
|
+
connection.installConnection(ctx, {
|
|
6923
|
+
transport,
|
|
6924
|
+
interactions: "answer"
|
|
6925
|
+
});
|
|
6926
|
+
return;
|
|
6927
|
+
}
|
|
6928
|
+
connection.apply(ctx);
|
|
6929
|
+
}
|
|
6911
6930
|
let clientFaces;
|
|
6912
6931
|
/**
|
|
6913
6932
|
* Load DSH's browser-distributed Client faces into a tiny Host-side module
|
|
@@ -6921,6 +6940,19 @@ function pluginModule(value, specifier) {
|
|
|
6921
6940
|
if (typeof value.apply !== "function") throw new Error(`${specifier} has no Client apply() export`);
|
|
6922
6941
|
return value;
|
|
6923
6942
|
}
|
|
6943
|
+
/**
|
|
6944
|
+
* Register one loaded Client face when the browser banner did not.
|
|
6945
|
+
*
|
|
6946
|
+
* alpha.3 resolves these specifiers through the `node` export condition to a
|
|
6947
|
+
* bundle that exports the face as ordinary ESM and never calls
|
|
6948
|
+
* `window.__ModuleLoader__.load`, while earlier hosts only ship the banner
|
|
6949
|
+
* shape. A banner registration wins, because it is what the bundle's own
|
|
6950
|
+
* internal `require()` calls resolve against; the ESM namespace is the fallback.
|
|
6951
|
+
*/
|
|
6952
|
+
function adoptClientModule(modules, specifier, loaded) {
|
|
6953
|
+
const id = specifier.replace(/\/client$/, "");
|
|
6954
|
+
if (!modules.has(id)) modules.set(id, loaded);
|
|
6955
|
+
}
|
|
6924
6956
|
async function loadClientFaces() {
|
|
6925
6957
|
clientFaces ??= (async () => {
|
|
6926
6958
|
const modules = /* @__PURE__ */ new Map([["@deepseek-ai/cordis", Cordis]]);
|
|
@@ -6938,7 +6970,7 @@ async function loadClientFaces() {
|
|
|
6938
6970
|
"@deepseek-ai/dsh-typert-registry/client",
|
|
6939
6971
|
"@deepseek-ai/dsh-client-connection/client",
|
|
6940
6972
|
"@deepseek-ai/dsh-api-gateway/client"
|
|
6941
|
-
]) await import(specifier);
|
|
6973
|
+
]) adoptClientModule(modules, specifier, await import(specifier));
|
|
6942
6974
|
} finally {
|
|
6943
6975
|
if (previousWindow === void 0) delete loaderGlobal.window;
|
|
6944
6976
|
else loaderGlobal.window = previousWindow;
|
|
@@ -6964,9 +6996,27 @@ function createAgentScope(ctx, identity) {
|
|
|
6964
6996
|
}
|
|
6965
6997
|
});
|
|
6966
6998
|
}
|
|
6967
|
-
|
|
6999
|
+
/**
|
|
7000
|
+
* Mint the Peer every in-process carrier call speaks for.
|
|
7001
|
+
*
|
|
7002
|
+
* alpha.3 requires a Peer on `fetch` and on `wireStream.open`, and refuses a
|
|
7003
|
+
* forwarded-event stream unless that Peer declares `interactions: 'answer'`.
|
|
7004
|
+
* Its connection service therefore grows `createPeer`, the only entry point
|
|
7005
|
+
* that can name the principal and the participation together. Before that the
|
|
7006
|
+
* service holds one operator Peer and defaults every absent Peer to it, so that
|
|
7007
|
+
* instance is the drop-in answer. A host with neither yields undefined, which
|
|
7008
|
+
* only the pre-alpha.3 carrier accepts.
|
|
7009
|
+
*/
|
|
7010
|
+
function createHostPeer(connection) {
|
|
7011
|
+
if (typeof connection.createPeer === "function") return connection.createPeer({
|
|
7012
|
+
principal: { kind: "owner" },
|
|
7013
|
+
interactions: "answer"
|
|
7014
|
+
});
|
|
7015
|
+
return connection.operator;
|
|
7016
|
+
}
|
|
7017
|
+
function inProcessStream(gateway, endpoint, payload, signal, peer) {
|
|
6968
7018
|
return (async function* () {
|
|
6969
|
-
yield* await gateway.wireStream.open(endpoint, payload, void 0,
|
|
7019
|
+
yield* await gateway.wireStream.open(endpoint, payload, void 0, peer, signal);
|
|
6970
7020
|
})();
|
|
6971
7021
|
}
|
|
6972
7022
|
/**
|
|
@@ -6983,10 +7033,11 @@ async function startDshRemoteInteractions(hostCtx, handlers) {
|
|
|
6983
7033
|
if (gateway === void 0) throw new Error("DSH typertGateway is unavailable");
|
|
6984
7034
|
const faces = await loadClientFaces();
|
|
6985
7035
|
const client = new Context();
|
|
7036
|
+
const peer = createHostPeer(connection);
|
|
6986
7037
|
const fetchHandler = connection.createSharedFetchHandler("/api");
|
|
6987
7038
|
const transport = {
|
|
6988
|
-
fetch: (input, init) => fetchHandler.fetch(inProcessRemoteRequest(input, init)),
|
|
6989
|
-
openStream: (endpoint, payload, signal) => inProcessStream(gateway, endpoint, payload, signal),
|
|
7039
|
+
fetch: (input, init) => fetchHandler.fetch(inProcessRemoteRequest(input, init), peer),
|
|
7040
|
+
openStream: (endpoint, payload, signal) => inProcessStream(gateway, endpoint, payload, signal, peer),
|
|
6990
7041
|
ownsHost: true
|
|
6991
7042
|
};
|
|
6992
7043
|
try {
|
|
@@ -6995,7 +7046,7 @@ async function startDshRemoteInteractions(hostCtx, handlers) {
|
|
|
6995
7046
|
const previousTransport = transportGlobal.__DSH_TRANSPORT__;
|
|
6996
7047
|
transportGlobal.__DSH_TRANSPORT__ = transport;
|
|
6997
7048
|
try {
|
|
6998
|
-
faces.connection
|
|
7049
|
+
installResidentConnection(faces.connection, client, transport);
|
|
6999
7050
|
} finally {
|
|
7000
7051
|
if (previousTransport === void 0) delete transportGlobal.__DSH_TRANSPORT__;
|
|
7001
7052
|
else transportGlobal.__DSH_TRANSPORT__ = previousTransport;
|