jiva-core 0.3.43 → 0.3.44-dev.72622a6

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 (35) hide show
  1. package/README.md +37 -5
  2. package/dist/code/agent.d.ts +16 -0
  3. package/dist/code/agent.d.ts.map +1 -1
  4. package/dist/code/agent.js +317 -186
  5. package/dist/code/agent.js.map +1 -1
  6. package/dist/core/config.d.ts +30 -16
  7. package/dist/core/config.d.ts.map +1 -1
  8. package/dist/core/config.js +2 -0
  9. package/dist/core/config.js.map +1 -1
  10. package/dist/core/worker-agent.d.ts +0 -8
  11. package/dist/core/worker-agent.d.ts.map +1 -1
  12. package/dist/core/worker-agent.js +359 -228
  13. package/dist/core/worker-agent.js.map +1 -1
  14. package/dist/core/workspace.d.ts.map +1 -1
  15. package/dist/core/workspace.js +2 -0
  16. package/dist/core/workspace.js.map +1 -1
  17. package/dist/interfaces/cli/index.js +33 -3
  18. package/dist/interfaces/cli/index.js.map +1 -1
  19. package/dist/interfaces/cli/repl.d.ts +6 -0
  20. package/dist/interfaces/cli/repl.d.ts.map +1 -1
  21. package/dist/interfaces/cli/repl.js +45 -3
  22. package/dist/interfaces/cli/repl.js.map +1 -1
  23. package/dist/interfaces/cli/setup-wizard.js +12 -12
  24. package/dist/interfaces/cli/setup-wizard.js.map +1 -1
  25. package/dist/models/model-client.d.ts.map +1 -1
  26. package/dist/models/model-client.js +19 -3
  27. package/dist/models/model-client.js.map +1 -1
  28. package/dist/personas/persona-manager.d.ts +14 -2
  29. package/dist/personas/persona-manager.d.ts.map +1 -1
  30. package/dist/personas/persona-manager.js +45 -14
  31. package/dist/personas/persona-manager.js.map +1 -1
  32. package/dist/storage/local-provider.d.ts.map +1 -1
  33. package/dist/storage/local-provider.js +2 -0
  34. package/dist/storage/local-provider.js.map +1 -1
  35. package/package.json +1 -1
package/README.md CHANGED
@@ -62,6 +62,7 @@ jiva run "Add error handling to the database module" --code
62
62
  | `/load` | Resume a saved conversation |
63
63
  | `/list` | Browse all saved conversations |
64
64
  | `/reset` | Clear conversation history |
65
+ | `/<skill-name>` | Load a skill (e.g. `/graphify`) |
65
66
  | `/exit` | Exit Jiva |
66
67
 
67
68
  ---
@@ -116,6 +117,21 @@ Code mode reduces latency by eliminating inter-agent overhead and running all fi
116
117
  | `bash` | Run shell commands |
117
118
  | `spawn_code_agent` | Delegate a sub-task to a child agent |
118
119
 
120
+ **MCP servers in code mode:** Code mode does not load all MCP servers by default (too many tools bloat the context). You opt in explicitly:
121
+
122
+ ```bash
123
+ # Per-invocation: pass server names via --mcp (comma-separated)
124
+ jiva chat --code --mcp browser
125
+ jiva chat --code --mcp browser,postgres
126
+
127
+ # Persistent: set codeMode:true on any server in your config
128
+ jiva config
129
+ # or edit ~/.config/jiva/config.json:
130
+ # "mcpServers": { "browser": { "command": "...", "codeMode": true } }
131
+ ```
132
+
133
+ When MCP servers are active in code mode, their tool names (e.g. `browser__screenshot`) are listed in the startup banner and the agent's system prompt.
134
+
119
135
  **LSP integration:** After each file edit, Jiva notifies the appropriate language server and appends any compiler errors to the tool result. Language servers are auto-detected from your PATH. If none is installed for a given language, the tool continues silently.
120
136
 
121
137
  ```bash
@@ -178,7 +194,7 @@ Configuration is stored at `~/.config/jiva-nodejs/config.json` (Linux/macOS) or
178
194
  }
179
195
  ```
180
196
 
181
- **Sarvam** — reasoning model with internal chain-of-thought; requires a generous token budget
197
+ **Sarvam (sarvam-105b)** — fully supported reasoning model with internal chain-of-thought. Jiva handles Sarvam's XML-format tool calls transparently and recovers automatically when large file writes hit the token limit.
182
198
  ```json
183
199
  {
184
200
  "models": {
@@ -247,10 +263,12 @@ Code review assistant for a Django web application.
247
263
  PostgreSQL backend, GDPR-sensitive user data.
248
264
  ```
249
265
 
250
- Jiva searches for directive files automatically:
266
+ Jiva searches for directive files automatically, in this order:
251
267
  1. Path given via `--directive`
252
268
  2. `jiva-directive.md` in the workspace root
253
- 3. `.jiva/directive.md` in the workspace root
269
+ 3. `CLAUDE.md` in the workspace root
270
+ 4. `AGENTS.md` in the workspace root
271
+ 5. `.jiva/directive.md` in the workspace root
254
272
 
255
273
  ---
256
274
 
@@ -315,9 +333,22 @@ Full guide: [Cloud Run Deployment](docs/deployment/CLOUD_RUN_DEPLOYMENT.md)
315
333
 
316
334
  ---
317
335
 
318
- ## Personas and Skills
336
+ ## Skills
337
+
338
+ Skills are reusable workflow modules defined by a `SKILL.md` file. They work standalone (no persona needed) and in both chat and code mode.
339
+
340
+ **Standalone skills** — drop a skill into `~/.claude/skills/<name>/SKILL.md` (Claude-compatible format) and Jiva discovers it automatically at startup. The skill's metadata appears in the agent's system prompt so it can be invoked by description.
341
+
342
+ **Slash commands** — invoke any skill from the REPL:
343
+
344
+ ```
345
+ /graphify
346
+ > visualise the dependency graph for this repo
347
+ ```
348
+
349
+ Jiva loads the skill's instructions and prepends them to your message before sending it to the agent.
319
350
 
320
- Jiva supports persona-based skill management, compatible with Claude's Skills/Plugins format:
351
+ **Persona-based skills** — for teams, skills can be grouped into personas that bundle MCP servers, directives, and model behavior:
321
352
 
322
353
  ```bash
323
354
  jiva persona list
@@ -408,3 +439,4 @@ MIT
408
439
  - [Harmony Response Format](https://github.com/openai/harmony)
409
440
  - [Model Context Protocol](https://modelcontextprotocol.io/)
410
441
  - [Krutrim Cloud API](https://cloud.olakrutrim.com/)
442
+ - [Sarvam AI API](https://www.sarvam.ai/)
@@ -8,6 +8,8 @@ import { ModelOrchestrator } from '../models/orchestrator.js';
8
8
  import { WorkspaceManager } from '../core/workspace.js';
9
9
  import { ConversationManager } from '../core/conversation-manager.js';
10
10
  import type { Message } from '../models/base.js';
11
+ import type { PersonaManager } from '../personas/persona-manager.js';
12
+ import type { MCPServerManager } from '../mcp/server-manager.js';
11
13
  export interface AgentResponse {
12
14
  content: string;
13
15
  toolsUsed: string[];
@@ -18,6 +20,7 @@ export interface CodeAgentConfig {
18
20
  orchestrator: ModelOrchestrator;
19
21
  workspace: WorkspaceManager;
20
22
  conversationManager?: ConversationManager;
23
+ personaManager?: PersonaManager;
21
24
  maxIterations?: number;
22
25
  lspEnabled?: boolean;
23
26
  depth?: number;
@@ -30,11 +33,22 @@ export interface CodeAgentConfig {
30
33
  * Set to 0 to disable in-loop compaction.
31
34
  */
32
35
  compactionThreshold?: number;
36
+ /**
37
+ * MCP server manager to draw external tools from.
38
+ * Only servers listed in `mcpServerNames` are exposed to the agent.
39
+ */
40
+ mcpManager?: MCPServerManager;
41
+ /**
42
+ * Names of MCP servers whose tools should be available in code mode.
43
+ * Sourced from servers with `codeMode: true` in config and/or the --mcp CLI flag.
44
+ */
45
+ mcpServerNames?: string[];
33
46
  }
34
47
  export declare class CodeAgent {
35
48
  private orchestrator;
36
49
  private workspace;
37
50
  private conversationManager?;
51
+ private personaManager?;
38
52
  private maxIterations;
39
53
  private compactionThreshold;
40
54
  private lsp;
@@ -42,6 +56,8 @@ export declare class CodeAgent {
42
56
  private maxDepth;
43
57
  private history;
44
58
  private tools;
59
+ private _mcpManager?;
60
+ private _mcpServerNames;
45
61
  private _stopped;
46
62
  constructor(config: CodeAgentConfig);
47
63
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/code/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAiBvD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,4BAA4B,EAAE,kBAAkB,CAAC;CACtE;AAkDD,MAAM,WAAW,eAAe;IAC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