jevctl 0.1.0 → 0.2.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/NOTICE +4 -0
  3. package/README.md +54 -388
  4. package/SECURITY.md +5 -3
  5. package/dist/cli.js +105 -16
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/ask.d.ts +5 -1
  8. package/dist/commands/ask.js +27 -10
  9. package/dist/commands/ask.js.map +1 -1
  10. package/dist/commands/auth.d.ts +14 -0
  11. package/dist/commands/auth.js +134 -0
  12. package/dist/commands/auth.js.map +1 -0
  13. package/dist/commands/batch.d.ts +28 -0
  14. package/dist/commands/batch.js +221 -0
  15. package/dist/commands/batch.js.map +1 -0
  16. package/dist/commands/classify.d.ts +34 -0
  17. package/dist/commands/classify.js +187 -0
  18. package/dist/commands/classify.js.map +1 -0
  19. package/dist/commands/compact.d.ts +29 -0
  20. package/dist/commands/compact.js +146 -0
  21. package/dist/commands/compact.js.map +1 -0
  22. package/dist/commands/config.d.ts +2 -1
  23. package/dist/commands/config.js +27 -10
  24. package/dist/commands/config.js.map +1 -1
  25. package/dist/commands/extract.d.ts +18 -0
  26. package/dist/commands/extract.js +108 -0
  27. package/dist/commands/extract.js.map +1 -0
  28. package/dist/commands/find.d.ts +5 -1
  29. package/dist/commands/find.js +30 -15
  30. package/dist/commands/find.js.map +1 -1
  31. package/dist/commands/match.d.ts +18 -0
  32. package/dist/commands/match.js +118 -0
  33. package/dist/commands/match.js.map +1 -0
  34. package/dist/commands/models.js +12 -10
  35. package/dist/commands/models.js.map +1 -1
  36. package/dist/commands/rerank.d.ts +15 -0
  37. package/dist/commands/rerank.js +82 -0
  38. package/dist/commands/rerank.js.map +1 -0
  39. package/dist/commands/route.d.ts +19 -0
  40. package/dist/commands/route.js +120 -0
  41. package/dist/commands/route.js.map +1 -0
  42. package/dist/commands/screen.d.ts +5 -1
  43. package/dist/commands/screen.js +27 -10
  44. package/dist/commands/screen.js.map +1 -1
  45. package/dist/commands/verify.d.ts +5 -1
  46. package/dist/commands/verify.js +23 -12
  47. package/dist/commands/verify.js.map +1 -1
  48. package/dist/config.d.ts +66 -6
  49. package/dist/config.js +53 -2
  50. package/dist/config.js.map +1 -1
  51. package/dist/context.d.ts +4 -0
  52. package/dist/context.js +11 -5
  53. package/dist/context.js.map +1 -1
  54. package/dist/core/ask.js +8 -3
  55. package/dist/core/ask.js.map +1 -1
  56. package/dist/core/batch.d.ts +42 -0
  57. package/dist/core/batch.js +93 -0
  58. package/dist/core/batch.js.map +1 -0
  59. package/dist/core/classify.d.ts +103 -0
  60. package/dist/core/classify.js +216 -0
  61. package/dist/core/classify.js.map +1 -0
  62. package/dist/core/compact.d.ts +32 -0
  63. package/dist/core/compact.js +47 -0
  64. package/dist/core/compact.js.map +1 -0
  65. package/dist/core/extract.d.ts +58 -0
  66. package/dist/core/extract.js +214 -0
  67. package/dist/core/extract.js.map +1 -0
  68. package/dist/core/find.js +3 -0
  69. package/dist/core/find.js.map +1 -1
  70. package/dist/core/match.d.ts +55 -0
  71. package/dist/core/match.js +114 -0
  72. package/dist/core/match.js.map +1 -0
  73. package/dist/core/rerank.d.ts +47 -0
  74. package/dist/core/rerank.js +60 -0
  75. package/dist/core/rerank.js.map +1 -0
  76. package/dist/core/route.d.ts +74 -0
  77. package/dist/core/route.js +153 -0
  78. package/dist/core/route.js.map +1 -0
  79. package/dist/core/transcript.d.ts +15 -0
  80. package/dist/core/transcript.js +118 -0
  81. package/dist/core/transcript.js.map +1 -0
  82. package/dist/credentials.d.ts +30 -0
  83. package/dist/credentials.js +161 -0
  84. package/dist/credentials.js.map +1 -0
  85. package/dist/errors.js.map +1 -1
  86. package/dist/index.d.ts +10 -0
  87. package/dist/index.js +10 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/input.js +1 -1
  90. package/dist/input.js.map +1 -1
  91. package/dist/lib.d.ts +2 -0
  92. package/dist/lib.js +9 -0
  93. package/dist/lib.js.map +1 -1
  94. package/dist/output.d.ts +41 -3
  95. package/dist/output.js +131 -6
  96. package/dist/output.js.map +1 -1
  97. package/dist/provider.d.ts +8 -0
  98. package/dist/provider.js +44 -4
  99. package/dist/provider.js.map +1 -1
  100. package/dist/vendor/compaction/compact.d.ts +29 -0
  101. package/dist/vendor/compaction/compact.js +236 -0
  102. package/dist/vendor/compaction/compact.js.map +1 -0
  103. package/dist/vendor/compaction/index.d.ts +4 -0
  104. package/dist/vendor/compaction/index.js +8 -0
  105. package/dist/vendor/compaction/index.js.map +1 -0
  106. package/dist/vendor/compaction/request.d.ts +19 -0
  107. package/dist/vendor/compaction/request.js +53 -0
  108. package/dist/vendor/compaction/request.js.map +1 -0
  109. package/dist/vendor/compaction/state.d.ts +28 -0
  110. package/dist/vendor/compaction/state.js +258 -0
  111. package/dist/vendor/compaction/state.js.map +1 -0
  112. package/dist/vendor/compaction/types.d.ts +177 -0
  113. package/dist/vendor/compaction/types.js +4 -0
  114. package/dist/vendor/compaction/types.js.map +1 -0
  115. package/docs/ask.md +52 -0
  116. package/docs/auth.md +53 -0
  117. package/docs/batch.md +48 -0
  118. package/docs/classify.md +55 -0
  119. package/docs/compact.md +58 -0
  120. package/docs/config.md +81 -0
  121. package/docs/extract.md +59 -0
  122. package/docs/find.md +49 -0
  123. package/docs/guidelines.md +19 -0
  124. package/docs/library.md +41 -0
  125. package/docs/match.md +52 -0
  126. package/docs/output.md +65 -0
  127. package/docs/recipes.md +78 -0
  128. package/docs/rerank.md +44 -0
  129. package/docs/route.md +57 -0
  130. package/docs/screen.md +53 -0
  131. package/docs/troubleshooting.md +17 -0
  132. package/docs/verify.md +58 -0
  133. package/package.json +9 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/vendor/compaction/state.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F;AAY1F,MAAM,CAAC,MAAM,aAAa,GACxB,qbAAqb,CAAC;AA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AAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAE,CAAC;QAC9B,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU;YAAE,SAAS;QAChD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,IAAI,EAAE,EAAE,CAAC;YACX,OAAO,MAAM,CACX,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,MAAM,EACN,uBAAuB,CACxB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,GAAG,aAAa,CACrB,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EACtC,MAAM,CACP,CAAC;IACF,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACpC,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9D,IAAI,IAAI,EAAE;QAAE,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAE/D,MAAM,IAAI,KAAK,CACb,+BAA+B,MAAM,mCAAmC,OAAO,CAAC,cAAc,GAAG,CAClG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,177 @@
1
+ export type Role = 'user' | 'assistant';
2
+ /**
3
+ * A tool_use block of an assistant message. `text` and `isError` mirror the
4
+ * outcome once the transcript holds it (Claude Code attaches them).
5
+ */
6
+ export interface ToolUse {
7
+ tool_use_id: string;
8
+ tool: string;
9
+ input: Record<string, unknown>;
10
+ text?: string;
11
+ isError?: boolean;
12
+ }
13
+ /** A tool_result block of a user message. */
14
+ export interface ToolResult {
15
+ tool_use_id: string;
16
+ text: string;
17
+ isError?: boolean;
18
+ }
19
+ /**
20
+ * One transcript message. The shape is a subset of Claude Code's
21
+ * `SessionMessage`, so a session transcript can be passed in as is.
22
+ */
23
+ export interface Message {
24
+ role: Role;
25
+ text: string;
26
+ toolUses: ToolUse[];
27
+ toolResults?: ToolResult[];
28
+ }
29
+ /** A tool call paired with its result by `tool_use_id`. */
30
+ export interface ToolCall {
31
+ /** Short id used in the Jev state and question names (`t1`, `t2`, ...). */
32
+ id: string;
33
+ tool_use_id: string;
34
+ tool: string;
35
+ input: Record<string, unknown>;
36
+ /** Index of the message holding the tool_use block. */
37
+ callIndex: number;
38
+ /** Index of the message holding the tool_result block. */
39
+ resultIndex: number;
40
+ resultChars: number;
41
+ isError: boolean;
42
+ /** In the first or the newest preserved messages; never a candidate. */
43
+ pinned: boolean;
44
+ }
45
+ export interface CallAnswer {
46
+ /** Jev's probability that the call itself still matters. */
47
+ keepCall: number;
48
+ /** Jev's probability that the full result still needs to stay verbatim. */
49
+ keepResult: number;
50
+ }
51
+ export type CallAction = 'keep' | 'drop_result' | 'drop_call';
52
+ export interface CallDecision extends CallAnswer {
53
+ id: string;
54
+ tool: string;
55
+ action: CallAction;
56
+ reason: 'pinned' | 'kept' | 'result_dropped' | 'call_dropped';
57
+ }
58
+ export interface HistoryToolCall {
59
+ id: string;
60
+ tool: string;
61
+ input: string;
62
+ result: string;
63
+ }
64
+ export interface HistoryEntry {
65
+ i: number;
66
+ role: Role;
67
+ text: string;
68
+ /** Structured per call, or one compact line per call once the state has to shrink. */
69
+ tool_calls?: HistoryToolCall[] | string[];
70
+ }
71
+ /** The state sent with every Jev request: the whole history, results omitted. */
72
+ export interface CompactionState {
73
+ context: string;
74
+ goal: string;
75
+ history: HistoryEntry[];
76
+ }
77
+ export interface FittedState {
78
+ state: CompactionState;
79
+ tokens: number;
80
+ /** Which fitting stage produced the state, for diagnostics. */
81
+ stage: string;
82
+ }
83
+ export interface CompactOptions {
84
+ /** Ongoing task description; defaults to the last few user prompts. */
85
+ goal?: string;
86
+ /** Minimum keep probability for a call or result to stay. Default 0.5. */
87
+ keepThreshold?: number;
88
+ /** Newest messages never touched (the first message is always kept). Default 6. */
89
+ preserveRecentMessages?: number;
90
+ /** Estimated token ceiling for the state. Default 25000. */
91
+ maxStateTokens?: number;
92
+ /** Estimated token ceiling for state plus one batch of questions. Default 30000. */
93
+ maxRequestTokens?: number;
94
+ /** Characters of a dropped tool result to retain. Default 300. */
95
+ truncateHeadChars?: number;
96
+ }
97
+ export interface ResolvedCompactOptions {
98
+ goal: string;
99
+ keepThreshold: number;
100
+ preserveRecentMessages: number;
101
+ maxStateTokens: number;
102
+ maxRequestTokens: number;
103
+ truncateHeadChars: number;
104
+ }
105
+ export interface CompactResult {
106
+ /** The compacted transcript; untouched messages are the input objects. */
107
+ messages: Message[];
108
+ decisions: CallDecision[];
109
+ stats: {
110
+ messagesBefore: number;
111
+ messagesAfter: number;
112
+ charsBefore: number;
113
+ charsAfter: number;
114
+ calls: number;
115
+ kept: number;
116
+ resultsDropped: number;
117
+ callsDropped: number;
118
+ pinned: number;
119
+ stateTokens: number;
120
+ /** Which fitting stage the state needed, '' when no request was made. */
121
+ stateStage: string;
122
+ requests: number;
123
+ ms: number;
124
+ };
125
+ }
126
+ /** The `state` of a Jev request: a string or any JSON-serialisable object. */
127
+ export type JevState = string | object;
128
+ export interface NoulQuestion {
129
+ type: 'noul';
130
+ instructions: string;
131
+ criteria?: {
132
+ true?: string;
133
+ false?: string;
134
+ };
135
+ }
136
+ export interface ChoiceQuestion {
137
+ type: 'choice';
138
+ instructions: string;
139
+ criteria: Record<string, string | null>;
140
+ }
141
+ export interface ScoreQuestion {
142
+ type: 'score';
143
+ instructions: string;
144
+ criteria: string[];
145
+ }
146
+ export type JevQuestion = NoulQuestion | ChoiceQuestion | ScoreQuestion;
147
+ export type JevQuestions = Record<string, JevQuestion>;
148
+ export interface NoulAnswer {
149
+ type?: 'noul';
150
+ noul: number;
151
+ }
152
+ export interface ChoiceAnswer {
153
+ type?: 'choice';
154
+ choice: string;
155
+ confidence: number;
156
+ probabilities: Record<string, number>;
157
+ }
158
+ export interface ScoreAnswer {
159
+ type?: 'score';
160
+ score: number;
161
+ confidence: number;
162
+ probabilities: Record<string, number>;
163
+ }
164
+ export type JevAnswer = NoulAnswer | ChoiceAnswer | ScoreAnswer;
165
+ export interface JevResponse {
166
+ model?: string;
167
+ answers: Record<string, JevAnswer>;
168
+ usage?: {
169
+ input_tokens?: number;
170
+ output_tokens?: number;
171
+ };
172
+ [key: string]: unknown;
173
+ }
174
+ /** Anything that can answer Jev questions: `JevClient`, or a host-provided adapter. */
175
+ export interface JevAsker {
176
+ ask(state: JevState, questions: JevQuestions): Promise<JevResponse>;
177
+ }
@@ -0,0 +1,4 @@
1
+ // Vendored from fast-jev-compaction (https://github.com/tamaratran/fast-jev-compaction), MIT.
2
+ // Local changes: import paths only. Keep in sync with the upstream file of the same name.
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/vendor/compaction/types.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F"}
package/docs/ask.md ADDED
@@ -0,0 +1,52 @@
1
+ # jev ask
2
+
3
+ The general form: any state, any questions, one typed answer each. Every other command is a specialization of this.
4
+
5
+ ```bash
6
+ jev ask [state] (--noul ... | --choice ... | --score ... | --questions <ref>) [options]
7
+ ```
8
+
9
+ ## When to use
10
+
11
+ When none of the purpose-built commands fits, or when you want several different questions answered about one input in a single request. Questions run in parallel over the same state, so asking five costs about the latency of one.
12
+
13
+ ## Question types
14
+
15
+ | Flag | Answer | Shorthand |
16
+ | --- | --- | --- |
17
+ | `--noul` | Probability of "yes", 0 to 1 | `id=Question text?` |
18
+ | `--choice` | One option, a probability per option, a confidence | `id=Question text?\|optionA,optionB:description,optionC` |
19
+ | `--score` | A position on an ordered scale, a probability per level, a confidence | `id=Question text?\|low level,middle level,high level` |
20
+
21
+ Shorthand rules: `=` separates the id from the question, the first `|` separates the question from its options, options are comma separated. Write `\|` or `\,` for a literal pipe or comma. Ids use letters, digits, `_`, `-`, `.`.
22
+
23
+ ## Options
24
+
25
+ | Option | Meaning |
26
+ | --- | --- |
27
+ | `[state]` | Text, `@file`, or `-`. Reads stdin when omitted and piped. |
28
+ | `--state-json` | Treat the state as JSON so you can send objects or arrays |
29
+ | `-q, --questions <ref>` | A JSON questions map in the [TypeSafe API shape](https://docs.typesafe.ai/api), instead of shorthands |
30
+
31
+ ## Example
32
+
33
+ ```bash
34
+ jev ask @ticket.txt \
35
+ --noul urgent="Does this convey urgency?" \
36
+ --choice team="Which team?|billing:refunds and invoices,technical:bugs and outages,sales" \
37
+ --score frustration="How frustrated is the customer?|calm,frustrated,very angry"
38
+ ```
39
+
40
+ ```text
41
+ urgent: 0.92
42
+ team: billing conf 0.82 [billing 0.85, technical 0.08, sales 0.07]
43
+ frustration: 1.60 conf 0.71 [0 0.10, 1 0.20, 2 0.70]
44
+ ```
45
+
46
+ ## Tips
47
+
48
+ - One narrow judgment per question. Include an escape option (`other`, `none`) when nothing may fit.
49
+ - Describe options when the labels alone are ambiguous; put domain rules in the descriptions.
50
+ - A `noul` near 0.5 means "as likely yes as no", not medium intensity.
51
+
52
+ Docs: [primitives](https://docs.typesafe.ai/primitives), [speculative fan-out](https://docs.typesafe.ai/patterns/fan-out).
package/docs/auth.md ADDED
@@ -0,0 +1,53 @@
1
+ # jev auth
2
+
3
+ Keep the API key out of shell profiles and process environments.
4
+
5
+ ```bash
6
+ jev auth login [provider] [--key-stdin]
7
+ jev auth status
8
+ jev auth logout [provider] [--all]
9
+ ```
10
+
11
+ ## Subcommands
12
+
13
+ | Subcommand | Does |
14
+ | --- | --- |
15
+ | `login [typesafe\|openrouter]` | Prompts with hidden input and stores the key. With `--key-stdin`, or when piped, reads one line from stdin so password managers work. |
16
+ | `status` | Where each provider's key comes from: `env`, `keychain`, `file`, or `none`. Exit 1 if none. |
17
+ | `logout [provider] [--all]` | Remove a stored key |
18
+
19
+ ## Where keys go
20
+
21
+ | Platform | Store |
22
+ | --- | --- |
23
+ | macOS | Keychain, service `jevctl` |
24
+ | Linux with `secret-tool` | Secret Service |
25
+ | Otherwise | `~/.config/jev/credentials.json`, mode `0600` |
26
+
27
+ Force one with `JEV_CREDENTIAL_STORE=file` or `keychain`. Move the file with `JEV_CREDENTIALS`.
28
+
29
+ ## Resolution order
30
+
31
+ 1. The environment variable (`TYPESAFE_API_KEY`, `OPENROUTER_API_KEY`)
32
+ 2. The store
33
+
34
+ `JEV_NO_STORED_CREDENTIALS=1` ignores the store, useful in CI. `jev config` shows which source won.
35
+
36
+ ## Examples
37
+
38
+ ```bash
39
+ jev auth login
40
+ op read "op://Private/TypeSafe/credential" | jev auth login --key-stdin
41
+ jev auth login openrouter
42
+ jev auth status
43
+ ```
44
+
45
+ ```text
46
+ Provider Source Key
47
+ ---------- -------- -------
48
+ typesafe keychain apik…64
49
+ openrouter none -
50
+ store: macOS Keychain (service "jevctl")
51
+ ```
52
+
53
+ The Claude Code compaction hook runs in Claude Code's sandbox and cannot read the keychain. For it, put the key in `~/.claude/settings.json` under `env`, or use the plugin's sensitive `apiKey` option.
package/docs/batch.md ADDED
@@ -0,0 +1,48 @@
1
+ # jev batch
2
+
3
+ Run a command over many rows with a concurrency pool. One JSON record per row, in input order.
4
+
5
+ ```bash
6
+ jev batch <command> --input <ref> [--output <path>] [--concurrency <n>] [--fail-fast] -- <flags for that command>
7
+ ```
8
+
9
+ Batchable: `classify`, `screen`, `extract`, `ask`, `verify`, `find`, `rerank`, `route`.
10
+
11
+ ## When to use
12
+
13
+ Anything over a handful of items: a backlog to label, a folder of emails to extract from, a list of claims against one spec, a set of queries against one candidate list.
14
+
15
+ ## Options
16
+
17
+ | Option | Meaning | Default |
18
+ | --- | --- | --- |
19
+ | `<command>` | The command to run per row | required |
20
+ | `-i, --input <ref>` | `@file` or `-`. Plain lines (one text per line), or JSONL objects with `text` (or `state`) and an optional `id`. Extra fields pass through as `meta`. | required |
21
+ | `-o, --output <path>` | Write records to a file instead of stdout | stdout |
22
+ | `--concurrency <n>` | Parallel requests | `4` |
23
+ | `--fail-fast` | Stop scheduling new rows after the first error | off |
24
+ | `-- <flags>` | Everything after `--` goes to the sub-command, minus its text argument, which each row supplies | |
25
+
26
+ For `verify` the row is a claim and `--evidence` is shared; for `find` and `rerank` the row is a query and the candidates are shared.
27
+
28
+ ## Output
29
+
30
+ One line per row: `{"index", "id", "ok", "failed", "result" | "error", "meta"}`. `failed` means the sub-command's `--fail-on` matched for that row. A summary goes to stderr.
31
+
32
+ Exit `1` if any row errored, `2` if any row matched `--fail-on`, else `0`.
33
+
34
+ ## Example
35
+
36
+ ```bash
37
+ jev batch classify -i @issues.jsonl -o labeled.jsonl -- -l bug,feature,question,docs --other --fail-on review
38
+ jq -r 'select(.failed) | .id' labeled.jsonl # rows a human should look at
39
+
40
+ jev batch screen -i @pages.jsonl --concurrency 8 -- --purpose "extract pricing"
41
+ jev batch verify -i @claims.txt -- --evidence @spec.md --fail-on contradicted,unsupported
42
+ ```
43
+
44
+ ```bash
45
+ # Build JSONL from files
46
+ for f in inbox/*.eml; do jq -n --arg id "$f" --arg text "$(cat "$f")" '{id:$id,text:$text}'; done \
47
+ | jev batch extract -i - -- --want sender=email:the sender --want reply_by=date:the reply deadline
48
+ ```
@@ -0,0 +1,55 @@
1
+ # jev classify
2
+
3
+ Assign labels from a set you define: one label, several labels, or a path through a hierarchy.
4
+
5
+ ```bash
6
+ jev classify [text] (--labels <list> | --labels-json <ref> | --taxonomy <ref>) [--multi] [--other] [options]
7
+ ```
8
+
9
+ ## When to use
10
+
11
+ Label issues, route tickets, tag content, sort documents into a catalog. Prefer it over `ask --choice` when the task is "pick a bucket": it adds an `other` escape, confidence gating, multi-label, and hierarchies.
12
+
13
+ ## Modes
14
+
15
+ | Mode | Flag | Returns |
16
+ | --- | --- | --- |
17
+ | Single (default) | `--labels a,b:description,c` | One `label`, `confidence`, full `probabilities`, `action` (`auto` or `review`) |
18
+ | Multi | `--multi` | One probability per label; `applied` lists those at or above `--threshold` |
19
+ | Taxonomy | `--taxonomy @tree.json` | A `path` decided one level per request, with per-level confidence |
20
+
21
+ ## Options
22
+
23
+ | Option | Meaning | Default |
24
+ | --- | --- | --- |
25
+ | `[text]` | Text, `@file`, or `-` | stdin |
26
+ | `-l, --labels <list>` | Comma-separated labels, optionally `label:description`. Escape a literal comma as `\,`. | |
27
+ | `--labels-json <ref>` | `["a","b"]`, `[{"label","description"}]`, or `{"label": "description"}` | |
28
+ | `-t, --taxonomy <ref>` | Nested JSON, e.g. `{"hardware": {"laptop": null, "phone": null}, "software": ["os", "app"]}` | |
29
+ | `--multi` | One yes/no probability per label instead of picking one | off |
30
+ | `--other` | Add an `other` option so the model can say nothing fits (single and taxonomy) | off |
31
+ | `-i, --instructions <text>` | Replace the default question | |
32
+ | `--min-confidence <p>` | Below this confidence the result is `review` | `0.6` |
33
+ | `--threshold <p>` | Multi: probability at or above which a label applies | `0.5` |
34
+ | `--state-json` | Treat the input as JSON | |
35
+ | `--fail-on <list>` | Exit 2 on `review`, `other`, or `unlabeled` (multi: nothing applied) | `none` |
36
+
37
+ ## Example
38
+
39
+ ```bash
40
+ jev classify "Login fails after the latest update" \
41
+ -l "bug:defect in an existing feature,feature:new capability,question" --other
42
+ ```
43
+
44
+ ```text
45
+ bug conf 0.91 auto
46
+ [bug 0.93, question 0.04, feature 0.02, other 0.01]
47
+ ```
48
+
49
+ ## Tips
50
+
51
+ - Put your domain rules in the label descriptions, not in the label names.
52
+ - Always add `--other` unless every input is known to fit a label.
53
+ - A taxonomy costs one request per level. Leaf lists (`["os", "app"]`) are shorthand for `{"os": null, "app": null}`.
54
+
55
+ Patterns: [classification using confidence](https://docs.typesafe.ai/cookbooks/classification_using_confidence), [hierarchical classification](https://docs.typesafe.ai/cookbooks/hierarchical_classification).
@@ -0,0 +1,58 @@
1
+ # jev compact
2
+
3
+ Shrink an agent transcript without summarizing anything. Jev decides, per old tool call, whether the call and whether its full output still matter. Stale results are cut to a short head plus a note, stale calls are removed, everything else is returned exactly as it was. User and assistant text is never touched.
4
+
5
+ ```bash
6
+ jev compact [transcript] [options]
7
+ ```
8
+
9
+ ## When to use
10
+
11
+ Before handing a long session to another agent, to audit what a compaction would drop, or as the engine behind the Claude Code plugin's compaction hook, which replaces the built-in summary in-session. Summaries are lossy: a path, an exact error, or a constraint can vanish. This never rewrites, only deletes what Jev says is no longer needed, and the assistant can always re-run a tool.
12
+
13
+ ## Input
14
+
15
+ | Form | Example |
16
+ | --- | --- |
17
+ | Claude Code session log | `@~/.claude/projects/<project>/<session>.jsonl` |
18
+ | Messages JSON | `[{"role","text","toolUses":[{"tool_use_id","tool","input"}],"toolResults":[{"tool_use_id","text"}]}]`; `text` and `toolUses` may be omitted |
19
+
20
+ ## Options
21
+
22
+ | Option | Meaning | Default |
23
+ | --- | --- | --- |
24
+ | `-g, --goal <text>` | The ongoing task, so Jev knows what still matters | last three user prompts |
25
+ | `--keep-threshold <p>` | Keep a call or result when Jev's probability is at least this | `0.5` |
26
+ | `--preserve-recent <n>` | Newest messages never touched; the first is always kept | `6` |
27
+ | `--max-state-tokens <n>` | Budget for the history sent to Jev | `25000` |
28
+ | `--max-request-tokens <n>` | Budget for history plus one batch of questions | `30000` |
29
+ | `--truncate-head <n>` | Characters kept from a dropped result before its note | `300` |
30
+ | `--min-reduction <p>` | Below this ratio the result is `worth_it: false` | `0.25` |
31
+ | `-o, --out <path>` | Write the compacted transcript as messages JSON | |
32
+ | `--fail-on <list>` | Exit 2 on `low-reduction` | `none` |
33
+
34
+ ## How it fits Jev's 32k window
35
+
36
+ Jev never sees the raw transcript. The state is the whole conversation with every tool output replaced by a one-line note (`ok, 4213 chars (omitted)`). If that exceeds the budget it is shrunk in stages: tool inputs truncated, long texts abridged, old messages collapsed to a note, old calls reduced to one line, old call-less messages left out. Questions (two per candidate call) are split across as many requests as needed, each resending the same state, run concurrently. Compressing the state never changes the output; it only shapes what Jev reads to decide. Token counts are estimates calibrated slightly above Jev's real counts.
37
+
38
+ ## Output
39
+
40
+ `reduction`, `worth_it`, `stats` (messages and chars before and after, kept/truncated/dropped/pinned counts, state tokens and stage, requests, ms), `decisions[]` (`id`, `tool`, `action`, `keepCall`, `keepResult`), `messages` (the compacted transcript).
41
+
42
+ ## Example
43
+
44
+ ```bash
45
+ jev compact @session.jsonl --out compacted.json
46
+ ```
47
+
48
+ ```text
49
+ 61% smaller 528 → 341 messages · 1,204,311 → 470,902 chars
50
+ 209 tool calls: 58 kept · 71 results truncated · 77 calls dropped · 3 pinned · state ~24944 tokens (old messages collapsed) in 5 request(s), 2140 ms
51
+
52
+ Call Tool Action P(call) P(result)
53
+ ---- ---- -------- ------- ---------
54
+ t1 Bash truncate 0.91 0.12
55
+ t2 Read drop 0.08 0.03
56
+ ```
57
+
58
+ In-session use: see [plugin/hooks/README.md](../plugin/hooks/README.md). Adapted from [fast-jev-compaction](https://github.com/tamaratran/fast-jev-compaction) (MIT).
package/docs/config.md ADDED
@@ -0,0 +1,81 @@
1
+ # Configuration
2
+
3
+ Settings resolve in this order, later wins: built-in defaults, config file, environment variables, command-line flags.
4
+
5
+ ## jev config
6
+
7
+ | Subcommand | Does |
8
+ | --- | --- |
9
+ | `jev config` or `jev config show` | Effective settings, masked credentials, key sources, resolved provider. Exit 1 if no provider can be resolved. |
10
+ | `jev config path` | Print the config file location |
11
+ | `jev config init` | Write a file with the defaults |
12
+ | `jev config set <key> <value>` | Set one value, e.g. `jev config set screen.blockAt 0.6`. Unknown keys and out-of-range values are rejected. |
13
+ | `jev config unset <key>` | Remove a top-level key |
14
+ | `jev config reset` | Delete the file |
15
+
16
+ ## Config file
17
+
18
+ `$JEV_CONFIG` if set, else `$XDG_CONFIG_HOME/jev/config.json`, else `~/.config/jev/config.json`. It never holds API keys.
19
+
20
+ ```json
21
+ {
22
+ "provider": "auto",
23
+ "model": "jev-latest",
24
+ "timeoutMs": 30000,
25
+ "format": "text",
26
+ "verify": { "autoAccept": 0.8 },
27
+ "screen": { "blockAt": 0.75, "reviewAt": 0.25 },
28
+ "find": { "topK": 5, "found": 0.7, "absent": 0.35 },
29
+ "classify": { "minConfidence": 0.6, "threshold": 0.5 },
30
+ "extract": { "minConfidence": 0.6 },
31
+ "rerank": { "topK": 10, "min": 0.5 },
32
+ "route": { "minConfidence": 0.6 },
33
+ "compact": { "keepThreshold": 0.5, "preserveRecent": 6, "maxStateTokens": 25000, "maxRequestTokens": 30000, "truncateHead": 300, "minReduction": 0.25 },
34
+ "batch": { "concurrency": 4 }
35
+ }
36
+ ```
37
+
38
+ ## Environment variables
39
+
40
+ | Variable | Purpose |
41
+ | --- | --- |
42
+ | `TYPESAFE_API_KEY` | TypeSafe key. Optional when stored with `jev auth login`; takes precedence when set. |
43
+ | `TYPESAFE_BASE_URL` | Alternate TypeSafe endpoint, for proxies or testing |
44
+ | `OPENROUTER_API_KEY` | OpenRouter key (`sk-or-...`), used when no TypeSafe key is present |
45
+ | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` | Cloudflare Workers AI, used when no other key is present. `JEV_CLOUDFLARE_API_TOKEN` takes precedence over `CLOUDFLARE_API_TOKEN`. |
46
+ | `JEV_PROVIDER` | Force `typesafe`, `openrouter`, or `cloudflare` |
47
+ | `JEV_MODEL` | Default model |
48
+ | `JEV_TIMEOUT_MS` | Default per-request timeout |
49
+ | `JEV_FORMAT` | Default output format: `text`, `json`, `jsonl`, `md`, `csv`, `tsv` |
50
+ | `JEV_CONFIG` | Config file path |
51
+ | `JEV_CREDENTIALS` | Credentials file path (file store) |
52
+ | `JEV_CREDENTIAL_STORE` | `auto`, `keychain`, or `file` |
53
+ | `JEV_NO_STORED_CREDENTIALS=1` | Ignore stored keys; environment only |
54
+ | `JEV_DEBUG=1` | Print stack traces on errors |
55
+
56
+ ## Providers
57
+
58
+ | Provider | Notes |
59
+ | --- | --- |
60
+ | TypeSafe (direct) | Recommended. Lowest latency, `jev-latest` alias, pinned versions, automatic retries with backoff. |
61
+ | OpenRouter | Alpha endpoint. Pinned versions only, so `jev-latest` maps to `typesafe/jev-1.13`. Adds a hop. |
62
+ | Cloudflare Workers AI | Single `typesafe/jev` alias, no version pinning. Adds a hop. |
63
+
64
+ ## Global flags
65
+
66
+ Work before or after the subcommand.
67
+
68
+ | Flag | Meaning |
69
+ | --- | --- |
70
+ | `--json`, `--md`, `--format <name>` | `text`, `json`, `jsonl`, `md`, `csv`, `tsv`; see [Output formats](output.md) |
71
+ | `--pluck <path>` | Print one value from the JSON result |
72
+ | `-m, --model <name>` | `jev-latest` or a pinned version such as `jev-1.13.0` |
73
+ | `-P, --provider <name>` | `auto`, `typesafe`, `openrouter`, `cloudflare` |
74
+ | `--timeout <ms>` | Per-request timeout, default 30000 |
75
+ | `--dry-run` | Print the exact request, exit 0, no API call |
76
+ | `-q, --quiet` | Omit the token usage footer |
77
+ | `--no-color` | Disable colors; `NO_COLOR` and `FORCE_COLOR` are honored too |
78
+
79
+ ## Models
80
+
81
+ `jev models` lists the models your account can use, with release dates. TypeSafe provider only. Pin a version with `-m jev-1.13.0` once you have tuned thresholds, so an alias update does not shift results.
@@ -0,0 +1,59 @@
1
+ # jev extract
2
+
3
+ Pull values out of text without letting the model invent them. Regexes find every candidate span in code, Jev picks the one that matches the field's meaning, code normalizes the verbatim value.
4
+
5
+ ```bash
6
+ jev extract [text] --want <field> [--want <field>...] [--context <text>] [options]
7
+ ```
8
+
9
+ ## When to use
10
+
11
+ Invoices, emails, forms, logs: anything where you need specific values and cannot afford a hallucinated one. If no regex matches, the field is `none` and no API call is made.
12
+
13
+ ## Fields
14
+
15
+ | Form | Example | Meaning |
16
+ | --- | --- | --- |
17
+ | builtin | `--want email,phone,date` | `email`, `phone`, `url`, `amount`, `date`, `percent`, `number` |
18
+ | custom regex | `--want invoice=/INV-\d+/` | Your pattern, named |
19
+ | custom regex with meaning | `--want po=/PO\s?\d{6}/:the purchase order number` | The description drives the question |
20
+ | aliased builtin | `--want "sender=email:the sender's address"` (quote descriptions with spaces) | Same pattern, different meaning, so two emails can be told apart |
21
+
22
+ ## Options
23
+
24
+ | Option | Meaning | Default |
25
+ | --- | --- | --- |
26
+ | `[text]` | Text, `@file`, or `-` | stdin |
27
+ | `-w, --want <field>` | A field, repeatable; comma-separate builtins | required |
28
+ | `-c, --context <text>` | What the document is, e.g. `"supplier invoice"` | |
29
+ | `--min-confidence <p>` | Below this confidence the value is `review` | `0.6` |
30
+ | `--fail-on <list>` | Exit 2 when any field is `review` or `missing` | `none` |
31
+
32
+ ## Output
33
+
34
+ Per field: `value` (verbatim), `normalized`, `confidence`, `action` (`auto`, `review`, `none`), `candidates` (how many spans matched).
35
+
36
+ | Builtin | Normalized form |
37
+ | --- | --- |
38
+ | `email` | lowercased |
39
+ | `phone` | digits only, leading `+` kept |
40
+ | `url` | trailing punctuation stripped |
41
+ | `amount` | `{"value": 1250, "currency": "USD"}` |
42
+ | `date` | `YYYY-MM-DD` |
43
+ | `percent`, `number` | number |
44
+
45
+ ## Example
46
+
47
+ ```bash
48
+ jev extract @invoice.txt --want amount,date --want invoice=/INV-\d+/ --context "supplier invoice"
49
+ ```
50
+
51
+ ```text
52
+ Field Value Normalized Conf Action Cands
53
+ ------- ------------- -------------------------------- ---- ------ -----
54
+ amount $1,250.00 {"value":1250,"currency":"USD"} 0.97 auto 3
55
+ date Sept 30, 2026 2026-09-30 0.94 auto 2
56
+ invoice INV-2231 1.00 auto 1
57
+ ```
58
+
59
+ Patterns: [pre-parsed value extraction](https://docs.typesafe.ai/cookbooks/pre_parsed_value_extraction_cookbook), [date extraction](https://docs.typesafe.ai/cookbooks/date_extraction_cookbook).
package/docs/find.md ADDED
@@ -0,0 +1,49 @@
1
+ # jev find
2
+
3
+ Pick the candidate that best answers a plain-language query, and say whether any candidate answers it at all. No index, no embeddings.
4
+
5
+ ```bash
6
+ jev find <query> (--files <paths...> | --candidates <ref> | --lines <ref>) [options]
7
+ ```
8
+
9
+ ## When to use
10
+
11
+ "Which file covers X", "which note mentions Y", "which line of the terms answers Z". Use it when the query is a concept rather than an identifier you could grep. For ordering and filtering a whole result list, use [`rerank`](rerank.md) instead.
12
+
13
+ ## Options
14
+
15
+ | Option | Meaning | Default |
16
+ | --- | --- | --- |
17
+ | `<query>` | What you are looking for | required |
18
+ | `-f, --files <paths...>` | Each file is a candidate; its id is the path | |
19
+ | `-c, --candidates <ref>` | JSON: `["text"]`, `[{"id","text"}]`, or `{"id": "text"}` | |
20
+ | `-l, --lines <ref>` | Each non-empty line of a file or stdin is a candidate with id `L<line number>` (1-based, counted in the source file, blank lines included) | |
21
+ | `-k, --top-k <n>` | How many ranked results to show | `5` |
22
+ | `--found <p>` | Exists probability at or above which the verdict is `answered` | `0.7` |
23
+ | `--absent <p>` | Exists probability below which the verdict is `absent`; between is `partial` | `0.35` |
24
+ | `--fail-on <list>` | Exit 2 when the exists verdict is `absent` or `partial` | `none` |
25
+
26
+ Limits: 250 candidates per call; each text is truncated at 2,000 characters.
27
+
28
+ ## Output
29
+
30
+ `top[]` with `id`, `probability`, `text`; `exists` and `exists_verdict` (`answered`, `partial`, `absent`).
31
+
32
+ Ranking always produces a winner because the probabilities sum to 1. Check `exists_verdict` before trusting `top[0]`.
33
+
34
+ ## Example
35
+
36
+ ```bash
37
+ jev find "how do I rotate API keys" --files docs/*.md -k 2
38
+ ```
39
+
40
+ ```text
41
+ answered (exists 0.99) how do I rotate API keys
42
+
43
+ # Prob Id Text
44
+ - ---- --------------- ------------------------------------------------------------
45
+ 1 0.99 docs/auth.md To rotate an API key: create a new key in Settings > Keys, …
46
+ 2 0.01 docs/billing.md Invoices are issued monthly and can be downloaded as PDF.
47
+ ```
48
+
49
+ Pattern: [semantic find cookbook](https://docs.typesafe.ai/cookbooks/semantic_find).