typebulb 0.31.0 → 0.31.1
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 +1 -0
- package/dist/agents/claude/client.js +112 -112
- package/dist/agents/pi/client.js +112 -112
- package/dist/agents/pi/matchu-patchu.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +107 -107
|
@@ -2280,7 +2280,7 @@ var Patcher = class {
|
|
|
2280
2280
|
|
|
2281
2281
|
// cli/agents/pi/server/piPatcherExtension.ts
|
|
2282
2282
|
var DESCRIPTION = true ? "Apply unified diffs to files \u2014 tolerant of form, strict about intent. Repairs sloppy AI-generated diffs (mangled headers, whitespace drift, missing prefixes; line numbers can be wrong or absent \u2014 hunks anchor by fuzzy-matched context lines) and applies all hunks atomically when the intent is unambiguous; fails with a precise, typed error when it isn't. Use for multi-hunk edits in one step, or when exact string-replacement editing fails on whitespace or invisible characters." : "Apply unified diffs to files.";
|
|
2283
|
-
var BUILD_TAG = true ? "matchu-patchu-pi 0.3.1, built 2026-07-
|
|
2283
|
+
var BUILD_TAG = true ? "matchu-patchu-pi 0.3.1, built 2026-07-18 18:29:35" : "matchu-patchu-pi dev";
|
|
2284
2284
|
var errorBlocks = (errors) => {
|
|
2285
2285
|
const parts = [`Patch failed with ${errors.length} error(s):`];
|
|
2286
2286
|
for (const e of errors) parts.push("", e.toString());
|
package/dist/index.js
CHANGED
|
@@ -1992,5 +1992,5 @@ ${fP}
|
|
|
1992
1992
|
`);let c=0,l=Promise.resolve();Yt({target:r,onChange:()=>{let f=++c;l=l.then(async()=>{if(f===c)try{console.log("Re-running..."),await a()}catch(u){console.error("Error:",u)}})}})}}gt();import{Console as yP}from"node:console";Ne();async function by(r,e,t,n,s){xP();try{let p=Sr(await z(),r)[0];p&&(Ii(p.pid,Re(p.pid).offset),console.error(`note: 'call' boots a fresh server.ts instance; the running server (${p.url}) is not contacted \u2014 state shared with it must live on disk.`))}catch{}let i=ge(t),{bulb:o,config:a}=await ke(r);o.server||Vn("This bulb has no **server.ts** block; nothing to call."),ht(i,r,o.server);let c;try{c=await _n(o.server,r,n,a.dependencies,s)}catch(p){Vn(p instanceof Error?p.message:String(p))}let l=Ao(c,e.fn);if(!l){let p=[...Object.keys(c).filter(y=>typeof c[y]=="function"),...Object.keys(Eo)];Vn(`Function '${e.fn}' not found. Available: ${p.length?p.join(", "):"(none)"}.`)}let f=await bP(e);if(To(l)){try{for await(let p of l(...f))await yy(JSON.stringify(p,wy)+`
|
|
1993
1993
|
`)}catch(p){Vn(p instanceof Error?p.stack??p.message:String(p))}return gy(0)}let u;try{u=await l(...f)}catch(p){Vn(p instanceof Error?p.stack??p.message:String(p))}let d=SP(u);d!==void 0&&await yy(d+`
|
|
1994
1994
|
`),gy(0)}function gy(r){process.exitCode=r,setTimeout(()=>process.exit(r),2e3).unref?.()}async function bP(r){if(r.hasArgsFlag){let e=r.argsJson??"";return e==="-"&&(e=await kP()),vP(e)}return wP(r.positional)}function wP(r){return r.map(e=>{try{return JSON.parse(e)}catch{return e}})}function vP(r){let e;try{e=JSON.parse(r)}catch(t){throw new Error(`--args must be a JSON array: ${t instanceof Error?t.message:String(t)}`)}if(!Array.isArray(e))throw new Error(`--args must be a JSON array, got ${e===null?"null":typeof e}`);return e}function SP(r){if(r!==void 0)return JSON.stringify(r,wy,2)}function wy(r,e){return typeof e=="bigint"?e.toString():e}function Vn(r){process.stderr.write(r+`
|
|
1995
|
-
`),process.exit(1)}function xP(){let r=new yP(process.stderr,process.stderr);console.log=r.log.bind(r),console.info=r.info.bind(r),console.debug=r.debug.bind(r),console.dir=r.dir.bind(r)}function yy(r){return new Promise((e,t)=>{process.stdout.write(r,n=>n?t(n):e())})}async function kP(){let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf-8")}var tu="0.31.
|
|
1995
|
+
`),process.exit(1)}function xP(){let r=new yP(process.stderr,process.stderr);console.log=r.log.bind(r),console.info=r.info.bind(r),console.debug=r.debug.bind(r),console.dir=r.dir.bind(r)}function yy(r){return new Promise((e,t)=>{process.stdout.write(r,n=>n?t(n):e())})}async function kP(){let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf-8")}var tu="0.31.1";function vy(r,e){r||(console.error(`This bulb runs server-side Node code (server.ts), which --trust must authorize:
|
|
1996
1996
|
${e}`),process.exit(1))}async function EP(){let r=yu(process.argv.slice(2));if(r.version&&(console.log(`typebulb ${tu}`),process.exit(0)),r.help&&(bu(),process.exit(0)),Bg(),r.subcommand==="logs"){await Vg(r.file||void 0,{follow:r.follow,clear:r.clear,run:r.run,lines:r.lines});return}if(r.subcommand==="wait"){await Gg(r.file||void 0,{match:r.match,timeoutSec:r.timeoutSec});return}if(r.subcommand==="stop"){r.stopScope?await Xg(r.stopScope):await zg(r.file||void 0);return}if(r.subcommand==="send"){await Zg(r.file,r.sendMessage,r.sendWaitMs??0);return}if(r.subcommand==="skill"){await Hg(tu);return}if(r.subcommand==="models"){await Jg(r.mode);return}if(r.subcommand==="pull"){await Um(r.file||void 0,{force:r.force,mode:r.mode});return}if(r.subcommand==="push"){await Hm(r.file||void 0,{force:r.force,mode:r.mode});return}if(r.subcommand==="agent"){await(r.agentTarget?py(r):Ug(tu));return}if(r.subcommand==="trust"||r.subcommand==="untrust"){await Dg(r.file||void 0,r.subcommand==="trust");return}let e;if(!r.file||r.file==="."){let c=await um(process.cwd());c||(console.error("No .bulb.md file found in current directory"),process.exit(1)),e=c}else e=Vt.resolve(r.file);await Sy.access(e).then(()=>!0,()=>!1)||(Rr().includes(r.file)&&(console.error(`To open the ${r.file} agent mirror, run: npx typebulb agent:${r.file}`),process.exit(1)),console.error(`File not found: ${e}`),process.exit(1)),e.endsWith(".bulb.md")||(console.error("File must have .bulb.md extension"),process.exit(1));let n=r.file&&r.file!=="."?r.file:Vt.relative(process.cwd(),e)||Vt.basename(e),s=`npx typebulb --trust ${n.includes(" ")?`"${n}"`:n}`;if(r.subcommand==="predict"){await Mg(e,s);return}let i=!r.noTrust&&Bt(e);i&&!r.trust&&console.error("trust: granted from memory (run `typebulb untrust` to revoke)"),r.trust=r.noTrust?!1:r.trust||i;let o;try{o=await ke(e)}catch{}let a;if(r.local){o&&!(r.local.name in(o.config.dependencies??{}))&&(console.error(`--replace: '${r.local.name}' is not a dependency in this bulb's config.json; nothing to replace.`),process.exit(1)),o&&r.subcommand!=="call"&&(!o.bulb.code||r.server)&&console.warn("warning: --replace has no effect in server mode (the override is client-only).");try{a=await mu(r.local)}catch(c){console.error(c instanceof Error?c.message:String(c)),process.exit(1)}console.error(`replace: ${a.name} \u2192 ${Vt.relative(process.cwd(),a.dir)||"."}`)}if(r.subcommand==="check"){await Lg(e,a);return}if(r.subcommand==="call"){vy(r.trust,s),await by(e,{fn:r.fn,positional:r.callArgs,argsJson:r.argsJson,hasArgsFlag:r.hasArgsFlag},r.mode,a,r.dir);return}if(o&&o.bulb.server&&(Xs(o.bulb)||r.server)){vy(r.trust,s),await hy(e,r.watch,r.mode,a,r.dir);return}await ly(e,r,s,a)}EP().catch(r=>{console.error("Error:",r.message),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "typebulb",
|
|
3
|
-
"version": "0.31.
|
|
4
|
-
"description": "Typebulb CLI to run single-file markdown apps called bulbs, either as standalone web apps or embedded in agent responses.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/typebulb/typebulb.git"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://typebulb.com",
|
|
11
|
-
"engines": {
|
|
12
|
-
"node": ">=18"
|
|
13
|
-
},
|
|
14
|
-
"type": "module",
|
|
15
|
-
"bin": {
|
|
16
|
-
"typebulb": "./dist/index.js"
|
|
17
|
-
},
|
|
18
|
-
"exports": {
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./dist/render.d.ts",
|
|
21
|
-
"browser": "./dist/render.js",
|
|
22
|
-
"import": "./dist/render.js",
|
|
23
|
-
"default": "./dist/render.js"
|
|
24
|
-
},
|
|
25
|
-
"./servers": {
|
|
26
|
-
"types": "./dist/servers.d.ts",
|
|
27
|
-
"node": "./dist/servers.js",
|
|
28
|
-
"import": "./dist/servers.js",
|
|
29
|
-
"default": "./dist/servers.js"
|
|
30
|
-
},
|
|
31
|
-
"./ai": {
|
|
32
|
-
"types": "./dist/ai/index.d.ts",
|
|
33
|
-
"default": "./dist/ai/index.js"
|
|
34
|
-
},
|
|
35
|
-
"./format": {
|
|
36
|
-
"types": "./dist/format/index.d.ts",
|
|
37
|
-
"default": "./dist/format/index.js"
|
|
38
|
-
},
|
|
39
|
-
"./resolver": {
|
|
40
|
-
"types": "./dist/resolver/index.d.ts",
|
|
41
|
-
"default": "./dist/resolver/index.js"
|
|
42
|
-
},
|
|
43
|
-
"./dts": {
|
|
44
|
-
"types": "./dist/dts/index.d.ts",
|
|
45
|
-
"default": "./dist/dts/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./lint": {
|
|
48
|
-
"types": "./dist/lint/index.d.ts",
|
|
49
|
-
"default": "./dist/lint/index.js"
|
|
50
|
-
},
|
|
51
|
-
"./transpile": {
|
|
52
|
-
"types": "./dist/transpile/index.d.ts",
|
|
53
|
-
"default": "./dist/transpile/index.js"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"files": [
|
|
57
|
-
"dist",
|
|
58
|
-
"description.md"
|
|
59
|
-
],
|
|
60
|
-
"scripts": {
|
|
61
|
-
"typecheck": "tsc --build",
|
|
62
|
-
"test": "vitest run",
|
|
63
|
-
"test:browser": "vitest run --config vitest.browser.config.ts",
|
|
64
|
-
"build": "tsc --build && node esbuild.config.mjs",
|
|
65
|
-
"clean": "rimraf dist cli/.tsbuild",
|
|
66
|
-
"dev": "tsc --build && node dist/index.js",
|
|
67
|
-
"prepublishOnly": "rimraf dist && tsc --build && node esbuild.config.mjs"
|
|
68
|
-
},
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"@hono/node-server": "^1.14.1",
|
|
71
|
-
"chokidar": "^4.0.3",
|
|
72
|
-
"es-module-lexer": "^1.7.0",
|
|
73
|
-
"fflate": "^0.8.2",
|
|
74
|
-
"hono": "^4.7.5",
|
|
75
|
-
"lru-cache": "^11.2.2",
|
|
76
|
-
"open": "^10.1.0",
|
|
77
|
-
"p-limit": "^7.2.0",
|
|
78
|
-
"resolve.exports": "^2.0.3",
|
|
79
|
-
"semver": "^7.7.3",
|
|
80
|
-
"sucrase": "^3.35.0",
|
|
81
|
-
"xml-utils": "1.10.2",
|
|
82
|
-
"yaml": "^2.8.2"
|
|
83
|
-
},
|
|
84
|
-
"devDependencies": {
|
|
85
|
-
"@types/katex": "^0.16.7",
|
|
86
|
-
"@types/markdown-it": "^14.1.2",
|
|
87
|
-
"@types/node": "^22.15.21",
|
|
88
|
-
"@types/semver": "^7.7.0",
|
|
89
|
-
"beautiful-mermaid": "^1.1.3",
|
|
90
|
-
"domeleon": "^0.6.
|
|
91
|
-
"dompurify": "^3.2.6",
|
|
92
|
-
"esbuild": "^0.27.3",
|
|
93
|
-
"highlight.js": "^11.10.0",
|
|
94
|
-
"katex": "^0.16.22",
|
|
95
|
-
"markdown-it": "^14.1.0",
|
|
96
|
-
"matchu-patchu": "^0.3.1",
|
|
97
|
-
"playwright": "^1.60.0",
|
|
98
|
-
"rimraf": "^6.0.1",
|
|
99
|
-
"typebox": "^1.3.4",
|
|
100
|
-
"vitest": "^2.1.9"
|
|
101
|
-
},
|
|
102
|
-
"pnpm": {
|
|
103
|
-
"onlyBuiltDependencies": [
|
|
104
|
-
"esbuild"
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "typebulb",
|
|
3
|
+
"version": "0.31.1",
|
|
4
|
+
"description": "Typebulb CLI to run single-file markdown apps called bulbs, either as standalone web apps or embedded in agent responses.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/typebulb/typebulb.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://typebulb.com",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"bin": {
|
|
16
|
+
"typebulb": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/render.d.ts",
|
|
21
|
+
"browser": "./dist/render.js",
|
|
22
|
+
"import": "./dist/render.js",
|
|
23
|
+
"default": "./dist/render.js"
|
|
24
|
+
},
|
|
25
|
+
"./servers": {
|
|
26
|
+
"types": "./dist/servers.d.ts",
|
|
27
|
+
"node": "./dist/servers.js",
|
|
28
|
+
"import": "./dist/servers.js",
|
|
29
|
+
"default": "./dist/servers.js"
|
|
30
|
+
},
|
|
31
|
+
"./ai": {
|
|
32
|
+
"types": "./dist/ai/index.d.ts",
|
|
33
|
+
"default": "./dist/ai/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./format": {
|
|
36
|
+
"types": "./dist/format/index.d.ts",
|
|
37
|
+
"default": "./dist/format/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./resolver": {
|
|
40
|
+
"types": "./dist/resolver/index.d.ts",
|
|
41
|
+
"default": "./dist/resolver/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./dts": {
|
|
44
|
+
"types": "./dist/dts/index.d.ts",
|
|
45
|
+
"default": "./dist/dts/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./lint": {
|
|
48
|
+
"types": "./dist/lint/index.d.ts",
|
|
49
|
+
"default": "./dist/lint/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./transpile": {
|
|
52
|
+
"types": "./dist/transpile/index.d.ts",
|
|
53
|
+
"default": "./dist/transpile/index.js"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"dist",
|
|
58
|
+
"description.md"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"typecheck": "tsc --build",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"test:browser": "vitest run --config vitest.browser.config.ts",
|
|
64
|
+
"build": "tsc --build && node esbuild.config.mjs",
|
|
65
|
+
"clean": "rimraf dist cli/.tsbuild",
|
|
66
|
+
"dev": "tsc --build && node dist/index.js",
|
|
67
|
+
"prepublishOnly": "rimraf dist && tsc --build && node esbuild.config.mjs"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@hono/node-server": "^1.14.1",
|
|
71
|
+
"chokidar": "^4.0.3",
|
|
72
|
+
"es-module-lexer": "^1.7.0",
|
|
73
|
+
"fflate": "^0.8.2",
|
|
74
|
+
"hono": "^4.7.5",
|
|
75
|
+
"lru-cache": "^11.2.2",
|
|
76
|
+
"open": "^10.1.0",
|
|
77
|
+
"p-limit": "^7.2.0",
|
|
78
|
+
"resolve.exports": "^2.0.3",
|
|
79
|
+
"semver": "^7.7.3",
|
|
80
|
+
"sucrase": "^3.35.0",
|
|
81
|
+
"xml-utils": "1.10.2",
|
|
82
|
+
"yaml": "^2.8.2"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@types/katex": "^0.16.7",
|
|
86
|
+
"@types/markdown-it": "^14.1.2",
|
|
87
|
+
"@types/node": "^22.15.21",
|
|
88
|
+
"@types/semver": "^7.7.0",
|
|
89
|
+
"beautiful-mermaid": "^1.1.3",
|
|
90
|
+
"domeleon": "^0.6.2",
|
|
91
|
+
"dompurify": "^3.2.6",
|
|
92
|
+
"esbuild": "^0.27.3",
|
|
93
|
+
"highlight.js": "^11.10.0",
|
|
94
|
+
"katex": "^0.16.22",
|
|
95
|
+
"markdown-it": "^14.1.0",
|
|
96
|
+
"matchu-patchu": "^0.3.1",
|
|
97
|
+
"playwright": "^1.60.0",
|
|
98
|
+
"rimraf": "^6.0.1",
|
|
99
|
+
"typebox": "^1.3.4",
|
|
100
|
+
"vitest": "^2.1.9"
|
|
101
|
+
},
|
|
102
|
+
"pnpm": {
|
|
103
|
+
"onlyBuiltDependencies": [
|
|
104
|
+
"esbuild"
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
}
|