@songtonyli/dsh-cli 0.1.63 → 0.1.65

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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +1 -1
  4. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
  5. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  6. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +17 -14
  7. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +17 -7
  8. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +17 -7
  9. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +37 -3
  10. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +1 -0
  11. package/node_modules/@deepseek-ai/dsh-permission-presets/README.i18n.yaml +8 -8
  12. package/node_modules/@deepseek-ai/dsh-permission-presets/README.md +4 -4
  13. package/node_modules/@deepseek-ai/dsh-permission-presets/README.zh.md +4 -4
  14. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/index.js +42 -4
  15. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +9 -2
  16. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.remote-client.js +1 -1
  17. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/types/index.js +48 -4
  18. package/node_modules/@deepseek-ai/dsh-sandbox/README.i18n.yaml +2 -2
  19. package/node_modules/@deepseek-ai/dsh-sandbox/README.md +1 -1
  20. package/node_modules/@deepseek-ai/dsh-sandbox/README.zh.md +1 -1
  21. package/node_modules/@deepseek-ai/dsh-sandbox/lib/index.js +13 -4
  22. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.i18n.yaml +2 -2
  23. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.md +2 -2
  24. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.zh.md +2 -2
  25. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/lib/index.js +14 -1
  26. package/node_modules/@deepseek-ai/dsh-sandbox-policy/README.i18n.yaml +2 -2
  27. package/node_modules/@deepseek-ai/dsh-sandbox-policy/README.md +1 -1
  28. package/node_modules/@deepseek-ai/dsh-sandbox-policy/README.zh.md +1 -1
  29. package/node_modules/@deepseek-ai/dsh-sandbox-policy/lib/index.js +16 -0
  30. package/node_modules/@deepseek-ai/dsh-tool-bash/lib/index.js +3 -1
  31. package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +13 -1
  32. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +6 -6
  33. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +4 -4
  34. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +4 -4
  35. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +31 -11
  36. package/node_modules/http-cache-semantics/index.js +32 -9
  37. package/node_modules/http-cache-semantics/package.json +3 -3
  38. package/package.json +2 -2
@@ -334,12 +334,13 @@ module.exports = class CachePolicy {
334
334
 
335
335
  /**
336
336
  * @param {{headers: Record<string, string>, synchronous: boolean}|undefined} revalidation - Revalidation information, if any.
337
- * @returns {{response: {headers: Record<string, string>}, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object with a cached response headers and revalidation info.
337
+ * @returns {{response: HttpResponse, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object with a cached response headers and revalidation info.
338
338
  */
339
339
  _evaluateRequestHitResult(revalidation) {
340
340
  return {
341
341
  response: {
342
342
  headers: this.responseHeaders(),
343
+ status: this._status,
343
344
  },
344
345
  revalidation,
345
346
  };
@@ -387,9 +388,9 @@ module.exports = class CachePolicy {
387
388
  * }
388
389
  * ```
389
390
  * @param {HttpRequest} req - new incoming HTTP request
390
- * @returns {{response: {headers: Record<string, string>}|undefined, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object containing keys:
391
+ * @returns {{response: HttpResponse|undefined, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object containing keys:
391
392
  * - revalidation: { headers: Record<string, string>, synchronous: boolean } Set if you should send this to the origin server
392
- * - response: { headers: Record<string, string> } Set if you can respond to the client with these cached headers
393
+ * - response: HttpResponse Set if you can respond to the client with these cached headers
393
394
  */
394
395
  evaluateRequest(req) {
395
396
  this._assertRequestHasHeaders(req);
@@ -484,18 +485,32 @@ module.exports = class CachePolicy {
484
485
  return true;
485
486
  }
486
487
 
487
- // A Vary header field-value of "*" always fails to match
488
- if (this._resHeaders.vary === '*') {
489
- return false;
490
- }
491
-
492
488
  const fields = this._resHeaders.vary
493
489
  .trim()
494
490
  .toLowerCase()
495
491
  .split(/\s*,\s*/);
492
+
496
493
  for (const name of fields) {
497
- if (req.headers[name] !== this._reqHeaders[name]) return false;
494
+ // A Vary header field-value of "*" always fails to match
495
+ if (name === '*') {
496
+ return false;
497
+ }
498
+
499
+ const newReq = Object.prototype.hasOwnProperty.call(
500
+ req.headers,
501
+ name
502
+ ) && req.headers[name];
503
+
504
+ const cachedReq = Object.prototype.hasOwnProperty.call(
505
+ this._reqHeaders,
506
+ name
507
+ ) && this._reqHeaders[name];
508
+
509
+ if (newReq !== cachedReq) {
510
+ return false;
511
+ }
498
512
  }
513
+
499
514
  return true;
500
515
  }
501
516
 
@@ -556,6 +571,14 @@ module.exports = class CachePolicy {
556
571
  return headers;
557
572
  }
558
573
 
574
+ /**
575
+ * Returns the status code of the cached response.
576
+ * @returns {number} The response status code.
577
+ */
578
+ status() {
579
+ return this._status;
580
+ }
581
+
559
582
  /**
560
583
  * Returns the Date header value from the response or the current time if invalid.
561
584
  * @returns {number} Timestamp (in milliseconds) representing the Date header or response time.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-cache-semantics",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,9 +11,9 @@
11
11
  "files": [
12
12
  "index.js"
13
13
  ],
14
- "author": "Kornel Lesiński <npms2@geekhood.net> (https://kornel.ski/)",
14
+ "author": "Kornel Lesiński <kornel@geekhood.net> (https://kornel.ski/)",
15
15
  "license": "BSD-2-Clause",
16
16
  "devDependencies": {
17
- "mocha": "^11.0"
17
+ "mocha": "^12.0"
18
18
  }
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songtonyli/dsh-cli",
3
- "version": "0.1.63",
3
+ "version": "0.1.65",
4
4
  "description": "The dsh terminal agent: an interactive TUI over the DeepSeek Harness, with its whole Node runtime bundled in one install.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -470,7 +470,7 @@
470
470
  "hast-util-to-html": "9.0.5",
471
471
  "hast-util-whitespace": "3.0.0",
472
472
  "html-void-elements": "3.0.0",
473
- "http-cache-semantics": "4.2.0",
473
+ "http-cache-semantics": "4.3.0",
474
474
  "http-errors": "2.0.1",
475
475
  "http-proxy-agent": "9.1.0",
476
476
  "http2-wrapper": "2.2.1",