pi-dent-agent 0.2.2 → 0.2.4

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 (55) hide show
  1. package/index.ts +5 -1
  2. package/lib/config.ts +59 -0
  3. package/lib/engine.ts +4 -1
  4. package/lib/script-render.ts +1 -1
  5. package/lib/script-runner.ts +70 -4
  6. package/lib/script-tool-calls.ts +116 -0
  7. package/lib/script-tool-log.ts +143 -0
  8. package/lib/script-tool-types.ts +258 -0
  9. package/lib/script-tool.ts +103 -9
  10. package/lib/script-worker.ts +92 -1
  11. package/lib/search-tool.ts +1 -1
  12. package/lib/tools.ts +13 -5
  13. package/node_modules/express-rate-limit/dist/index.cjs +6 -4
  14. package/node_modules/express-rate-limit/dist/index.mjs +6 -4
  15. package/node_modules/express-rate-limit/package.json +1 -1
  16. package/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
  17. package/node_modules/jose/dist/webapi/jwt/encrypt.js +5 -8
  18. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +1 -1
  19. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +2 -2
  20. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
  21. package/node_modules/jose/dist/webapi/lib/key.js +2 -0
  22. package/node_modules/jose/package.json +1 -1
  23. package/node_modules/object-inspect/CHANGELOG.md +31 -0
  24. package/node_modules/object-inspect/index.js +326 -24
  25. package/node_modules/object-inspect/package.json +22 -13
  26. package/node_modules/object-inspect/readme.markdown +4 -1
  27. package/node_modules/object-inspect/stringWidth.js +68 -0
  28. package/node_modules/object-inspect/stringWidthRanges.js +38 -0
  29. package/package.json +1 -1
  30. package/node_modules/object-inspect/.eslintrc +0 -53
  31. package/node_modules/object-inspect/.nycrc +0 -13
  32. package/node_modules/object-inspect/example/all.js +0 -23
  33. package/node_modules/object-inspect/example/circular.js +0 -6
  34. package/node_modules/object-inspect/example/fn.js +0 -5
  35. package/node_modules/object-inspect/example/inspect.js +0 -10
  36. package/node_modules/object-inspect/test/bigint.js +0 -58
  37. package/node_modules/object-inspect/test/browser/dom.js +0 -15
  38. package/node_modules/object-inspect/test/circular.js +0 -16
  39. package/node_modules/object-inspect/test/deep.js +0 -12
  40. package/node_modules/object-inspect/test/element.js +0 -53
  41. package/node_modules/object-inspect/test/err.js +0 -48
  42. package/node_modules/object-inspect/test/fakes.js +0 -29
  43. package/node_modules/object-inspect/test/fn.js +0 -76
  44. package/node_modules/object-inspect/test/global.js +0 -17
  45. package/node_modules/object-inspect/test/has.js +0 -15
  46. package/node_modules/object-inspect/test/holes.js +0 -15
  47. package/node_modules/object-inspect/test/indent-option.js +0 -271
  48. package/node_modules/object-inspect/test/inspect.js +0 -139
  49. package/node_modules/object-inspect/test/lowbyte.js +0 -12
  50. package/node_modules/object-inspect/test/number.js +0 -58
  51. package/node_modules/object-inspect/test/quoteStyle.js +0 -26
  52. package/node_modules/object-inspect/test/toStringTag.js +0 -40
  53. package/node_modules/object-inspect/test/undef.js +0 -12
  54. package/node_modules/object-inspect/test/values.js +0 -261
  55. package/node_modules/object-inspect/test-core-js.js +0 -26
@@ -307,7 +307,7 @@ var setRetryAfterHeader = (response, info, windowMs, retryAfter) => {
307
307
 
308
308
  // source/utils.ts
309
309
  var omitUndefinedProperties = (passedOptions) => {
310
- const omittedOptions = {};
310
+ const omittedOptions = /* @__PURE__ */ Object.create(null);
311
311
  for (const k of Object.keys(passedOptions)) {
312
312
  const key = k;
313
313
  if (passedOptions[key] !== void 0) {
@@ -787,7 +787,7 @@ var getOptionsFromConfig = (config) => {
787
787
  };
788
788
  var parseOptions = (passedOptions) => {
789
789
  const notUndefinedOptions = omitUndefinedProperties(passedOptions);
790
- const logger = passedOptions.logger ?? ConsoleLogger;
790
+ const logger = notUndefinedOptions.logger ?? ConsoleLogger;
791
791
  const validations2 = getValidations(
792
792
  notUndefinedOptions?.validate ?? true,
793
793
  logger
@@ -808,11 +808,11 @@ var parseOptions = (passedOptions) => {
808
808
  if (standardHeaders === true) standardHeaders = "draft-6";
809
809
  const config = {
810
810
  windowMs: 60 * 1e3,
811
- limit: passedOptions.max ?? 5,
811
+ limit: notUndefinedOptions.max ?? 5,
812
812
  // `max` is deprecated, but support it anyways.
813
813
  message: "Too many requests, please try again later.",
814
814
  statusCode: 429,
815
- legacyHeaders: passedOptions.headers ?? true,
815
+ legacyHeaders: notUndefinedOptions.headers ?? true,
816
816
  identifier(request, _response) {
817
817
  let duration = "";
818
818
  const property = config.requestPropertyName;
@@ -856,6 +856,8 @@ var parseOptions = (passedOptions) => {
856
856
  if (!response.writableEnded) response.send(message);
857
857
  },
858
858
  passOnStoreError: false,
859
+ // Options without a default would otherwise fall through to Object.prototype.
860
+ retryAfter: void 0,
859
861
  // Allow the default options to be overridden by the passed options.
860
862
  ...notUndefinedOptions,
861
863
  // `standardHeaders` is resolved into a draft version above, use that.
@@ -264,7 +264,7 @@ var setRetryAfterHeader = (response, info, windowMs, retryAfter) => {
264
264
 
265
265
  // source/utils.ts
266
266
  var omitUndefinedProperties = (passedOptions) => {
267
- const omittedOptions = {};
267
+ const omittedOptions = /* @__PURE__ */ Object.create(null);
268
268
  for (const k of Object.keys(passedOptions)) {
269
269
  const key = k;
270
270
  if (passedOptions[key] !== void 0) {
@@ -744,7 +744,7 @@ var getOptionsFromConfig = (config) => {
744
744
  };
745
745
  var parseOptions = (passedOptions) => {
746
746
  const notUndefinedOptions = omitUndefinedProperties(passedOptions);
747
- const logger = passedOptions.logger ?? ConsoleLogger;
747
+ const logger = notUndefinedOptions.logger ?? ConsoleLogger;
748
748
  const validations2 = getValidations(
749
749
  notUndefinedOptions?.validate ?? true,
750
750
  logger
@@ -765,11 +765,11 @@ var parseOptions = (passedOptions) => {
765
765
  if (standardHeaders === true) standardHeaders = "draft-6";
766
766
  const config = {
767
767
  windowMs: 60 * 1e3,
768
- limit: passedOptions.max ?? 5,
768
+ limit: notUndefinedOptions.max ?? 5,
769
769
  // `max` is deprecated, but support it anyways.
770
770
  message: "Too many requests, please try again later.",
771
771
  statusCode: 429,
772
- legacyHeaders: passedOptions.headers ?? true,
772
+ legacyHeaders: notUndefinedOptions.headers ?? true,
773
773
  identifier(request, _response) {
774
774
  let duration = "";
775
775
  const property = config.requestPropertyName;
@@ -813,6 +813,8 @@ var parseOptions = (passedOptions) => {
813
813
  if (!response.writableEnded) response.send(message);
814
814
  },
815
815
  passOnStoreError: false,
816
+ // Options without a default would otherwise fall through to Object.prototype.
817
+ retryAfter: void 0,
816
818
  // Allow the default options to be overridden by the passed options.
817
819
  ...notUndefinedOptions,
818
820
  // `standardHeaders` is resolved into a draft version above, use that.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-rate-limit",
3
- "version": "8.7.4",
3
+ "version": "8.7.5",
4
4
  "description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",
5
5
  "author": {
6
6
  "name": "Nathan Friedly",
@@ -5,7 +5,7 @@ function isCloudflareWorkers() {
5
5
  return typeof WebSocketPair < "u" || typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime < "u" && EdgeRuntime === "vercel";
6
6
  }
7
7
  let USER_AGENT;
8
- (typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (USER_AGENT = "jose/v6.2.17");
8
+ (typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (USER_AGENT = "jose/v6.2.18");
9
9
  const customFetch = /* @__PURE__ */ Symbol();
10
10
  async function fetchJwks(url, headers, signal, fetchImpl = fetch) {
11
11
  const response = await fetchImpl(url, {
@@ -21,7 +21,7 @@ async function fetchJwks(url, headers, signal, fetchImpl = fetch) {
21
21
  try {
22
22
  return await response.json();
23
23
  } catch (cause) {
24
- throw new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON", { cause });
24
+ throw signal.aborted ? new JWKSTimeout(void 0, { cause }) : new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON", { cause });
25
25
  }
26
26
  }
27
27
  const jwksCache = /* @__PURE__ */ Symbol();
@@ -29,15 +29,12 @@ class EncryptJWT extends EncryptJWT_base {
29
29
  return this.#replicateAudienceAsHeader = !0, this;
30
30
  }
31
31
  async encrypt(key, options) {
32
- const plaintext = jwtClaimsSetBytes(this);
33
- this.#input[1] && (this.#replicateIssuerAsHeader || this.#replicateSubjectAsHeader || this.#replicateAudienceAsHeader) && (this.#input[1] = {
34
- ...this.#input[1],
35
- iss: this.#replicateIssuerAsHeader ? jwtClaim(this, "iss") : void 0,
36
- sub: this.#replicateSubjectAsHeader ? jwtClaim(this, "sub") : void 0,
37
- aud: this.#replicateAudienceAsHeader ? jwtClaim(this, "aud") : void 0
38
- });
39
32
  const input = [...this.#input];
40
- return input[0] = plaintext, compactJWE(await createJWE(input, key, options));
33
+ if (input[0] = jwtClaimsSetBytes(this), input[1] && (this.#replicateIssuerAsHeader || this.#replicateSubjectAsHeader || this.#replicateAudienceAsHeader)) {
34
+ const header = { ...input[1] };
35
+ this.#replicateIssuerAsHeader && (header.iss = jwtClaim(this, "iss")), this.#replicateSubjectAsHeader && (header.sub = jwtClaim(this, "sub")), this.#replicateAudienceAsHeader && (header.aud = jwtClaim(this, "aud")), input[1] = header;
36
+ }
37
+ return compactJWE(await createJWE(input, key, options));
41
38
  }
42
39
  }
43
40
  export {
@@ -151,7 +151,7 @@ async function decryptJWE(jwe, shared, key, token = shareJWE(jwe)) {
151
151
  if (decompressionLimit === 0)
152
152
  throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');
153
153
  plaintext = await decompress(plaintext, decompressionLimit).catch((cause) => {
154
- throw cause instanceof JWEInvalid ? cause : new JWEInvalid("Failed to decompress plaintext", { cause });
154
+ throw cause instanceof JWEInvalid || cause instanceof JOSENotSupported ? cause : new JWEInvalid("Failed to decompress plaintext", { cause });
155
155
  });
156
156
  }
157
157
  return {
@@ -1,7 +1,7 @@
1
1
  import { encode as b64u } from "../util/base64url.js";
2
2
  import { encrypt } from "./content_encryption.js";
3
3
  import { encryptKeyManagement } from "./key_management.js";
4
- import { JWEInvalid } from "../util/errors.js";
4
+ import { JOSENotSupported, JWEInvalid } from "../util/errors.js";
5
5
  import { assertUint8Array, isDisjoint, isObject, serializeJoseHeader, validateCrit, validateCritDuplicates, JWE_RECOGNIZED } from "./validate.js";
6
6
  import { encode } from "./buffer_utils.js";
7
7
  import { prepareKey } from "./key.js";
@@ -51,7 +51,7 @@ async function encryptJWE(input, checked, key) {
51
51
  const encodedProtectedHeader = protectedHeader ? b64u(JSON.stringify(protectedHeader)) : "", encodedAad = aad?.byteLength ? b64u(aad) : void 0, additionalAuthenticatedData = encode(encodedAad ? `${encodedProtectedHeader}.${encodedAad}` : encodedProtectedHeader);
52
52
  let plaintext = inputPlaintext;
53
53
  joseHeader.zip === "DEF" && (plaintext = await compress(plaintext).catch((cause) => {
54
- throw new JWEInvalid("Failed to compress plaintext", { cause });
54
+ throw cause instanceof JOSENotSupported ? cause : new JWEInvalid("Failed to compress plaintext", { cause });
55
55
  }));
56
56
  let ciphertext, tag, iv;
57
57
  algEntry.mode === "integrated-encryption" ? [encryptedKey, ciphertext] = await algEntry.encrypt(cek, plaintext, additionalAuthenticatedData, protectedHeader, joseHeader, keyManagementParameters) : { ciphertext, tag, iv } = await encrypt(encEntry, plaintext, cek, inputIv, additionalAuthenticatedData);
@@ -17,7 +17,7 @@ function secs(str) {
17
17
  const matched = REGEX.exec(str);
18
18
  (!matched || matched[4] && matched[1]) && invalidDuration();
19
19
  const value = parseFloat(matched[2]), durationSeconds = Math.round(value * multipliers[matched[3][0].toLowerCase()]);
20
- return Number.isFinite(durationSeconds) || invalidDuration(), matched[1] === "-" || matched[4] === "ago" ? -durationSeconds : durationSeconds;
20
+ return Number.isFinite(durationSeconds) || invalidDuration(), matched[1] === "-" || matched[4]?.toLowerCase() === "ago" ? -durationSeconds : durationSeconds;
21
21
  }
22
22
  function validateInput(label, input) {
23
23
  if (!Number.isFinite(input))
@@ -8,6 +8,8 @@ const tag = (key) => key[Symbol.toStringTag], jwkMatchesOp = (entry, key, usage)
8
8
  if (key.use !== expected)
9
9
  throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
10
10
  }
11
+ if (key.kty === "AKP" && key.alg === void 0)
12
+ throw new TypeError('missing "alg" (Algorithm) Parameter value');
11
13
  if (key.alg !== void 0 && key.alg !== alg)
12
14
  throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
13
15
  if (Array.isArray(key.key_ops)) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.2.17",
3
+ "version": "6.2.18",
4
4
  "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "akp",
@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v1.14.0](https://github.com/inspect-js/object-inspect/compare/v1.13.4...v1.14.0) - 2026-11-18
9
+
10
+ ### Fixed
11
+
12
+ - [New] add `breakLength` option [`#47`](https://github.com/inspect-js/object-inspect/issues/47)
13
+ - [New] add `maxCollectionLength` option [`#44`](https://github.com/inspect-js/object-inspect/issues/44) [`#51`](https://github.com/inspect-js/object-inspect/issues/51)
14
+
15
+ ### Commits
16
+
17
+ - [New] `breakLength`: measure array entries by display width, like `util.inspect` [`77a3946`](https://github.com/inspect-js/object-inspect/commit/77a394674a5ef46830c93869af28da57f6793263)
18
+ - [meta] add `generate:string-width` script, to regenerate the display width table [`6aabdb7`](https://github.com/inspect-js/object-inspect/commit/6aabdb75a5c5a908bcc371abdff52ccb392f647b)
19
+ - [Dev Deps] update `eslint` [`02726bd`](https://github.com/inspect-js/object-inspect/commit/02726bd9df6d829020438e5a5940cbf2f4fac1ce)
20
+ - [Fix] guard `toStringTag` with correct ternary precedence [`012c719`](https://github.com/inspect-js/object-inspect/commit/012c71960f9fcc70b59f180f355ec752e068dcb3)
21
+ - [Fix] only report a null prototype when the immediate prototype is `null` [`bc9b5bb`](https://github.com/inspect-js/object-inspect/commit/bc9b5bb99a25d10b5d1275c145dcd75b7d543b12)
22
+ - [New] add `multilineStrings` option, to print newlines in strings as line breaks [`59f64e0`](https://github.com/inspect-js/object-inspect/commit/59f64e0220b9bc079f177b4c3791f9a9f5c7f3f3)
23
+ - [Fix] avoid quadratic time when inspecting collections [`46f23b9`](https://github.com/inspect-js/object-inspect/commit/46f23b985fc62841140b9c816f812d831511d98f)
24
+ - [actions] update workflows [`f1d2734`](https://github.com/inspect-js/object-inspect/commit/f1d273499d0da648ab68e99709178f28cad0599b)
25
+ - [Tests] restore the require cache via `require-stash` instead of deleting [`4cf972c`](https://github.com/inspect-js/object-inspect/commit/4cf972c77e17cf64c7f9bc18e3e160c5d1472853)
26
+ - [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `mock-property`, `npmignore`, `semver`, `tape` [`aa960eb`](https://github.com/inspect-js/object-inspect/commit/aa960ebd1eba690196c3312919a7dc24660b574d)
27
+ - [meta] npmignore tests [`cf245d6`](https://github.com/inspect-js/object-inspect/commit/cf245d60882b25c5c9c020b95c8ede799b43e9cd)
28
+ - [Dev Deps] update `eslint` [`0c6b083`](https://github.com/inspect-js/object-inspect/commit/0c6b083853b4b04964276a434263dad6c604752f)
29
+ - [Dev Deps] update `@ljharb/eslint-config`, `eslint`, `npmignore` [`693b6e8`](https://github.com/inspect-js/object-inspect/commit/693b6e82d841985ce7aedab192654ed70df88d03)
30
+ - [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `for-each` [`01f6906`](https://github.com/inspect-js/object-inspect/commit/01f6906422395d7ec69ca93fdc46c9c6662f4115)
31
+ - [meta] sort `devDependencies` [`09ee536`](https://github.com/inspect-js/object-inspect/commit/09ee536fd3c3a41e6f0ad7c3dabb47ade1b8c6e5)
32
+ - [Fix] `maxStringLength`: error message should say "non-negative", since `0` is allowed [`8d669a8`](https://github.com/inspect-js/object-inspect/commit/8d669a804bb3cf84f62d9d2b1c145d032ffaae20)
33
+ - [meta] Fix broken repository URL in package.json [`195f7ea`](https://github.com/inspect-js/object-inspect/commit/195f7ea1d6ce0749cf687437c226303fe9e2d96b)
34
+ - [Dev Deps] update `@ljharb/eslint-config` [`f5eb186`](https://github.com/inspect-js/object-inspect/commit/f5eb186e5066e071895a5916dd1a67ea706512e6)
35
+ - [readme] replace runkit CI badge with shields.io check-runs badge [`c32b915`](https://github.com/inspect-js/object-inspect/commit/c32b91506b44ffba774812b16e46c8ac6bf4c242)
36
+ - [Dev Deps] add `keyv` [`711eca7`](https://github.com/inspect-js/object-inspect/commit/711eca7871f5b215521f7633be68f253d79a2e35)
37
+ - [New] add `breakLength` option for single-line output [`3504471`](https://github.com/inspect-js/object-inspect/commit/3504471482fef1b7c073d164f8d78298f2f29df7)
38
+
8
39
  ## [v1.13.4](https://github.com/inspect-js/object-inspect/compare/v1.13.3...v1.13.4) - 2025-02-04
9
40
 
10
41
  ### Commits