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.
- package/.dockerignore +53 -0
- package/.gcloudignore +49 -0
- package/CONTRIBUTING.md +92 -0
- package/Dockerfile +63 -0
- package/LICENSE +21 -0
- package/README.md +248 -102
- package/cloud-run-deploy.yaml +135 -0
- package/cloud-run.yaml +135 -0
- package/cloud-run.yaml.template +143 -0
- package/deploy.sh +107 -0
- package/dist/core/agent-spawner.d.ts +89 -0
- package/dist/core/agent-spawner.d.ts.map +1 -0
- package/dist/core/agent-spawner.js +195 -0
- package/dist/core/agent-spawner.js.map +1 -0
- package/dist/core/client-agent.d.ts +82 -0
- package/dist/core/client-agent.d.ts.map +1 -0
- package/dist/core/client-agent.js +406 -0
- package/dist/core/client-agent.js.map +1 -0
- package/dist/core/config.d.ts +59 -10
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +19 -2
- package/dist/core/config.js.map +1 -1
- package/dist/core/conversation-manager.d.ts +10 -18
- package/dist/core/conversation-manager.d.ts.map +1 -1
- package/dist/core/conversation-manager.js +28 -60
- package/dist/core/conversation-manager.js.map +1 -1
- package/dist/core/dual-agent.d.ts +24 -3
- package/dist/core/dual-agent.d.ts.map +1 -1
- package/dist/core/dual-agent.js +112 -19
- package/dist/core/dual-agent.js.map +1 -1
- package/dist/core/manager-agent.d.ts +3 -1
- package/dist/core/manager-agent.d.ts.map +1 -1
- package/dist/core/manager-agent.js +66 -14
- package/dist/core/manager-agent.js.map +1 -1
- package/dist/core/worker-agent.d.ts +15 -1
- package/dist/core/worker-agent.d.ts.map +1 -1
- package/dist/core/worker-agent.js +244 -11
- package/dist/core/worker-agent.js.map +1 -1
- package/dist/core/workspace.d.ts +5 -0
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +47 -7
- package/dist/core/workspace.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/cli/index.js +376 -44
- package/dist/interfaces/cli/index.js.map +1 -1
- package/dist/interfaces/cli/repl.d.ts.map +1 -1
- package/dist/interfaces/cli/repl.js +6 -0
- package/dist/interfaces/cli/repl.js.map +1 -1
- package/dist/interfaces/http/index.d.ts +22 -0
- package/dist/interfaces/http/index.d.ts.map +1 -0
- package/dist/interfaces/http/index.js +135 -0
- package/dist/interfaces/http/index.js.map +1 -0
- package/dist/interfaces/http/middleware/auth.d.ts +32 -0
- package/dist/interfaces/http/middleware/auth.d.ts.map +1 -0
- package/dist/interfaces/http/middleware/auth.js +176 -0
- package/dist/interfaces/http/middleware/auth.js.map +1 -0
- package/dist/interfaces/http/routes/chat.d.ts +7 -0
- package/dist/interfaces/http/routes/chat.d.ts.map +1 -0
- package/dist/interfaces/http/routes/chat.js +144 -0
- package/dist/interfaces/http/routes/chat.js.map +1 -0
- package/dist/interfaces/http/routes/health.d.ts +6 -0
- package/dist/interfaces/http/routes/health.d.ts.map +1 -0
- package/dist/interfaces/http/routes/health.js +25 -0
- package/dist/interfaces/http/routes/health.js.map +1 -0
- package/dist/interfaces/http/routes/session.d.ts +7 -0
- package/dist/interfaces/http/routes/session.d.ts.map +1 -0
- package/dist/interfaces/http/routes/session.js +114 -0
- package/dist/interfaces/http/routes/session.js.map +1 -0
- package/dist/interfaces/http/session-manager.d.ts +76 -0
- package/dist/interfaces/http/session-manager.d.ts.map +1 -0
- package/dist/interfaces/http/session-manager.js +339 -0
- package/dist/interfaces/http/session-manager.js.map +1 -0
- package/dist/interfaces/http/websocket-handler.d.ts +18 -0
- package/dist/interfaces/http/websocket-handler.d.ts.map +1 -0
- package/dist/interfaces/http/websocket-handler.js +146 -0
- package/dist/interfaces/http/websocket-handler.js.map +1 -0
- package/dist/mcp/client.d.ts +11 -2
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +44 -19
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/server-manager.d.ts +1 -1
- package/dist/mcp/server-manager.d.ts.map +1 -1
- package/dist/mcp/server-manager.js +12 -2
- package/dist/mcp/server-manager.js.map +1 -1
- package/dist/personas/index.d.ts +13 -0
- package/dist/personas/index.d.ts.map +1 -0
- package/dist/personas/index.js +13 -0
- package/dist/personas/index.js.map +1 -0
- package/dist/personas/persona-loader.d.ts +30 -0
- package/dist/personas/persona-loader.d.ts.map +1 -0
- package/dist/personas/persona-loader.js +246 -0
- package/dist/personas/persona-loader.js.map +1 -0
- package/dist/personas/persona-manager.d.ts +82 -0
- package/dist/personas/persona-manager.d.ts.map +1 -0
- package/dist/personas/persona-manager.js +211 -0
- package/dist/personas/persona-manager.js.map +1 -0
- package/dist/personas/skill-loader.d.ts +35 -0
- package/dist/personas/skill-loader.d.ts.map +1 -0
- package/dist/personas/skill-loader.js +144 -0
- package/dist/personas/skill-loader.js.map +1 -0
- package/dist/personas/skill-packager.d.ts +25 -0
- package/dist/personas/skill-packager.d.ts.map +1 -0
- package/dist/personas/skill-packager.js +233 -0
- package/dist/personas/skill-packager.js.map +1 -0
- package/dist/personas/types.d.ts +134 -0
- package/dist/personas/types.d.ts.map +1 -0
- package/dist/personas/types.js +7 -0
- package/dist/personas/types.js.map +1 -0
- package/dist/personas/validator.d.ts +22 -0
- package/dist/personas/validator.d.ts.map +1 -0
- package/dist/personas/validator.js +144 -0
- package/dist/personas/validator.js.map +1 -0
- package/dist/storage/factory.d.ts +51 -0
- package/dist/storage/factory.d.ts.map +1 -0
- package/dist/storage/factory.js +154 -0
- package/dist/storage/factory.js.map +1 -0
- package/dist/storage/gcp-bucket-provider.d.ts +59 -0
- package/dist/storage/gcp-bucket-provider.d.ts.map +1 -0
- package/dist/storage/gcp-bucket-provider.js +275 -0
- package/dist/storage/gcp-bucket-provider.js.map +1 -0
- package/dist/storage/index.d.ts +33 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +37 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/local-provider.d.ts +36 -0
- package/dist/storage/local-provider.d.ts.map +1 -0
- package/dist/storage/local-provider.js +219 -0
- package/dist/storage/local-provider.js.map +1 -0
- package/dist/storage/provider.d.ts +137 -0
- package/dist/storage/provider.d.ts.map +1 -0
- package/dist/storage/provider.js +136 -0
- package/dist/storage/provider.js.map +1 -0
- package/dist/storage/types.d.ts +78 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +14 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/utils/orchestration-logger.d.ts +36 -0
- package/dist/utils/orchestration-logger.d.ts.map +1 -0
- package/dist/utils/orchestration-logger.js +224 -0
- package/dist/utils/orchestration-logger.js.map +1 -0
- package/jiva-new-demo.gif +0 -0
- package/package.json +30 -2
- package/.fluen/cache/state.json +0 -7
- package/actions/action_registry.py +0 -75
- package/actions/python_coder.py +0 -470
- package/api/main.py +0 -269
- package/downloaded_image.avif +0 -0
- package/downloads/snipping_tool.avif +0 -0
- package/image.avif +0 -0
- package/ms_image.avif +0 -0
- package/screenshot.png +0 -0
- package/snipping_tool.avif +0 -0
- 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
|
package/CONTRIBUTING.md
ADDED
|
@@ -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.
|