Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/pullfrog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
inputs:
prompt:
type: string
description: 'Agent prompt'
description: Agent prompt
workflow_call:
inputs:
prompt:
description: 'Agent prompt'
description: Agent prompt
type: string

permissions:
Expand All @@ -27,7 +27,7 @@ jobs:
# optionally, setup your repo here
# the agent can figure this out itself, but pre-setup is more efficient
# - uses: actions/setup-node@v6

- name: Run agent
uses: pullfrog/action@v0
with:
Expand All @@ -39,4 +39,3 @@ jobs:
google_api_key: ${{ secrets.GOOGLE_API_KEY }}
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
cursor_api_key: ${{ secrets.CURSOR_API_KEY }}

2 changes: 1 addition & 1 deletion ark/docs/components/dts/regex.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ark/docs/components/dts/schema.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ark/docs/components/dts/type.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ark/docs/components/dts/util.ts

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion ark/regex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# arkregex

## 0.0.5

### represent \d as `${number}` instead of `${bigint}`

Though this slightly widens the scope of literal strings allowed by \d, it will now behave consistently and can collapse when multiple `${number}`s appear in sequence, since `${number}` allows 0-prefixed strings like `"00"` that are rejected by `${bigint}`.

```ts
// was: Regex<`${bigint}${bigint}`>
// now: Regex<`${number}`>
regex("^\\d{2}$")
```

## 0.0.4

### consecutive `${bigint}`s are no longer collapsed

```ts
// was: Regex<`${bigint}`>
// now: Regex<`${bigint}${bigint}`>
regex("^\\d\\d$")
regex("^\\d{2}$")
```

Though the new representation will be longer for some expressions, it is required to correctly allow a zero-prefix like `"01"` in this case.
Expand Down
2 changes: 1 addition & 1 deletion ark/regex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ok = regex("^ok$", "i")
// Regex<"ok" | "oK" | "Ok" | "OK", { flags: "i" }>

const semver = regex("^(\\d*)\\.(\\d*)\\.(\\d*)$")
// Regex<`${bigint}.${bigint}.${bigint}`, { captures: [`${bigint}`, `${bigint}`, `${bigint}`] }>
// Regex<`${number}.${number}.${number}`, { captures: [`${number}`, `${number}`, `${number}`] }>

const email = regex("^(?<name>\\w+)@(?<domain>\\w+\\.\\w+)$")
// Regex<`${string}@${string}.${string}`, { names: { name: string; domain: `${string}.${string}`; }; ...>
Expand Down
88 changes: 44 additions & 44 deletions ark/regex/__tests__/regex.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,111 +28,111 @@ bench("repeat(513)", () => {

bench("anchored union", () => {
const r = regex("typescript|^go$|brrr$")
}).types([1670, "instantiations"])
}).types([1702, "instantiations"])

bench("?(1)", () => {
const r = regex("^a?$")
}).types([474, "instantiations"])
}).types([480, "instantiations"])

bench("?(4)", () => {
const r = regex("^a?b?c?d?$")
}).types([1366, "instantiations"])
}).types([1378, "instantiations"])

bench("?(7)", () => {
const r = regex("^a?b?c?d?e?f?g?$")
}).types([3946, "instantiations"])
}).types([3964, "instantiations"])

bench("?(15)", () => {
const r = regex("^ab?c?d?e?f?g?h?i?j?k?l?m?n?o?$")
}).types([282014, "instantiations"])
}).types([282048, "instantiations"])

bench("escape(6)", () => {
const r = regex("^\t\n\r\v\f\0$")
}).types([495, "instantiations"])
}).types([509, "instantiations"])

bench("quantified char", () => {
const r = regex("^a{5}$")
}).types([625, "instantiations"])
}).types([631, "instantiations"])

bench("quantified char min max", () => {
const r = regex("^a{5,10}$")
}).types([698, "instantiations"])
}).types([704, "instantiations"])

bench("quantified string", () => {
const r = regex("^.{5,10}$")
}).types([499, "instantiations"])
}).types([506, "instantiations"])

bench("semver", () => {
const r = regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$")
}).types([35650, "instantiations"])
}).types([35386, "instantiations"])

// Literals
bench("literal basic", () => {
const r = regex("abcdef")
}).types([414, "instantiations"])
}).types([426, "instantiations"])

bench("literal long", () => {
const r = regex("abcdefghijklmnopqrstuvwxyz")
}).types([1528, "instantiations"])
}).types([1580, "instantiations"])

// Anchors
bench("anchor start", () => {
const r = regex("^abc")
}).types([286, "instantiations"])
}).types([294, "instantiations"])

bench("anchor end", () => {
const r = regex("abc$")
}).types([299, "instantiations"])
}).types([305, "instantiations"])
bench("anchor both", () => {
const r = regex("^abc$")
}).types([321, "instantiations"])
}).types([329, "instantiations"])

bench("anchor union(2)", () => {
const r = regex("^foo|bar$")
}).types([906, "instantiations"])
}).types([916, "instantiations"])

bench("anchor union(5)", () => {
const r = regex("^foo|^bar|baz$|qux|^end")
}).types([1899, "instantiations"])
}).types([1929, "instantiations"])

// Unions
bench("union(2)", () => {
const r = regex("a|b")
}).types([610, "instantiations"])
}).types([612, "instantiations"])

bench("union(5)", () => {
const r = regex("a|b|c|d|e")
}).types([1192, "instantiations"])
}).types([1200, "instantiations"])

bench("union(10)", () => {
const r = regex("a|b|c|d|e|f|g|h|i|j")
}).types([2194, "instantiations"])
}).types([2212, "instantiations"])

bench("union nested", () => {
const r = regex("(a|b)(c|d)(e|f)")
}).types([6340, "instantiations"])
}).types([6384, "instantiations"])

// Quantifiers - ranges
bench("range {1,3}", () => {
const r = regex("^a{1,3}$")
}).types([599, "instantiations"])
}).types([605, "instantiations"])

bench("range {2,8}", () => {
const r = regex("^a{2,8}$")
}).types([711, "instantiations"])
}).types([717, "instantiations"])

bench("range {0,5}", () => {
const r = regex("^a{0,5}$")
}).types([690, "instantiations"])
}).types([696, "instantiations"])

bench("range complex", () => {
const r = regex("^a{1,2}b{2,3}c{0,2}$")
}).types([1367, "instantiations"])
}).types([1377, "instantiations"])

// Character sets
bench("charset simple", () => {
const r = regex("[abc]")
}).types([670, "instantiations"])
}).types([674, "instantiations"])

bench("charset range", () => {
const r = regex("[a-z]")
Expand All @@ -149,72 +149,72 @@ bench("charset negated", () => {
// Escapes
bench("escape shorthand", () => {
const r = regex("\\d\\w\\s")
}).types([502, "instantiations"])
}).types([529, "instantiations"])

bench("escape builtin", () => {
const r = regex("\t\n\r\v\f\0")
}).types([424, "instantiations"])
}).types([436, "instantiations"])

// Groups - Captures
bench("group single", () => {
const r = regex("(abc)")
}).types([441, "instantiations"])
}).types([447, "instantiations"])

bench("group nested(2)", () => {
const r = regex("(a(b)c)")
}).types([866, "instantiations"])
}).types([874, "instantiations"])

bench("group nested(3)", () => {
const r = regex("(a(b(c)d)e)")
}).types([1530, "instantiations"])
}).types([1544, "instantiations"])

bench("group union", () => {
const r = regex("(a|b|c)")
}).types([1154, "instantiations"])
}).types([1158, "instantiations"])

bench("group quantified", () => {
const r = regex("(ab){1,3}")
}).types([753, "instantiations"])
}).types([759, "instantiations"])

// Non-capturing groups
bench("group non-capturing", () => {
const r = regex("(?:abc)")
}).types([397, "instantiations"])
}).types([403, "instantiations"])

bench("group mixed capturing", () => {
const r = regex("(a)(?:b)(c)")
}).types([1084, "instantiations"])
}).types([1092, "instantiations"])

// Backreferences
bench("backref simple", () => {
const r = regex("(a)\\1")
}).types([743, "instantiations"])
}).types([749, "instantiations"])

bench("backref union", () => {
const r = regex("(a|b)\\1")
}).types([1428, "instantiations"])
}).types([1440, "instantiations"])

bench("backref multiple", () => {
const r = regex("(a)(b)\\1\\2")
}).types([1326, "instantiations"])
}).types([1336, "instantiations"])

// Named captures
bench("named capture", () => {
const r = regex("(?<name>abc)")
}).types([613, "instantiations"])
}).types([619, "instantiations"])

bench("named backref", () => {
const r = regex("(?<name>a|b)\\k<name>")
}).types([1629, "instantiations"])
}).types([1641, "instantiations"])

// Complex patterns
bench("email pattern", () => {
const r = regex("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$")
}).types([3016, "instantiations"])
}).types([3035, "instantiations"])

bench("phone pattern", () => {
const r = regex("^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$")
}).types([9488, "instantiations"])
}).types([9650, "instantiations"])

// Scaling tests
bench("wildcard sequence(5)", () => {
Expand All @@ -227,10 +227,10 @@ bench("wildcard sequence(10)", () => {

bench("nested groups(4)", () => {
const r = regex("((((a))))")
}).types([1407, "instantiations"])
}).types([1409, "instantiations"])

bench("mixed complexity", () => {
const r = regex(
"^((?:https?://)?(?:www\\.)?([a-zA-Z0-9-]+)\\.(com|org|net))(/.*)?$"
)
}).types([9597, "instantiations"])
}).types([9686, "instantiations"])
Loading