@forwardimpact/libutil 0.1.78 → 0.1.81
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/README.md +5 -2
- package/bin/fit-download-bundle.js +7 -3
- package/bin/fit-tiktoken.js +7 -3
- package/package.json +4 -13
package/README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# libutil
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
<!-- BEGIN:description — Do not edit. Generated from package.json. -->
|
|
4
|
+
|
|
5
|
+
Cross-cutting utilities: retry, hashing, token counting, and project discovery.
|
|
6
|
+
|
|
7
|
+
<!-- END:description -->
|
|
5
8
|
|
|
6
9
|
## Getting Started
|
|
7
10
|
|
|
@@ -8,9 +8,13 @@ import { createStorage } from "@forwardimpact/libstorage";
|
|
|
8
8
|
import { createLogger } from "@forwardimpact/libtelemetry";
|
|
9
9
|
import { createBundleDownloader, execLine } from "@forwardimpact/libutil";
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
11
|
+
// `bun build --compile` injects FIT_DOWNLOAD_BUNDLE_VERSION via --define,
|
|
12
|
+
// eliminating the readFileSync branch in the compiled binary (which would
|
|
13
|
+
// ENOENT against the bunfs virtual mount). Source execution falls through.
|
|
14
|
+
const VERSION =
|
|
15
|
+
process.env.FIT_DOWNLOAD_BUNDLE_VERSION ||
|
|
16
|
+
JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"))
|
|
17
|
+
.version;
|
|
14
18
|
|
|
15
19
|
const definition = {
|
|
16
20
|
name: "fit-download-bundle",
|
package/bin/fit-tiktoken.js
CHANGED
|
@@ -4,9 +4,13 @@ import { createCli } from "@forwardimpact/libcli";
|
|
|
4
4
|
import { createLogger } from "@forwardimpact/libtelemetry";
|
|
5
5
|
import { countTokens } from "@forwardimpact/libutil";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
7
|
+
// `bun build --compile` injects FIT_TIKTOKEN_VERSION via --define, eliminating
|
|
8
|
+
// the readFileSync branch in the compiled binary (which would ENOENT against
|
|
9
|
+
// the bunfs virtual mount). Source execution falls through to package.json.
|
|
10
|
+
const VERSION =
|
|
11
|
+
process.env.FIT_TIKTOKEN_VERSION ||
|
|
12
|
+
JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"))
|
|
13
|
+
.version;
|
|
10
14
|
|
|
11
15
|
const definition = {
|
|
12
16
|
name: "fit-tiktoken",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forwardimpact/libutil",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Cross-cutting utilities
|
|
3
|
+
"version": "0.1.81",
|
|
4
|
+
"description": "Cross-cutting utilities: retry, hashing, token counting, and project discovery.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"util",
|
|
7
7
|
"retry",
|
|
@@ -17,17 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"author": "D. Olsson <hi@senzilla.io>",
|
|
20
|
-
"forwardimpact": {
|
|
21
|
-
"capability": "foundations",
|
|
22
|
-
"needs": [
|
|
23
|
-
"Compute a stable hash (SHA-256 checksum)",
|
|
24
|
-
"Count LLM tokens",
|
|
25
|
-
"Find the project root",
|
|
26
|
-
"Retry a flaky network call",
|
|
27
|
-
"Download and extract a tarball",
|
|
28
|
-
"Generate a UUID"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
20
|
"type": "module",
|
|
32
21
|
"main": "./src/index.js",
|
|
33
22
|
"exports": {
|
|
@@ -49,6 +38,8 @@
|
|
|
49
38
|
},
|
|
50
39
|
"dependencies": {
|
|
51
40
|
"@forwardimpact/libcli": "^0.1.0",
|
|
41
|
+
"@forwardimpact/libconfig": "^0.1.79",
|
|
42
|
+
"@forwardimpact/libstorage": "^0.1.78",
|
|
52
43
|
"@forwardimpact/libtelemetry": "^0.1.22"
|
|
53
44
|
},
|
|
54
45
|
"devDependencies": {
|