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
4 changes: 2 additions & 2 deletions THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4391,7 +4391,7 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

The following npm package may be included in this product:

- mathjs@13.0.3
- mathjs@13.1.0

This package contains the following license and notice below:

Expand Down Expand Up @@ -5079,7 +5079,7 @@ SOFTWARE.

The following npm package may be included in this product:

- tsx@4.17.0
- tsx@4.18.0

This package contains the following license and notice below:

Expand Down
18 changes: 13 additions & 5 deletions docs/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

91 changes: 43 additions & 48 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1198,9 +1198,9 @@ array-iterate@^2.0.0:
integrity sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==

astring@^1.8.0:
version "1.8.6"
resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.6.tgz#2c9c157cf1739d67561c56ba896e6948f6b93731"
integrity sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==
version "1.9.0"
resolved "https://registry.yarnpkg.com/astring/-/astring-1.9.0.tgz#cc73e6062a7eb03e7d19c22d8b0b3451fd9bfeef"
integrity sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==

astro-expressive-code@^0.35.6:
version "0.35.6"
Expand Down Expand Up @@ -1371,9 +1371,9 @@ camelcase@^7.0.1:
integrity sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==

caniuse-lite@^1.0.30001646:
version "1.0.30001651"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138"
integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==
version "1.0.30001653"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz#b8af452f8f33b1c77f122780a4aecebea0caca56"
integrity sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==

ccount@^2.0.0:
version "2.0.1"
Expand Down Expand Up @@ -1439,12 +1439,12 @@ cli-boxes@^3.0.0:
resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-3.0.0.tgz#71a10c716feeba005e4504f36329ef0b17cf3145"
integrity sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==

cli-cursor@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea"
integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==
cli-cursor@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-5.0.0.tgz#24a4831ecf5a6b01ddeb32fb71a4b2088b0dce38"
integrity sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==
dependencies:
restore-cursor "^4.0.0"
restore-cursor "^5.0.0"

cli-spinners@^2.9.2:
version "2.9.2"
Expand Down Expand Up @@ -1631,9 +1631,9 @@ emmet@^2.4.3:
"@emmetio/css-abbreviation" "^2.1.8"

emoji-regex@^10.3.0:
version "10.3.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23"
integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==
version "10.4.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.4.0.tgz#03553afea80b3975749cfcb36f776ca268e413d4"
integrity sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down Expand Up @@ -3072,16 +3072,16 @@ micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.7:
braces "^3.0.3"
picomatch "^2.3.1"

mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==

mimic-fn@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc"
integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==

mimic-function@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/mimic-function/-/mimic-function-5.0.1.tgz#acbe2b3349f99b9deaca7fb70e48b83e94e67076"
integrity sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==

mrmime@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-2.0.0.tgz#151082a6e06e59a9a39b46b3e14d5cfe92b3abb4"
Expand Down Expand Up @@ -3143,33 +3143,33 @@ nth-check@^2.0.0:
dependencies:
boolbase "^1.0.0"

onetime@^5.1.0:
version "5.1.2"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"
integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==
dependencies:
mimic-fn "^2.1.0"

onetime@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4"
integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==
dependencies:
mimic-fn "^4.0.0"

onetime@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-7.0.0.tgz#9f16c92d8c9ef5120e3acd9dd9957cceecc1ab60"
integrity sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==
dependencies:
mimic-function "^5.0.0"

ora@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/ora/-/ora-8.0.1.tgz#6dcb9250a629642cbe0d2df3a6331ad6f7a2af3e"
integrity sha512-ANIvzobt1rls2BDny5fWZ3ZVKyD6nscLvfFRpQgfWsythlcsVUC9kL0zq6j2Z5z9wwp1kd7wpsD/T9qNPVLCaQ==
version "8.1.0"
resolved "https://registry.yarnpkg.com/ora/-/ora-8.1.0.tgz#c3db2f9f83a2bec9e8ab71fe3b9ae234d65ca3a8"
integrity sha512-GQEkNkH/GHOhPFXcqZs3IDahXEQcQxsSjEkK4KvEEST4t7eNzoMjxTzef+EZ+JluDEV+Raoi3WQ2CflnRdSVnQ==
dependencies:
chalk "^5.3.0"
cli-cursor "^4.0.0"
cli-cursor "^5.0.0"
cli-spinners "^2.9.2"
is-interactive "^2.0.0"
is-unicode-supported "^2.0.0"
log-symbols "^6.0.0"
stdin-discarder "^0.2.1"
string-width "^7.0.0"
stdin-discarder "^0.2.2"
string-width "^7.2.0"
strip-ansi "^7.1.0"

p-limit@^2.2.0:
Expand Down Expand Up @@ -3538,13 +3538,13 @@ require-from-string@^2.0.2:
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==

restore-cursor@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9"
integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==
restore-cursor@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-5.1.0.tgz#0766d95699efacb14150993f55baf0953ea1ebe7"
integrity sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==
dependencies:
onetime "^5.1.0"
signal-exit "^3.0.2"
onetime "^7.0.0"
signal-exit "^4.1.0"

retext-latin@^4.0.0:
version "4.0.0"
Expand All @@ -3556,9 +3556,9 @@ retext-latin@^4.0.0:
unified "^11.0.0"

retext-smartypants@^6.0.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/retext-smartypants/-/retext-smartypants-6.1.0.tgz#59a005113c3e63a0045ebc8b3edbb31d0a1d2a55"
integrity sha512-LDPXg95346bqFZnDMHo0S7Rq5p64+B+N8Vz733+wPMDtwb9rCOs9LIdIEhrUOU+TAywX9St+ocQWJt8wrzivcQ==
version "6.1.1"
resolved "https://registry.yarnpkg.com/retext-smartypants/-/retext-smartypants-6.1.1.tgz#6f57e71c889510d9c322ceb61038908ffabd31d0"
integrity sha512-onsHf34i/GzgElJgtT1K2V+31yEhWs7NJboKNxXJcmVMMPxLpgxZ9iADoMdydd6j/bHic5F/aNq0CGqElEtu2g==
dependencies:
"@types/nlcst" "^2.0.0"
nlcst-to-string "^4.0.0"
Expand Down Expand Up @@ -3692,11 +3692,6 @@ shiki@^1.1.7, shiki@^1.10.3, shiki@^1.14.1:
"@shikijs/core" "1.14.1"
"@types/hast" "^3.0.4"

signal-exit@^3.0.2:
version "3.0.7"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==

signal-exit@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04"
Expand Down Expand Up @@ -3761,7 +3756,7 @@ starlight-blog@^0.12.0:
marked-plaintify "1.0.1"
ultrahtml "1.5.3"

stdin-discarder@^0.2.1:
stdin-discarder@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/stdin-discarder/-/stdin-discarder-0.2.2.tgz#390037f44c4ae1a1ae535c5fe38dc3aba8d997be"
integrity sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==
Expand Down Expand Up @@ -3789,7 +3784,7 @@ string-width@^5.0.1, string-width@^5.1.2:
emoji-regex "^9.2.2"
strip-ansi "^7.0.1"

string-width@^7.0.0, string-width@^7.2.0:
string-width@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.2.0.tgz#b5bb8e2165ce275d4d43476dd2700ad9091db6dc"
integrity sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==
Expand Down
18 changes: 13 additions & 5 deletions genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"dockerode": "^4.0.2",
"gpt-tokenizer": "^2.2.1",
"mammoth": "^1.8.0",
"mathjs": "^13.0.3",
"mathjs": "^13.1.0",
"pdfjs-dist": "4.5.136",
"tree-sitter-wasms": "^0.1.11",
"tsx": "^4.17.0",
"tsx": "^4.18.0",
"typescript": "5.5.4",
"vectra": "^0.9.0",
"web-tree-sitter": "^0.22.2",
Expand Down Expand Up @@ -67,7 +67,6 @@
"memorystream": "^0.3.1",
"node-sarif-builder": "^3.2.0",
"openai": "^4.56.0",
"ora": "^8.0.1",
"pretty-bytes": "^6.1.1",
"replace-ext": "^2.0.0",
"ws": "^8.18.0",
Expand Down
15 changes: 4 additions & 11 deletions packages/cli/src/parse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { createProgressSpinner } from "./spinner"
import replaceExt from "replace-ext"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for createProgressSpinner from "./spinner".

generated by pr-review-commit missing_import

import { readFile } from "node:fs/promises"
import { DOCXTryParse } from "../../core/src/docx"
Expand Down Expand Up @@ -38,19 +37,16 @@ export async function parseHTMLToText(file: string) {
}

export async function jsonl2json(files: string[]) {
const spinner = createProgressSpinner(`converting...`)
for (const file of await expandFiles(files)) {
spinner.report({ message: file })
if (!isJSONLFilename(file)) {
spinner.report({ succeeded: false })
console.log(`skipping ${file}`)
continue
}
const objs = await readJSONL(file)
const out = replaceExt(file, ".json")
await writeText(out, JSON.stringify(objs, null, 2))
spinner.report({ succeeded: true })
console.log(`${file} -> ${out}`)
}
spinner.stop()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing progress report for jsonl2json function.

generated by pr-review-commit missing_progress_report


export async function parseTokens(
Expand All @@ -61,18 +57,15 @@ export async function parseTokens(
const encoder = await resolveTokenEncoder(model)

const files = await expandFiles(filesGlobs, options?.excludedFiles)
const progress = createProgressSpinner(`parsing ${files.length} files`)
console.log(`parsing ${files.length} files`)
let text = ""
for (const file of files) {
const content = await readText(file)
if (content) {
const tokens = estimateTokens(content, encoder)
progress.report({
message: `${file}, ${tokens}`,
})
console.log(`${file}, ${tokens}`)
text += `${file}, ${tokens}\n`
}
}
progress.stop()
console.log(text)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing progress report for parseTokens function.

generated by pr-review-commit missing_progress_report

Loading