@fs/mycroft 0.2.0 → 0.4.0
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 +23 -0
- package/completions/mycroft.bash +11 -1
- package/completions/mycroft.fish +15 -2
- package/completions/mycroft.zsh +14 -1
- package/dist/batch-embedder-6IIWAZPW.js +14 -0
- package/dist/batch-embedder-6IIWAZPW.js.map +1 -0
- package/dist/batch-embedder-7DGZAQKL.js +14 -0
- package/dist/batch-embedder-7DGZAQKL.js.map +1 -0
- package/dist/batch-embedder-C2E6OHBQ.js +14 -0
- package/dist/batch-embedder-C2E6OHBQ.js.map +1 -0
- package/dist/batch-embedder-IZDBS3IL.js +13 -0
- package/dist/batch-embedder-IZDBS3IL.js.map +1 -0
- package/dist/batch-embedder-LYCZDYI4.js +15 -0
- package/dist/batch-embedder-LYCZDYI4.js.map +1 -0
- package/dist/batch-embedder-RHKD2OJD.js +14 -0
- package/dist/batch-embedder-RHKD2OJD.js.map +1 -0
- package/dist/batch-embedder-VQZUI7R6.js +14 -0
- package/dist/batch-embedder-VQZUI7R6.js.map +1 -0
- package/dist/batch-embedder-ZJZLNLOK.js +14 -0
- package/dist/batch-embedder-ZJZLNLOK.js.map +1 -0
- package/dist/batch-summarizer-7MCT4HJB.js +14 -0
- package/dist/batch-summarizer-7MCT4HJB.js.map +1 -0
- package/dist/batch-summarizer-BMIBVFAE.js +14 -0
- package/dist/batch-summarizer-BMIBVFAE.js.map +1 -0
- package/dist/batch-summarizer-CM3NO7TK.js +14 -0
- package/dist/batch-summarizer-CM3NO7TK.js.map +1 -0
- package/dist/chunk-35EO53CC.js +8058 -0
- package/dist/chunk-35EO53CC.js.map +1 -0
- package/dist/chunk-57ZGGKEF.js +8060 -0
- package/dist/chunk-57ZGGKEF.js.map +1 -0
- package/dist/chunk-6DLQHHCC.js +249 -0
- package/dist/chunk-6DLQHHCC.js.map +1 -0
- package/dist/chunk-7CO4PMU5.js +92 -0
- package/dist/chunk-7CO4PMU5.js.map +1 -0
- package/dist/chunk-7DUQNGEK.js +253 -0
- package/dist/chunk-7DUQNGEK.js.map +1 -0
- package/dist/chunk-7IPX4MKA.js +4637 -0
- package/dist/chunk-7IPX4MKA.js.map +1 -0
- package/dist/chunk-7NLMBXXY.js +6438 -0
- package/dist/chunk-7NLMBXXY.js.map +1 -0
- package/dist/chunk-BR2PM6D3.js +11047 -0
- package/dist/chunk-BR2PM6D3.js.map +1 -0
- package/dist/chunk-KGG7WEYE.js +162 -0
- package/dist/chunk-KGG7WEYE.js.map +1 -0
- package/dist/chunk-LV52FEMB.js +169 -0
- package/dist/chunk-LV52FEMB.js.map +1 -0
- package/dist/chunk-QRDUQX63.js +256 -0
- package/dist/chunk-QRDUQX63.js.map +1 -0
- package/dist/chunk-R3FOJK5A.js +2088 -0
- package/dist/chunk-R3FOJK5A.js.map +1 -0
- package/dist/chunk-T6X7DRBN.js +275 -0
- package/dist/chunk-T6X7DRBN.js.map +1 -0
- package/dist/chunk-VBEGUDHG.js +103 -0
- package/dist/chunk-VBEGUDHG.js.map +1 -0
- package/dist/chunk-XXO66RCF.js +94 -0
- package/dist/chunk-XXO66RCF.js.map +1 -0
- package/dist/cli.js +769 -317
- package/dist/cli.js.map +1 -1
- package/dist/fileFromPath-FLANAQWT.js +128 -0
- package/dist/fileFromPath-FLANAQWT.js.map +1 -0
- package/dist/main-36PRDAPE.js +1857 -0
- package/dist/main-36PRDAPE.js.map +1 -0
- package/dist/main-B3QJZGLU.js +1859 -0
- package/dist/main-B3QJZGLU.js.map +1 -0
- package/package.json +14 -2
package/README.md
CHANGED
|
@@ -21,6 +21,11 @@ Run `mycroft config onboard` first to set everything up, then use the book and c
|
|
|
21
21
|
```bash
|
|
22
22
|
mycroft book list
|
|
23
23
|
mycroft book ingest /path/to/book.epub
|
|
24
|
+
mycroft book ingest /path/to/book.epub --summary
|
|
25
|
+
mycroft book ingest /path/to/book.epub --batch
|
|
26
|
+
mycroft book ingest /path/to/book.epub --batch --summary
|
|
27
|
+
mycroft book ingest status <id>
|
|
28
|
+
mycroft book ingest resume <id>
|
|
24
29
|
mycroft book ask <id> "What is the main conflict?"
|
|
25
30
|
mycroft chat start <id>
|
|
26
31
|
mycroft chat ask <session> "What does this foreshadow?"
|
|
@@ -30,6 +35,23 @@ mycroft config resolve
|
|
|
30
35
|
mycroft config onboard
|
|
31
36
|
```
|
|
32
37
|
|
|
38
|
+
## Cost estimates (approximate)
|
|
39
|
+
|
|
40
|
+
These are rough, model-dependent estimates for embeddings + optional summaries. Costs vary by model pricing and book structure. Use this as a directional guide only. Summarization estimates assume `gpt-5-nano` and embeddings assume `text-embedding-3-small`.
|
|
41
|
+
|
|
42
|
+
| Book size | Example | No summaries | With summaries | With summaries (batched) |
|
|
43
|
+
| --- | --- | --- | --- | --- |
|
|
44
|
+
| Small | 200-300 pages | ~$0.002-$0.004 | ~$0.04-$0.08 | ~$0.02-$0.04 |
|
|
45
|
+
| Average novel | 350-450 pages | ~$0.004-$0.006 | ~$0.08-$0.15 | ~$0.04-$0.08 |
|
|
46
|
+
| Large novel | 600-800 pages | ~$0.007-$0.01 | ~$0.15-$0.25 | ~$0.08-$0.13 |
|
|
47
|
+
| Trilogy | 1,500-2,000 pages | ~$0.02-$0.03 | ~$0.30-$0.60 | ~$0.15-$0.30 |
|
|
48
|
+
|
|
49
|
+
Reference point: a ~700 page book (~1,600 chunks) is about ~$0.008 for embeddings only, ~$0.20 with summaries, or ~$0.10 with summaries batched.
|
|
50
|
+
|
|
51
|
+
Use `--summary` to generate per-chapter summaries during ingestion. Summaries improve retrieval quality but are significantly more expensive than embeddings alone (see cost table above). Without `--summary`, ingestion only generates embeddings, which is fast and cheap.
|
|
52
|
+
|
|
53
|
+
Use `--batch` to cut costs by 50% via the OpenAI Batch API. This applies to both embeddings and summaries. Batch jobs may take up to 24 hours to complete. When using `--batch`, the command returns immediately after submitting the job. When combined with `--summary`, the summary batch runs first; once complete, run `resume` to submit the embedding batch. Use `mycroft book ingest status <id>` to check progress, and `mycroft book ingest resume <id>` to advance to the next phase. If a non-batch ingest is interrupted, use the same resume command to continue without re-embedding completed chunks.
|
|
54
|
+
|
|
33
55
|
## Local dev
|
|
34
56
|
|
|
35
57
|
```bash
|
|
@@ -74,5 +96,6 @@ CLI overrides:
|
|
|
74
96
|
- `--max-chapter <n>`
|
|
75
97
|
- `--top-k <n>`
|
|
76
98
|
- `--manual` (interactive chapter selection)
|
|
99
|
+
- `--batch`
|
|
77
100
|
- `--summary`
|
|
78
101
|
- `--force`
|
package/completions/mycroft.bash
CHANGED
|
@@ -6,6 +6,7 @@ _mycroft() {
|
|
|
6
6
|
local top_commands="book config chat"
|
|
7
7
|
local global_flags="--help --version --data-dir"
|
|
8
8
|
local book_commands="ingest list show ask search delete"
|
|
9
|
+
local ingest_commands="status resume"
|
|
9
10
|
local config_commands="path init resolve onboard"
|
|
10
11
|
local chat_commands="start ask list show repl"
|
|
11
12
|
|
|
@@ -22,7 +23,16 @@ _mycroft() {
|
|
|
22
23
|
fi
|
|
23
24
|
case "${COMP_WORDS[2]}" in
|
|
24
25
|
ingest)
|
|
25
|
-
|
|
26
|
+
if [[ ${COMP_CWORD} -eq 3 ]]; then
|
|
27
|
+
COMPREPLY=( $(compgen -W "${ingest_commands} --manual --summary --batch" -f -- "${cur}") )
|
|
28
|
+
return 0
|
|
29
|
+
fi
|
|
30
|
+
case "${COMP_WORDS[3]}" in
|
|
31
|
+
status|resume)
|
|
32
|
+
return 0
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
COMPREPLY=( $(compgen -W "--manual --summary --batch" -- "${cur}") )
|
|
26
36
|
return 0
|
|
27
37
|
;;
|
|
28
38
|
ask|search)
|
package/completions/mycroft.fish
CHANGED
|
@@ -15,6 +15,16 @@ function __mycroft_using_command
|
|
|
15
15
|
return 1
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
function __mycroft_using_subcommand
|
|
19
|
+
set -l cmd (commandline -opc)
|
|
20
|
+
set -l sub $argv[1]
|
|
21
|
+
set -l subsub $argv[2]
|
|
22
|
+
if test (count $cmd) -ge 3; and test $cmd[2] = $sub; and test $cmd[3] = $subsub
|
|
23
|
+
return 0
|
|
24
|
+
end
|
|
25
|
+
return 1
|
|
26
|
+
end
|
|
27
|
+
|
|
18
28
|
complete -c mycroft -n '__mycroft_needs_command' -a 'book' -d 'Manage books and queries'
|
|
19
29
|
complete -c mycroft -n '__mycroft_needs_command' -a 'config' -d 'Manage configuration'
|
|
20
30
|
complete -c mycroft -n '__mycroft_needs_command' -a 'chat' -d 'Run multi-turn chat sessions'
|
|
@@ -29,8 +39,11 @@ complete -c mycroft -n '__mycroft_using_command book' -a 'ask' -d 'Ask a questio
|
|
|
29
39
|
complete -c mycroft -n '__mycroft_using_command book' -a 'search' -d 'Vector search without LLM'
|
|
30
40
|
complete -c mycroft -n '__mycroft_using_command book' -a 'delete' -d 'Remove book, EPUB, and vectors'
|
|
31
41
|
|
|
32
|
-
complete -c mycroft -n '
|
|
33
|
-
complete -c mycroft -n '
|
|
42
|
+
complete -c mycroft -n '__mycroft_using_subcommand book ingest' -a 'status' -d 'Check ingestion status'
|
|
43
|
+
complete -c mycroft -n '__mycroft_using_subcommand book ingest' -a 'resume' -d 'Resume a pending ingestion'
|
|
44
|
+
complete -c mycroft -n '__mycroft_using_subcommand book ingest' -l manual -d 'Interactive chapter selection'
|
|
45
|
+
complete -c mycroft -n '__mycroft_using_subcommand book ingest' -l summary -d 'Enable AI chapter summaries'
|
|
46
|
+
complete -c mycroft -n '__mycroft_using_subcommand book ingest' -l batch -d 'Use OpenAI Batch API'
|
|
34
47
|
complete -c mycroft -n '__mycroft_using_command book; and __fish_seen_subcommand_from ask search' -l top-k -r -d 'Number of passages to retrieve'
|
|
35
48
|
complete -c mycroft -n '__mycroft_using_command book; and __fish_seen_subcommand_from ask search' -l max-chapter -r -d 'Spoiler-free limit'
|
|
36
49
|
complete -c mycroft -n '__mycroft_using_command book; and __fish_seen_subcommand_from delete' -l force -d 'Skip confirmation'
|
package/completions/mycroft.zsh
CHANGED
|
@@ -7,6 +7,9 @@ _mycroft() {
|
|
|
7
7
|
local -a book_commands
|
|
8
8
|
book_commands=(ingest list show ask search delete)
|
|
9
9
|
|
|
10
|
+
local -a ingest_commands
|
|
11
|
+
ingest_commands=(status resume)
|
|
12
|
+
|
|
10
13
|
local -a config_commands
|
|
11
14
|
config_commands=(path init resolve onboard)
|
|
12
15
|
|
|
@@ -31,7 +34,17 @@ _mycroft() {
|
|
|
31
34
|
fi
|
|
32
35
|
case ${words[3]} in
|
|
33
36
|
ingest)
|
|
34
|
-
|
|
37
|
+
if (( CURRENT == 4 )); then
|
|
38
|
+
_describe -t commands "ingest commands" ingest_commands
|
|
39
|
+
_arguments "--manual[Interactive chapter selection]" "--summary[Enable AI chapter summaries]" "--batch[Use OpenAI Batch API]" '*:epub file:_files -g "*.epub"'
|
|
40
|
+
return
|
|
41
|
+
fi
|
|
42
|
+
case ${words[4]} in
|
|
43
|
+
status|resume)
|
|
44
|
+
return
|
|
45
|
+
;;
|
|
46
|
+
esac
|
|
47
|
+
_arguments "--manual[Interactive chapter selection]" "--summary[Enable AI chapter summaries]" "--batch[Use OpenAI Batch API]"
|
|
35
48
|
return
|
|
36
49
|
;;
|
|
37
50
|
ask|search)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-BR2PM6D3.js";
|
|
7
|
+
import "./chunk-R3FOJK5A.js";
|
|
8
|
+
export {
|
|
9
|
+
checkBatchStatus,
|
|
10
|
+
cleanupBatchFiles,
|
|
11
|
+
downloadBatchResults,
|
|
12
|
+
submitBatchEmbeddings
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-embedder-6IIWAZPW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-7CO4PMU5.js";
|
|
7
|
+
import "./chunk-KGG7WEYE.js";
|
|
8
|
+
export {
|
|
9
|
+
checkBatchStatus,
|
|
10
|
+
cleanupBatchFiles,
|
|
11
|
+
downloadBatchResults,
|
|
12
|
+
submitBatchEmbeddings
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-embedder-7DGZAQKL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-VBEGUDHG.js";
|
|
7
|
+
import "./chunk-LV52FEMB.js";
|
|
8
|
+
export {
|
|
9
|
+
checkBatchStatus,
|
|
10
|
+
cleanupBatchFiles,
|
|
11
|
+
downloadBatchResults,
|
|
12
|
+
submitBatchEmbeddings
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-embedder-C2E6OHBQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-6DLQHHCC.js";
|
|
7
|
+
export {
|
|
8
|
+
checkBatchStatus,
|
|
9
|
+
cleanupBatchFiles,
|
|
10
|
+
downloadBatchResults,
|
|
11
|
+
submitBatchEmbeddings
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=batch-embedder-IZDBS3IL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-7NLMBXXY.js";
|
|
7
|
+
import "./chunk-7IPX4MKA.js";
|
|
8
|
+
import "./chunk-R3FOJK5A.js";
|
|
9
|
+
export {
|
|
10
|
+
checkBatchStatus,
|
|
11
|
+
cleanupBatchFiles,
|
|
12
|
+
downloadBatchResults,
|
|
13
|
+
submitBatchEmbeddings
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=batch-embedder-LYCZDYI4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-57ZGGKEF.js";
|
|
7
|
+
import "./chunk-R3FOJK5A.js";
|
|
8
|
+
export {
|
|
9
|
+
checkBatchStatus,
|
|
10
|
+
cleanupBatchFiles,
|
|
11
|
+
downloadBatchResults,
|
|
12
|
+
submitBatchEmbeddings
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-embedder-RHKD2OJD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-35EO53CC.js";
|
|
7
|
+
import "./chunk-R3FOJK5A.js";
|
|
8
|
+
export {
|
|
9
|
+
checkBatchStatus,
|
|
10
|
+
cleanupBatchFiles,
|
|
11
|
+
downloadBatchResults,
|
|
12
|
+
submitBatchEmbeddings
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-embedder-VQZUI7R6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkBatchStatus,
|
|
3
|
+
cleanupBatchFiles,
|
|
4
|
+
downloadBatchResults,
|
|
5
|
+
submitBatchEmbeddings
|
|
6
|
+
} from "./chunk-XXO66RCF.js";
|
|
7
|
+
import "./chunk-KGG7WEYE.js";
|
|
8
|
+
export {
|
|
9
|
+
checkBatchStatus,
|
|
10
|
+
cleanupBatchFiles,
|
|
11
|
+
downloadBatchResults,
|
|
12
|
+
submitBatchEmbeddings
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-embedder-ZJZLNLOK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
downloadBatchSummaryResults,
|
|
3
|
+
downloadMergeResults,
|
|
4
|
+
submitBatchSummaries,
|
|
5
|
+
submitMergePass
|
|
6
|
+
} from "./chunk-QRDUQX63.js";
|
|
7
|
+
import "./chunk-KGG7WEYE.js";
|
|
8
|
+
export {
|
|
9
|
+
downloadBatchSummaryResults,
|
|
10
|
+
downloadMergeResults,
|
|
11
|
+
submitBatchSummaries,
|
|
12
|
+
submitMergePass
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-summarizer-7MCT4HJB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
downloadBatchSummaryResults,
|
|
3
|
+
downloadMergeResults,
|
|
4
|
+
submitBatchSummaries,
|
|
5
|
+
submitMergePass
|
|
6
|
+
} from "./chunk-7DUQNGEK.js";
|
|
7
|
+
import "./chunk-KGG7WEYE.js";
|
|
8
|
+
export {
|
|
9
|
+
downloadBatchSummaryResults,
|
|
10
|
+
downloadMergeResults,
|
|
11
|
+
submitBatchSummaries,
|
|
12
|
+
submitMergePass
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-summarizer-BMIBVFAE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
downloadBatchSummaryResults,
|
|
3
|
+
downloadMergeResults,
|
|
4
|
+
submitBatchSummaries,
|
|
5
|
+
submitMergePass
|
|
6
|
+
} from "./chunk-T6X7DRBN.js";
|
|
7
|
+
import "./chunk-LV52FEMB.js";
|
|
8
|
+
export {
|
|
9
|
+
downloadBatchSummaryResults,
|
|
10
|
+
downloadMergeResults,
|
|
11
|
+
submitBatchSummaries,
|
|
12
|
+
submitMergePass
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=batch-summarizer-CM3NO7TK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|