Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

# JavaScript, JSON, YAML
[*.{js,json,yml,yaml}]
indent_style = space
indent_size = 2

# Markdown
[*.md]
trim_trailing_whitespace = false
max_line_length = off

# Shell scripts
[*.sh]
indent_style = space
indent_size = 2

# Package files
[{package.json,package-lock.json}]
indent_style = space
indent_size = 2
50 changes: 50 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"env": {
"node": true,
"es2021": true,
"jest": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"no-console": "off",
"prefer-const": "error",
"no-var": "error",
"eqeqeq": ["error", "always"],
"curly": ["error", "all"],
"brace-style": ["error", "1tbs"],
"comma-dangle": ["error", "never"],
"arrow-spacing": "error",
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}],
"keyword-spacing": "error",
"space-infix-ops": "error",
"no-trailing-spaces": "error",
"eol-last": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": ["error", "never"],
"max-len": ["warn", { "code": 120, "ignoreUrls": true, "ignoreStrings": true }],
"no-multiple-empty-lines": ["error", { "max": 1 }],
"no-multi-spaces": "error"
},
"ignorePatterns": [
"node_modules/",
"dist/",
"build/",
"coverage/",
"*.min.js"
]
}
107 changes: 107 additions & 0 deletions .github/copilot/agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: SmartBrain
description: AI/ML Engine for CyberAi Ecosystem
version: 1.0.0

commands:
- name: /terminal SmartBrain
description: SmartBrain main command - displays help and system status
endpoint: smartbrain.main
parameters: []

- name: /terminal SmartBrain.status
description: Check SmartBrain status - displays models, training jobs, and system health
endpoint: smartbrain.status
parameters: []

- name: /terminal SmartBrain.validate
description: Validate models and configurations - runs validation checks on all components
endpoint: smartbrain.validate
parameters:
- name: target
description: What to validate (models, datasets, configs, all)
type: string
required: false
default: "all"

- name: /terminal SmartBrain.inference
description: Run inference commands - execute model predictions
endpoint: smartbrain.inference
parameters:
- name: model
description: Path to the model directory
type: string
required: true
- name: input
description: Path to input data file (JSON)
type: string
required: true
- name: output
description: Path to save results (optional)
type: string
required: false

- name: /terminal SmartBrain.train
description: Run training commands - train ML models
endpoint: smartbrain.train
parameters:
- name: config
description: Path to training configuration file
type: string
required: true
- name: output
description: Path to save trained model
type: string
required: false
- name: epochs
description: Number of training epochs
type: integer
required: false

- name: /terminal SmartBrain.models
description: List and manage models - display registered models and their status
endpoint: smartbrain.models
parameters:
- name: action
description: Action to perform (list, info, validate)
type: string
required: false
default: "list"
- name: model
description: Model name for info/validate actions
type: string
required: false

- name: /terminal SmartBrain.fix
description: Auto-fix common issues - automatically fixes validation errors and configuration issues
endpoint: smartbrain.fix
parameters:
- name: target
description: What to fix (permissions, configs, all)
type: string
required: false
default: "all"

permissions:
contents: write
pull-requests: write
issues: write
workflows: write

features:
- model_management
- training_pipeline
- inference_engine
- dataset_validation
- auto_fix

integration:
ecosystem: CyberAi
bots:
- SmartContractDeploy
- SmartContractAudit
workflows:
- ci
- lint
- model-validate
- model-lint
- codeql
39 changes: 39 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2

updates:
# Enable version updates for npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
assignees:
- "SolanaRemix"
labels:
- "dependencies"
- "npm"
commit-message:
prefix: "chore(deps)"
include: "scope"
versioning-strategy: increase
allow:
- dependency-type: "all"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
assignees:
- "SolanaRemix"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "chore(actions)"
include: "scope"
70 changes: 70 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Configuration for PR labeler
# See https://github.com/actions/labeler

# Models
models:
- changed-files:
- any-glob-to-any-file: 'models/**'

# Inference
inference:
- changed-files:
- any-glob-to-any-file: 'inference/**'

# Training
training:
- changed-files:
- any-glob-to-any-file: 'training/**'

# Datasets
datasets:
- changed-files:
- any-glob-to-any-file: 'datasets/**'

# Documentation
documentation:
- changed-files:
- any-glob-to-any-file:
- 'docs/**'
- '*.md'
- 'README.md'
- 'CONTRIBUTING.md'
- 'SECURITY.md'
- 'CODE_OF_CONDUCT.md'

# Tests
tests:
- changed-files:
- any-glob-to-any-file: 'tests/**'

# Scripts
scripts:
- changed-files:
- any-glob-to-any-file: 'scripts/**'

# Workflows
workflows:
- changed-files:
- any-glob-to-any-file: '.github/workflows/**'

# Dependencies
dependencies:
- changed-files:
- any-glob-to-any-file:
- 'package.json'
- 'package-lock.json'

# Bots
bots:
- changed-files:
- any-glob-to-any-file: 'bots/**'

# Configuration
configuration:
- changed-files:
- any-glob-to-any-file:
- '.eslintrc.json'
- '.prettierrc'
- 'commitlint.config.js'
- '.editorconfig'
- '.github/**'
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Run build (if exists)
run: npm run build --if-present

- name: Upload coverage
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
Loading
Loading