phaibel 4.0.7 → 4.0.21

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 (150) hide show
  1. package/README.md +229 -245
  2. package/dist/commands/chat.d.ts +5 -2
  3. package/dist/commands/chat.d.ts.map +1 -1
  4. package/dist/commands/chat.js +168 -172
  5. package/dist/commands/chat.js.map +1 -1
  6. package/dist/commands/cron.d.ts.map +1 -1
  7. package/dist/commands/cron.js +1 -0
  8. package/dist/commands/cron.js.map +1 -1
  9. package/dist/commands/init.d.ts.map +1 -1
  10. package/dist/commands/init.js +54 -52
  11. package/dist/commands/init.js.map +1 -1
  12. package/dist/config.js +2 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/entities/entity-summary.js +3 -3
  15. package/dist/entities/entity-type-config.d.ts +3 -0
  16. package/dist/entities/entity-type-config.d.ts.map +1 -1
  17. package/dist/entities/entity-type-config.js +67 -1
  18. package/dist/entities/entity-type-config.js.map +1 -1
  19. package/dist/entities/entity-types-defaults.d.ts.map +1 -1
  20. package/dist/entities/entity-types-defaults.js +2 -0
  21. package/dist/entities/entity-types-defaults.js.map +1 -1
  22. package/dist/entities/spawner.d.ts.map +1 -1
  23. package/dist/entities/spawner.js +4 -2
  24. package/dist/entities/spawner.js.map +1 -1
  25. package/dist/feral/catalog/entity-catalog-source.js +31 -31
  26. package/dist/feral/node-code/abstract-node-code.js +1 -1
  27. package/dist/feral/node-code/abstract-node-code.js.map +1 -1
  28. package/dist/feral/node-code/data/set-context-value-node-code.d.ts.map +1 -1
  29. package/dist/feral/node-code/data/set-context-value-node-code.js +10 -1
  30. package/dist/feral/node-code/data/set-context-value-node-code.js.map +1 -1
  31. package/dist/feral/node-code/entity/create-entity-type-node-code.js +20 -20
  32. package/dist/feral/node-code/entity/load-vault-context-node-code.d.ts.map +1 -1
  33. package/dist/feral/node-code/entity/load-vault-context-node-code.js +7 -15
  34. package/dist/feral/node-code/entity/load-vault-context-node-code.js.map +1 -1
  35. package/dist/feral/node-code/entity/update-entity-type-node-code.js +20 -20
  36. package/dist/feral/node-code/input/prompt-input-node-code.d.ts.map +1 -1
  37. package/dist/feral/node-code/input/prompt-input-node-code.js +6 -0
  38. package/dist/feral/node-code/input/prompt-input-node-code.js.map +1 -1
  39. package/dist/feral/node-code/input/prompt-select-node-code.d.ts.map +1 -1
  40. package/dist/feral/node-code/input/prompt-select-node-code.js +6 -0
  41. package/dist/feral/node-code/input/prompt-select-node-code.js.map +1 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +5 -39
  44. package/dist/index.js.map +1 -1
  45. package/dist/llm/router.js +27 -27
  46. package/dist/personalities.js +4 -4
  47. package/dist/phaibel.txt +81 -81
  48. package/dist/service/api-router.d.ts.map +1 -1
  49. package/dist/service/api-router.js +42 -2
  50. package/dist/service/api-router.js.map +1 -1
  51. package/dist/service/cron/feedback-analysis.js +14 -14
  52. package/dist/service/cron/innovate.d.ts +2 -0
  53. package/dist/service/cron/innovate.d.ts.map +1 -0
  54. package/dist/service/cron/innovate.js +354 -0
  55. package/dist/service/cron/innovate.js.map +1 -0
  56. package/dist/service/cron/process-lifecycle.js +36 -36
  57. package/dist/service/cron/scheduler.d.ts.map +1 -1
  58. package/dist/service/cron/scheduler.js +8 -0
  59. package/dist/service/cron/scheduler.js.map +1 -1
  60. package/dist/service/index.d.ts.map +1 -1
  61. package/dist/service/index.js +27 -20
  62. package/dist/service/index.js.map +1 -1
  63. package/dist/service/web-client.html +1984 -1569
  64. package/dist/service/web-server.d.ts +1 -0
  65. package/dist/service/web-server.d.ts.map +1 -1
  66. package/dist/service/web-server.js +188 -6
  67. package/dist/service/web-server.js.map +1 -1
  68. package/dist/tools/daily.js +2 -2
  69. package/package.json +69 -66
  70. package/dist/agentary.txt +0 -82
  71. package/dist/commands/event.d.ts +0 -4
  72. package/dist/commands/event.d.ts.map +0 -1
  73. package/dist/commands/event.js +0 -515
  74. package/dist/commands/event.js.map +0 -1
  75. package/dist/commands/goal.d.ts +0 -4
  76. package/dist/commands/goal.d.ts.map +0 -1
  77. package/dist/commands/goal.js +0 -14
  78. package/dist/commands/goal.js.map +0 -1
  79. package/dist/commands/interview.d.ts +0 -14
  80. package/dist/commands/interview.d.ts.map +0 -1
  81. package/dist/commands/interview.js +0 -343
  82. package/dist/commands/interview.js.map +0 -1
  83. package/dist/commands/note.d.ts +0 -4
  84. package/dist/commands/note.d.ts.map +0 -1
  85. package/dist/commands/note.js +0 -548
  86. package/dist/commands/note.js.map +0 -1
  87. package/dist/commands/pamp.d.ts +0 -4
  88. package/dist/commands/pamp.d.ts.map +0 -1
  89. package/dist/commands/pamp.js +0 -323
  90. package/dist/commands/pamp.js.map +0 -1
  91. package/dist/commands/person.d.ts +0 -4
  92. package/dist/commands/person.d.ts.map +0 -1
  93. package/dist/commands/person.js +0 -185
  94. package/dist/commands/person.js.map +0 -1
  95. package/dist/commands/project.d.ts +0 -4
  96. package/dist/commands/project.d.ts.map +0 -1
  97. package/dist/commands/project.js +0 -70
  98. package/dist/commands/project.js.map +0 -1
  99. package/dist/commands/remember.d.ts +0 -4
  100. package/dist/commands/remember.d.ts.map +0 -1
  101. package/dist/commands/remember.js +0 -70
  102. package/dist/commands/remember.js.map +0 -1
  103. package/dist/commands/research.d.ts +0 -4
  104. package/dist/commands/research.d.ts.map +0 -1
  105. package/dist/commands/research.js +0 -14
  106. package/dist/commands/research.js.map +0 -1
  107. package/dist/commands/shell.d.ts +0 -3
  108. package/dist/commands/shell.d.ts.map +0 -1
  109. package/dist/commands/shell.js +0 -346
  110. package/dist/commands/shell.js.map +0 -1
  111. package/dist/commands/today.d.ts +0 -4
  112. package/dist/commands/today.d.ts.map +0 -1
  113. package/dist/commands/today.js +0 -112
  114. package/dist/commands/today.js.map +0 -1
  115. package/dist/commands/todo.d.ts +0 -4
  116. package/dist/commands/todo.d.ts.map +0 -1
  117. package/dist/commands/todo.js +0 -678
  118. package/dist/commands/todo.js.map +0 -1
  119. package/dist/commands/todont.d.ts +0 -19
  120. package/dist/commands/todont.d.ts.map +0 -1
  121. package/dist/commands/todont.js +0 -209
  122. package/dist/commands/todont.js.map +0 -1
  123. package/dist/commands/week.d.ts +0 -4
  124. package/dist/commands/week.d.ts.map +0 -1
  125. package/dist/commands/week.js +0 -267
  126. package/dist/commands/week.js.map +0 -1
  127. package/dist/dobbai.txt +0 -55
  128. package/dist/dobbi.txt +0 -55
  129. package/dist/dobbie-bundle.cjs +0 -73313
  130. package/dist/dobbie.txt +0 -55
  131. package/dist/feral/node-code/output/dobbai-speak-node-code.d.ts +0 -11
  132. package/dist/feral/node-code/output/dobbai-speak-node-code.d.ts.map +0 -1
  133. package/dist/feral/node-code/output/dobbai-speak-node-code.js +0 -56
  134. package/dist/feral/node-code/output/dobbai-speak-node-code.js.map +0 -1
  135. package/dist/feral/node-code/output/dobbi-speak-node-code.d.ts +0 -15
  136. package/dist/feral/node-code/output/dobbi-speak-node-code.d.ts.map +0 -1
  137. package/dist/feral/node-code/output/dobbi-speak-node-code.js +0 -60
  138. package/dist/feral/node-code/output/dobbi-speak-node-code.js.map +0 -1
  139. package/dist/feral/node-code/output/dobbie-speak-node-code.d.ts +0 -11
  140. package/dist/feral/node-code/output/dobbie-speak-node-code.d.ts.map +0 -1
  141. package/dist/feral/node-code/output/dobbie-speak-node-code.js +0 -56
  142. package/dist/feral/node-code/output/dobbie-speak-node-code.js.map +0 -1
  143. package/dist/service/cron/process-evaluator.d.ts +0 -6
  144. package/dist/service/cron/process-evaluator.d.ts.map +0 -1
  145. package/dist/service/cron/process-evaluator.js +0 -126
  146. package/dist/service/cron/process-evaluator.js.map +0 -1
  147. package/dist/tools/project.d.ts +0 -2
  148. package/dist/tools/project.d.ts.map +0 -1
  149. package/dist/tools/project.js +0 -112
  150. package/dist/tools/project.js.map +0 -1
package/README.md CHANGED
@@ -1,245 +1,229 @@
1
- # Phaibel
2
-
3
- An AI-powered personal assistant that lives in your terminal. Phaibel manages your todos, events, notes, goals, people, and more — all stored as plain Markdown files in a local "vault" folder.
4
-
5
- Choose from 4 personalities and name your agent to make it truly yours.
6
-
7
- > **Requires an API key from [OpenAI](https://platform.openai.com) and/or [Anthropic](https://console.anthropic.com).**
8
-
9
- ```
10
- ___ __
11
- @@@@@@%%%%%%%%%%%%%%%%%##############%%#######%%%%%%%%%%%%%%@@@@@@@@@@@%%#########*+*#+++=:::::::::-
12
- @@@@@@@@%%%%%%%%%%%%#################%###********#######%%%@@@@@@%%####**##*+=-:::.:-+==+=::::::::::
13
- @@@@@@@@@@@@%%%%%%%%%%%%%########***###**********###%%%%@@%%%%###*****+=-:::........-+====::::::::::
14
- @@@@%*=+%@%%%%%%%%%%%%%%%%######****##******####%%%%%%%%#####*+++=-:::..............:+=-==::::::::::
15
- @@@@@##%@@@%%%%%%%%%%%%%%%%%##########*+*#%%%%%%%%%##*****+=+==-:...................:+=-=-::::::::::
16
- @@@@@@@@@@@@@@@@%%%%%%%%%%%%%#########++*%@%%%##***++=--::..:--::...................:=--=-::.:::::::
17
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%%%%#+=+####***+-::........:--::...................:=--=-:::::----:
18
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%###%*==+*****+=-:.-*%%%%%%%##*-:...................:=---===++**+===
19
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%#*****=-=++===::=#%@@@@@@@%####%*=:............:::--++---==++***+===
20
- @@@@@@@@@@@@@@@@%%%%%%%%%%%%%%@%#+==++---==----#@@@@@@%@@@%%##%%%##=..........:---==++-:-==+++++==--
21
- @@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%#*=--==-:-=--:=@@@@@@@@@@@@@%%##%@%%%*:......::-----=++-:-====+++=---
22
- @@@@@%%%%%%%%%%%%%%%%%%%%%#%#%%#+---==-:---:-*@@@@@@@@%#*++====*%%%#*-......-------=++-:-==+++++=---
23
- @@@@@@%%%%%%%%%%###############*=---==-:---::*@@@%#***++===-----*##*+-......:---====++-:-===++++=---
24
- @@%%%%%%%%%%#############***###*=-:--=-::--::*@@##**++++++==----+****-......:---====*+-:-===++++=---
25
- %%%%%%%%%%%############*******#*=:::--:::--::-%%###**++++==------=**#=:.....:----===+=::-====+++=-::
26
- %%%%%%%%%%%#######*******++****+-:::--:::-::::-%##**++++++*###*=::=*==+.....:---====+=::-=====+==-::
27
- %%%%%%%######*********++++++++*+-:::--:::-:::::=##%%@%#*+*%%@%#+=:-+=*=.....:------=+=::-====+++=-::
28
- %%%%%#######*********+++++++++*+-:::--:::-::::-=%%%%@%%*-=+**+=--::--+=.....:---====+=::---===+==--:
29
- %%%%%#######*******++++++++==+++-:::--:::-::::-+%##***#*-:--==-----:--:.....:------=+=::-====+++=---
30
- %%%%%%%%%%####*****+++++++====+=-:::--:::-::::*%@%****#*-:-=+=------:.......:------=+=::---======--:
31
- %%%%%@@%%%%###****++++++======+=-::::-:::-::-=**%@%***###+*====------......::------=+=::-=====++=---
32
- %%%%%%@@@%%########**++=======+=::::--:::-=+*%@@@@@%###%##+++**=-===-......:-------=+=::---======---
33
- @@@@@@@@@%%%%%%##*****++======+=::::--::-+++=++++@+#%%%%%%*+========-:.....:-----===+=::-====+++=---
34
- %%%%%%%@@%%%%%%#*+++++++======+=::::--::+**###%@@%:-*%#####+==--=++=--.:...:-------=+=::--====++=---
35
- %%%%%%@@@%%%%%%####**++=========::.::-:=**+=+***%%*::-*##**++=+*#*+=:..=*-.:-------=+=::---======---
36
- %@@@@@@@@@@@@%%####**++===+***+=::.::-=++++#%@@@@%*:::-#%%%##****+-:..-%#%*--------=+=::--====+===--
37
- @@@@@@@@@@@%%%%%%%#***++=+*##*+=::.::-**+=+%%@@@#+::::-*%%##***+-::::=%%%%%%#+=----=+=::---=======--
38
- @@@@@@@@%%%%%%%%%%%#*+++++++++==-::::=*+=-+#%%@%+-:-+%%**####+--::::=%%%%%@@@@%%#*==+=::--========--
39
- @%%@@@@@@@@%%%%#####*++==+*###*=-:::-=*+=-=+===+*#%@@@@**#%%*=-:::-=%@@%%@@@@@@@@%%%#+-:---=======--
40
- %%%@%%%%@@%%%%##%####*+++*%@%%#+-:::-+*+==-=-==#@@@@@@@%@@@@%@%*=-=%%@@@@@@@@@@@@@@@@%%%%%*+========
41
- ```
42
-
43
- ## Quick Start
44
-
45
- ```bash
46
- # Install globally
47
- npm install -g phaibel
48
-
49
- # Initialize your vault
50
- phaibel init
51
-
52
- # Add an API key (OpenAI or Anthropic)
53
- phaibel config add-provider openai
54
-
55
- # Launch the interactive shell
56
- phaibel
57
- ```
58
-
59
- That's it. Your agent is ready to serve.
60
-
61
- ## Personalities
62
-
63
- During onboarding, choose a personality for your agent:
64
-
65
- | Personality | Style |
66
- |-------------|-------|
67
- | **British Butler** | Formal, composed, measured. Refers to itself in the third person. "Very good, sir." |
68
- | **Rock Star** | High-energy, irreverent, enthusiastic. Uses slang and music metaphors. "Let's shred this to-do list!" |
69
- | **Executive Assistant** | Professional, crisp, efficient. Corporate tone, uses your name directly. "Done. Next item on your agenda." |
70
- | **Friend** | Warm, casual, supportive peer. "Hey! I took care of that for you." |
71
-
72
- You also choose a name for your agent — it becomes part of every interaction, from the CLI shell to the web UI.
73
-
74
- ## Requirements
75
-
76
- - **Node.js 18** or later
77
- - An API key from **OpenAI** and/or **Anthropic**
78
-
79
- ## Install from Source
80
-
81
- If you prefer to build from source:
82
-
83
- ```bash
84
- git clone https://github.com/clift-labs/phaibel.git
85
- cd phaibel
86
- npm install
87
- npm run build
88
- npm link
89
- ```
90
-
91
- ## What Phaibel Does
92
-
93
- All of your information stays **local** — stored as plain Markdown files with YAML frontmatter, organized into structured content types within your vault. Phaibel comes with built-in content types for common needs, and can create new ones on the fly when it needs a new way to store information.
94
-
95
- ### Content Types
96
-
97
- | Type | Description |
98
- |------|-------------|
99
- | **todo** | Tasks with priority, status, and due dates |
100
- | **event** | Calendar events with start/end times and locations |
101
- | **note** | Freeform notes |
102
- | **todont** | Things you're deliberately *not* doing |
103
-
104
- Your agent creates new content types as needed — just ask it to track something new and it'll figure out the right structure.
105
-
106
- ### Natural Language Chat
107
-
108
- Just type naturally and your agent figures out what to do:
109
-
110
- ```
111
- > remind me to call the dentist tomorrow
112
- > what's on my plate today?
113
- > create a goal to run a half marathon by June
114
- > add a note about the meeting with Sarah
115
- ```
116
-
117
- ### Dynamic Process Generation
118
-
119
- What sets Phaibel apart from other personal agents is that it **writes a unique software process for every request**. Instead of following rigid, pre-built workflows, it dynamically assembles a process graph tailored to exactly what you asked for.
120
-
121
- This is powered by the **FeralCCF** (Feral Catalog-Code Framework) library, which has three layers:
122
-
123
- - **NodeCode** reusable logic templates (e.g., "query todos", "format as markdown", "call LLM")
124
- - **CatalogNodes** configured instances of NodeCode with default settings
125
- - **ProcessNodes** the actual nodes wired together into a directed graph for a specific request
126
-
127
- When you say "show me my high-priority tasks due this week", your agent doesn't run a canned query — it builds a process that selects the right nodes, connects them, and executes the graph. The **Web UI** visualizes the process that was created for each action, so you can see exactly what happened and how.
128
-
129
- ## Commands
130
-
131
- Run `phaibel` with no arguments to enter the interactive shell, or use commands directly:
132
-
133
- | Command | Description |
134
- |---------|-------------|
135
- | `phaibel` | Launch interactive shell |
136
- | `phaibel init` | Initialize a new vault |
137
- | `phaibel interview` | Run (or re-run) the personality & onboarding interview |
138
- | `phaibel setup` | Change your name/gender preferences |
139
- | `phaibel today` | Show today's tasks and schedule |
140
- | `phaibel todo [title]` | Create or list tasks |
141
- | `phaibel todo done <title>` | Mark a task complete |
142
- | `phaibel event [title]` | Create or list events |
143
- | `phaibel note [title]` | Create or list notes |
144
- | `phaibel goal [title]` | Create or list goals |
145
- | `phaibel person [name]` | Create or list people |
146
- | `phaibel todont [title]` | Create or list todonts |
147
- | `phaibel remember <text>` | Quick-capture to inbox |
148
- | `phaibel cal` | Calendar view |
149
- | `phaibel config` | View/manage LLM configuration |
150
- | `phaibel service start` | Start the background service + web UI |
151
- | `phaibel shell` | Enter interactive mode (same as no args) |
152
-
153
- ## BYOK (Bring Your Own Key)
154
-
155
- Phaibel doesn't come with an API key — you bring your own from [OpenAI](https://platform.openai.com) and/or [Anthropic](https://console.anthropic.com). Your keys are stored locally in `~/.phaibel/secrets.json` and never leave your machine.
156
-
157
- ```bash
158
- # Add OpenAI
159
- phaibel config add-provider openai
160
-
161
- # Add Anthropic
162
- phaibel config add-provider anthropic
163
-
164
- # Or both Phaibel will use each provider's strengths
165
- ```
166
-
167
- When both providers are configured, Phaibel automatically picks the best model for each task based on six **capabilities**:
168
-
169
- | Capability | What it does | OpenAI default | Anthropic default |
170
- |------------|-------------|----------------|-------------------|
171
- | reason | Complex thinking | gpt-4o | claude-opus-4-6 |
172
- | chat | Conversation | gpt-4o | claude-sonnet-4-6 |
173
- | summarize | Condensing info | gpt-4o-mini | claude-haiku-4-5 |
174
- | categorize | Classification | gpt-4o-mini | claude-haiku-4-5 |
175
- | format | Text formatting | gpt-4o-mini | claude-haiku-4-5 |
176
- | embed | Vector embeddings | text-embedding-3-small | *(not supported)* |
177
-
178
- You can override any mapping:
179
-
180
- ```bash
181
- phaibel config set-capability reason anthropic claude-sonnet-4-6
182
- phaibel config reset-capability reason # restore auto-selection
183
- phaibel config # view current configuration
184
- ```
185
-
186
- ### Where Things Live
187
-
188
- ```
189
- ~/.phaibel/
190
- secrets.json # API keys (never committed)
191
-
192
- your-vault/
193
- .vault.md # Vault root context (read by the LLM)
194
- .state.json # User profile (name, personality, agent name)
195
- .phaibel/ # Vault-scoped config
196
- config.json # LLM capability overrides
197
- entity-types.json # Custom entity type definitions
198
- todos/ # Markdown files with YAML frontmatter
199
- events/
200
- notes/
201
- goals/
202
- people/
203
- recurrences/
204
- todonts/
205
- inbox/
206
- ```
207
-
208
- Every entity is a plain `.md` file. You can edit them with any text editor, sync them with Git, or back them up however you like.
209
-
210
- ## Web UI
211
-
212
- Phaibel includes a browser-based dashboard:
213
-
214
- ```bash
215
- phaibel service start
216
- ```
217
-
218
- This starts a background daemon with a web UI (default: `http://localhost:3737`) that shows:
219
-
220
- - Today's tasks with priority badges
221
- - 3-day calendar view
222
- - Chat interface with the same natural language capabilities as the CLI
223
- - Interactive Q&A when your agent needs clarification during a process
224
-
225
- ## The Interactive Shell
226
-
227
- When you run `phaibel` with no arguments, you get a full interactive shell with:
228
-
229
- - **Tab completion** for commands
230
- - **Up/Down arrow** history
231
- - **Natural language fallback** — anything that isn't a command gets routed to the AI chat
232
- - **Vault context** — the LLM reads `.vault.md` for project-specific context
233
-
234
- ## Development
235
-
236
- ```bash
237
- npm run dev # Run with tsx (hot reload)
238
- npm test # Run unit tests
239
- npm run test:all # Run all tests including integration
240
- npm run build # Compile TypeScript to dist/
241
- ```
242
-
243
- ## License
244
-
245
- MIT © [Clift Labs](https://github.com/clift-labs)
1
+ # Phaibel
2
+
3
+ An AI-powered personal assistant that manages your tasks, events, notes, goals, people, and more — all stored as plain Markdown files in a local "vault" folder.
4
+
5
+ Choose from 4 personalities and name your agent to make it truly yours.
6
+
7
+ > **Requires an API key from [OpenAI](https://platform.openai.com) and/or [Anthropic](https://console.anthropic.com).**
8
+
9
+ ```
10
+ ___ __
11
+ @@@@@@%%%%%%%%%%%%%%%%%##############%%#######%%%%%%%%%%%%%%@@@@@@@@@@@%%#########*+*#+++=:::::::::-
12
+ @@@@@@@@%%%%%%%%%%%%#################%###********#######%%%@@@@@@%%####**##*+=-:::.:-+==+=::::::::::
13
+ @@@@@@@@@@@@%%%%%%%%%%%%%########***###**********###%%%%@@%%%%###*****+=-:::........-+====::::::::::
14
+ @@@@%*=+%@%%%%%%%%%%%%%%%%######****##******####%%%%%%%%#####*+++=-:::..............:+=-==::::::::::
15
+ @@@@@##%@@@%%%%%%%%%%%%%%%%%##########*+*#%%%%%%%%%##*****+=+==-:...................:+=-=-::::::::::
16
+ @@@@@@@@@@@@@@@@%%%%%%%%%%%%%#########++*%@%%%##***++=--::..:--::...................:=--=-::.:::::::
17
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%%%%#+=+####***+-::........:--::...................:=--=-:::::----:
18
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%###%*==+*****+=-:.-*%%%%%%%##*-:...................:=---===++**+===
19
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%#*****=-=++===::=#%@@@@@@@%####%*=:............:::--++---==++***+===
20
+ @@@@@@@@@@@@@@%%%%%%%%%%%%%%@%#+==++---==----#@@@@@@%@@@%%##%%%##=..........:---==++-:-==+++++==--
21
+ @@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%#*=--==-:-=--:=@@@@@@@@@@@@@%%##%@%%%*:......::-----=++-:-====+++=---
22
+ @@@@@%%%%%%%%%%%%%%%%%%%%%#%#%%#+---==-:---:-*@@@@@@@@%#*++====*%%%#*-......-------=++-:-==+++++=---
23
+ @@@@@@%%%%%%%%%%###############*=---==-:---::*@@@%#***++===-----*##*+-......:---====++-:-===++++=---
24
+ @@%%%%%%%%%%#############***###*=-:--=-::--::*@@##**++++++==----+****-......:---====*+-:-===++++=---
25
+ %%%%%%%%%%%############*******#*=:::--:::--::-%%###**++++==------=**#=:.....:----===+=::-====+++=-::
26
+ %%%%%%%%%%%#######*******++****+-:::--:::-::::-%##**++++++*###*=::=*==+.....:---====+=::-=====+==-::
27
+ %%%%%%%######*********++++++++*+-:::--:::-:::::=##%%@%#*+*%%@%#+=:-+=*=.....:------=+=::-====+++=-::
28
+ %%%%%#######*********+++++++++*+-:::--:::-::::-=%%%%@%%*-=+**+=--::--+=.....:---====+=::---===+==--:
29
+ %%%%%#######*******++++++++==+++-:::--:::-::::-+%##***#*-:--==-----:--:.....:------=+=::-====+++=---
30
+ %%%%%%%%%%####*****+++++++====+=-:::--:::-::::*%@%****#*-:-=+=------:.......:------=+=::---======--:
31
+ %%%%%@@%%%%###****++++++======+=-::::-:::-::-=**%@%***###+*====------......::------=+=::-=====++=---
32
+ %%%%%%@@@%%########**++=======+=::::--:::-=+*%@@@@@%###%##+++**=-===-......:-------=+=::---======---
33
+ @@@@@@@@@%%%%%%##*****++======+=::::--::-+++=++++@+#%%%%%%*+========-:.....:-----===+=::-====+++=---
34
+ %%%%%%%@@%%%%%%#*+++++++======+=::::--::+**###%@@%:-*%#####+==--=++=--.:...:-------=+=::--====++=---
35
+ %%%%%%@@@%%%%%%####**++=========::.::-:=**+=+***%%*::-*##**++=+*#*+=:..=*-.:-------=+=::---======---
36
+ %@@@@@@@@@@@@%%####**++===+***+=::.::-=++++#%@@@@%*:::-#%%%##****+-:..-%#%*--------=+=::--====+===--
37
+ @@@@@@@@@@@%%%%%%%#***++=+*##*+=::.::-**+=+%%@@@#+::::-*%%##***+-::::=%%%%%%#+=----=+=::---=======--
38
+ @@@@@@@@%%%%%%%%%%%#*+++++++++==-::::=*+=-+#%%@%+-:-+%%**####+--::::=%%%%%@@@@%%#*==+=::--========--
39
+ @%%@@@@@@@@%%%%#####*++==+*###*=-:::-=*+=-=+===+*#%@@@@**#%%*=-:::-=%@@%%@@@@@@@@%%%#+-:---=======--
40
+ %%%@%%%%@@%%%%##%####*+++*%@%%#+-:::-+*+==-=-==#@@@@@@@%@@@@%@%*=-=%%@@@@@@@@@@@@@@@@%%%%%*+========
41
+ ```
42
+
43
+ ## Quick Start
44
+
45
+ ### 1. Install
46
+
47
+ ```bash
48
+ # Install globally
49
+ npm install -g phaibel
50
+
51
+ # Or build from source
52
+ git clone https://github.com/clift-labs/phaibel.git
53
+ cd phaibel
54
+ npm install
55
+ npm run build
56
+ npm link
57
+ ```
58
+
59
+ ### 2. Create a vault
60
+
61
+ Navigate to a directory where you want your data stored:
62
+
63
+ ```bash
64
+ mkdir my-vault && cd my-vault
65
+ phaibel init
66
+ ```
67
+
68
+ This creates a `.vault.md` marker, entity directories (todos, events, notes, etc.), and prompts you to configure an AI provider API key.
69
+
70
+ ### 3. Start the service
71
+
72
+ ```bash
73
+ phaibel service start
74
+ ```
75
+
76
+ ### 4. Open the web client
77
+
78
+ Visit **http://localhost:3737** in your browser.
79
+
80
+ If this is a new vault, you'll see an onboarding wizard that walks you through:
81
+
82
+ 1. **Personality** — choose how your agent communicates
83
+ 2. **Identity** — name your agent and introduce yourself
84
+ 3. **Profile** — optional context about your work, goals, and life
85
+
86
+ After onboarding, chat with your agent using natural language:
87
+
88
+ ```
89
+ remind me to call the dentist tomorrow
90
+ what's on my plate today?
91
+ create a goal to run a half marathon by June
92
+ add a note about the meeting with Sarah
93
+ ```
94
+
95
+ ## Personalities
96
+
97
+ | Personality | Style |
98
+ |-------------|-------|
99
+ | **British Butler** | Formal, composed, measured. "Very good, sir." |
100
+ | **Rock Star** | High-energy, irreverent, enthusiastic. "Let's shred this to-do list!" |
101
+ | **Executive Assistant** | Professional, crisp, efficient. "Done. Next item on your agenda." |
102
+ | **Friend** | Warm, casual, supportive peer. "Hey! I took care of that for you." |
103
+
104
+ ## CLI Commands
105
+
106
+ The CLI is an admin toolkit for managing Phaibel. The web client at `http://localhost:3737` is the primary user interface.
107
+
108
+ Run `phaibel --help` to see all commands:
109
+
110
+ | Command | Description |
111
+ |---------|-------------|
112
+ | `phaibel init` | Create a new vault in the current directory |
113
+ | `phaibel config` | Manage API keys and LLM provider settings |
114
+ | `phaibel service start\|stop\|restart\|status` | Manage the background daemon |
115
+ | `phaibel queue status\|pause\|resume\|clear` | Inspect the task queue |
116
+ | `phaibel index stats\|rebuild\|graph\|neighbors` | Manage the entity relationship graph |
117
+ | `phaibel cron list\|enable\|disable\|run` | Manage scheduled background jobs |
118
+ | `phaibel feral` | Inspect the Feral CCF flow engine |
119
+ | `phaibel sync` | Git-based vault sync |
120
+ | `phaibel setup` | Update your name and preferences |
121
+ | `phaibel type list\|add\|edit\|remove` | Manage entity type schemas |
122
+ | `phaibel entity <type> [action]` | CRUD for any entity type |
123
+ | `phaibel skill` | Manage MCP skill servers |
124
+ | `phaibel tool <name> [input]` | Run a registered tool directly |
125
+ | `phaibel tools` | List all available tools |
126
+
127
+ ## Content Types
128
+
129
+ | Type | Description |
130
+ |------|-------------|
131
+ | **todo** | Tasks with priority, status, and due dates |
132
+ | **event** | Calendar events with start/end times and locations |
133
+ | **note** | Freeform notes |
134
+ | **todont** | Things you're deliberately *not* doing |
135
+
136
+ Your agent creates new content types as needed — just ask it to track something new.
137
+
138
+ ## How It Works
139
+
140
+ Phaibel **writes a unique software process for every request**. Instead of following rigid workflows, it dynamically assembles a process graph tailored to what you asked for.
141
+
142
+ This is powered by **Feral CCF** (Catalog-Code Framework):
143
+
144
+ - **NodeCode** reusable logic blocks (e.g., "query todos", "format as markdown", "call LLM")
145
+ - **CatalogNodes** configured instances with default settings
146
+ - **ProcessNodes** nodes wired together into a directed graph for a specific request
147
+
148
+ The web UI visualizes the process created for each action so you can see exactly what happened.
149
+
150
+ ## BYOK (Bring Your Own Key)
151
+
152
+ Your keys are stored locally in `~/.phaibel/secrets.json` and never leave your machine.
153
+
154
+ ```bash
155
+ phaibel config add-provider openai
156
+ phaibel config add-provider anthropic
157
+ ```
158
+
159
+ When both providers are configured, Phaibel picks the best model for each task:
160
+
161
+ | Capability | What it does | OpenAI default | Anthropic default |
162
+ |------------|-------------|----------------|-------------------|
163
+ | reason | Complex thinking | gpt-4o | claude-opus-4-6 |
164
+ | chat | Conversation | gpt-4o | claude-sonnet-4-6 |
165
+ | summarize | Condensing info | gpt-4o-mini | claude-haiku-4-5 |
166
+ | categorize | Classification | gpt-4o-mini | claude-haiku-4-5 |
167
+ | format | Text formatting | gpt-4o-mini | claude-haiku-4-5 |
168
+ | embed | Vector embeddings | text-embedding-3-small | *(not supported)* |
169
+
170
+ Override any mapping:
171
+
172
+ ```bash
173
+ phaibel config set-capability reason anthropic claude-sonnet-4-6
174
+ phaibel config reset-capability reason
175
+ ```
176
+
177
+ ## Where Things Live
178
+
179
+ ```
180
+ ~/.phaibel/
181
+ secrets.json # API keys (never committed)
182
+ phaibel.pid # Daemon PID
183
+ phaibel.sock # Unix socket
184
+
185
+ your-vault/
186
+ .vault.md # Vault root context (read by the LLM)
187
+ .state.json # User profile (name, personality, agent name)
188
+ .phaibel/ # Vault-scoped config
189
+ config.json # LLM capability overrides
190
+ entity-types.json # Entity type definitions
191
+ logs/ # Chat session logs
192
+ processes/ # Saved Feral processes
193
+ todos/
194
+ events/
195
+ notes/
196
+ goals/
197
+ people/
198
+ recurrences/
199
+ todonts/
200
+ inbox/
201
+ ```
202
+
203
+ Every entity is a plain `.md` file. Edit them with any text editor, sync with Git, or back up however you like.
204
+
205
+ ## Environment Variables
206
+
207
+ | Variable | Description |
208
+ |----------|-------------|
209
+ | `PHAIBEL_VAULT` | Override vault root path |
210
+ | `PHAIBEL_SERVICE=1` | Internal: marks the process as the daemon |
211
+ | `PHAIBEL_DEBUG=1` | Enable verbose debug output |
212
+
213
+ ## Development
214
+
215
+ ```bash
216
+ npm run dev # Run with tsx (hot reload)
217
+ npm test # Run unit tests
218
+ npm run test:all # Run all tests including integration
219
+ npm run build # Compile TypeScript to dist/
220
+ ```
221
+
222
+ ## Requirements
223
+
224
+ - Node.js >= 18
225
+ - An API key from OpenAI and/or Anthropic
226
+
227
+ ## License
228
+
229
+ MIT © [Clift Labs](https://github.com/clift-labs)
@@ -1,3 +1,6 @@
1
- export declare function feralChatHeadless(userInput: string, onStatus?: (status: string) => void, onProcess?: (processJson: Record<string, unknown>) => void, onQuestion?: (question: string, options?: string[]) => Promise<string>, onChatId?: (chatId: string) => void): Promise<string>;
2
- export declare function feralChat(userInput: string): Promise<void>;
1
+ export interface ChatHistoryEntry {
2
+ role: 'user' | 'assistant';
3
+ content: string;
4
+ }
5
+ export declare function feralChatHeadless(userInput: string, onStatus?: (status: string) => void, onProcess?: (processJson: Record<string, unknown>) => void, onQuestion?: (question: string, options?: string[]) => Promise<string>, onChatId?: (chatId: string) => void, history?: ChatHistoryEntry[]): Promise<string>;
3
6
  //# sourceMappingURL=chat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAkLA,wBAAsB,iBAAiB,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAC1D,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,EACtE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GACpC,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAylBD,wBAAsB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhE"}
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAiLA,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACnB;AAmBD,wBAAsB,iBAAiB,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAC1D,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,EACtE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACnC,OAAO,CAAC,EAAE,gBAAgB,EAAE,GAC7B,OAAO,CAAC,MAAM,CAAC,CAiBjB"}