pi-dent-agent 0.2.8 → 0.2.10
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/index.ts +25 -2
- package/lib/engine.ts +2 -2
- package/lib/plugin-state.ts +484 -0
- package/lib/plugin-ui-proxy.ts +495 -0
- package/lib/plugin-ui.ts +119 -33
- package/lib/script-runner.ts +8 -0
- package/lib/script-tool.ts +3 -0
- package/lib/script-worker.ts +78 -7
- package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/CacheStore.md +11 -0
- package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Client.md +1 -1
- package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Connector.md +9 -2
- package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Dispatcher.md +20 -0
- package/node_modules/pi-web-access/node_modules/undici/docs/docs/api/Interceptors.md +13 -3
- package/node_modules/pi-web-access/node_modules/undici/docs/docs/best-practices/mocking-request.md +1 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/api/abort-signal.js +55 -5
- package/node_modules/pi-web-access/node_modules/undici/lib/api/api-connect.js +6 -2
- package/node_modules/pi-web-access/node_modules/undici/lib/api/api-pipeline.js +7 -2
- package/node_modules/pi-web-access/node_modules/undici/lib/api/api-request.js +12 -4
- package/node_modules/pi-web-access/node_modules/undici/lib/api/api-stream.js +6 -2
- package/node_modules/pi-web-access/node_modules/undici/lib/api/api-upgrade.js +6 -2
- package/node_modules/pi-web-access/node_modules/undici/lib/core/request.js +17 -0
- package/node_modules/pi-web-access/node_modules/undici/lib/core/symbols.js +3 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/client-h1.js +24 -0
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/client-h2.js +11 -5
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/client.js +109 -2
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/dispatcher-base.js +6 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/dispatcher.js +22 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/pool-base.js +72 -16
- package/node_modules/pi-web-access/node_modules/undici/lib/dispatcher/pool.js +22 -9
- package/node_modules/pi-web-access/node_modules/undici/lib/handler/cache-handler.js +1 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/handler/retry-handler.js +27 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/cache.js +9 -2
- package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/decompress.js +0 -11
- package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/deduplicate.js +4 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/interceptor/redirect.js +4 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/util/cache.js +1 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/util/timers.js +1 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/web/fetch/index.js +20 -1
- package/node_modules/pi-web-access/node_modules/undici/lib/web/fetch/util.js +2 -2
- package/node_modules/pi-web-access/node_modules/undici/package.json +3 -3
- package/node_modules/pi-web-access/node_modules/undici/types/retry-handler.d.ts +1 -1
- 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
|
|
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
|
|
586
|
+
return isPotentiallyTrustworthyIPv4(origin)
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "undici",
|
|
3
|
-
"version": "8.
|
|
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
|
|
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.
|
|
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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-dent-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
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",
|