@agent-native/core 0.237.0 → 0.237.1-nightly-20261202123958

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "@agent-native/actions": "0.1.2",
3
- "@agent-native/agentkit": "0.237.0",
3
+ "@agent-native/agentkit": "0.237.1-nightly-20261202123958",
4
4
  "@agent-native/code-agents-ui": "0.1.75",
5
- "@agent-native/core": "0.237.0",
6
- "@agent-native/core-corpus": "0.237.0",
5
+ "@agent-native/core": "0.237.1-nightly-20261202123958",
6
+ "@agent-native/core-corpus": "0.237.1-nightly-20261202123958",
7
7
  "@agent-native/creative-context": "0.8.82",
8
- "@agent-native/design-system": "0.237.0",
9
- "@agent-native/dispatch": "0.43.6",
8
+ "@agent-native/design-system": "0.237.1-nightly-20261202123958",
9
+ "@agent-native/dispatch": "0.43.7-nightly-20261202123958",
10
10
  "@agent-native/embedding": "0.2.0",
11
11
  "@agent-native/migrate": "0.0.7",
12
12
  "@agent-native/otel": "0.1.49",
@@ -14,6 +14,6 @@
14
14
  "@agent-native/recap-cli": "0.5.113",
15
15
  "@agent-native/scheduling": "0.4.6",
16
16
  "@agent-native/shared-app-config": "0.1.2",
17
- "@agent-native/skills": "0.4.17",
18
- "@agent-native/toolkit": "0.237.0"
17
+ "@agent-native/skills": "0.4.18-nightly-20261202123958",
18
+ "@agent-native/toolkit": "0.237.1-nightly-20261202123958"
19
19
  }
@@ -1,30 +1,14 @@
1
- const RAW_TEXT_TAG_NAMES = new Set(["script", "style", "textarea", "title"]);
1
+ const TAG_START = /<(?:(?<comment>!--)|(?<slash>\/?)(?<name>[A-Za-z][\w:-]*))/g;
2
+ const TAG_END = /[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/y;
3
+ const RAW_TEXT_CLOSE = new Map(["script", "style", "textarea", "title"].map((tag) => [
4
+ tag,
5
+ new RegExp(`<\\/${tag}\\s*>`, "gi"),
6
+ ]));
2
7
  function tagEndIndex(html, start) {
3
- let quote = null;
4
- for (let index = start; index < html.length; index += 1) {
5
- const character = html[index];
6
- if (quote) {
7
- if (character === quote)
8
- quote = null;
9
- continue;
10
- }
11
- if (character === '"' || character === "'") {
12
- quote = character;
13
- continue;
14
- }
15
- if (character === ">")
16
- return index;
17
- }
18
- return -1;
19
- }
20
- const TAG_NAME = /[A-Za-z][\w:-]*/y;
21
- function tagNameAt(html, start) {
22
- TAG_NAME.lastIndex = start;
23
- const match = TAG_NAME.exec(html);
24
- return match?.[0]?.toLowerCase() ?? null;
8
+ TAG_END.lastIndex = start;
9
+ return TAG_END.test(html) ? TAG_END.lastIndex - 1 : -1;
25
10
  }
26
- function rawTextCloseIndex(html, tag, start) {
27
- const pattern = new RegExp(`<\\/${tag}\\s*>`, "gi");
11
+ function rawTextCloseIndex(html, pattern, start) {
28
12
  pattern.lastIndex = start;
29
13
  return pattern.exec(html)?.index ?? -1;
30
14
  }
@@ -32,33 +16,33 @@ function closingTagIndex(html, tag, last) {
32
16
  let index = -1;
33
17
  let cursor = 0;
34
18
  while (cursor < html.length) {
35
- const tagStart = html.indexOf("<", cursor);
36
- if (tagStart === -1)
19
+ TAG_START.lastIndex = cursor;
20
+ const match = TAG_START.exec(html);
21
+ if (!match)
37
22
  break;
38
- if (html.startsWith("<!--", tagStart)) {
23
+ const tagStart = match.index;
24
+ if (match.groups?.comment) {
39
25
  const commentEnd = html.indexOf("-->", tagStart + 4);
40
26
  cursor = commentEnd === -1 ? html.length : commentEnd + 3;
41
27
  continue;
42
28
  }
43
- const closing = html[tagStart + 1] === "/";
44
- const nameStart = tagStart + (closing ? 2 : 1);
45
- const tagName = tagNameAt(html, nameStart);
46
- if (!tagName) {
47
- cursor = tagStart + 1;
48
- continue;
49
- }
50
- const tagEnd = tagEndIndex(html, nameStart + tagName.length);
29
+ const closing = match.groups?.slash === "/";
30
+ const rawTagName = match.groups?.name;
31
+ if (rawTagName === undefined)
32
+ throw new Error("Tag pattern matched without a tag name");
33
+ const tagName = rawTagName.toLowerCase();
34
+ const nameEnd = tagStart + (closing ? 2 : 1) + tagName.length;
35
+ const tagEnd = tagEndIndex(html, nameEnd);
51
36
  if (tagEnd === -1)
52
37
  break;
53
- if (closing &&
54
- tagName === tag &&
55
- !/\S/.test(html.slice(nameStart + tagName.length, tagEnd))) {
38
+ if (closing && tagName === tag && !/\S/.test(html.slice(nameEnd, tagEnd))) {
56
39
  index = tagStart;
57
40
  if (!last)
58
41
  return index;
59
42
  }
60
- if (!closing && RAW_TEXT_TAG_NAMES.has(tagName)) {
61
- const rawTextEnd = rawTextCloseIndex(html, tagName, tagEnd + 1);
43
+ const rawTextClose = closing ? undefined : RAW_TEXT_CLOSE.get(tagName);
44
+ if (rawTextClose) {
45
+ const rawTextEnd = rawTextCloseIndex(html, rawTextClose, tagEnd + 1);
62
46
  cursor =
63
47
  rawTextEnd === -1 ? html.length : rawTextEnd + tagName.length + 3;
64
48
  continue;
@@ -346,8 +346,6 @@ const PEM_PRIVATE_KEY_RE = /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?(?:----
346
346
  const WEBHOOK_URL_RE = /https?:\/\/(?:hooks\.slack\.com\/services\/[A-Za-z0-9_-]+\/[A-Za-z0-9_-]+\/[A-Za-z0-9_-]+|(?:canary\.|ptb\.)?discord(?:app)?\.com\/api\/webhooks\/\d+\/[A-Za-z0-9_-]+|[A-Za-z0-9.-]+\.webhook\.office\.com\/[^\s"'<>]+|hooks\.zapier\.com\/hooks\/[^\s"'<>]+|maker\.ifttt\.com\/use\/[A-Za-z0-9_-]+)/gi;
347
347
  const BEARER_RE = /\b(bearer)[ \t]+[A-Za-z0-9._~+/=-]+/gi;
348
348
  const BASIC_RE = /\b(basic)[ \t]+([A-Za-z0-9+/]{8,}={0,2})/gi;
349
- // A prefix that names a provider, then the key. The eyJ pattern caps its first
350
- // segment: a run of `eyJ-eyJ-...` restarts at every `eyJ` and scans to the end.
351
349
  const PROVIDER_KEY_RE = new RegExp([
352
350
  String.raw `\b(?:AKIA|ASIA)[A-Z0-9]{16,}`,
353
351
  String.raw `\bsk-[A-Za-z0-9_-]{8,}`,
@@ -363,8 +361,63 @@ const PROVIDER_KEY_RE = new RegExp([
363
361
  String.raw `\bpat-[A-Za-z0-9_-]+`,
364
362
  String.raw `\bnpm_[A-Za-z0-9_-]+`,
365
363
  String.raw `\bbpk-[A-Za-z0-9-]{8,}`,
366
- String.raw `\beyJ[A-Za-z0-9_-]{4,1024}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+`,
367
364
  ].join("|"), "g");
365
+ function isWordCharacter(code) {
366
+ return ((code >= 48 && code <= 57) ||
367
+ (code >= 65 && code <= 90) ||
368
+ (code >= 97 && code <= 122) ||
369
+ code === 95);
370
+ }
371
+ function isBase64UrlCharacter(code) {
372
+ return isWordCharacter(code) || code === 45;
373
+ }
374
+ function redactJwts(text, placeholder) {
375
+ const len = text.length;
376
+ let out = "";
377
+ let copied = 0;
378
+ let cursor = 0;
379
+ while (cursor < len) {
380
+ const start = text.indexOf("eyJ", cursor);
381
+ if (start === -1)
382
+ break;
383
+ if (start > 0 && isWordCharacter(text.charCodeAt(start - 1))) {
384
+ cursor = start + 3;
385
+ continue;
386
+ }
387
+ const seg1Start = start + 3;
388
+ let p = seg1Start;
389
+ while (p < len && isBase64UrlCharacter(text.charCodeAt(p)))
390
+ p += 1;
391
+ if (p >= len || text.charCodeAt(p) !== 46) {
392
+ cursor = p;
393
+ continue;
394
+ }
395
+ if (p - seg1Start < 4) {
396
+ cursor = p + 1;
397
+ continue;
398
+ }
399
+ const seg2Start = p + 1;
400
+ let q = seg2Start;
401
+ while (q < len && isBase64UrlCharacter(text.charCodeAt(q)))
402
+ q += 1;
403
+ if (q === seg2Start || q >= len || text.charCodeAt(q) !== 46) {
404
+ cursor = p + 1;
405
+ continue;
406
+ }
407
+ const seg3Start = q + 1;
408
+ let r = seg3Start;
409
+ while (r < len && isBase64UrlCharacter(text.charCodeAt(r)))
410
+ r += 1;
411
+ if (r === seg3Start) {
412
+ cursor = p + 1;
413
+ continue;
414
+ }
415
+ out += text.slice(copied, start) + placeholder;
416
+ copied = r;
417
+ cursor = r;
418
+ }
419
+ return copied === 0 ? text : out + text.slice(copied);
420
+ }
368
421
  function redactSchemes(text, placeholder) {
369
422
  return text
370
423
  .replace(BEARER_RE, (_match, scheme) => `${scheme} ${placeholder}`)
@@ -472,6 +525,7 @@ export function redactSecretsInText(text, options) {
472
525
  .replace(WEBHOOK_URL_RE, replacement);
473
526
  out = redactAssignments(out, placeholder, names);
474
527
  out = redactSchemes(out, placeholder).replace(PROVIDER_KEY_RE, replacement);
528
+ out = redactJwts(out, placeholder);
475
529
  out = redactUserinfo(out, placeholder);
476
530
  return tail ? redactTail(out, placeholder, tail === "truncated") : out;
477
531
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.237.0",
3
+ "version": "0.237.1-nightly-20261202123958",
4
4
  "description": "The agentic application framework for building autonomous agents with intuitive UIs",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -835,7 +835,7 @@
835
835
  "yjs": "^13.6.33",
836
836
  "zod": "^4.3.6",
837
837
  "@agent-native/actions": "^0.1.2",
838
- "@agent-native/agentkit": "^0.237.0",
838
+ "@agent-native/agentkit": "^0.237.1-nightly-20261202123958",
839
839
  "@agent-native/recap-cli": "^0.5.113"
840
840
  },
841
841
  "devDependencies": {
@@ -910,7 +910,7 @@
910
910
  "xlsx": "^0.18.5"
911
911
  },
912
912
  "peerDependencies": {
913
- "@agent-native/core-corpus": ">=0.196.0",
913
+ "@agent-native/core-corpus": "0.237.1-nightly-20261202123958",
914
914
  "@ai-sdk/anthropic": ">=3",
915
915
  "@ai-sdk/cohere": ">=3",
916
916
  "@ai-sdk/google": ">=3.0.152",