@techwavedev/agi-agent-kit 1.1.5 → 1.2.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.
Potentially problematic release.
This version of @techwavedev/agi-agent-kit might be problematic. Click here for more details.
- package/CHANGELOG.md +140 -0
- package/README.md +190 -12
- package/bin/init.js +30 -2
- package/package.json +6 -3
- package/templates/base/AGENTS.md +54 -23
- package/templates/base/README.md +325 -0
- package/templates/base/directives/memory_integration.md +95 -0
- package/templates/base/execution/memory_manager.py +309 -0
- package/templates/base/execution/session_boot.py +218 -0
- package/templates/base/execution/session_init.py +320 -0
- package/templates/base/skill-creator/LICENSE.txt +0 -0
- package/templates/base/skill-creator/references/output-patterns.md +0 -0
- package/templates/base/skill-creator/references/workflows.md +0 -0
- package/templates/base/skill-creator/scripts/init_skill.py +0 -0
- package/templates/base/skill-creator/scripts/package_skill.py +0 -0
- package/templates/base/skill-creator/scripts/quick_validate.py +0 -0
- package/templates/skills/core/documentation/SKILL.md +0 -0
- package/templates/skills/core/documentation/references/best_practices.md +0 -0
- package/templates/skills/core/documentation/scripts/analyze_code.py +0 -0
- package/templates/skills/core/documentation/scripts/detect_changes.py +0 -0
- package/templates/skills/core/documentation/scripts/generate_changelog.py +0 -0
- package/templates/skills/core/documentation/scripts/sync_docs.py +0 -0
- package/templates/skills/core/documentation/scripts/update_skill_docs.py +0 -0
- package/templates/skills/core/pdf-reader/SKILL.md +0 -0
- package/templates/skills/core/pdf-reader/references/pdf_libraries.md +0 -0
- package/templates/skills/core/pdf-reader/scripts/extract_text.py +0 -0
- package/templates/skills/core/qdrant-memory/SKILL.md +0 -0
- package/templates/skills/core/qdrant-memory/references/advanced_patterns.md +0 -0
- package/templates/skills/core/qdrant-memory/references/collection_schemas.md +0 -0
- package/templates/skills/core/qdrant-memory/references/complete_guide.md +0 -0
- package/templates/skills/core/qdrant-memory/references/embedding_models.md +0 -0
- package/templates/skills/core/qdrant-memory/scripts/__pycache__/embedding_utils.cpython-314.pyc +0 -0
- package/templates/skills/core/qdrant-memory/scripts/__pycache__/init_collection.cpython-314.pyc +0 -0
- package/templates/skills/core/qdrant-memory/scripts/benchmark_token_savings.py +0 -0
- package/templates/skills/core/qdrant-memory/scripts/embedding_utils.py +0 -0
- package/templates/skills/core/qdrant-memory/scripts/hybrid_search.py +0 -0
- package/templates/skills/core/qdrant-memory/scripts/init_collection.py +0 -0
- package/templates/skills/core/qdrant-memory/scripts/memory_retrieval.py +0 -0
- package/templates/skills/core/qdrant-memory/scripts/semantic_cache.py +0 -0
- package/templates/skills/core/qdrant-memory/scripts/test_skill.py +0 -0
- package/templates/skills/core/webcrawler/references/advanced_crawling.md +0 -0
- package/templates/skills/core/webcrawler/scripts/crawl_docs.py +0 -0
- package/templates/skills/core/webcrawler/scripts/extract_page.py +0 -0
- package/templates/skills/core/webcrawler/scripts/filter_docs.py +0 -0
- package/templates/skills/ec/README.md +31 -0
- package/templates/skills/ec/aws/SKILL.md +1020 -0
- package/templates/skills/ec/aws/defaults.yaml +13 -0
- package/templates/skills/ec/aws/references/common_patterns.md +80 -0
- package/templates/skills/ec/aws/references/mcp_servers.md +98 -0
- package/templates/skills/ec/aws-terraform/SKILL.md +349 -0
- package/templates/skills/ec/aws-terraform/references/best_practices.md +394 -0
- package/templates/skills/ec/aws-terraform/references/checkov_reference.md +337 -0
- package/templates/skills/ec/aws-terraform/scripts/configure_mcp.py +150 -0
- package/templates/skills/ec/confluent-kafka/SKILL.md +655 -0
- package/templates/skills/ec/confluent-kafka/references/ansible_playbooks.md +792 -0
- package/templates/skills/ec/confluent-kafka/references/ec_deployment.md +579 -0
- package/templates/skills/ec/confluent-kafka/references/kraft_migration.md +490 -0
- package/templates/skills/ec/confluent-kafka/references/troubleshooting.md +778 -0
- package/templates/skills/ec/confluent-kafka/references/upgrade_7x_to_8x.md +488 -0
- package/templates/skills/ec/confluent-kafka/scripts/kafka_health_check.py +435 -0
- package/templates/skills/ec/confluent-kafka/scripts/upgrade_preflight.py +568 -0
- package/templates/skills/ec/confluent-kafka/scripts/validate_config.py +455 -0
- package/templates/skills/ec/consul/SKILL.md +427 -0
- package/templates/skills/ec/consul/references/acl_setup.md +168 -0
- package/templates/skills/ec/consul/references/ha_config.md +196 -0
- package/templates/skills/ec/consul/references/troubleshooting.md +267 -0
- package/templates/skills/ec/consul/references/upgrades.md +213 -0
- package/templates/skills/ec/consul/scripts/consul_health_report.py +530 -0
- package/templates/skills/ec/consul/scripts/consul_status.py +264 -0
- package/templates/skills/ec/consul/scripts/generate_values.py +170 -0
- package/templates/skills/ec/documentation/SKILL.md +351 -0
- package/templates/skills/ec/documentation/references/best_practices.md +201 -0
- package/templates/skills/ec/documentation/scripts/analyze_code.py +307 -0
- package/templates/skills/ec/documentation/scripts/detect_changes.py +460 -0
- package/templates/skills/ec/documentation/scripts/generate_changelog.py +312 -0
- package/templates/skills/ec/documentation/scripts/sync_docs.py +272 -0
- package/templates/skills/ec/documentation/scripts/update_skill_docs.py +366 -0
- package/templates/skills/ec/gitlab/SKILL.md +529 -0
- package/templates/skills/ec/gitlab/references/agent_installation.md +416 -0
- package/templates/skills/ec/gitlab/references/api_reference.md +508 -0
- package/templates/skills/ec/gitlab/references/gitops_flux.md +465 -0
- package/templates/skills/ec/gitlab/references/troubleshooting.md +518 -0
- package/templates/skills/ec/gitlab/scripts/generate_agent_values.py +329 -0
- package/templates/skills/ec/gitlab/scripts/gitlab_agent_status.py +414 -0
- package/templates/skills/ec/jira/SKILL.md +484 -0
- package/templates/skills/ec/jira/references/jql_reference.md +148 -0
- package/templates/skills/ec/jira/scripts/add_comment.py +91 -0
- package/templates/skills/ec/jira/scripts/bulk_log_work.py +124 -0
- package/templates/skills/ec/jira/scripts/create_ticket.py +162 -0
- package/templates/skills/ec/jira/scripts/get_ticket.py +191 -0
- package/templates/skills/ec/jira/scripts/jira_client.py +383 -0
- package/templates/skills/ec/jira/scripts/log_work.py +154 -0
- package/templates/skills/ec/jira/scripts/search_tickets.py +104 -0
- package/templates/skills/ec/jira/scripts/update_comment.py +67 -0
- package/templates/skills/ec/jira/scripts/update_ticket.py +161 -0
- package/templates/skills/ec/karpenter/SKILL.md +301 -0
- package/templates/skills/ec/karpenter/references/ec2nodeclasses.md +421 -0
- package/templates/skills/ec/karpenter/references/migration.md +396 -0
- package/templates/skills/ec/karpenter/references/nodepools.md +400 -0
- package/templates/skills/ec/karpenter/references/troubleshooting.md +359 -0
- package/templates/skills/ec/karpenter/scripts/generate_ec2nodeclass.py +187 -0
- package/templates/skills/ec/karpenter/scripts/generate_nodepool.py +245 -0
- package/templates/skills/ec/karpenter/scripts/karpenter_status.py +359 -0
- package/templates/skills/ec/opensearch/SKILL.md +720 -0
- package/templates/skills/ec/opensearch/references/ml_neural_search.md +576 -0
- package/templates/skills/ec/opensearch/references/operator.md +532 -0
- package/templates/skills/ec/opensearch/references/query_dsl.md +532 -0
- package/templates/skills/ec/opensearch/scripts/configure_mcp.py +148 -0
- package/templates/skills/ec/victoriametrics/SKILL.md +598 -0
- package/templates/skills/ec/victoriametrics/references/kubernetes.md +531 -0
- package/templates/skills/ec/victoriametrics/references/prometheus_migration.md +333 -0
- package/templates/skills/ec/victoriametrics/references/troubleshooting.md +442 -0
- package/templates/skills/knowledge/SKILLS_CATALOG.md +1066 -0
- package/templates/skills/knowledge/api-patterns/SKILL.md +0 -0
- package/templates/skills/knowledge/api-patterns/api-style.md +0 -0
- package/templates/skills/knowledge/api-patterns/auth.md +0 -0
- package/templates/skills/knowledge/api-patterns/documentation.md +0 -0
- package/templates/skills/knowledge/api-patterns/graphql.md +0 -0
- package/templates/skills/knowledge/api-patterns/rate-limiting.md +0 -0
- package/templates/skills/knowledge/api-patterns/response.md +0 -0
- package/templates/skills/knowledge/api-patterns/rest.md +0 -0
- package/templates/skills/knowledge/api-patterns/scripts/api_validator.py +0 -0
- package/templates/skills/knowledge/api-patterns/security-testing.md +0 -0
- package/templates/skills/knowledge/api-patterns/trpc.md +0 -0
- package/templates/skills/knowledge/api-patterns/versioning.md +0 -0
- package/templates/skills/knowledge/app-builder/SKILL.md +0 -0
- package/templates/skills/knowledge/app-builder/agent-coordination.md +0 -0
- package/templates/skills/knowledge/app-builder/feature-building.md +0 -0
- package/templates/skills/knowledge/app-builder/project-detection.md +0 -0
- package/templates/skills/knowledge/app-builder/scaffolding.md +0 -0
- package/templates/skills/knowledge/app-builder/tech-stack.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/SKILL.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/astro-static/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/chrome-extension/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/cli-tool/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/electron-desktop/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/express-api/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/flutter-app/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/nextjs-static/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/nuxt-app/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/python-fastapi/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/app-builder/templates/react-native-app/TEMPLATE.md +0 -0
- package/templates/skills/knowledge/architecture/SKILL.md +0 -0
- package/templates/skills/knowledge/architecture/context-discovery.md +0 -0
- package/templates/skills/knowledge/architecture/examples.md +0 -0
- package/templates/skills/knowledge/architecture/pattern-selection.md +0 -0
- package/templates/skills/knowledge/architecture/patterns-reference.md +0 -0
- package/templates/skills/knowledge/architecture/trade-off-analysis.md +0 -0
- package/templates/skills/knowledge/bash-linux/SKILL.md +0 -0
- package/templates/skills/knowledge/behavioral-modes/SKILL.md +0 -0
- package/templates/skills/knowledge/brainstorming/SKILL.md +0 -0
- package/templates/skills/knowledge/brainstorming/dynamic-questioning.md +0 -0
- package/templates/skills/knowledge/clean-code/SKILL.md +0 -0
- package/templates/skills/knowledge/code-review-checklist/SKILL.md +0 -0
- package/templates/skills/knowledge/database-design/SKILL.md +0 -0
- package/templates/skills/knowledge/database-design/database-selection.md +0 -0
- package/templates/skills/knowledge/database-design/indexing.md +0 -0
- package/templates/skills/knowledge/database-design/migrations.md +0 -0
- package/templates/skills/knowledge/database-design/optimization.md +0 -0
- package/templates/skills/knowledge/database-design/orm-selection.md +0 -0
- package/templates/skills/knowledge/database-design/schema-design.md +0 -0
- package/templates/skills/knowledge/database-design/scripts/schema_validator.py +0 -0
- package/templates/skills/knowledge/deployment-procedures/SKILL.md +0 -0
- package/templates/skills/knowledge/documentation-templates/SKILL.md +0 -0
- package/templates/skills/knowledge/frontend-design/SKILL.md +0 -0
- package/templates/skills/knowledge/frontend-design/animation-guide.md +0 -0
- package/templates/skills/knowledge/frontend-design/color-system.md +0 -0
- package/templates/skills/knowledge/frontend-design/decision-trees.md +0 -0
- package/templates/skills/knowledge/frontend-design/motion-graphics.md +0 -0
- package/templates/skills/knowledge/frontend-design/scripts/accessibility_checker.py +0 -0
- package/templates/skills/knowledge/frontend-design/scripts/ux_audit.py +0 -0
- package/templates/skills/knowledge/frontend-design/typography-system.md +0 -0
- package/templates/skills/knowledge/frontend-design/ux-psychology.md +0 -0
- package/templates/skills/knowledge/frontend-design/visual-effects.md +0 -0
- package/templates/skills/knowledge/game-development/2d-games/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/3d-games/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/game-art/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/game-audio/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/game-design/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/mobile-games/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/multiplayer/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/pc-games/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/vr-ar/SKILL.md +0 -0
- package/templates/skills/knowledge/game-development/web-games/SKILL.md +0 -0
- package/templates/skills/knowledge/geo-fundamentals/SKILL.md +0 -0
- package/templates/skills/knowledge/geo-fundamentals/scripts/geo_checker.py +0 -0
- package/templates/skills/knowledge/i18n-localization/SKILL.md +0 -0
- package/templates/skills/knowledge/i18n-localization/scripts/i18n_checker.py +0 -0
- package/templates/skills/knowledge/intelligent-routing/SKILL.md +237 -164
- package/templates/skills/knowledge/jira/scripts/__pycache__/jira_client.cpython-314.pyc +0 -0
- package/templates/skills/knowledge/lint-and-validate/SKILL.md +0 -0
- package/templates/skills/knowledge/lint-and-validate/scripts/lint_runner.py +0 -0
- package/templates/skills/knowledge/lint-and-validate/scripts/type_coverage.py +0 -0
- package/templates/skills/knowledge/mcp-builder/SKILL.md +0 -0
- package/templates/skills/knowledge/mobile-design/SKILL.md +0 -0
- package/templates/skills/knowledge/mobile-design/decision-trees.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-backend.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-color-system.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-debugging.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-design-thinking.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-navigation.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-performance.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-testing.md +0 -0
- package/templates/skills/knowledge/mobile-design/mobile-typography.md +0 -0
- package/templates/skills/knowledge/mobile-design/platform-android.md +0 -0
- package/templates/skills/knowledge/mobile-design/platform-ios.md +0 -0
- package/templates/skills/knowledge/mobile-design/scripts/mobile_audit.py +0 -0
- package/templates/skills/knowledge/mobile-design/touch-psychology.md +0 -0
- package/templates/skills/knowledge/nextjs-best-practices/SKILL.md +0 -0
- package/templates/skills/knowledge/nodejs-best-practices/SKILL.md +0 -0
- package/templates/skills/knowledge/parallel-agents/SKILL.md +345 -73
- package/templates/skills/knowledge/performance-profiling/SKILL.md +0 -0
- package/templates/skills/knowledge/performance-profiling/scripts/lighthouse_audit.py +0 -0
- package/templates/skills/knowledge/plan-writing/SKILL.md +0 -0
- package/templates/skills/knowledge/plugin-discovery/SKILL.md +582 -0
- package/templates/skills/knowledge/plugin-discovery/scripts/platform_setup.py +1083 -0
- package/templates/skills/knowledge/powershell-windows/SKILL.md +0 -0
- package/templates/skills/knowledge/python-patterns/SKILL.md +0 -0
- package/templates/skills/knowledge/react-patterns/SKILL.md +0 -0
- package/templates/skills/knowledge/red-team-tactics/SKILL.md +0 -0
- package/templates/skills/knowledge/seo-fundamentals/SKILL.md +0 -0
- package/templates/skills/knowledge/seo-fundamentals/scripts/seo_checker.py +0 -0
- package/templates/skills/knowledge/server-management/SKILL.md +0 -0
- package/templates/skills/knowledge/systematic-debugging/SKILL.md +0 -0
- package/templates/skills/knowledge/tailwind-patterns/SKILL.md +0 -0
- package/templates/skills/knowledge/tdd-workflow/SKILL.md +0 -0
- package/templates/skills/knowledge/testing-patterns/SKILL.md +0 -0
- package/templates/skills/knowledge/testing-patterns/scripts/test_runner.py +0 -0
- package/templates/skills/knowledge/vulnerability-scanner/SKILL.md +0 -0
- package/templates/skills/knowledge/vulnerability-scanner/checklists.md +0 -0
- package/templates/skills/knowledge/vulnerability-scanner/scripts/security_scan.py +0 -0
- package/templates/skills/knowledge/webapp-testing/SKILL.md +0 -0
- package/templates/skills/knowledge/webapp-testing/scripts/playwright_runner.py +0 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Script: session_init.py
|
|
4
|
+
Purpose: Bootstrap script for AI agent sessions. Checks prerequisites and
|
|
5
|
+
initializes Qdrant collections with correct dimensions for the
|
|
6
|
+
configured embedding provider (defaults to Ollama/768d).
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
# Full initialization (check + create collections)
|
|
10
|
+
python3 execution/session_init.py
|
|
11
|
+
|
|
12
|
+
# Check only (no collection creation)
|
|
13
|
+
python3 execution/session_init.py --check-only
|
|
14
|
+
|
|
15
|
+
# Force re-initialization
|
|
16
|
+
python3 execution/session_init.py --force
|
|
17
|
+
|
|
18
|
+
Environment Variables:
|
|
19
|
+
EMBEDDING_PROVIDER - "ollama" (default), "openai", or "bedrock"
|
|
20
|
+
OLLAMA_URL - Ollama server URL (default: http://localhost:11434)
|
|
21
|
+
QDRANT_URL - Qdrant server URL (default: http://localhost:6333)
|
|
22
|
+
|
|
23
|
+
Exit Codes:
|
|
24
|
+
0 - Success (all systems ready)
|
|
25
|
+
1 - Partial success (some checks failed but non-critical)
|
|
26
|
+
2 - Critical failure (Qdrant or embeddings not available)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
import argparse
|
|
30
|
+
import json
|
|
31
|
+
import os
|
|
32
|
+
import sys
|
|
33
|
+
from urllib.request import Request, urlopen
|
|
34
|
+
from urllib.error import URLError, HTTPError
|
|
35
|
+
|
|
36
|
+
# Resolve path to qdrant-memory scripts
|
|
37
|
+
SKILL_SCRIPTS_DIR = os.path.join(
|
|
38
|
+
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
|
|
39
|
+
"skills",
|
|
40
|
+
"qdrant-memory",
|
|
41
|
+
"scripts",
|
|
42
|
+
)
|
|
43
|
+
sys.path.insert(0, SKILL_SCRIPTS_DIR)
|
|
44
|
+
|
|
45
|
+
from embedding_utils import (
|
|
46
|
+
check_embedding_service,
|
|
47
|
+
get_embedding_dimension,
|
|
48
|
+
EMBEDDING_PROVIDER,
|
|
49
|
+
EMBEDDING_MODEL,
|
|
50
|
+
)
|
|
51
|
+
from init_collection import create_collection, create_payload_index
|
|
52
|
+
|
|
53
|
+
# Configuration
|
|
54
|
+
QDRANT_URL = os.environ.get("QDRANT_URL", "http://localhost:6333")
|
|
55
|
+
COLLECTIONS = ["agent_memory", "semantic_cache"]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def check_qdrant() -> dict:
|
|
59
|
+
"""Check if Qdrant is running and accessible."""
|
|
60
|
+
try:
|
|
61
|
+
req = Request(f"{QDRANT_URL}/collections", method="GET")
|
|
62
|
+
with urlopen(req, timeout=10) as response:
|
|
63
|
+
data = json.loads(response.read().decode())
|
|
64
|
+
existing = [
|
|
65
|
+
c["name"] for c in data.get("result", {}).get("collections", [])
|
|
66
|
+
]
|
|
67
|
+
return {"status": "ok", "url": QDRANT_URL, "existing_collections": existing}
|
|
68
|
+
except URLError as e:
|
|
69
|
+
return {
|
|
70
|
+
"status": "error",
|
|
71
|
+
"url": QDRANT_URL,
|
|
72
|
+
"message": str(e),
|
|
73
|
+
"fix": "docker run -d -p 6333:6333 -p 6334:6334 -v qdrant_storage:/qdrant/storage qdrant/qdrant",
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def check_ollama() -> dict:
|
|
78
|
+
"""Check if Ollama is running and has the embedding model."""
|
|
79
|
+
embed_status = check_embedding_service()
|
|
80
|
+
|
|
81
|
+
if embed_status.get("status") == "ok":
|
|
82
|
+
return embed_status
|
|
83
|
+
|
|
84
|
+
if embed_status.get("status") == "missing_model":
|
|
85
|
+
embed_status["fix"] = f"ollama pull {EMBEDDING_MODEL}"
|
|
86
|
+
return embed_status
|
|
87
|
+
|
|
88
|
+
if embed_status.get("status") == "connection_error":
|
|
89
|
+
embed_status["fix"] = "Install and start Ollama: https://ollama.ai"
|
|
90
|
+
return embed_status
|
|
91
|
+
|
|
92
|
+
return embed_status
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def init_collections(force: bool = False) -> list:
|
|
96
|
+
"""Initialize required Qdrant collections with correct dimensions."""
|
|
97
|
+
dimension = get_embedding_dimension()
|
|
98
|
+
results = []
|
|
99
|
+
|
|
100
|
+
for collection_name in COLLECTIONS:
|
|
101
|
+
# Check if collection already exists
|
|
102
|
+
try:
|
|
103
|
+
req = Request(f"{QDRANT_URL}/collections/{collection_name}", method="GET")
|
|
104
|
+
with urlopen(req, timeout=10) as response:
|
|
105
|
+
data = json.loads(response.read().decode())
|
|
106
|
+
existing_dim = (
|
|
107
|
+
data.get("result", {})
|
|
108
|
+
.get("config", {})
|
|
109
|
+
.get("params", {})
|
|
110
|
+
.get("vectors", {})
|
|
111
|
+
.get("size")
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
if existing_dim and existing_dim != dimension and force:
|
|
115
|
+
# Delete and recreate with correct dimensions
|
|
116
|
+
del_req = Request(
|
|
117
|
+
f"{QDRANT_URL}/collections/{collection_name}", method="DELETE"
|
|
118
|
+
)
|
|
119
|
+
urlopen(del_req, timeout=10)
|
|
120
|
+
print(
|
|
121
|
+
f" Deleted {collection_name} (was {existing_dim}d, need {dimension}d)"
|
|
122
|
+
)
|
|
123
|
+
elif existing_dim == dimension:
|
|
124
|
+
results.append(
|
|
125
|
+
{
|
|
126
|
+
"collection": collection_name,
|
|
127
|
+
"status": "exists",
|
|
128
|
+
"dimension": existing_dim,
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
continue
|
|
132
|
+
elif existing_dim and existing_dim != dimension and not force:
|
|
133
|
+
results.append(
|
|
134
|
+
{
|
|
135
|
+
"collection": collection_name,
|
|
136
|
+
"status": "dimension_mismatch",
|
|
137
|
+
"current": existing_dim,
|
|
138
|
+
"expected": dimension,
|
|
139
|
+
"fix": f"Run with --force to recreate with {dimension}d",
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
continue
|
|
143
|
+
except HTTPError as e:
|
|
144
|
+
if e.code != 404:
|
|
145
|
+
results.append(
|
|
146
|
+
{
|
|
147
|
+
"collection": collection_name,
|
|
148
|
+
"status": "error",
|
|
149
|
+
"message": str(e),
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
continue
|
|
153
|
+
except URLError:
|
|
154
|
+
results.append(
|
|
155
|
+
{
|
|
156
|
+
"collection": collection_name,
|
|
157
|
+
"status": "error",
|
|
158
|
+
"message": "Cannot connect to Qdrant",
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
continue
|
|
162
|
+
|
|
163
|
+
# Create collection
|
|
164
|
+
try:
|
|
165
|
+
create_result = create_collection(
|
|
166
|
+
QDRANT_URL, collection_name, dimension, "cosine"
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
# Create standard payload indexes
|
|
170
|
+
indexes = [
|
|
171
|
+
("type", "keyword"),
|
|
172
|
+
("project", "keyword"),
|
|
173
|
+
("timestamp", "datetime"),
|
|
174
|
+
("tags", "keyword"),
|
|
175
|
+
("model", "keyword"),
|
|
176
|
+
("token_count", "integer"),
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
for field, field_type in indexes:
|
|
180
|
+
create_payload_index(QDRANT_URL, collection_name, field, field_type)
|
|
181
|
+
|
|
182
|
+
results.append(
|
|
183
|
+
{
|
|
184
|
+
"collection": collection_name,
|
|
185
|
+
"status": "created",
|
|
186
|
+
"dimension": dimension,
|
|
187
|
+
"indexes": len(indexes),
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
except Exception as e:
|
|
191
|
+
results.append(
|
|
192
|
+
{"collection": collection_name, "status": "error", "message": str(e)}
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
return results
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def main():
|
|
199
|
+
parser = argparse.ArgumentParser(
|
|
200
|
+
description="Initialize AI agent session (Qdrant + Ollama check + collection setup)"
|
|
201
|
+
)
|
|
202
|
+
parser.add_argument(
|
|
203
|
+
"--check-only",
|
|
204
|
+
action="store_true",
|
|
205
|
+
help="Only check prerequisites, don't create collections",
|
|
206
|
+
)
|
|
207
|
+
parser.add_argument(
|
|
208
|
+
"--force",
|
|
209
|
+
action="store_true",
|
|
210
|
+
help="Force re-initialization (recreate collections)",
|
|
211
|
+
)
|
|
212
|
+
parser.add_argument(
|
|
213
|
+
"--json",
|
|
214
|
+
action="store_true",
|
|
215
|
+
help="Output as JSON only (no human-readable messages)",
|
|
216
|
+
)
|
|
217
|
+
args = parser.parse_args()
|
|
218
|
+
|
|
219
|
+
report = {
|
|
220
|
+
"provider": EMBEDDING_PROVIDER,
|
|
221
|
+
"model": EMBEDDING_MODEL,
|
|
222
|
+
"dimension": get_embedding_dimension(),
|
|
223
|
+
"qdrant": {},
|
|
224
|
+
"embeddings": {},
|
|
225
|
+
"collections": [],
|
|
226
|
+
"ready": False,
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
# Step 1: Check Qdrant
|
|
230
|
+
if not args.json:
|
|
231
|
+
print(f"Checking Qdrant at {QDRANT_URL}...")
|
|
232
|
+
qdrant_status = check_qdrant()
|
|
233
|
+
report["qdrant"] = qdrant_status
|
|
234
|
+
|
|
235
|
+
if qdrant_status["status"] != "ok":
|
|
236
|
+
if not args.json:
|
|
237
|
+
print(f" FAILED: {qdrant_status.get('message', 'Unknown error')}")
|
|
238
|
+
print(f" FIX: {qdrant_status.get('fix', 'Check Qdrant installation')}")
|
|
239
|
+
if args.json:
|
|
240
|
+
print(json.dumps(report, indent=2))
|
|
241
|
+
sys.exit(2)
|
|
242
|
+
else:
|
|
243
|
+
if not args.json:
|
|
244
|
+
print(f" OK. Collections: {qdrant_status.get('existing_collections', [])}")
|
|
245
|
+
|
|
246
|
+
# Step 2: Check embedding service
|
|
247
|
+
if not args.json:
|
|
248
|
+
print(f"Checking embedding service ({EMBEDDING_PROVIDER}/{EMBEDDING_MODEL})...")
|
|
249
|
+
embed_status = check_ollama()
|
|
250
|
+
report["embeddings"] = embed_status
|
|
251
|
+
|
|
252
|
+
if embed_status.get("status") != "ok":
|
|
253
|
+
if not args.json:
|
|
254
|
+
print(f" FAILED: {embed_status.get('message', 'Unknown error')}")
|
|
255
|
+
if embed_status.get("fix"):
|
|
256
|
+
print(f" FIX: {embed_status['fix']}")
|
|
257
|
+
if args.json:
|
|
258
|
+
print(json.dumps(report, indent=2))
|
|
259
|
+
sys.exit(2)
|
|
260
|
+
else:
|
|
261
|
+
if not args.json:
|
|
262
|
+
print(f" OK. Model: {EMBEDDING_MODEL} ({get_embedding_dimension()}d)")
|
|
263
|
+
|
|
264
|
+
# Step 3: Initialize collections
|
|
265
|
+
if not args.check_only:
|
|
266
|
+
if not args.json:
|
|
267
|
+
print(
|
|
268
|
+
f"Initializing collections (dimension={get_embedding_dimension()})..."
|
|
269
|
+
)
|
|
270
|
+
collection_results = init_collections(force=args.force)
|
|
271
|
+
report["collections"] = collection_results
|
|
272
|
+
|
|
273
|
+
for cr in collection_results:
|
|
274
|
+
if not args.json:
|
|
275
|
+
status = cr["status"]
|
|
276
|
+
name = cr["collection"]
|
|
277
|
+
if status == "created":
|
|
278
|
+
print(
|
|
279
|
+
f" CREATED: {name} ({cr['dimension']}d, {cr['indexes']} indexes)"
|
|
280
|
+
)
|
|
281
|
+
elif status == "exists":
|
|
282
|
+
print(f" EXISTS: {name} ({cr['dimension']}d)")
|
|
283
|
+
elif status == "dimension_mismatch":
|
|
284
|
+
print(
|
|
285
|
+
f" MISMATCH: {name} (current={cr['current']}d, expected={cr['expected']}d)"
|
|
286
|
+
)
|
|
287
|
+
print(f" FIX: {cr.get('fix', '')}")
|
|
288
|
+
else:
|
|
289
|
+
print(f" ERROR: {name} - {cr.get('message', '')}")
|
|
290
|
+
else:
|
|
291
|
+
if not args.json:
|
|
292
|
+
print("Skipping collection initialization (--check-only)")
|
|
293
|
+
|
|
294
|
+
# Final status
|
|
295
|
+
all_ok = qdrant_status["status"] == "ok" and embed_status.get("status") == "ok"
|
|
296
|
+
|
|
297
|
+
if not args.check_only:
|
|
298
|
+
all_ok = all_ok and all(
|
|
299
|
+
cr["status"] in ("created", "exists")
|
|
300
|
+
for cr in report.get("collections", [])
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
report["ready"] = all_ok
|
|
304
|
+
|
|
305
|
+
if not args.json:
|
|
306
|
+
if all_ok:
|
|
307
|
+
print(f"\nSession initialized. Memory system ready.")
|
|
308
|
+
print(f" Provider: {EMBEDDING_PROVIDER} ({EMBEDDING_MODEL})")
|
|
309
|
+
print(f" Dimension: {get_embedding_dimension()}")
|
|
310
|
+
print(f" Qdrant: {QDRANT_URL}")
|
|
311
|
+
else:
|
|
312
|
+
print(f"\nSession initialization incomplete. See errors above.")
|
|
313
|
+
else:
|
|
314
|
+
print(json.dumps(report, indent=2))
|
|
315
|
+
|
|
316
|
+
sys.exit(0 if all_ok else 1)
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
if __name__ == "__main__":
|
|
320
|
+
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/templates/skills/core/qdrant-memory/scripts/__pycache__/embedding_utils.cpython-314.pyc
ADDED
|
Binary file
|
package/templates/skills/core/qdrant-memory/scripts/__pycache__/init_collection.cpython-314.pyc
ADDED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# EC Skills (Private)
|
|
2
|
+
|
|
3
|
+
> ⚠️ **Private Branch Only** - These skills are exclusive to the `ec` protected branch.
|
|
4
|
+
|
|
5
|
+
This directory contains European Commission (EC) specific infrastructure skills that require private access to EC systems:
|
|
6
|
+
|
|
7
|
+
## Skills Included
|
|
8
|
+
|
|
9
|
+
| Skill | Purpose |
|
|
10
|
+
| ------------------ | --------------------------------- |
|
|
11
|
+
| `aws/` | AWS MCP hub for EC infrastructure |
|
|
12
|
+
| `aws-terraform/` | Terraform/Terragrunt deployments |
|
|
13
|
+
| `confluent-kafka/` | Kafka cluster management |
|
|
14
|
+
| `consul/` | HashiCorp Consul on EKS |
|
|
15
|
+
| `gitlab/` | GitLab agent management (on-prem) |
|
|
16
|
+
| `jira/` | CITnet Jira integration |
|
|
17
|
+
| `karpenter/` | EKS autoscaler |
|
|
18
|
+
| `opensearch/` | OpenSearch management |
|
|
19
|
+
| `victoriametrics/` | Time-series database |
|
|
20
|
+
| `documentation/` | Documentation automation |
|
|
21
|
+
|
|
22
|
+
## Access Requirements
|
|
23
|
+
|
|
24
|
+
- EC VPN or network access
|
|
25
|
+
- AWS credentials for EC accounts
|
|
26
|
+
- CITnet Jira API token
|
|
27
|
+
- GitLab on-premise access
|
|
28
|
+
|
|
29
|
+
## Branch Information
|
|
30
|
+
|
|
31
|
+
These skills are only included in the `ec` protected branch and are not distributed with the public `main` branch.
|