@chroxify/eunoe 1.0.0 → 1.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 (88) hide show
  1. package/README.md +68 -9
  2. package/package.json +18 -2
  3. package/src/cli/{types.ts → command.ts} +0 -4
  4. package/src/cli/commands/index.ts +13 -1
  5. package/src/cli/commands/load.ts +44 -0
  6. package/src/cli/commands/mode.ts +41 -33
  7. package/src/cli/commands/peek.ts +22 -0
  8. package/src/cli/commands/replay.ts +245 -0
  9. package/src/cli/commands/serve.ts +22 -7
  10. package/src/cli/commands/sessions.ts +70 -0
  11. package/src/cli/commands/settings.ts +79 -60
  12. package/src/cli/commands/start.ts +56 -21
  13. package/src/cli/commands/stats.ts +233 -0
  14. package/src/cli/commands/status.ts +98 -55
  15. package/src/cli/commands/stop.ts +8 -6
  16. package/src/cli/commands/uninstall.ts +10 -12
  17. package/src/cli/commands/watch.ts +16 -0
  18. package/src/cli/logo/art.ts +99 -0
  19. package/src/cli/logo/index.ts +12 -18
  20. package/src/cli/main.ts +3 -3
  21. package/src/cli/proxy/claude-settings.ts +69 -0
  22. package/src/cli/proxy/inspect.ts +67 -0
  23. package/src/cli/proxy/launchd.ts +53 -0
  24. package/src/cli/proxy/live.ts +57 -0
  25. package/src/cli/proxy/service.ts +53 -0
  26. package/src/cli/{stats.ts → proxy/stats.ts} +29 -16
  27. package/src/cli/proxy/watch.ts +60 -0
  28. package/src/cli/replay/index.ts +146 -0
  29. package/src/cli/replay/worker.ts +20 -0
  30. package/src/cli/sessions/browse.ts +88 -0
  31. package/src/cli/sessions/index.ts +76 -0
  32. package/src/cli/sessions/source.ts +74 -0
  33. package/src/cli/{help.ts → terminal/help.ts} +24 -8
  34. package/src/cli/terminal/prompt.ts +114 -0
  35. package/src/cli/{ui.ts → terminal/ui.ts} +55 -24
  36. package/src/cli/usage/index.ts +151 -0
  37. package/src/config/index.ts +99 -34
  38. package/src/config/paths.ts +17 -0
  39. package/src/context/content.ts +40 -14
  40. package/src/context/fold/evidence.ts +145 -0
  41. package/src/context/fold/index.ts +65 -0
  42. package/src/context/fold/strategies.ts +94 -0
  43. package/src/context/fold/turns.ts +76 -0
  44. package/src/context/prompts.ts +141 -22
  45. package/src/context/recall/index.ts +214 -0
  46. package/src/context/recall/rerank.ts +71 -0
  47. package/src/proxy/canonical.ts +17 -9
  48. package/src/proxy/compaction.ts +106 -53
  49. package/src/proxy/estimate.ts +14 -9
  50. package/src/proxy/fingerprint.ts +23 -9
  51. package/src/proxy/handoff.ts +71 -0
  52. package/src/proxy/log.ts +2 -2
  53. package/src/proxy/recall.ts +58 -0
  54. package/src/proxy/rewrite.ts +141 -119
  55. package/src/proxy/server.ts +108 -51
  56. package/src/proxy/sessions.ts +32 -14
  57. package/src/proxy/state.ts +17 -3
  58. package/src/proxy/usage.ts +50 -34
  59. package/src/proxy/window.ts +32 -34
  60. package/src/transcript/format.ts +88 -25
  61. package/src/transcript/locate.ts +38 -17
  62. package/src/transcript/messages.ts +3 -14
  63. package/src/transcript/parse.ts +137 -56
  64. package/src/transcript/render.ts +44 -17
  65. package/src/transcript/search.ts +20 -56
  66. package/src/transcript/subagents.ts +150 -0
  67. package/src/cli/claude-settings.ts +0 -42
  68. package/src/cli/constants.ts +0 -52
  69. package/src/cli/inspect.ts +0 -41
  70. package/src/cli/launchd.ts +0 -39
  71. package/src/cli/logo/pixels.ts +0 -34
  72. package/src/cli/prompt.ts +0 -91
  73. package/src/cli/service.ts +0 -33
  74. package/src/cli/sessions.ts +0 -25
  75. package/src/config/constants.ts +0 -39
  76. package/src/config/types.ts +0 -50
  77. package/src/context/constants.ts +0 -42
  78. package/src/context/evidence.ts +0 -92
  79. package/src/context/recall.ts +0 -155
  80. package/src/context/rerank.ts +0 -44
  81. package/src/context/strategies.ts +0 -89
  82. package/src/context/turns.ts +0 -87
  83. package/src/context/types.ts +0 -66
  84. package/src/proxy/constants.ts +0 -29
  85. package/src/proxy/types.ts +0 -82
  86. package/src/transcript/constants.ts +0 -15
  87. package/src/transcript/types.ts +0 -43
  88. /package/src/cli/{args.ts → terminal/args.ts} +0 -0
@@ -1,66 +0,0 @@
1
- export type Block = { type: string; [key: string]: any }
2
-
3
- export type Message = { role: string; content: string | Block[] }
4
-
5
- export type Body = {
6
- model?: string
7
- system?: string | Block[]
8
- messages: Message[]
9
- tools?: unknown[]
10
- metadata?: { user_id?: string }
11
- [key: string]: any
12
- }
13
-
14
- export interface ReduceOptions {
15
- evidence?: boolean
16
- }
17
-
18
- export interface CompactOptions extends ReduceOptions {
19
- keepTurns: number
20
- guide: string | null
21
- omittedBefore?: number
22
- }
23
-
24
- export interface NoticeCounts {
25
- omitted: number
26
- kept: number
27
- guide: string | null
28
- }
29
-
30
- export interface RecallChunk {
31
- turn: number
32
- call: string
33
- lines: string[]
34
- terms: string[]
35
- }
36
-
37
- export interface EvidenceOptions {
38
- linesPerCall?: number
39
- lineChars?: number
40
- turnChars?: number
41
- scanLines?: number
42
- minScore?: number
43
- allTools?: boolean
44
- ranked?: boolean
45
- labels?: boolean
46
- callFloor?: number
47
- }
48
-
49
- export interface RecallOptions {
50
- windowLines?: number
51
- perQuery?: number
52
- minTerms?: number
53
- maxChars?: number
54
- maxCharsMulti?: number
55
- narrative?: boolean
56
- callWeight?: number
57
- salientExcerpt?: boolean
58
- candidates?: number
59
- }
60
-
61
- export type Reranker = (query: string, chunks: RecallChunk[], candidates: number[]) => Promise<number[]>
62
-
63
- export interface RecallPick {
64
- index: number
65
- query: Set<string>
66
- }
@@ -1,29 +0,0 @@
1
- export const HEALTH_PATH = "/_eunoe/health"
2
- export const SESSION_HEADER = "x-claude-code-session-id"
3
- export const TRANSCRIPT_HEADER = "x-eunoe-transcript"
4
- export const OMITTED_BEFORE_HEADER = "x-eunoe-omitted-before"
5
- export const CANONICAL_HEADER = "x-eunoe-canonical"
6
- export const WINDOW_HEADER = "x-eunoe-window"
7
- export const BILLING_LINE = /^x-anthropic-billing-header:[^\n]*/
8
-
9
- export const TARGET_SHARE = 0.3
10
- export const PROTECTED_OUTPUTS = 5
11
-
12
- export const DEFAULT_RATIO = 1 / 3.6
13
- export const MEDIA_CHARS = 5_800
14
- export const MEDIA_MIN_LENGTH = 2_000
15
-
16
- export const MODEL_HEADERS = ["authorization", "x-api-key", "anthropic-version", "anthropic-beta"]
17
- export const ANTHROPIC_VERSION = "2023-06-01"
18
- export const MODEL_LOOKUP_TIMEOUT_MS = 5_000
19
-
20
- export const MAX_EVENT_BUFFER = 4_000_000
21
- export const LOGGED_ERROR_CHARS = 500
22
- export const IDLE_TIMEOUT_SECONDS = 255
23
-
24
- export const SESSION_SEEN_INTERVAL_MS = 30_000
25
- export const SESSION_HEAD_BYTES = 65_536
26
- export const SESSIONS_KEPT = 200
27
-
28
- export const FINGERPRINT_LENGTH = 12
29
- export const SKILL_MARKER = /Base directory for this skill: ([^\s"\\]+)/g
@@ -1,82 +0,0 @@
1
- import type { Config } from "../config/types"
2
- import type { Body, Message } from "../context/types"
3
- import type { TranscriptRef } from "../transcript/types"
4
-
5
- export interface ThreadState {
6
- cut?: string
7
- keep?: number
8
- cleared?: number
9
- ratio?: number
10
- recalls?: Record<string, string>
11
- }
12
-
13
- export type Note = Record<string, unknown>
14
-
15
- export interface ContextFingerprint {
16
- system: string
17
- tools: string
18
- skills: string[]
19
- given?: ContextFingerprint
20
- }
21
-
22
- export interface Canonical {
23
- system: Body["system"]
24
- tools: Body["tools"]
25
- }
26
-
27
- export interface CanonicalResult {
28
- body: Body
29
- status: "applied" | "captured" | "skipped"
30
- }
31
-
32
- export interface RewriteInput {
33
- body: Body
34
- sessionId: string | null
35
- config: Config
36
- transcript: TranscriptRef | null
37
- window: number | null
38
- mayCompact: boolean
39
- omittedBefore?: number
40
- }
41
-
42
- export interface Rewrite {
43
- body: Body
44
- threadKey: string | null
45
- note: Note
46
- }
47
-
48
- export interface CompactInput {
49
- body: Body
50
- config: Config
51
- state: ThreadState
52
- window: number | null
53
- guide: string | null
54
- mayCompact: boolean
55
- omittedBefore?: number
56
- }
57
-
58
- export interface CompactResult {
59
- messages: Message[]
60
- stateChanged: boolean
61
- note: Note
62
- }
63
-
64
- export interface Estimator {
65
- of: (messages: Message[]) => number
66
- fixed: number
67
- }
68
-
69
- export type Usage = Record<string, number>
70
-
71
- export interface SeenSession {
72
- lastSeen: string
73
- mode: Config["mode"]
74
- cwd?: string
75
- }
76
-
77
- export interface Health {
78
- ok: boolean
79
- version: string
80
- mode: Config["mode"]
81
- pid: number
82
- }
@@ -1,15 +0,0 @@
1
- export const OUTPUT_CAP = 40_000
2
-
3
- export const CALL_COMMAND_CHARS = 300
4
- export const CALL_PATTERN_CHARS = 120
5
- export const CALL_DESCRIPTION_CHARS = 160
6
- export const CALL_INPUT_CHARS = 200
7
-
8
- export const INDEX_PROMPT_CHARS = 140
9
- export const INDEX_REPLY_CHARS = 160
10
-
11
- export const RENDER_STAMP = ".rendered"
12
- export const TURN_COUNT_FILE = ".turns"
13
- export const INDEX_FILE = "index.md"
14
- export const QMD_DIR = ".qmd"
15
-
@@ -1,43 +0,0 @@
1
- import type { SearchMode } from "../config/types"
2
-
3
- export type SessionEntry = Record<string, any>
4
-
5
- export type TranscriptFormat = "markdown" | "xml"
6
-
7
- export interface ToolPart {
8
- kind: "tool"
9
- n: number
10
- name: string
11
- call: string
12
- body: string
13
- output: string
14
- error: boolean
15
- }
16
-
17
- export interface SayPart {
18
- kind: "say"
19
- text: string
20
- }
21
-
22
- export type TurnPart = SayPart | ToolPart
23
-
24
- export interface Turn {
25
- number: number
26
- time: string
27
- prompt: string
28
- parts: TurnPart[]
29
- final: string
30
- calls: number
31
- }
32
-
33
- export interface RenderResult {
34
- dir: string
35
- changed: boolean
36
- turns: number
37
- }
38
-
39
- export interface TranscriptRef {
40
- mode: SearchMode
41
- jsonl: string
42
- dir: string
43
- }
File without changes