npcsh 1.1.14__tar.gz → 1.1.15__tar.gz

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 (124) hide show
  1. {npcsh-1.1.14 → npcsh-1.1.15}/PKG-INFO +399 -58
  2. {npcsh-1.1.14 → npcsh-1.1.15}/README.md +398 -57
  3. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/_state.py +488 -77
  4. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/mcp_server.py +2 -1
  5. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc.py +84 -32
  6. npcsh-1.1.15/npcsh/npc_team/alicanto.npc +23 -0
  7. npcsh-1.1.15/npcsh/npc_team/corca.npc +31 -0
  8. npcsh-1.1.15/npcsh/npc_team/frederic.npc +27 -0
  9. npcsh-1.1.15/npcsh/npc_team/guac.npc +22 -0
  10. npcsh-1.1.15/npcsh/npc_team/jinxs/bin/nql.jinx +141 -0
  11. npcsh-1.1.15/npcsh/npc_team/jinxs/bin/sync.jinx +230 -0
  12. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/bin}/vixynt.jinx +8 -30
  13. npcsh-1.1.15/npcsh/npc_team/jinxs/bin/wander.jinx +152 -0
  14. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/browser/browser_action.jinx +220 -0
  15. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/browser/browser_screenshot.jinx +40 -0
  16. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/browser/close_browser.jinx +14 -0
  17. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/browser/open_browser.jinx +43 -0
  18. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use/click.jinx +23 -0
  19. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use/key_press.jinx +26 -0
  20. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use/launch_app.jinx +37 -0
  21. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use/screenshot.jinx +23 -0
  22. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use/type_text.jinx +27 -0
  23. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use/wait.jinx +21 -0
  24. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/edit_file.jinx +3 -3
  25. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/load_file.jinx +1 -1
  26. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core/paste.jinx +134 -0
  27. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/search.jinx +2 -1
  28. {npcsh-1.1.14/npcsh/npc_team/jinxs/code → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/sh.jinx +2 -8
  29. {npcsh-1.1.14/npcsh/npc_team/jinxs/code → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/sql.jinx +1 -1
  30. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/orchestration/convene.jinx +232 -0
  31. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/orchestration/delegate.jinx +184 -0
  32. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/research/arxiv.jinx +76 -0
  33. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/research/paper_search.jinx +101 -0
  34. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/research/semantic_scholar.jinx +69 -0
  35. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils/core → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils}/build.jinx +8 -8
  36. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils/jinxs.jinx +176 -0
  37. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils/shh.jinx +17 -0
  38. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils/switch.jinx +62 -0
  39. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils/switches.jinx +61 -0
  40. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils/teamviz.jinx +205 -0
  41. npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils/verbose.jinx +17 -0
  42. npcsh-1.1.15/npcsh/npc_team/kadiefa.npc +21 -0
  43. npcsh-1.1.15/npcsh/npc_team/plonk.npc +27 -0
  44. npcsh-1.1.15/npcsh/npc_team/plonkjr.npc +23 -0
  45. npcsh-1.1.15/npcsh/npc_team/sibiji.npc +24 -0
  46. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npcsh.py +153 -39
  47. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/ui.py +22 -1
  48. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh.egg-info/PKG-INFO +399 -58
  49. npcsh-1.1.15/npcsh.egg-info/SOURCES.txt +103 -0
  50. npcsh-1.1.15/npcsh.egg-info/entry_points.txt +19 -0
  51. npcsh-1.1.15/npcsh.egg-info/top_level.txt +2 -0
  52. npcsh-1.1.15/project/__init__.py +1 -0
  53. {npcsh-1.1.14 → npcsh-1.1.15}/setup.py +20 -8
  54. npcsh-1.1.14/npcsh/npc_team/alicanto.npc +0 -2
  55. npcsh-1.1.14/npcsh/npc_team/corca.npc +0 -12
  56. npcsh-1.1.14/npcsh/npc_team/foreman.npc +0 -7
  57. npcsh-1.1.14/npcsh/npc_team/frederic.npc +0 -6
  58. npcsh-1.1.14/npcsh/npc_team/jinxs/modes/alicanto.jinx +0 -194
  59. npcsh-1.1.14/npcsh/npc_team/jinxs/modes/corca.jinx +0 -249
  60. npcsh-1.1.14/npcsh/npc_team/jinxs/modes/guac.jinx +0 -317
  61. npcsh-1.1.14/npcsh/npc_team/jinxs/modes/plonk.jinx +0 -214
  62. npcsh-1.1.14/npcsh/npc_team/jinxs/modes/pti.jinx +0 -170
  63. npcsh-1.1.14/npcsh/npc_team/jinxs/modes/wander.jinx +0 -186
  64. npcsh-1.1.14/npcsh/npc_team/jinxs/utils/agent.jinx +0 -17
  65. npcsh-1.1.14/npcsh/npc_team/jinxs/utils/core/jinxs.jinx +0 -32
  66. npcsh-1.1.14/npcsh/npc_team/kadiefa.npc +0 -3
  67. npcsh-1.1.14/npcsh/npc_team/plonk.npc +0 -2
  68. npcsh-1.1.14/npcsh/npc_team/plonkjr.npc +0 -2
  69. npcsh-1.1.14/npcsh/npc_team/sibiji.npc +0 -3
  70. npcsh-1.1.14/npcsh.egg-info/SOURCES.txt +0 -85
  71. npcsh-1.1.14/npcsh.egg-info/entry_points.txt +0 -9
  72. npcsh-1.1.14/npcsh.egg-info/top_level.txt +0 -1
  73. {npcsh-1.1.14 → npcsh-1.1.15}/LICENSE +0 -0
  74. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/__init__.py +0 -0
  75. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/alicanto.py +0 -0
  76. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/build.py +0 -0
  77. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/completion.py +0 -0
  78. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/config.py +0 -0
  79. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/corca.py +0 -0
  80. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/execution.py +0 -0
  81. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/guac.py +0 -0
  82. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/mcp_helpers.py +0 -0
  83. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/alicanto.png +0 -0
  84. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/corca.png +0 -0
  85. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/corca_example.png +0 -0
  86. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/frederic4.png +0 -0
  87. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/guac.png +0 -0
  88. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/bin}/roll.jinx +0 -0
  89. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/bin}/sample.jinx +0 -0
  90. {npcsh-1.1.14/npcsh/npc_team/jinxs/modes → npcsh-1.1.15/npcsh/npc_team/jinxs/bin}/spool.jinx +0 -0
  91. {npcsh-1.1.14/npcsh/npc_team/jinxs/modes → npcsh-1.1.15/npcsh/npc_team/jinxs/bin}/yap.jinx +0 -0
  92. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/computer_use}/trigger.jinx +0 -0
  93. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/chat.jinx +0 -0
  94. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/cmd.jinx +0 -0
  95. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/compress.jinx +0 -0
  96. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/ots.jinx +0 -0
  97. {npcsh-1.1.14/npcsh/npc_team/jinxs/code → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/python.jinx +0 -0
  98. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/core}/sleep.jinx +0 -0
  99. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils/core → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils}/compile.jinx +0 -0
  100. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils/core → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils}/help.jinx +0 -0
  101. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils/core → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils}/init.jinx +0 -0
  102. {npcsh-1.1.14/npcsh/npc_team/jinxs → npcsh-1.1.15/npcsh/npc_team/jinxs/lib}/utils/serve.jinx +0 -0
  103. {npcsh-1.1.14/npcsh/npc_team/jinxs/utils/core → npcsh-1.1.15/npcsh/npc_team/jinxs/lib/utils}/set.jinx +0 -0
  104. {npcsh-1.1.14/npcsh/npc_team/jinxs → npcsh-1.1.15/npcsh/npc_team/jinxs/lib}/utils/usage.jinx +0 -0
  105. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/jinxs/npc_studio/npc-studio.jinx +0 -0
  106. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/kadiefa.png +0 -0
  107. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/npcsh.ctx +0 -0
  108. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/npcsh_sibiji.png +0 -0
  109. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/plonk.png +0 -0
  110. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/plonkjr.png +0 -0
  111. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/sibiji.png +0 -0
  112. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/spool.png +0 -0
  113. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/npc_team/yap.png +0 -0
  114. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/parsing.py +0 -0
  115. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/plonk.py +0 -0
  116. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/pti.py +0 -0
  117. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/routes.py +0 -0
  118. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/spool.py +0 -0
  119. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/wander.py +0 -0
  120. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh/yap.py +0 -0
  121. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh.egg-info/dependency_links.txt +0 -0
  122. {npcsh-1.1.14 → npcsh-1.1.15}/npcsh.egg-info/requires.txt +0 -0
  123. {npcsh-1.1.14 → npcsh-1.1.15}/setup.cfg +0 -0
  124. {npcsh-1.1.14 → npcsh-1.1.15}/tests/test_tool_routing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcsh
3
- Version: 1.1.14
3
+ Version: 1.1.15
4
4
  Summary: npcsh is a command-line toolkit for using AI agents in novel ways.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcsh
6
6
  Author: Christopher Agostino
@@ -100,12 +100,14 @@ Dynamic: summary
100
100
 
101
101
  <p align="center">
102
102
  <a href= "https://github.com/npc-worldwide/npcsh/blob/main/docs/npcsh.md">
103
- <img src="https://raw.githubusercontent.com/npc-worldwide/npcsh/main/npcsh/npcsh.png" alt="npcsh logo" width=250></a>
103
+ <img src="https://raw.githubusercontent.com/NPC-Worldwide/npcsh/main/npcsh/npcsh.png" alt="npcsh logo" width=600></a>
104
104
  </p>
105
105
 
106
106
  # NPC Shell
107
107
 
108
- The NPC shell is the toolkit for tomorrow, providing a suite of programs to make use of multi-modal LLMs and agents in novel interactive modes. `npcsh` is based in the command line, and so can be used wherever you work.
108
+ `npcsh` - a new standard in human-agent interaction. Co-create with agents to build organizations that refine themselves and evolve to your needs.
109
+
110
+ The NPC shell is a suite of programs to make use of multi-modal LLMs and agents in novel interactive modes. Based in the command line, use it wherever you work.
109
111
 
110
112
  - It is developed to work reliably with small models and performs excellently with the state-of-the-art models from major model providers.
111
113
  - Fundamentally, the core program of npcsh extends the familiar bash environment with an intelligent layer that lets users seamlessly ask agents questions, run pre-built or custom macros or agents, all without breaking the flow of command-line work.
@@ -125,7 +127,7 @@ Once installed: run
125
127
  ```bash
126
128
  npcsh
127
129
  ```
128
- and you will enter the NPC shell. Additionally, the pip installation includes the following CLI tools available in bash: `corca`, `guac`, `npc` cli, `pti`, `spool`, `wander`, and`yap`.
130
+ and you will enter the NPC shell. Additionally, the pip installation includes the following CLI tools available in bash: `npc` cli, `wander`, `spool`, `yap`, and `nql`. Bin jinxs in `npc_team/jinxs/bin/` are automatically registered as CLI commands.
129
131
 
130
132
 
131
133
  # Usage
@@ -204,10 +206,19 @@ and you will enter the NPC shell. Additionally, the pip installation includes th
204
206
  <img src="https://raw.githubusercontent.com/NPC-Worldwide/npcsh/main/test_data/hatridingdog.gif" alt="video of a hat riding a dog", width=250>
205
207
  </p>
206
208
 
207
- - **Serve an NPC Team**
209
+ - **Serve an NPC Team** (Agentic API Server)
208
210
  ```bash
209
211
  /serve --port 5337 --cors='http://localhost:5137/'
210
212
  ```
213
+ This exposes your NPC team as a full agentic server with:
214
+ - **OpenAI-compatible endpoints** for drop-in LLM replacement
215
+ - `POST /v1/chat/completions` - Chat with NPCs (use `agent` param to select NPC)
216
+ - `GET /v1/models` - List available NPCs as models
217
+ - **NPC management**
218
+ - `GET /npcs` - List team NPCs with their capabilities
219
+ - `POST /chat` - Direct chat with NPC selection
220
+ - **Jinx controls** - Execute jinxs remotely via API
221
+ - **Team orchestration** - Delegate tasks and convene discussions programmatically
211
222
  - **Screenshot Analysis**: select an area on your screen and then send your question to the LLM
212
223
  ```bash
213
224
  /ots
@@ -217,7 +228,7 @@ and you will enter the NPC shell. Additionally, the pip installation includes th
217
228
  /corca --mcp-server-path /path.to.server.py
218
229
  ```
219
230
 
220
- - **Build an NPC Team**:
231
+ - **Build an NPC Team**:
221
232
 
222
233
  ``` bash
223
234
  npc build flask --output ./dist --port 5337
@@ -226,6 +237,28 @@ and you will enter the NPC shell. Additionally, the pip installation includes th
226
237
  npc build static --api_url https://api.example.com
227
238
  ```
228
239
 
240
+ - **NQL - AI-Powered SQL Models**:
241
+ Run SQL models with embedded AI transformations using NPC agents:
242
+ ```bash
243
+ # List available models
244
+ nql show=1
245
+
246
+ # Run all models in dependency order
247
+ nql
248
+
249
+ # Run a specific model
250
+ nql model=daily_summary
251
+
252
+ # Schedule with cron (runs daily at 6am)
253
+ nql install_cron="0 6 * * *"
254
+ ```
255
+
256
+ - **Visualize Team Structure**:
257
+ ```bash
258
+ npc teamviz save=team_structure.png
259
+ ```
260
+ Generates network and ordered views showing NPCs, jinxs, and their relationships.
261
+
229
262
  # NPC Data Layer
230
263
 
231
264
  The core of npcsh's capabilities is powered by the NPC Data Layer. Upon initialization, a user will be prompted to make a team in the current directory or to use a global team stored in `~/.npcsh/` which houses the NPC team with its jinxs, models, contexts, assembly lines. By implementing these components as simple data structures, users can focus on tweaking the relevant parts of their multi-agent systems.
@@ -237,6 +270,7 @@ Users can extend NPC capabilities through simple YAML files:
237
270
  - **NPCs** (.npc): are defined with a name, primary directive, and optional model specifications
238
271
  - **Jinxs** (.jinx): Jinja execution templates that provide function-like capabilities and scaleable extensibility through Jinja references to call other jinxs to build upon. Jinxs are executed through prompt-based flows, allowing them to be used by models regardless of their tool-calling capabilities, making it possible then to enable agents at the edge of computing through this simple methodology.
239
272
  - **Context** (.ctx): Specify contextual information, team preferences, MCP server paths, database connections, and other environment variables that are loaded for the team or for specific agents (e.g. `GUAC_FORENPC`). Teams are specified by their path and the team name in the `<team>.ctx` file. Teams organize collections of NPCs with shared context and specify a coordinator within the team context who is used whenever the team is called upon for orchestration.
273
+ - **SQL Models** (.sql): NQL (NPC Query Language) models combine SQL with AI-powered transformations. Place `.sql` files in `npc_team/models/` to create data pipelines with embedded LLM calls.
240
274
 
241
275
  The NPC Shell system integrates the capabilities of `npcpy` to maintain conversation history, track command execution, and provide intelligent autocomplete through an extensible command routing system. State is preserved between sessions, allowing for continuous knowledge building over time.
242
276
 
@@ -244,40 +278,334 @@ This architecture enables users to build complex AI workflows while maintaining
244
278
 
245
279
  Importantly, users can switch easily between the NPCs they are chatting with by typing `/n npc_name` within the NPC shell. Likewise, they can create Jinxs and then use them from within the NPC shell by invoking the jinx name and the arguments required for the Jinx; `/<jinx_name> arg1 arg2`
246
280
 
247
- # Jinx as macros
248
- - activated by invoking `/<jinx_name> ...` in `npcsh`, jinxs can be called in bash or through the `npc` CLI. In our examples, we provide both `npcsh` calls as well as bash calls with the `npc` cli where relevant. For converting any `/<command>` in `npcsh` to a bash version, replace the `/` with `npc ` and the macro command will be invoked as a positional argument.
249
- - `/alicanto` - Conduct deep research with multiple perspectives, identifying gold insights and cliff warnings. Usage: `/alicanto 'query to be researched' --num-npcs <int> --depth <int>`
250
- - `/build` - Builds the current npc team to an executable format . Usage: `/build <output[flask,docker,cli,static]> --options`
251
- - `/breathe` - Condense context on a regular cadence. Usage: `/breathe -p <provider: NPCSH_CHAT_PROVIDER> -m <model: NPCSH_CHAT_MODEL>`
252
- - `/compile` - Compile NPC profiles. Usage: `/compile <path_to_npc> `
253
- - `/corca` - Enter the Corca MCP-powered agentic shell. Usage: `/corca [--mcp-server-path path]`
254
- - `/guac` - Enter guac mode. Usage: `/guac`
255
- - `/help` - Show help for commands, NPCs, or Jinxs. Usage: `/help`
256
- - `/init` - Initialize NPC project. Usage: `/init`
257
- - `/jinxs` - Show available jinxs for the current NPC/Team. Usage: `/jinxs`
258
- - `/<jinx_name>` - Run a jinx with specified command line arguments. `/<jinx_name> jinx_arg1 jinx_arg2`
259
- - `/npc-studio` - Start npc studio. Pulls NPC Studio github to `~/.npcsh/npc-studio` and launches it in development mode after installing necessary NPM dependencies.Usage: `/npc-studio`
260
- - `/ots` - Take screenshot and analyze with vision model. Usage: `/ots filename=<output_file_name_for_screenshot>` then select an area, and you will be prompted for your request.
261
- - `/plonk` - Use vision model to interact with GUI. Usage: `/plonk '<task description>' `
262
- - `/pti` - Use pardon-the-interruption mode to interact with reasoning model LLM. Usage: `/pti`
263
- - `/roll` - generate a video with video generation model. Usage: `/roll '<description_for_a_movie>' --vgmodel <NPCSH_VIDEO_GEN_MODEL> --vgprovider <NPCSH_VIDEO_GEN_PROVIDER>`
264
- - `/sample` - Send a context-free prompt to an LLM, letting you get fresh answers without needing to start a separate conversation/shell. Usage: `/sample -m <NPCSH_CHAT_MODEL> 'question to sample --temp <float> --top_k int`
265
- - `/search` - Execute a search command on the web, in your memories, in the knowledge graph, or in documents with rag. Usage: `/search 'search query' --sprovider <provider>` where provider is currently limited to DuckDuckGo, Perplexity, and Exa with more coming soon through litellm. Wikipedia integration ongoing. See above for more search specific examples.
266
- - `/serve` - Serve an NPC Team server.
267
- - `/set` - Set configuration values.
268
- - Usage:
269
- - `/set model gemma3:4b`,
270
- - `/set provider ollama`,
271
- - `/set NPCSH_VIDEO_GEN_PROVIDER diffusers`
272
- - `/sleep` - Evolve knowledge graph with options for dreaming. Usage: `/sleep --ops link_facts,deepen`
273
- - `/spool` - Enter interactive chat (spool) mode with an npc with fresh context or files for rag. Usage: `/spool --attachments 'path1,path2,path3' -n <npc_name> -m <modell> -p <provider>`
274
- - `/trigger` - Execute a trigger command. Usage: `/trigger 'a description of a trigger to implement with system daemons/file system listeners.' -m gemma3:27b -p ollama`
275
- - `/vixynt` - Generate and edit images from text descriptions using local models, openai, gemini.
276
- - Usage:
277
- - Gen Image: `/vixynt -igp <NPCSH_IMAGE_GEN_PROVIDER> --igmodel <NPCSH_IMAGE_GEN_MODEL> --output_file <path_to_file> width=<int:1024> height =<int:1024> 'description of image`
278
- - Edit Image: `/vixynt 'edit this....' --attachments '/path/to/image.png,/path/to/image.jpeg'`
279
- - `/wander` - A method for LLMs to think on a problem by switching between states of high temperature and low temperature. Usage: `/wander 'query to wander about' --provider "ollama" --model "deepseek-r1:32b" environment="a vast dark ocean" interruption-likelihood=.1`
280
- - `/yap` - Enter voice chat (yap) mode. Usage: `/yap -n <npc_to_chat_with>`
281
+ # Team Orchestration
282
+
283
+ NPCs work together through orchestration patterns. The **forenpc** (specified in your team's `.ctx` file) acts as the coordinator, delegating tasks to specialized NPCs and convening group discussions.
284
+
285
+ ## How NPCs and Jinxs Relate
286
+
287
+ Each NPC has a set of **jinxs** they can use, defined in their `.npc` file:
288
+
289
+ ```yaml
290
+ # corca.npc
291
+ name: corca
292
+ primary_directive: "You are a coding specialist..."
293
+ model: claude-sonnet-4-20250514
294
+ provider: anthropic
295
+ jinxs:
296
+ - lib/core/python
297
+ - lib/core/sh
298
+ - lib/core/edit_file
299
+ - lib/core/search
300
+ ```
301
+
302
+ When an NPC is invoked, they can only use the jinxs assigned to them. This creates **specialization**:
303
+ - `corca` has coding tools (python, sh, edit_file)
304
+ - `plonk` has browser automation (browser_action, screenshot)
305
+ - `alicanto` has research tools (arxiv, semantic_scholar, paper_search)
306
+ - `frederic` has generation tools (vixynt, roll, sample)
307
+
308
+ The forenpc (orchestrator) can delegate to any team member based on their specialization.
309
+
310
+ ## Delegation with Review Loop
311
+
312
+ The `/delegate` jinx sends a task to another NPC with automatic review and feedback:
313
+
314
+ ```bash
315
+ /delegate npc_name=corca task="Write a Python function to parse JSON files" max_iterations=5
316
+ ```
317
+
318
+ **How it works:**
319
+ 1. The orchestrator sends the task to the target NPC (e.g., `corca`)
320
+ 2. The target NPC works on the task using their available jinxs
321
+ 3. The orchestrator **reviews** the output and decides: COMPLETE or needs more work
322
+ 4. If incomplete, the orchestrator provides feedback and the target NPC iterates
323
+ 5. This continues until complete or max iterations reached
324
+
325
+ ```
326
+ ┌─────────────────┐ task ┌─────────────────┐
327
+ │ Orchestrator │ ────────────▶ │ Target NPC │
328
+ │ (sibiji) │ │ (corca) │
329
+ │ │ ◀──────────── │ │
330
+ │ Reviews work │ output │ Uses jinxs: │
331
+ │ Gives feedback│ │ - python │
332
+ └─────────────────┘ │ - sh │
333
+ │ │ - edit_file │
334
+ │ feedback └─────────────────┘
335
+
336
+ Iterate until
337
+ task complete
338
+ ```
339
+
340
+ ## Convening Multi-NPC Discussions
341
+
342
+ The `/convene` jinx brings multiple NPCs together for a structured discussion:
343
+
344
+ ```bash
345
+ /convene "How should we architect the new API?" --npcs corca,guac,frederic --rounds 3
346
+ ```
347
+
348
+ **How it works:**
349
+ 1. Each NPC contributes their perspective based on their persona
350
+ 2. NPCs respond to each other, building on or challenging ideas
351
+ 3. Random follow-ups create organic discussion flow
352
+ 4. After all rounds, the orchestrator synthesizes key points
353
+
354
+ ```
355
+ Round 1:
356
+ [corca]: "From a code structure perspective..."
357
+ [guac responds]: "I agree, but we should also consider..."
358
+ [frederic]: "The mathematical elegance here suggests..."
359
+
360
+ Round 2:
361
+ [guac]: "Building on what corca said..."
362
+ [corca responds]: "That's a good point about..."
363
+
364
+ SYNTHESIS:
365
+ - Key agreements: ...
366
+ - Areas of disagreement: ...
367
+ - Recommended next steps: ...
368
+ ```
369
+
370
+ ## Visualizing Team Structure
371
+
372
+ Use `/teamviz` to see how your NPCs and jinxs are connected:
373
+
374
+ ```bash
375
+ /teamviz save=team_structure.png
376
+ ```
377
+
378
+ This generates two views:
379
+ - **Network view**: Organic layout showing NPC-jinx relationships
380
+ - **Ordered view**: NPCs on left, jinxs grouped by category on right
381
+
382
+ Shared jinxs (like `python` used by 7 NPCs) appear with thicker connection bundles, helping you identify common capabilities and potential consolidation opportunities.
383
+
384
+ # NQL - SQL Models with AI Functions
385
+
386
+ NQL (NPC Query Language) enables AI-powered data transformations directly in SQL, similar to dbt but with embedded LLM calls. Create `.sql` files in `npc_team/models/` that combine standard SQL with `nql.*` AI function calls, then run them on a schedule to build analytical tables enriched with AI insights.
387
+
388
+ ## How It Works
389
+
390
+ NQL models are SQL files with embedded AI function calls. When executed:
391
+
392
+ 1. **Model Discovery**: The compiler finds all `.sql` files in your `models/` directory
393
+ 2. **Dependency Resolution**: Models referencing other models via `{{ ref('model_name') }}` are sorted topologically
394
+ 3. **Jinja Processing**: Template expressions (`{% %}`) are evaluated with access to NPC/team/jinx context
395
+ 4. **Execution Path**:
396
+ - **Native AI databases** (Snowflake, Databricks, BigQuery): NQL calls are translated to native AI functions (e.g., `SNOWFLAKE.CORTEX.COMPLETE()`)
397
+ - **Standard databases** (SQLite, PostgreSQL, etc.): SQL executes first, then Python-based AI functions process each row
398
+ 5. **Materialization**: Results are written back to the database as tables or views
399
+
400
+ ## Example Model
401
+
402
+ ```sql
403
+ {{ config(materialized='table') }}
404
+
405
+ SELECT
406
+ command,
407
+ count(*) as exec_count,
408
+ nql.synthesize(
409
+ 'Analyze "{command}" usage pattern with {exec_count} executions',
410
+ 'sibiji',
411
+ 'pattern_insight'
412
+ ) as insight
413
+ FROM command_history
414
+ GROUP BY command
415
+ ```
416
+
417
+ The `nql.synthesize()` call:
418
+ - Takes a prompt template with `{column}` placeholders filled from each row
419
+ - Uses the specified NPC (`sibiji`) for context and model/provider settings
420
+ - Returns the AI response as a new column (`insight`)
421
+
422
+ ## Enterprise Database Support
423
+
424
+ NQL **automatically translates** your `nql.*` function calls to native database AI functions under the hood. You write portable NQL syntax once, and the compiler handles the translation:
425
+
426
+ | Database | Auto-Translation | Your Code → Native SQL |
427
+ |----------|------------------|------------------------|
428
+ | **Snowflake** | Cortex AI | `nql.synthesize(...)` → `SNOWFLAKE.CORTEX.COMPLETE('llama3.1-8b', ...)` |
429
+ | **Databricks** | ML Serving | `nql.generate_text(...)` → `ai_query('databricks-meta-llama...', ...)` |
430
+ | **BigQuery** | Vertex AI | `nql.summarize(...)` → `ML.GENERATE_TEXT(MODEL 'gemini-pro', ...)` |
431
+ | **SQLite/PostgreSQL** | Python Fallback | SQL executes first, then AI applied row-by-row via `npcpy` |
432
+
433
+ Write models locally with SQLite, deploy to Snowflake/Databricks/BigQuery with zero code changes—the NQL compiler rewrites your AI calls to use native accelerated functions automatically.
434
+
435
+ ## NQL Functions
436
+
437
+ **Built-in LLM functions** (from `npcpy.llm_funcs`):
438
+ - `nql.synthesize(prompt, npc, alias)` - Synthesize insights from multiple perspectives
439
+ - `nql.summarize(text, npc, alias)` - Summarize text content
440
+ - `nql.criticize(text, npc, alias)` - Provide critical analysis
441
+ - `nql.extract_entities(text, npc, alias)` - Extract named entities
442
+ - `nql.generate_text(prompt, npc, alias)` - General text generation
443
+ - `nql.translate(text, npc, alias)` - Translate between languages
444
+
445
+ **Team jinxs as functions**: Any jinx in your team can be called as `nql.<jinx_name>(...)`:
446
+ ```sql
447
+ nql.sample('Generate variations of: {text}', 'frederic', 'variations')
448
+ ```
449
+
450
+ **Model references**: Use `{{ ref('other_model') }}` to create dependencies between models. The compiler ensures models run in the correct order.
451
+
452
+ ## Jinja Templating
453
+
454
+ NQL models support Jinja expressions (using `{% %}` delimiters) for dynamic access to NPC and team properties:
455
+
456
+ ```sql
457
+ -- Use the team's forenpc dynamically
458
+ nql.synthesize('Analyze this...', '{% team.forenpc %}', 'result')
459
+
460
+ -- Access NPC properties
461
+ -- Model: {% npc('sibiji').model %}
462
+ -- Provider: {% npc('corca').provider %}
463
+ -- Directive: {% npc('frederic').directive %}
464
+
465
+ -- Access jinx metadata
466
+ -- Description: {% jinx('sample').description %}
467
+
468
+ -- Environment variables with defaults
469
+ -- API URL: {% env('NPCSH_API_URL', 'http://localhost:5337') %}
470
+ ```
471
+
472
+ ## Running Models
473
+
474
+ ```bash
475
+ # List available models (shows [NQL] tag for models with AI functions)
476
+ nql show=1
477
+
478
+ # Run all models in dependency order
479
+ nql
480
+
481
+ # Run a specific model
482
+ nql model=daily_summary
483
+
484
+ # Use a different database
485
+ nql db=~/analytics.db
486
+
487
+ # Specify output schema
488
+ nql schema=analytics
489
+
490
+ # Schedule with cron (runs daily at 6am)
491
+ nql install_cron="0 6 * * *"
492
+ ```
493
+
494
+ ## Example: Analytics Pipeline
495
+
496
+ ```
497
+ models/
498
+ ├── base/
499
+ │ ├── command_stats.sql # Pure SQL aggregations
500
+ │ └── daily_activity.sql # Time-series breakdown
501
+ └── insights/
502
+ ├── command_patterns.sql # Uses nql.synthesize() on base stats
503
+ └── weekly_summary.sql # References command_patterns via {{ ref() }}
504
+ ```
505
+
506
+ Run `nql` to execute the entire pipeline—base models first, then insights that depend on them.
507
+
508
+ # Working with NPCs (Agents)
509
+
510
+ NPCs are AI agents with distinct personas, models, and tool sets. You can interact with them in two ways:
511
+
512
+ ## Switching to an NPC
513
+
514
+ Use `/npc <name>` or `/n <name>` to switch your session to a different NPC. All subsequent messages will be handled by that NPC until you switch again:
515
+
516
+ ```bash
517
+ /npc corca # Switch to corca for coding tasks
518
+ /n frederic # Switch to frederic for math/music
519
+ ```
520
+
521
+ You can also invoke an NPC directly as a slash command to switch to them:
522
+ ```bash
523
+ /corca # Same as /npc corca
524
+ /guac # Same as /npc guac
525
+ ```
526
+
527
+ ## One-Time Questions with @
528
+
529
+ Use `@<npc_name>` to ask a specific NPC a one-time question without switching your session:
530
+
531
+ ```bash
532
+ @corca can you review this function for bugs?
533
+ @frederic what's the derivative of x^3 * sin(x)?
534
+ @alicanto search for recent papers on transformer architectures
535
+ ```
536
+
537
+ The NPC responds using their persona and available jinxs, then control returns to your current NPC.
538
+
539
+ ## Available NPCs
540
+
541
+ | NPC | Specialty | Key Jinxs |
542
+ |-----|-----------|-----------|
543
+ | `sibiji` | Orchestrator/coordinator | delegate, convene, search |
544
+ | `corca` | Coding and development | python, sh, edit_file, search |
545
+ | `plonk` | Browser/GUI automation | browser_action, screenshot, click |
546
+ | `alicanto` | Research and analysis | arxiv, semantic_scholar, paper_search |
547
+ | `frederic` | Math, physics, music | python, vixynt, roll, sample, wander |
548
+ | `guac` | General assistant | python, sh, search |
549
+ | `kadiefa` | Creative generation | vixynt, roll, wander |
550
+
551
+ # Jinxs (Macros/Tools)
552
+
553
+ Jinxs are reusable tools that NPCs can invoke. They're activated with `/<jinx_name> ...` in npcsh or via the `npc` CLI in bash. For converting any `/<command>` in npcsh to bash, replace `/` with `npc `:
554
+
555
+ ```bash
556
+ # In npcsh:
557
+ /vixynt "a sunset over mountains"
558
+
559
+ # In bash:
560
+ npc vixynt "a sunset over mountains"
561
+ ```
562
+
563
+ ## Jinx Commands
564
+
565
+ ### Orchestration & Research
566
+ | Command | Description |
567
+ |---------|-------------|
568
+ | `/alicanto` | Deep research with multiple perspectives. Usage: `/alicanto 'query' --num-npcs 3 --depth 2` |
569
+ | `/convene` | Multi-NPC structured discussion. Usage: `/convene "topic" --npcs corca,guac --rounds 3` |
570
+ | `/delegate` | Delegate task to NPC with review loop. Usage: `/delegate npc_name=corca task="..." max_iterations=5` |
571
+ | `/search` | Web/memory/knowledge graph search. Usage: `/search 'query' --sprovider perplexity` |
572
+
573
+ ### Generation
574
+ | Command | Description |
575
+ |---------|-------------|
576
+ | `/vixynt` | Generate/edit images. Usage: `/vixynt 'description' --igmodel gpt-image-1 --igprovider openai` |
577
+ | `/roll` | Generate videos. Usage: `/roll 'description' --vgmodel veo-3.1-fast-generate-preview --vgprovider gemini` |
578
+ | `/sample` | Context-free LLM prompt. Usage: `/sample 'question' -m gpt-4o-mini --temp 0.7` |
579
+
580
+ ### Modes & Sessions
581
+ | Command | Description |
582
+ |---------|-------------|
583
+ | `/spool` | Interactive chat with fresh context/RAG. Usage: `/spool --attachments 'file1,file2' -n corca` |
584
+ | `/yap` | Voice chat mode. Usage: `/yap -n frederic` |
585
+ | `/pti` | Pardon-the-interruption reasoning mode. Usage: `/pti` |
586
+ | `/plonk` | GUI automation with vision. Usage: `/plonk 'click the submit button'` |
587
+ | `/wander` | Exploratory thinking with temperature shifts. Usage: `/wander 'query' --model deepseek-r1:32b` |
588
+
589
+ ### Data & Analytics
590
+ | Command | Description |
591
+ |---------|-------------|
592
+ | `/nql` | Run NQL SQL models. Usage: `/nql show=1`, `/nql model=daily_summary` |
593
+ | `/teamviz` | Visualize team structure. Usage: `/teamviz save=output.png` |
594
+ | `/ots` | Screenshot analysis. Usage: `/ots` then select area |
595
+ | `/sleep` | Evolve knowledge graph. Usage: `/sleep --ops link_facts,deepen` |
596
+
597
+ ### System & Config
598
+ | Command | Description |
599
+ |---------|-------------|
600
+ | `/build` | Build team to deployable format. Usage: `/build docker --output ./deploy` |
601
+ | `/serve` | Full agentic server with NPC management, jinx controls, and OpenAI-compatible endpoints. Usage: `/serve --port 5337` |
602
+ | `/compile` | Compile NPC profiles. Usage: `/compile path/to/npc` |
603
+ | `/init` | Initialize NPC project. Usage: `/init` |
604
+ | `/set` | Set config values. Usage: `/set model gemma3:4b`, `/set provider ollama` |
605
+ | `/help` | Show help. Usage: `/help` |
606
+ | `/jinxs` | List available jinxs. Usage: `/jinxs` |
607
+ | `/npc-studio` | Launch NPC Studio GUI. Usage: `/npc-studio` |
608
+ | `/trigger` | Set up system triggers. Usage: `/trigger 'description' -m gemma3:27b` |
281
609
 
282
610
  ## Common Command-Line Flags:
283
611
 
@@ -294,7 +622,6 @@ Importantly, users can switch easily between the NPCs they are chatting with by
294
622
  --exploration (-ex) | --npc (-np) | --rprovider (-rp) |
295
623
  --format (-f) | --num_frames (-num_f) | --sprovider (-s) |
296
624
  ```
297
- '
298
625
 
299
626
  ## Read the Docs
300
627
  To see more about how to use the jinxs and modes in the NPC Shell, read the docs at [npc-shell.readthedocs.io](https://npc-shell.readthedocs.io/en/latest/)
@@ -489,27 +816,41 @@ export PERPLEXITY_API_KEY='your_perplexity_key'
489
816
  Once initialized and set up, you will find the following in your `~/.npcsh` directory:
490
817
  ```bash
491
818
  ~/.npcsh/
492
- ├── npc_team/ # Global NPCs
493
- │ ├── jinxs/ # Global tools
494
- └── assembly_lines/ # Workflow pipelines
495
- │ └── sibiji.npc # globally available npc
496
- └── npcsh.ctx # global context file
497
-
498
-
499
-
819
+ ├── npc_team/ # Global NPC team
820
+ │ ├── jinxs/
821
+ │ ├── bin/ # CLI commands (wander, spool, yap, nql, vixynt, roll, sample)
822
+ └── lib/ # Library jinxs by category
823
+ │ ├── core/ # python, sh, sql, search, edit_file, load_file
824
+ │ │ ├── browser/ # browser_action, screenshot
825
+ │ │ ├── orchestration/ # delegate, convene
826
+ │ │ └── research/ # arxiv, semantic_scholar, paper_search
827
+ │ ├── models/ # NQL SQL models
828
+ │ ├── assembly_lines/ # Workflow pipelines
829
+ │ ├── sibiji.npc # Orchestrator NPC
830
+ │ ├── corca.npc # Coding specialist
831
+ │ ├── plonk.npc # Browser automation
832
+ │ ├── ... # Other NPCs
833
+ │ └── npcsh.ctx # Team context (sets forenpc, team name)
500
834
  ```
501
835
  For cases where you wish to set up a project specific set of NPCs, jinxs, and assembly lines, add a `npc_team` directory to your project and `npcsh` should be able to pick up on its presence, like so:
502
836
  ```bash
503
837
  ./npc_team/ # Project-specific NPCs
504
- ├── jinxs/ # Project jinxs #example jinx next
505
- └── example.jinx
506
- └── assembly_lines/ # Agentic Workflows
507
- └── example.line
508
- └── models/ # Project workflows
509
- └── example.model
510
- └── example1.npc # Example NPC
511
- └── example2.npc # Example NPC
512
- └── team.ctx # Example ctx
838
+ ├── jinxs/ # Project jinxs
839
+ ├── bin/ # Standalone CLI commands (unique names, auto-registered)
840
+ │ │ └── wander, spool, yap, nql, vixynt, roll, sample
841
+ └── lib/ # Library jinxs organized by category
842
+ │ ├── core/ # Core utilities (python, sh, sql, search, etc.)
843
+ │ ├── browser/ # Browser automation
844
+ │ ├── orchestration/ # delegate, convene
845
+ └── research/ # Research tools (arxiv, semantic_scholar)
846
+ ├── models/ # NQL SQL models for AI-powered data pipelines
847
+ │ ├── base/ # Base statistics models
848
+ │ └── insights/ # Models with nql.* AI functions
849
+ ├── assembly_lines/ # Agentic Workflows
850
+ │ └── example.line
851
+ ├── example1.npc # Example NPC
852
+ ├── example2.npc # Example NPC
853
+ └── team.ctx # Team context file
513
854
 
514
855
 
515
856
  ```