Skip to content

Commit a12e8a0

Browse files
authored
Web-base64 (#1822)
* Add @jsonjoy.com/base64 package and update related imports; improve error logging in various modules * Remove @jsonjoy.com/base64 package and replace its usage with base64-js; update related imports and dependencies * Update serve:web script to include -provider github option * Update serve:cli script to include -provider github option * Update serve:cli script to use --provider option; enhance typecheck script with --explainFiles flag * chore: update @modelcontextprotocol/sdk to version 1.17.1
1 parent 09ae642 commit a12e8a0

22 files changed

Lines changed: 433 additions & 404 deletions

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ dev-proxy-ca.crt
7777
.clinerules.bak
7878
.codex/config.toml
7979
.codex/config.toml.bak
80+
.crush.json
81+
.crush.json.bak
8082
.cursor/mcp.json.bak
8183
.cursor/rules/ruler_cursor_instructions.mdc
8284
.cursor/rules/ruler_cursor_instructions.mdc.bak
@@ -104,10 +106,14 @@ dev-proxy-ca.crt
104106
.vscode/settings.json.bak
105107
.windsurf/rules/ruler_windsurf_instructions.md
106108
.windsurf/rules/ruler_windsurf_instructions.md.bak
109+
AGENT.md
110+
AGENT.md.bak
107111
AGENTS.md
108112
AGENTS.md.bak
109113
CLAUDE.md
110114
CLAUDE.md.bak
115+
CRUSH.md
116+
CRUSH.md.bak
111117
GEMINI.md
112118
GEMINI.md.bak
113119
opencode.json

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
"jaegertracing",
162162
"Jamba",
163163
"jinja",
164+
"jsonjoy",
164165
"jsonlinecache",
165166
"JSONLLM",
166167
"labeli",

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"@astrojs/check": "^0.9.4",
2727
"@astrojs/starlight": "0.34.4",
28-
"astro": "^5.12.5",
28+
"astro": "^5.12.8",
2929
"astro-embed": "^0.9.0",
3030
"rehype-mermaid": "^3.0.0",
3131
"starlight-blog": "^0.24.0",

docs/public/genaiscript.d.ts

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"run:script": "cd samples/sample/ && pnpm run:script",
8585
"run:script:devproxy": "cd samples/sample/ && HTTPS_PROXY=http://127.0.0.1:8000 NODE_TLS_REJECT_UNAUTHORIZED=0 DEBUG=http,https,net,script,genaiscript:fetch*,proxy-agent pnpm run:script",
8686
"serve": "pnpm build:cli && run-p serve:*",
87-
"serve:cli": "node --watch --watch-path=packages/cli/dist packages/cli/dist/src/index.js serve --dispatch-progress",
87+
"serve:cli": "node --watch --watch-path=packages/cli/dist packages/cli/dist/src/index.js serve --dispatch-progress --provider github",
8888
"serve:web": "pnpm --filter=@genaiscript/web watch",
8989
"serve:webapi": "node --watch --watch-path=packages/cli/dist packages/cli/dist/src/index.js webapi --network --cors \"*\"",
9090
"setup": "git submodule update --init --recursive",
@@ -121,11 +121,11 @@
121121
},
122122
"devDependencies": {
123123
"@inquirer/prompts": "catalog:",
124-
"@intellectronica/ruler": "^0.2.17",
124+
"@intellectronica/ruler": "^0.2.19",
125125
"@types/node": "catalog:",
126126
"npm-check-updates": "^18.0.2",
127127
"npm-run-all": "^4.1.5",
128-
"playwright": "^1.54.1",
128+
"playwright": "^1.54.2",
129129
"prettier": "catalog:",
130130
"prettier-plugin-curly": "^0.3.2",
131131
"release-it": "^19.0.4",

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
"license": "MIT",
3636
"dependencies": {
3737
"@actions/core": "^1.11.1",
38-
"@fastify/cors": "^11.0.1",
38+
"@fastify/cors": "^11.1.0",
3939
"@fastify/swagger": "^9.5.1",
4040
"@fastify/swagger-ui": "^5.2.3",
4141
"@genaiscript/api": "workspace:*",
4242
"@genaiscript/core": "workspace:*",
4343
"@genaiscript/runtime": "workspace:*",
4444
"@inquirer/prompts": "catalog:",
45-
"@modelcontextprotocol/sdk": "^1.17.0",
45+
"@modelcontextprotocol/sdk": "^1.17.1",
4646
"chokidar": "^4.0.3",
4747
"commander": "^14.0.0",
4848
"debug": "catalog:",
@@ -51,7 +51,7 @@
5151
"execa": "catalog:",
5252
"fastify": "^5.4.0",
5353
"inflection": "catalog:",
54-
"openai": "^5.10.2",
54+
"openai": "^5.11.0",
5555
"replace-ext": "^2.0.0",
5656
"tslib": "catalog:",
5757
"typescript": "catalog:",

packages/core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"@azure/identity": "^4.10.2",
5555
"@azure/search-documents": "^12.1.0",
5656
"@huggingface/jinja": "^0.5.1",
57-
"@modelcontextprotocol/sdk": "^1.17.0",
58-
"@napi-rs/canvas": "^0.1.74",
57+
"@modelcontextprotocol/sdk": "^1.17.1",
58+
"@napi-rs/canvas": "^0.1.76",
5959
"@octokit/core": "^7.0.3",
6060
"@octokit/plugin-paginate-rest": "^13.1.1",
6161
"@octokit/plugin-retry": "^8.0.1",
@@ -89,7 +89,7 @@
8989
"json5": "^2.2.3",
9090
"jsonrepair": "^3.13.0",
9191
"magic-string": "^0.30.17",
92-
"mammoth": "^1.9.1",
92+
"mammoth": "^1.10.0",
9393
"mathjs": "^14.6.0",
9494
"merge-descriptors": "^2.0.0",
9595
"mime": "^4.0.7",
@@ -100,7 +100,7 @@
100100
"node-sarif-builder": "^3.2.0",
101101
"object-inspect": "^1.13.4",
102102
"octokit": "^5.0.3",
103-
"openai": "^5.10.2",
103+
"openai": "^5.11.0",
104104
"p-limit": "^6.2.0",
105105
"package-manager-detector": "^1.3.0",
106106
"parse-diff": "^0.11.1",
@@ -121,7 +121,7 @@
121121
"tsx": "catalog:",
122122
"turndown": "^7.2.0",
123123
"turndown-plugin-gfm": "^1.0.2",
124-
"undici": "^7.12.0",
124+
"undici": "^7.13.0",
125125
"unified": "^11.0.5",
126126
"unist-util-visit": "^5.0.0",
127127
"uuid": "^11.1.0",

packages/core/src/base64.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function fromBase64(base64: string): Uint8Array {
1111
if (typeof base64 !== "string" || !/^[A-Za-z0-9+/=\s]+$/.test(base64)) {
1212
throw new Error("Input is not a valid base64 string");
1313
}
14-
return new Uint8Array(Buffer.from(base64, "base64"));
14+
return Buffer.from(base64, "base64");
1515
}
1616

1717
/**

packages/core/src/fetchtext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function fetchText(
7878
try {
7979
bytes = await runtimeHost.readFile(url);
8080
} catch (e) {
81-
logVerbose(e);
81+
dbg(`failed to read file`);
8282
ok = false;
8383
status = 404;
8484
}

packages/core/src/fileedits.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export async function computeFileEdits(
104104
val,
105105
)) ?? val;
106106
} catch (e) {
107-
logVerbose(e);
107+
logVerbose(errorMessage(e));
108108
trace?.error(`error custom merging diff in ${fn}`, e);
109109
}
110110
} else fileEdit.after = val;
@@ -113,12 +113,12 @@ export async function computeFileEdits(
113113
try {
114114
fileEdit.after = applyLLMPatch(fileEdit.after || fileEdit.before, chunks);
115115
} catch (e) {
116-
logVerbose(e);
116+
logVerbose(errorMessage(e));
117117
trace?.error(`error applying patch to ${fn}`, e);
118118
try {
119119
fileEdit.after = applyLLMDiff(fileEdit.after || fileEdit.before, chunks);
120120
} catch (e) {
121-
logVerbose(e);
121+
logVerbose(errorMessage(e));
122122
trace?.error(`error merging diff in ${fn}`, e);
123123
}
124124
}

0 commit comments

Comments
 (0)