Skip to content

Commit 597949b

Browse files
Merge branch 'main' into feat/sdk-wrapper
2 parents c7f0b4e + b132010 commit 597949b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6302
-2511
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
15+
# Use the pnpm version from package.json's packageManager
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: "pnpm"
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm run lint
22+
- run: pnpm run format:check

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --yes lint-staged
5+
6+

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
dist
3+
coverage
4+
*.min.js
5+
*.d.ts
6+
7+

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": true,
4+
"singleQuote": false,
5+
"trailingComma": "all",
6+
"printWidth": 100,
7+
"tabWidth": 2,
8+
"arrowParens": "always",
9+
"endOfLine": "lf"
10+
}

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"eslint.useFlatConfig": true,
5+
"eslint.validate": ["javascript", "typescript", "typescriptreact"],
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.eslint": "explicit"
8+
}
9+
}

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ pnpm dev
3232

3333
This project is a monorepo managed by pnpm workspaces. The project is organized as follows:
3434

35-
- `apps/`: Contains the applications, such as the documentation and the main server.
36-
- `packages/`: Contains the shared packages and libraries used by the applications.
37-
- `tools/`: Contains the tooling and configuration for the project, such as ESLint and TypeScript configurations.
35+
- `apps/`: Contains the applications, such as the documentation and the main server.
36+
- `packages/`: Contains the shared packages and libraries used by the applications.
37+
- `tools/`: Contains the tooling and configuration for the project, such as ESLint and TypeScript configurations.
3838

3939
## Commit Message Conventions
4040

@@ -52,14 +52,14 @@ Each commit message consists of a **header**, a **body**, and a **footer**. The
5252
5353
The **type** must be one of the following:
5454
55-
- `feat`: A new feature
56-
- `fix`: A bug fix
57-
- `docs`: Documentation only changes
58-
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
59-
- `refactor`: A code change that neither fixes a bug nor adds a feature
60-
- `perf`: A code change that improves performance
61-
- `test`: Adding missing tests or correcting existing tests
62-
- `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation
55+
- `feat`: A new feature
56+
- `fix`: A bug fix
57+
- `docs`: Documentation only changes
58+
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
59+
- `refactor`: A code change that neither fixes a bug nor adds a feature
60+
- `perf`: A code change that improves performance
61+
- `test`: Adding missing tests or correcting existing tests
62+
- `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation
6363
6464
## Code Style
6565

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# lighthouse-agent-tooling
2+
3+
Lighthouse Agent Tooling – A set of connectors, IDE extensions, and AI-native developer tools to seamlessly integrate Lighthouse into AI-powered workflows. Supports MCP (Model Context Protocol) connectors, Cursor/IDE extensions for pinning and encrypting datasets/models.
4+
5+
## Code Style
6+
7+
This repo uses ESLint (flat config) and Prettier for consistent code quality and formatting.
8+
9+
- Run lint: `pnpm lint`
10+
- Auto-fix: `pnpm lint:fix`
11+
- Format: `pnpm format`
12+
13+
Pre-commit hooks via Husky run lint-staged to format and lint changed files.
14+
115
# Lighthouse Agent Tooling
216

317
Lighthouse Agent Tooling – A set of connectors, IDE extensions, and AI-native developer tools to seamlessly integrate Lighthouse into AI-powered workflows. Supports MCP (Model Context Protocol) connectors, Cursor/IDE extensions for pinning and encrypting datasets/models.
@@ -70,19 +84,14 @@ The `@lighthouse-tooling/types` package provides comprehensive TypeScript interf
7084
### Usage
7185

7286
```typescript
73-
import {
74-
UploadResult,
75-
Dataset,
76-
AuthConfig,
77-
LIGHTHOUSE_MCP_TOOLS
78-
} from '@lighthouse-tooling/types';
87+
import { UploadResult, Dataset, AuthConfig, LIGHTHOUSE_MCP_TOOLS } from "@lighthouse-tooling/types";
7988

8089
// Create upload result
8190
const uploadResult: UploadResult = {
82-
cid: 'QmHash...',
91+
cid: "QmHash...",
8392
size: 1024,
8493
encrypted: true,
85-
uploadedAt: new Date()
94+
uploadedAt: new Date(),
8695
};
8796
```
8897

apps/docs/TECHNICAL_PROPOSAL.md

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ interface LighthouseMCPServer {
122122
const LIGHTHOUSE_MCP_TOOLS = [
123123
{
124124
name: "lighthouse_upload_file",
125-
description:
126-
"Upload a file to IPFS via Lighthouse with optional encryption",
125+
description: "Upload a file to IPFS via Lighthouse with optional encryption",
127126
inputSchema: {
128127
type: "object",
129128
properties: {
@@ -294,11 +293,7 @@ class LighthouseAISDK {
294293
});
295294

296295
// Save key shards with access conditions
297-
await this.saveEncryptionKeys(
298-
uploadResult.Hash,
299-
keyShards,
300-
accessConditions
301-
);
296+
await this.saveEncryptionKeys(uploadResult.Hash, keyShards, accessConditions);
302297

303298
return {
304299
cid: uploadResult.Hash,
@@ -356,14 +351,12 @@ class LighthouseAISDK {
356351
#### Deliverables:
357352

358353
1. **Lighthouse MCP Server Core**
359-
360354
- Basic MCP protocol implementation
361355
- Lighthouse SDK integration
362356
- Authentication management
363357
- File upload/download tools
364358

365359
2. **Core SDK Wrapper**
366-
367360
- Unified interface for Lighthouse and Kavach SDKs
368361
- Progress tracking and event emission
369362
- Error handling and retry logic
@@ -389,7 +382,7 @@ class LighthouseMCPServer extends Server {
389382
tools: {},
390383
resources: {},
391384
},
392-
}
385+
},
393386
);
394387

395388
this.setRequestHandler(ListToolsRequestSchema, this.handleListTools);
@@ -402,9 +395,7 @@ class LighthouseMCPServer extends Server {
402395
};
403396
}
404397

405-
private async handleCallTool(
406-
request: CallToolRequest
407-
): Promise<CallToolResult> {
398+
private async handleCallTool(request: CallToolRequest): Promise<CallToolResult> {
408399
const { name, arguments: args } = request.params;
409400

410401
switch (name) {
@@ -426,14 +417,12 @@ class LighthouseMCPServer extends Server {
426417
#### Deliverables:
427418

428419
1. **Enhanced VSCode Extension**
429-
430420
- AI agent command interface
431421
- Workspace context provider
432422
- Progress streaming to AI
433423
- MCP server integration
434424

435425
2. **Cursor IDE Extension**
436-
437426
- Port core functionality to Cursor
438427
- Cursor-specific UI adaptations
439428
- AI assistant integration hooks
@@ -468,28 +457,16 @@ export class LighthouseExtension {
468457

469458
private registerAICommands(context: vscode.ExtensionContext) {
470459
const commands = [
471-
vscode.commands.registerCommand(
472-
"lighthouse.ai.uploadFile",
473-
this.aiUploadFile
474-
),
475-
vscode.commands.registerCommand(
476-
"lighthouse.ai.createDataset",
477-
this.aiCreateDataset
478-
),
479-
vscode.commands.registerCommand(
480-
"lighthouse.ai.fetchFile",
481-
this.aiFetchFile
482-
),
460+
vscode.commands.registerCommand("lighthouse.ai.uploadFile", this.aiUploadFile),
461+
vscode.commands.registerCommand("lighthouse.ai.createDataset", this.aiCreateDataset),
462+
vscode.commands.registerCommand("lighthouse.ai.fetchFile", this.aiFetchFile),
483463
];
484464

485465
context.subscriptions.push(...commands);
486466
}
487467

488468
private async aiUploadFile(params: any) {
489-
const result = await this.mcpClient.callTool(
490-
"lighthouse_upload_file",
491-
params
492-
);
469+
const result = await this.mcpClient.callTool("lighthouse_upload_file", params);
493470

494471
// Notify AI of completion
495472
this.aiHooks.notifyCompletion("upload", result);
@@ -506,13 +483,11 @@ export class LighthouseExtension {
506483
#### Deliverables:
507484

508485
1. **Advanced Encryption Features**
509-
510486
- Threshold encryption with Kavach integration
511487
- Access condition management
512488
- Key sharing and revocation
513489

514490
2. **Dataset Management System**
515-
516491
- Version control for datasets
517492
- ML model lifecycle management
518493
- Collaborative dataset sharing
@@ -527,10 +502,7 @@ export class LighthouseExtension {
527502
```typescript
528503
// Advanced Encryption Service
529504
class AdvancedEncryptionService {
530-
async encryptWithConditions(
531-
file: Buffer,
532-
conditions: AccessCondition[]
533-
): Promise<EncryptedFile> {
505+
async encryptWithConditions(file: Buffer, conditions: AccessCondition[]): Promise<EncryptedFile> {
534506
// Generate threshold keys
535507
const { masterKey, keyShards } = await this.kavach.generate(3, 5);
536508

@@ -542,15 +514,15 @@ class AdvancedEncryptionService {
542514
this.auth.address,
543515
encryptedContent.cid,
544516
this.auth.token,
545-
conditions
517+
conditions,
546518
);
547519

548520
// Save key shards with conditions
549521
await this.kavach.saveShards(
550522
this.auth.address,
551523
encryptedContent.cid,
552524
this.auth.token,
553-
keyShards
525+
keyShards,
554526
);
555527

556528
return {
@@ -570,13 +542,11 @@ class AdvancedEncryptionService {
570542
#### Deliverables:
571543

572544
1. **Performance Optimization**
573-
574545
- Caching strategies for AI workflows
575546
- Batch operations for large datasets
576547
- Connection pooling and request optimization
577548

578549
2. **Security Hardening**
579-
580550
- Authentication token management
581551
- Secure key storage for AI agents
582552
- Rate limiting and abuse prevention
@@ -744,7 +714,6 @@ const claudeLighthouseTools = [
744714
### Authentication & Authorization
745715

746716
1. **Multi-layer Authentication**
747-
748717
- API key authentication for Lighthouse services
749718
- Wallet-based authentication for encryption operations
750719
- JWT token management with refresh cycles
@@ -757,7 +726,6 @@ const claudeLighthouseTools = [
757726
### Data Protection
758727

759728
1. **Encryption at Rest and Transit**
760-
761729
- AES-256 encryption for sensitive data
762730
- TLS 1.3 for all network communications
763731
- Threshold cryptography for distributed key management
@@ -770,7 +738,6 @@ const claudeLighthouseTools = [
770738
### AI Agent Security
771739

772740
1. **Sandboxed Operations**
773-
774741
- Restrict AI agents to authorized file operations
775742
- Rate limiting and quota management
776743
- Audit logging for all AI-initiated actions
@@ -812,9 +779,7 @@ const claudeLighthouseTools = [
812779
class BatchOperationManager {
813780
async uploadBatch(files: FileUpload[]): Promise<BatchResult> {
814781
// Process files in parallel with concurrency limit
815-
const results = await Promise.allSettled(
816-
files.map((file) => this.uploadWithRetry(file))
817-
);
782+
const results = await Promise.allSettled(files.map((file) => this.uploadWithRetry(file)));
818783

819784
return this.processBatchResults(results);
820785
}
@@ -913,7 +878,6 @@ describe("Full Workflow Tests", () => {
913878
### Package Distribution
914879

915880
1. **NPM Packages**
916-
917881
- `@lighthouse/mcp-server`: Standalone MCP server
918882
- `@lighthouse/ide-core`: Shared extension core
919883
- `@lighthouse/vscode-extension`: VSCode marketplace package

apps/mcp-server/eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { config as baseConfig } from "../../tools/eslint-config/base.js";
2+
3+
export default [...baseConfig];

apps/mcp-server/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
{
22
"name": "@lighthouse-tooling/mcp-server",
33
"version": "0.1.0",
4+
"main": "dist/index.js",
5+
"scripts": {
6+
"build": "tsc",
7+
"test": "jest",
8+
"test:watch": "jest --watch",
9+
"test:coverage": "jest --coverage",
10+
"clean": "rm -rf dist",
11+
"dev": "ts-node src/index.ts",
12+
"lint": "eslint .",
13+
"lint:fix": "eslint . --fix",
14+
"format": "prettier --write .",
15+
"format:check": "prettier --check ."
16+
},
417
"dependencies": {
518
"@lighthouse-tooling/sdk-wrapper": "workspace:*",
619
"@lighthouse-tooling/types": "workspace:*",
720
"@modelcontextprotocol/sdk": "latest"
21+
},
22+
"devDependencies": {
23+
"jest": "^29.7.0",
24+
"ts-jest": "^29.1.1",
25+
"@types/jest": "^29.5.5",
26+
"typescript": "^5.0.0",
27+
"ts-node": "^10.9.0",
28+
"@lighthouse-tooling/shared": "workspace:*"
829
}
930
}

0 commit comments

Comments
 (0)