pi-dent-agent 0.2.9 → 0.2.11

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 (39) hide show
  1. package/lib/plugin-state.ts +587 -0
  2. package/lib/plugin-ui.ts +2 -0
  3. package/lib/script-runner.ts +8 -0
  4. package/lib/script-tool.ts +3 -0
  5. package/lib/script-worker.ts +78 -7
  6. package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/CacheStore.md +11 -0
  7. package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Client.md +1 -1
  8. package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Connector.md +9 -2
  9. package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Dispatcher.md +20 -0
  10. package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Interceptors.md +13 -3
  11. package/node_modules/pi-web-access/node_modules/undici/docs/docs/best-practices/mocking-request.md +1 -1
  12. package/node_modules/pi-web-access/node_modules/undici/lib/api/abort-signal.js +55 -5
  13. package/node_modules/pi-web-access/node_modules/undici/lib/api/api-connect.js +6 -2
  14. package/node_modules/pi-web-access/node_modules/undici/lib/api/api-pipeline.js +7 -2
  15. package/node_modules/pi-web-access/node_modules/undici/lib/api/api-request.js +12 -4
  16. package/node_modules/pi-web-access/node_modules/undici/lib/api/api-stream.js +6 -2
  17. package/node_modules/pi-web-access/node_modules/undici/lib/api/api-upgrade.js +6 -2
  18. package/node_modules/pi-web-access/node_modules/undici/lib/core/request.js +17 -0
  19. package/node_modules/pi-web-access/node_modules/undici/lib/core/symbols.js +3 -1
  20. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/client-h1.js +24 -0
  21. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/client-h2.js +11 -5
  22. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/client.js +109 -2
  23. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/dispatcher-base.js +6 -1
  24. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/dispatcher.js +22 -1
  25. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/pool-base.js +72 -16
  26. package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/pool.js +22 -9
  27. package/node_modules/pi-web-access/node_modules/undici/lib/handler/cache-handler.js +1 -1
  28. package/node_modules/pi-web-access/node_modules/undici/lib/handler/retry-handler.js +27 -1
  29. package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/cache.js +9 -2
  30. package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/decompress.js +0 -11
  31. package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/deduplicate.js +4 -1
  32. package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/redirect.js +4 -1
  33. package/node_modules/pi-web-access/node_modules/undici/lib/util/cache.js +1 -1
  34. package/node_modules/pi-web-access/node_modules/undici/lib/util/timers.js +1 -1
  35. package/node_modules/pi-web-access/node_modules/undici/lib/web/fetch/index.js +20 -1
  36. package/node_modules/pi-web-access/node_modules/undici/lib/web/fetch/util.js +2 -2
  37. package/node_modules/pi-web-access/node_modules/undici/package.json +3 -3
  38. package/node_modules/pi-web-access/node_modules/undici/types/retry-handler.d.ts +1 -1
  39. package/package.json +1 -1
@@ -59,7 +59,7 @@ const {
59
59
  const EE = require('node:events')
60
60
  const { Readable, pipeline, finished, isErrored, isReadable } = require('node:stream')
61
61
  const { addAbortListener, bufferToLowerCasedHeaderName } = require('../../core/util')
62
- const { SocketError } = require('../../core/errors')
62
+ const { SocketError, InformationalError } = require('../../core/errors')
63
63
  const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url')
64
64
  const { getGlobalDispatcher } = require('../../global')
65
65
  const { webidl } = require('../webidl')
@@ -2333,6 +2333,10 @@ async function httpNetworkFetch (
2333
2333
  }
2334
2334
  }
2335
2335
 
2336
+ // The response will be exposed without a body, so any content the
2337
+ // server sends is disregarded (see main fetch step 19).
2338
+ this.nullBodyStatus = nullBodyStatus.includes(status)
2339
+
2336
2340
  this.body = new Readable({ read: () => controller.resume() })
2337
2341
 
2338
2342
  const onError = (err) => this.onResponseError(controller, err)
@@ -2352,6 +2356,14 @@ async function httpNetworkFetch (
2352
2356
  },
2353
2357
 
2354
2358
  onResponseData (controller, chunk) {
2359
+ if (this.nullBodyStatus) {
2360
+ // The server sent content in a response that must not have any.
2361
+ // Nobody can read it, so close the connection instead of waiting
2362
+ // for the server to finish sending it.
2363
+ controller.abort(new InformationalError('response with null body status has content'))
2364
+ return
2365
+ }
2366
+
2355
2367
  if (fetchParams.controller.dump) {
2356
2368
  return
2357
2369
  }
@@ -2391,6 +2403,13 @@ async function httpNetworkFetch (
2391
2403
  fetchParams.controller.off('terminated', this.abort)
2392
2404
  }
2393
2405
 
2406
+ if (this.nullBodyStatus) {
2407
+ // The response has no body, so a failure while receiving the
2408
+ // disregarded content must not turn it into a network error.
2409
+ this.body?.destroy()
2410
+ return
2411
+ }
2412
+
2394
2413
  if (
2395
2414
  request.mode === 'websocket' &&
2396
2415
  allowH2 !== false &&
@@ -560,7 +560,7 @@ function stripURLForReferrer (url, originOnly = false) {
560
560
  return url
561
561
  }
562
562
 
563
- const isPotentialleTrustworthyIPv4 = RegExp.prototype.test
563
+ const isPotentiallyTrustworthyIPv4 = RegExp.prototype.test
564
564
  .bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/)
565
565
 
566
566
  const isPotentiallyTrustworthyIPv6 = RegExp.prototype.test
@@ -583,7 +583,7 @@ function isOriginIPPotentiallyTrustworthy (origin) {
583
583
  }
584
584
 
585
585
  // IPv4
586
- return isPotentialleTrustworthyIPv4(origin)
586
+ return isPotentiallyTrustworthyIPv4(origin)
587
587
  }
588
588
 
589
589
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "8.12.4",
3
+ "version": "8.13.0",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -93,7 +93,7 @@
93
93
  "test:node-test": "borp --timeout 180000 -p \"test/node-test/**/*.js\"",
94
94
  "test:tdd": "borp --timeout 180000 --expose-gc -p \"test/*.js\"",
95
95
  "test:tdd:node-test": "borp --timeout 180000 -p \"test/node-test/**/*.js\" -w",
96
- "test:typescript": "tsd && tsc test/imports/undici-import.ts --typeRoots ./types --noEmit && tsc ./types/*.d.ts --noEmit --typeRoots ./types",
96
+ "test:typescript": "tsd && tsc test/imports/undici-import.ts --typeRoots ./types --noEmit && tsc -p tsconfig.types.json",
97
97
  "test:webidl": "borp --timeout 180000 -p \"test/webidl/*.js\"",
98
98
  "test:websocket": "borp --timeout 180000 -p \"test/websocket/**/*.js\"",
99
99
  "test:websocket:autobahn": "node test/autobahn/client.js",
@@ -111,7 +111,7 @@
111
111
  "prepare": "husky && node ./scripts/platform-shell.js"
112
112
  },
113
113
  "devDependencies": {
114
- "@fastify/busboy": "3.2.4",
114
+ "@fastify/busboy": "3.2.5",
115
115
  "@matteo.collina/tspl": "^0.2.0",
116
116
  "@metcoder95/https-pem": "^1.0.0",
117
117
  "@sinonjs/fake-timers": "^12.0.0",
@@ -78,7 +78,7 @@ declare namespace RetryHandler {
78
78
  */
79
79
  minTimeout?: number;
80
80
  /**
81
- * Factior to multiply the timeout factor between retries.
81
+ * Factor to multiply the timeout factor between retries.
82
82
  *
83
83
  * @type {number}
84
84
  * @memberof RetryOptions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dent-agent",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "A generic coding agent as a pi extension: Bash, Task, Agent, Fleet, Script, Search, Markdown and more tools, with billing and terms extensions bundled",
5
5
  "keywords": [
6
6
  "coding-agent",