btca 0.1.0 → 0.1.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 +40 -0
- package/dist/btca-darwin-arm64 +0 -0
- package/dist/btca-darwin-x64 +0 -0
- package/dist/btca-linux-arm64 +0 -0
- package/dist/btca-linux-x64 +0 -0
- package/dist/index.js +14 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# The Better Context App
|
|
2
2
|
|
|
3
|
+
```
|
|
4
|
+
bun add -g btca@latest
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
btca ask -t svelte -q "How does the inspect rune work?"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**out of the box this uses grok code from open code because it's free, but if you have opencode installed you can customize the model and provider in the config file at ~/.config/btca/btca.json**
|
|
12
|
+
|
|
13
|
+
I recommend haiku 4.5...
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"promptsDirectory": "~/.config/btca/prompts",
|
|
18
|
+
"reposDirectory": "~/.config/btca/repos",
|
|
19
|
+
"port": 3420,
|
|
20
|
+
"maxInstances": 5,
|
|
21
|
+
"repos": [
|
|
22
|
+
{
|
|
23
|
+
"name": "svelte",
|
|
24
|
+
"url": "https://github.com/sveltejs/svelte.dev",
|
|
25
|
+
"branch": "main"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "effect",
|
|
29
|
+
"url": "https://github.com/Effect-TS/effect",
|
|
30
|
+
"branch": "main"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "nextjs",
|
|
34
|
+
"url": "https://github.com/vercel/next.js",
|
|
35
|
+
"branch": "canary"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"model": "claude-haiku-4-5",
|
|
39
|
+
"provider": "anthropic"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
3
43
|
This is an evolution of: https://github.com/bmdavis419/opencode-hosted-docs-nonsense. Eventually I want to have this be the easiest way to pass in a piece of tech (ie. Svelte) and a question (ie. "How do remote functions work?") and get an up to date answer based on the latest version of the tech using the latest version of the docs/source code...
|
|
4
44
|
|
|
5
45
|
**_this is all scratch work right now, I'll remove this once it's more ready to go_**
|
package/dist/btca-darwin-arm64
CHANGED
|
Binary file
|
package/dist/btca-darwin-x64
CHANGED
|
Binary file
|
package/dist/btca-linux-arm64
CHANGED
|
Binary file
|
package/dist/btca-linux-x64
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -60283,7 +60283,6 @@ var techOption = exports_Options.text("tech").pipe(exports_Options.withAlias("t"
|
|
|
60283
60283
|
var askCommand = exports_Command.make("ask", { question: questionOption, tech: techOption }, ({ question, tech }) => exports_Effect.gen(function* () {
|
|
60284
60284
|
const oc = yield* OcService;
|
|
60285
60285
|
const eventStream = yield* oc.askQuestion({ tech, question });
|
|
60286
|
-
const displayMessages = [];
|
|
60287
60286
|
let currentMessageId = null;
|
|
60288
60287
|
yield* eventStream.pipe(exports_Stream.runForEach((event) => exports_Effect.sync(() => {
|
|
60289
60288
|
switch (event.type) {
|
|
@@ -60305,8 +60304,6 @@ var askCommand = exports_Command.make("ask", { question: questionOption, tech: t
|
|
|
60305
60304
|
})));
|
|
60306
60305
|
console.log(`
|
|
60307
60306
|
`);
|
|
60308
|
-
displayMessages.forEach((m) => console.log(m.text, `
|
|
60309
|
-
`, m.id));
|
|
60310
60307
|
}).pipe(exports_Effect.provide(programLayer)));
|
|
60311
60308
|
var openCommand = exports_Command.make("open", {}, () => exports_Effect.gen(function* () {
|
|
60312
60309
|
const oc = yield* OcService;
|
|
@@ -60326,12 +60323,21 @@ var serveCommand = exports_Command.make("serve", { port: portOption }, ({ port:
|
|
|
60326
60323
|
question: body.question
|
|
60327
60324
|
});
|
|
60328
60325
|
const chunks3 = [];
|
|
60326
|
+
let currentMessageId = null;
|
|
60329
60327
|
yield* eventStream.pipe(exports_Stream.runForEach((event) => exports_Effect.sync(() => {
|
|
60330
|
-
|
|
60331
|
-
|
|
60332
|
-
|
|
60333
|
-
|
|
60334
|
-
|
|
60328
|
+
switch (event.type) {
|
|
60329
|
+
case "message.part.updated":
|
|
60330
|
+
if (event.properties.part.type === "text") {
|
|
60331
|
+
if (currentMessageId === event.properties.part.messageID) {
|
|
60332
|
+
chunks3[chunks3.length - 1] += event.properties.delta ?? "";
|
|
60333
|
+
} else {
|
|
60334
|
+
currentMessageId = event.properties.part.messageID;
|
|
60335
|
+
chunks3.push(event.properties.part.text ?? "");
|
|
60336
|
+
}
|
|
60337
|
+
}
|
|
60338
|
+
break;
|
|
60339
|
+
default:
|
|
60340
|
+
break;
|
|
60335
60341
|
}
|
|
60336
60342
|
})));
|
|
60337
60343
|
return yield* exports_HttpServerResponse.json({ answer: chunks3.join("") });
|