jiva-core 0.2.2 → 0.3.1

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 (156) hide show
  1. package/.dockerignore +53 -0
  2. package/.gcloudignore +49 -0
  3. package/CONTRIBUTING.md +92 -0
  4. package/Dockerfile +63 -0
  5. package/LICENSE +21 -0
  6. package/README.md +248 -102
  7. package/cloud-run-deploy.yaml +135 -0
  8. package/cloud-run.yaml +135 -0
  9. package/cloud-run.yaml.template +143 -0
  10. package/deploy.sh +107 -0
  11. package/dist/core/agent-spawner.d.ts +89 -0
  12. package/dist/core/agent-spawner.d.ts.map +1 -0
  13. package/dist/core/agent-spawner.js +195 -0
  14. package/dist/core/agent-spawner.js.map +1 -0
  15. package/dist/core/client-agent.d.ts +82 -0
  16. package/dist/core/client-agent.d.ts.map +1 -0
  17. package/dist/core/client-agent.js +406 -0
  18. package/dist/core/client-agent.js.map +1 -0
  19. package/dist/core/config.d.ts +59 -10
  20. package/dist/core/config.d.ts.map +1 -1
  21. package/dist/core/config.js +19 -2
  22. package/dist/core/config.js.map +1 -1
  23. package/dist/core/conversation-manager.d.ts +10 -18
  24. package/dist/core/conversation-manager.d.ts.map +1 -1
  25. package/dist/core/conversation-manager.js +28 -60
  26. package/dist/core/conversation-manager.js.map +1 -1
  27. package/dist/core/dual-agent.d.ts +24 -3
  28. package/dist/core/dual-agent.d.ts.map +1 -1
  29. package/dist/core/dual-agent.js +112 -19
  30. package/dist/core/dual-agent.js.map +1 -1
  31. package/dist/core/manager-agent.d.ts +3 -1
  32. package/dist/core/manager-agent.d.ts.map +1 -1
  33. package/dist/core/manager-agent.js +66 -14
  34. package/dist/core/manager-agent.js.map +1 -1
  35. package/dist/core/worker-agent.d.ts +15 -1
  36. package/dist/core/worker-agent.d.ts.map +1 -1
  37. package/dist/core/worker-agent.js +244 -11
  38. package/dist/core/worker-agent.js.map +1 -1
  39. package/dist/core/workspace.d.ts +5 -0
  40. package/dist/core/workspace.d.ts.map +1 -1
  41. package/dist/core/workspace.js +47 -7
  42. package/dist/core/workspace.js.map +1 -1
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +4 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/interfaces/cli/index.js +376 -44
  48. package/dist/interfaces/cli/index.js.map +1 -1
  49. package/dist/interfaces/cli/repl.d.ts.map +1 -1
  50. package/dist/interfaces/cli/repl.js +6 -0
  51. package/dist/interfaces/cli/repl.js.map +1 -1
  52. package/dist/interfaces/http/index.d.ts +22 -0
  53. package/dist/interfaces/http/index.d.ts.map +1 -0
  54. package/dist/interfaces/http/index.js +135 -0
  55. package/dist/interfaces/http/index.js.map +1 -0
  56. package/dist/interfaces/http/middleware/auth.d.ts +32 -0
  57. package/dist/interfaces/http/middleware/auth.d.ts.map +1 -0
  58. package/dist/interfaces/http/middleware/auth.js +176 -0
  59. package/dist/interfaces/http/middleware/auth.js.map +1 -0
  60. package/dist/interfaces/http/routes/chat.d.ts +7 -0
  61. package/dist/interfaces/http/routes/chat.d.ts.map +1 -0
  62. package/dist/interfaces/http/routes/chat.js +144 -0
  63. package/dist/interfaces/http/routes/chat.js.map +1 -0
  64. package/dist/interfaces/http/routes/health.d.ts +6 -0
  65. package/dist/interfaces/http/routes/health.d.ts.map +1 -0
  66. package/dist/interfaces/http/routes/health.js +25 -0
  67. package/dist/interfaces/http/routes/health.js.map +1 -0
  68. package/dist/interfaces/http/routes/session.d.ts +7 -0
  69. package/dist/interfaces/http/routes/session.d.ts.map +1 -0
  70. package/dist/interfaces/http/routes/session.js +114 -0
  71. package/dist/interfaces/http/routes/session.js.map +1 -0
  72. package/dist/interfaces/http/session-manager.d.ts +76 -0
  73. package/dist/interfaces/http/session-manager.d.ts.map +1 -0
  74. package/dist/interfaces/http/session-manager.js +339 -0
  75. package/dist/interfaces/http/session-manager.js.map +1 -0
  76. package/dist/interfaces/http/websocket-handler.d.ts +18 -0
  77. package/dist/interfaces/http/websocket-handler.d.ts.map +1 -0
  78. package/dist/interfaces/http/websocket-handler.js +146 -0
  79. package/dist/interfaces/http/websocket-handler.js.map +1 -0
  80. package/dist/mcp/client.d.ts +11 -2
  81. package/dist/mcp/client.d.ts.map +1 -1
  82. package/dist/mcp/client.js +44 -19
  83. package/dist/mcp/client.js.map +1 -1
  84. package/dist/mcp/server-manager.d.ts +1 -1
  85. package/dist/mcp/server-manager.d.ts.map +1 -1
  86. package/dist/mcp/server-manager.js +12 -2
  87. package/dist/mcp/server-manager.js.map +1 -1
  88. package/dist/personas/index.d.ts +13 -0
  89. package/dist/personas/index.d.ts.map +1 -0
  90. package/dist/personas/index.js +13 -0
  91. package/dist/personas/index.js.map +1 -0
  92. package/dist/personas/persona-loader.d.ts +30 -0
  93. package/dist/personas/persona-loader.d.ts.map +1 -0
  94. package/dist/personas/persona-loader.js +246 -0
  95. package/dist/personas/persona-loader.js.map +1 -0
  96. package/dist/personas/persona-manager.d.ts +82 -0
  97. package/dist/personas/persona-manager.d.ts.map +1 -0
  98. package/dist/personas/persona-manager.js +211 -0
  99. package/dist/personas/persona-manager.js.map +1 -0
  100. package/dist/personas/skill-loader.d.ts +35 -0
  101. package/dist/personas/skill-loader.d.ts.map +1 -0
  102. package/dist/personas/skill-loader.js +144 -0
  103. package/dist/personas/skill-loader.js.map +1 -0
  104. package/dist/personas/skill-packager.d.ts +25 -0
  105. package/dist/personas/skill-packager.d.ts.map +1 -0
  106. package/dist/personas/skill-packager.js +233 -0
  107. package/dist/personas/skill-packager.js.map +1 -0
  108. package/dist/personas/types.d.ts +134 -0
  109. package/dist/personas/types.d.ts.map +1 -0
  110. package/dist/personas/types.js +7 -0
  111. package/dist/personas/types.js.map +1 -0
  112. package/dist/personas/validator.d.ts +22 -0
  113. package/dist/personas/validator.d.ts.map +1 -0
  114. package/dist/personas/validator.js +144 -0
  115. package/dist/personas/validator.js.map +1 -0
  116. package/dist/storage/factory.d.ts +51 -0
  117. package/dist/storage/factory.d.ts.map +1 -0
  118. package/dist/storage/factory.js +154 -0
  119. package/dist/storage/factory.js.map +1 -0
  120. package/dist/storage/gcp-bucket-provider.d.ts +59 -0
  121. package/dist/storage/gcp-bucket-provider.d.ts.map +1 -0
  122. package/dist/storage/gcp-bucket-provider.js +275 -0
  123. package/dist/storage/gcp-bucket-provider.js.map +1 -0
  124. package/dist/storage/index.d.ts +33 -0
  125. package/dist/storage/index.d.ts.map +1 -0
  126. package/dist/storage/index.js +37 -0
  127. package/dist/storage/index.js.map +1 -0
  128. package/dist/storage/local-provider.d.ts +36 -0
  129. package/dist/storage/local-provider.d.ts.map +1 -0
  130. package/dist/storage/local-provider.js +219 -0
  131. package/dist/storage/local-provider.js.map +1 -0
  132. package/dist/storage/provider.d.ts +137 -0
  133. package/dist/storage/provider.d.ts.map +1 -0
  134. package/dist/storage/provider.js +136 -0
  135. package/dist/storage/provider.js.map +1 -0
  136. package/dist/storage/types.d.ts +78 -0
  137. package/dist/storage/types.d.ts.map +1 -0
  138. package/dist/storage/types.js +14 -0
  139. package/dist/storage/types.js.map +1 -0
  140. package/dist/utils/orchestration-logger.d.ts +36 -0
  141. package/dist/utils/orchestration-logger.d.ts.map +1 -0
  142. package/dist/utils/orchestration-logger.js +224 -0
  143. package/dist/utils/orchestration-logger.js.map +1 -0
  144. package/jiva-new-demo.gif +0 -0
  145. package/package.json +30 -2
  146. package/.fluen/cache/state.json +0 -7
  147. package/actions/action_registry.py +0 -75
  148. package/actions/python_coder.py +0 -470
  149. package/api/main.py +0 -269
  150. package/downloaded_image.avif +0 -0
  151. package/downloads/snipping_tool.avif +0 -0
  152. package/image.avif +0 -0
  153. package/ms_image.avif +0 -0
  154. package/screenshot.png +0 -0
  155. package/snipping_tool.avif +0 -0
  156. package/tmp_image.avif +0 -0
package/.dockerignore ADDED
@@ -0,0 +1,53 @@
1
+ # Node modules (will be reinstalled)
2
+ node_modules/
3
+
4
+ # Build outputs (will be rebuilt)
5
+ dist/
6
+
7
+ # Development files
8
+ *.log
9
+ npm-debug.log*
10
+ yarn-debug.log*
11
+ yarn-error.log*
12
+ .npm
13
+ .eslintcache
14
+
15
+ # IDE
16
+ .vscode/
17
+ .idea/
18
+ *.swp
19
+ *.swo
20
+ *~
21
+ .DS_Store
22
+
23
+ # Git
24
+ .git/
25
+ .gitignore
26
+ .gitattributes
27
+
28
+ # Documentation
29
+ *.md
30
+ !README.md
31
+ docs/
32
+ examples/
33
+
34
+ # Tests
35
+ test/
36
+ tests/
37
+ *.test.ts
38
+ *.spec.ts
39
+
40
+ # CI/CD
41
+ .github/
42
+ .gitlab-ci.yml
43
+ .travis.yml
44
+
45
+ # Local development
46
+ .env
47
+ .env.local
48
+ .env.*.local
49
+
50
+ # Temporary files
51
+ tmp/
52
+ temp/
53
+ *.tmp
package/.gcloudignore ADDED
@@ -0,0 +1,49 @@
1
+ # Google Cloud Build ignore patterns
2
+ # Files not needed in Cloud Build/Container Registry
3
+
4
+ # Node modules (will be installed in container)
5
+ node_modules/
6
+
7
+ # Development and docs
8
+ docs/
9
+ examples/
10
+ *.md
11
+ !README.md
12
+
13
+ # Git
14
+ .git/
15
+ .gitignore
16
+ .gitattributes
17
+
18
+ # Editor
19
+ .vscode/
20
+ .idea/
21
+ *.swp
22
+ *.swo
23
+
24
+ # OS
25
+ .DS_Store
26
+ Thumbs.db
27
+
28
+ # Logs
29
+ *.log
30
+
31
+ # Build artifacts (will be rebuilt)
32
+ dist/
33
+ *.tsbuildinfo
34
+
35
+ # Test files
36
+ test/
37
+ tests/
38
+ *.test.ts
39
+ *.test.js
40
+ *.spec.ts
41
+ *.spec.js
42
+
43
+ # npm package files
44
+ .npmignore
45
+ .npmrc
46
+
47
+ # Scripts (except deploy.sh which is needed)
48
+ setup.sh
49
+ fix-filesystem-config.js
@@ -0,0 +1,92 @@
1
+ # Contributing to Jiva
2
+
3
+ Thank you for your interest in contributing to Jiva! This document provides guidelines for contributing to the project.
4
+
5
+ ## Code of Conduct
6
+
7
+ Be respectful and constructive in your interactions with other contributors.
8
+
9
+ ## Getting Started
10
+
11
+ 1. **Fork the repository** on GitHub
12
+ 2. **Clone your fork:**
13
+ ```bash
14
+ git clone https://github.com/YOUR_USERNAME/Jiva.git
15
+ cd Jiva
16
+ ```
17
+ 3. **Install dependencies:**
18
+ ```bash
19
+ npm install
20
+ ```
21
+ 4. **Build the project:**
22
+ ```bash
23
+ npm run build
24
+ ```
25
+
26
+ ## Development Workflow
27
+
28
+ See [docs/guides/DEV_WORKFLOW.md](docs/guides/DEV_WORKFLOW.md) for detailed development instructions.
29
+
30
+ ### Quick Commands
31
+
32
+ ```bash
33
+ npm run build # Compile TypeScript
34
+ npm run dev # Watch mode for development
35
+ npm run type-check # Check TypeScript types
36
+ npm test # Run tests (when available)
37
+ ```
38
+
39
+ ## Making Changes
40
+
41
+ 1. **Create a feature branch:**
42
+ ```bash
43
+ git checkout -b feature/your-feature-name
44
+ ```
45
+
46
+ 2. **Make your changes** following the coding standards
47
+
48
+ 3. **Test your changes:**
49
+ ```bash
50
+ npm run build
51
+ npm link # Test CLI globally
52
+ jiva chat # Verify functionality
53
+ ```
54
+
55
+ 4. **Commit with clear messages:**
56
+ ```bash
57
+ git commit -m "feat: add new feature X"
58
+ ```
59
+
60
+ ## Coding Standards
61
+
62
+ - **TypeScript**: All code must be in TypeScript
63
+ - **Formatting**: Follow existing code style
64
+ - **Error Handling**: All functions should handle errors gracefully
65
+ - **Logging**: Use the logger utility for consistent logging
66
+ - **Documentation**: Update docs for new features
67
+
68
+ ## Pull Request Process
69
+
70
+ 1. **Update documentation** for any changed functionality
71
+ 2. **Update README.md** if adding new features
72
+ 3. **Add release notes** in `docs/release_notes/` if applicable
73
+ 4. **Create pull request** with clear description of changes
74
+ 5. **Link related issues** in the PR description
75
+
76
+ ## Areas for Contribution
77
+
78
+ - Bug fixes
79
+ - New MCP server integrations
80
+ - Documentation improvements
81
+ - Performance optimizations
82
+ - Test coverage
83
+ - Storage provider implementations (S3, Redis, etc.)
84
+ - UI/UX improvements for CLI interface
85
+
86
+ ## Questions?
87
+
88
+ Open an issue on GitHub for any questions about contributing.
89
+
90
+ ## License
91
+
92
+ By contributing to Jiva, you agree that your contributions will be licensed under the MIT License.
package/Dockerfile ADDED
@@ -0,0 +1,63 @@
1
+ # Multi-stage build for Jiva Cloud Run deployment
2
+ # Stage 1: Build
3
+ FROM node:20-alpine AS builder
4
+
5
+ WORKDIR /app
6
+
7
+ # Copy package files
8
+ COPY package*.json ./
9
+ COPY tsconfig.json ./
10
+
11
+ # Install dependencies (including dev dependencies for build)
12
+ RUN npm ci
13
+
14
+ # Copy source code
15
+ COPY src ./src
16
+
17
+ # Build TypeScript
18
+ RUN npm run build
19
+
20
+ # Stage 2: Production
21
+ FROM node:20-alpine
22
+
23
+ WORKDIR /app
24
+
25
+ # Install dumb-init for proper signal handling
26
+ RUN apk add --no-cache dumb-init
27
+
28
+ # Copy package files
29
+ COPY package*.json ./
30
+
31
+ # Install production dependencies only
32
+ RUN npm ci --omit=dev && npm cache clean --force
33
+
34
+ # Copy built application from builder
35
+ COPY --from=builder /app/dist ./dist
36
+
37
+ # Create non-root user
38
+ RUN addgroup -g 1001 -S nodejs && \
39
+ adduser -S nodejs -u 1001 && \
40
+ chown -R nodejs:nodejs /app
41
+
42
+ USER nodejs
43
+
44
+ # Environment variables (overrideable)
45
+ ENV NODE_ENV=production \
46
+ PORT=8080 \
47
+ LOG_LEVEL=info \
48
+ JIVA_STORAGE_PROVIDER=gcp \
49
+ MAX_CONCURRENT_SESSIONS=100 \
50
+ SESSION_IDLE_TIMEOUT_MS=1800000
51
+
52
+ # Expose port
53
+ EXPOSE 8080
54
+
55
+ # Health check
56
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
57
+ CMD node -e "require('http').get('http://localhost:8080/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
58
+
59
+ # Use dumb-init to handle signals properly
60
+ ENTRYPOINT ["dumb-init", "--"]
61
+
62
+ # Start HTTP server
63
+ CMD ["node", "dist/interfaces/http/index.js"]
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 KarmaloopAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.