dsh-deeppilot 0.9.0 → 0.9.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/lib/index.d.ts CHANGED
@@ -862,8 +862,11 @@ interface Config {
862
862
  devicesPath?: string;
863
863
  /** Replay ring buffer bound (frames) per deployment. */
864
864
  historyBufferMax?: number;
865
- /** Verbose per-frame diagnostics (never prints token or message bodies). */
866
- debug?: boolean;
865
+ /** Testing & troubleshooting, rendered as its own settings section. */
866
+ diagnostics?: {
867
+ /** Verbose per-frame diagnostics (never prints token or message bodies). */
868
+ debug?: boolean;
869
+ };
867
870
  /** Independent LAN transport. Never exposes the wider DSH web server. */
868
871
  local?: {
869
872
  enabled?: boolean;
@@ -909,7 +912,11 @@ declare const Config: z<Schemastery.ObjectS<NoInfer<{
909
912
  enabled: z<boolean, boolean, "volatile-defined">;
910
913
  devicesPath: z<string, string, "defined">;
911
914
  historyBufferMax: z<number, number, "defined">;
912
- debug: z<boolean, boolean, "volatile-defined">;
915
+ diagnostics: z<NoInfer<Schemastery.ObjectS<NoInfer<{
916
+ debug: z<boolean, boolean, "defined">;
917
+ }>>>, NoInfer<Schemastery.ObjectT<NoInfer<{
918
+ debug: z<boolean, boolean, "defined">;
919
+ }>>>, "volatile-defined">;
913
920
  local: z<NoInfer<Schemastery.ObjectS<NoInfer<{
914
921
  enabled: z<boolean, boolean, "defined">;
915
922
  port: z<number, number, "defined">;
@@ -957,7 +964,11 @@ declare const Config: z<Schemastery.ObjectS<NoInfer<{
957
964
  enabled: z<boolean, boolean, "volatile-defined">;
958
965
  devicesPath: z<string, string, "defined">;
959
966
  historyBufferMax: z<number, number, "defined">;
960
- debug: z<boolean, boolean, "volatile-defined">;
967
+ diagnostics: z<NoInfer<Schemastery.ObjectS<NoInfer<{
968
+ debug: z<boolean, boolean, "defined">;
969
+ }>>>, NoInfer<Schemastery.ObjectT<NoInfer<{
970
+ debug: z<boolean, boolean, "defined">;
971
+ }>>>, "volatile-defined">;
961
972
  local: z<NoInfer<Schemastery.ObjectS<NoInfer<{
962
973
  enabled: z<boolean, boolean, "defined">;
963
974
  port: z<number, number, "defined">;
package/lib/index.js CHANGED
@@ -1491,9 +1491,15 @@ var BridgeConnection = class {
1491
1491
  * Subagent sessions are host-internal workers of a parent conversation.
1492
1492
  * They must never surface on the phone: not in the project/session list,
1493
1493
  * and not as turn-completion pushes for a session the device cannot open.
1494
+ *
1495
+ * `parentSessionId` alone is NOT a subagent signal: a session forked from
1496
+ * another one (c2s.session.fork) also carries it, as fork lineage, while
1497
+ * being an ordinary top-level session the phone must show. Only the host's
1498
+ * explicit `origin` marks a worker — mirror the same rule already used for
1499
+ * the live mux stream (see dsh-api-proxy.ts's `isSubagent` derivation).
1494
1500
  */
1495
1501
  function isSubagentRow(row) {
1496
- return row.origin === "subagent" || typeof row.parentSessionId === "string" && row.parentSessionId.length > 0;
1502
+ return row.origin === "subagent";
1497
1503
  }
1498
1504
  function unwrapStreamItem(item) {
1499
1505
  const nested = item.payload;
@@ -4896,7 +4902,6 @@ function parseReport(value) {
4896
4902
  pairingReady: bool(s, "pairingReady", "pairingReady"),
4897
4903
  activeConnections: int(s, "activeConnections", "activeConnections"),
4898
4904
  historyBufferMax: int(s, "historyBufferMax", "historyBufferMax"),
4899
- debug: bool(s, "debug", "debug"),
4900
4905
  lanAddresses,
4901
4906
  local: parseLocal(s.local),
4902
4907
  remote: parseRemote(s.remote),
@@ -6197,7 +6202,7 @@ const Config = z.object({
6197
6202
  enabled: z.boolean().default(true).volatile(),
6198
6203
  devicesPath: z.string().default(join(bridgeDataDir(), "devices-v2.json")),
6199
6204
  historyBufferMax: z.natural().min(100).default(2e3),
6200
- debug: z.boolean().default(false).volatile(),
6205
+ diagnostics: z.object({ debug: z.boolean().default(false).description("打印握手、推送等诊断日志;不会打印配对令牌、APNs token 或消息内容") }).default({ debug: false }).volatile(),
6201
6206
  local: z.object({
6202
6207
  enabled: z.boolean().default(true),
6203
6208
  port: z.natural().min(MIN_LOCAL_PORT).max(MAX_LOCAL_PORT).default(DEFAULT_LOCAL_PORT).description("DeepPilot 局域网独立端口(仅 TLS;默认 3098,修改后本地连接会短暂重连)")
@@ -7111,7 +7116,7 @@ function apply(ctx, options) {
7111
7116
  }
7112
7117
  const token = await new RelayClient({
7113
7118
  url,
7114
- debug: currentConfig().debug === true,
7119
+ debug: currentConfig().diagnostics?.debug === true,
7115
7120
  log
7116
7121
  }).enroll(enrollmentCell.clientId, enrollmentCell.enrollKey ?? "");
7117
7122
  if (!token) {
@@ -7153,7 +7158,7 @@ function apply(ctx, options) {
7153
7158
  const client = new RelayClient({
7154
7159
  url: resolved.url,
7155
7160
  token: resolved.token,
7156
- debug: currentConfig().debug === true,
7161
+ debug: currentConfig().diagnostics?.debug === true,
7157
7162
  log
7158
7163
  });
7159
7164
  cachedSender = {
@@ -7177,7 +7182,7 @@ function apply(ctx, options) {
7177
7182
  keyId: resolved.keyId,
7178
7183
  keyPath: resolved.keyPath,
7179
7184
  bundleId: resolved.bundleId,
7180
- debug: currentConfig().debug === true,
7185
+ debug: currentConfig().diagnostics?.debug === true,
7181
7186
  log
7182
7187
  });
7183
7188
  cachedSender = {
@@ -7294,11 +7299,11 @@ function apply(ctx, options) {
7294
7299
  if (!registration) return false;
7295
7300
  if (connectedIds.has(device.deviceId)) return false;
7296
7301
  if (!mayReceivePush(device, notification)) {
7297
- if (currentConfig().debug === true) log(`push skip "${deviceDisplayName(device)}": notification permission not granted`);
7302
+ if (currentConfig().diagnostics?.debug === true) log(`push skip "${deviceDisplayName(device)}": notification permission not granted`);
7298
7303
  return false;
7299
7304
  }
7300
7305
  if (registration.categories?.[notification.category] === false) {
7301
- if (currentConfig().debug === true) log(`push skip "${deviceDisplayName(device)}": category ${notification.category} muted`);
7306
+ if (currentConfig().diagnostics?.debug === true) log(`push skip "${deviceDisplayName(device)}": category ${notification.category} muted`);
7302
7307
  return false;
7303
7308
  }
7304
7309
  return true;
@@ -7422,7 +7427,6 @@ function apply(ctx, options) {
7422
7427
  pairingReady,
7423
7428
  activeConnections: connections.size,
7424
7429
  historyBufferMax: currentConfig().historyBufferMax ?? 2e3,
7425
- debug: currentConfig().debug === true,
7426
7430
  lanAddresses,
7427
7431
  local: localStatus(lanAddresses),
7428
7432
  remote: remoteStatus(),
@@ -7635,7 +7639,7 @@ function apply(ctx, options) {
7635
7639
  serverVersion: SERVER_VERSION,
7636
7640
  audience,
7637
7641
  log,
7638
- debug: currentConfig().debug === true,
7642
+ debug: currentConfig().diagnostics?.debug === true,
7639
7643
  onClosed: (closed) => connections.delete(closed),
7640
7644
  onAuthenticationSettled: (ok) => {
7641
7645
  admission.release();