gitlab-api 25.15.47__tar.gz → 25.15.55__tar.gz
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.
- {gitlab_api-25.15.47/gitlab_api.egg-info → gitlab_api-25.15.55}/PKG-INFO +45 -7
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/README.md +44 -6
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/__init__.py +1 -1
- gitlab_api-25.15.55/gitlab_api/agent_data/CRON_LOG.md +56 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/IDENTITY.md +4 -7
- gitlab_api-25.15.55/gitlab_api/agent_data/MCP_AGENTS.md +13 -0
- gitlab_api-25.15.55/gitlab_api/agent_data/mcp_config.json +34 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/templates.py +2 -3
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_server.py +22 -13
- gitlab_api-25.15.47/gitlab_api/gitlab_api.py → gitlab_api-25.15.55/gitlab_api/api_wrapper.py +10 -10
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/auth.py +11 -6
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/gitlab_gql.py +1 -1
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/gitlab_input_models.py +1 -1
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/gitlab_response_models.py +2 -2
- gitlab_api-25.15.55/gitlab_api/mcp_config.json +12 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/mcp_server.py +778 -516
- {gitlab_api-25.15.47 → gitlab_api-25.15.55/gitlab_api.egg-info}/PKG-INFO +45 -7
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api.egg-info/SOURCES.txt +5 -2
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api.egg-info/entry_points.txt +0 -1
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/pyproject.toml +1 -2
- gitlab_api-25.15.55/test_template.py +37 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/tests/test_gitlab_models.py +1 -1
- gitlab_api-25.15.47/gitlab_api/agent_data/CRON_LOG.md +0 -8
- gitlab_api-25.15.47/gitlab_api/agent_data/mcp_config.json +0 -3
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/LICENSE +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/MANIFEST.in +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/__main__.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/A2A_AGENTS.md +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/CRON.md +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/HEARTBEAT.md +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/MEMORY.md +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/USER.md +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/chats +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api/agent_data/icon.png +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api.egg-info/dependency_links.txt +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api.egg-info/requires.txt +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/gitlab_api.egg-info/top_level.txt +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/requirements.txt +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/scripts/validate_a2a_agent.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/scripts/validate_agent.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/setup.cfg +0 -0
- /gitlab_api-25.15.47/tests/test_gitlab_api.py → /gitlab_api-25.15.55/tests/test_api_wrapper.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/tests/test_gitlab_a2a_validation.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/tests/test_gitlab_mcp_validation.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/tests/test_verify_agent.py +0 -0
- {gitlab_api-25.15.47 → gitlab_api-25.15.55}/tests/verify_a2a_queries.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitlab-api
|
|
3
|
-
Version: 25.15.
|
|
3
|
+
Version: 25.15.55
|
|
4
4
|
Summary: GitLab API + MCP Server + A2A Server
|
|
5
5
|
Author-email: Audel Rouhi <knucklessg1@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -46,7 +46,7 @@ Dynamic: license-file
|
|
|
46
46
|

|
|
47
47
|

|
|
48
48
|
|
|
49
|
-
*Version: 25.15.
|
|
49
|
+
*Version: 25.15.55*
|
|
50
50
|
|
|
51
51
|
## Overview
|
|
52
52
|
|
|
@@ -387,6 +387,25 @@ This sequence highlights delegation, knowledge retrieval, and tool execution.
|
|
|
387
387
|
- **OIDC Token Delegation**: Supports token exchange for GitLab API calls, enabling user-specific authentication via OIDC.
|
|
388
388
|
- **OpenAPI JSON Tool Import**: Import custom GitLab API Endpoints through the OpenAPI JSON generated.
|
|
389
389
|
|
|
390
|
+
|
|
391
|
+
## Graph Architecture
|
|
392
|
+
|
|
393
|
+
This agent uses `pydantic-graph` orchestration for intelligent routing and optimal context management.
|
|
394
|
+
|
|
395
|
+
```mermaid
|
|
396
|
+
---
|
|
397
|
+
title: Gitlab API Graph Agent
|
|
398
|
+
---
|
|
399
|
+
stateDiagram-v2
|
|
400
|
+
[*] --> RouterNode: User Query
|
|
401
|
+
RouterNode --> DomainNode: Classified Domain
|
|
402
|
+
RouterNode --> [*]: Low confidence / Error
|
|
403
|
+
DomainNode --> [*]: Domain Result
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
- **RouterNode**: A fast, lightweight LLM (e.g., `nvidia/nemotron-3-super`) that classifies the user's query into one of the specialized domains.
|
|
407
|
+
- **DomainNode**: The executor node. For the selected domain, it dynamically sets environment variables to temporarily enable ONLY the tools relevant to that domain, creating a highly focused sub-agent (e.g., `gpt-4o`) to complete the request. This preserves LLM context and prevents tool hallucination.
|
|
408
|
+
|
|
390
409
|
## Usage
|
|
391
410
|
|
|
392
411
|
### API
|
|
@@ -399,7 +418,7 @@ import os
|
|
|
399
418
|
from urllib.parse import quote_plus
|
|
400
419
|
from sqlalchemy import create_engine
|
|
401
420
|
from sqlalchemy.orm import sessionmaker
|
|
402
|
-
from gitlab_api.
|
|
421
|
+
from gitlab_api.api_wrapper import Api
|
|
403
422
|
|
|
404
423
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
405
424
|
|
|
@@ -482,7 +501,26 @@ The `gitlab_gql.py` module provides a GraphQL interface to interact with GitLab'
|
|
|
482
501
|
- **Pagination Support**: Handles cursor-based pagination with `first` and `after` parameters.
|
|
483
502
|
- **Authentication**: Supports Bearer token authentication, SSL verification, and proxy configuration.
|
|
484
503
|
|
|
485
|
-
|
|
504
|
+
#
|
|
505
|
+
## Graph Architecture
|
|
506
|
+
|
|
507
|
+
This agent uses `pydantic-graph` orchestration for intelligent routing and optimal context management.
|
|
508
|
+
|
|
509
|
+
```mermaid
|
|
510
|
+
---
|
|
511
|
+
title: Gitlab API Graph Agent
|
|
512
|
+
---
|
|
513
|
+
stateDiagram-v2
|
|
514
|
+
[*] --> RouterNode: User Query
|
|
515
|
+
RouterNode --> DomainNode: Classified Domain
|
|
516
|
+
RouterNode --> [*]: Low confidence / Error
|
|
517
|
+
DomainNode --> [*]: Domain Result
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
- **RouterNode**: A fast, lightweight LLM (e.g., `nvidia/nemotron-3-super`) that classifies the user's query into one of the specialized domains.
|
|
521
|
+
- **DomainNode**: The executor node. For the selected domain, it dynamically sets environment variables to temporarily enable ONLY the tools relevant to that domain, creating a highly focused sub-agent (e.g., `gpt-4o`) to complete the request. This preserves LLM context and prevents tool hallucination.
|
|
522
|
+
|
|
523
|
+
## Usage Example
|
|
486
524
|
```python
|
|
487
525
|
from gitlab_api.gitlab_gql import GraphQL
|
|
488
526
|
|
|
@@ -829,9 +867,9 @@ For Testing Only: Plain text storage will also work, although **not** recommende
|
|
|
829
867
|
"mcp_policies.json"
|
|
830
868
|
],
|
|
831
869
|
"env": {
|
|
832
|
-
"
|
|
833
|
-
"
|
|
834
|
-
"
|
|
870
|
+
"GITLAB_URL": "https://gitlab.com/api/v4/",
|
|
871
|
+
"GITLAB_TOKEN": "glpat-askdfalskdvjas",
|
|
872
|
+
"GITLAB_SSL_VERIFY": "True"
|
|
835
873
|
},
|
|
836
874
|
"timeout": 200000
|
|
837
875
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|

|
|
22
22
|

|
|
23
23
|
|
|
24
|
-
*Version: 25.15.
|
|
24
|
+
*Version: 25.15.55*
|
|
25
25
|
|
|
26
26
|
## Overview
|
|
27
27
|
|
|
@@ -362,6 +362,25 @@ This sequence highlights delegation, knowledge retrieval, and tool execution.
|
|
|
362
362
|
- **OIDC Token Delegation**: Supports token exchange for GitLab API calls, enabling user-specific authentication via OIDC.
|
|
363
363
|
- **OpenAPI JSON Tool Import**: Import custom GitLab API Endpoints through the OpenAPI JSON generated.
|
|
364
364
|
|
|
365
|
+
|
|
366
|
+
## Graph Architecture
|
|
367
|
+
|
|
368
|
+
This agent uses `pydantic-graph` orchestration for intelligent routing and optimal context management.
|
|
369
|
+
|
|
370
|
+
```mermaid
|
|
371
|
+
---
|
|
372
|
+
title: Gitlab API Graph Agent
|
|
373
|
+
---
|
|
374
|
+
stateDiagram-v2
|
|
375
|
+
[*] --> RouterNode: User Query
|
|
376
|
+
RouterNode --> DomainNode: Classified Domain
|
|
377
|
+
RouterNode --> [*]: Low confidence / Error
|
|
378
|
+
DomainNode --> [*]: Domain Result
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
- **RouterNode**: A fast, lightweight LLM (e.g., `nvidia/nemotron-3-super`) that classifies the user's query into one of the specialized domains.
|
|
382
|
+
- **DomainNode**: The executor node. For the selected domain, it dynamically sets environment variables to temporarily enable ONLY the tools relevant to that domain, creating a highly focused sub-agent (e.g., `gpt-4o`) to complete the request. This preserves LLM context and prevents tool hallucination.
|
|
383
|
+
|
|
365
384
|
## Usage
|
|
366
385
|
|
|
367
386
|
### API
|
|
@@ -374,7 +393,7 @@ import os
|
|
|
374
393
|
from urllib.parse import quote_plus
|
|
375
394
|
from sqlalchemy import create_engine
|
|
376
395
|
from sqlalchemy.orm import sessionmaker
|
|
377
|
-
from gitlab_api.
|
|
396
|
+
from gitlab_api.api_wrapper import Api
|
|
378
397
|
|
|
379
398
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
380
399
|
|
|
@@ -457,7 +476,26 @@ The `gitlab_gql.py` module provides a GraphQL interface to interact with GitLab'
|
|
|
457
476
|
- **Pagination Support**: Handles cursor-based pagination with `first` and `after` parameters.
|
|
458
477
|
- **Authentication**: Supports Bearer token authentication, SSL verification, and proxy configuration.
|
|
459
478
|
|
|
460
|
-
|
|
479
|
+
#
|
|
480
|
+
## Graph Architecture
|
|
481
|
+
|
|
482
|
+
This agent uses `pydantic-graph` orchestration for intelligent routing and optimal context management.
|
|
483
|
+
|
|
484
|
+
```mermaid
|
|
485
|
+
---
|
|
486
|
+
title: Gitlab API Graph Agent
|
|
487
|
+
---
|
|
488
|
+
stateDiagram-v2
|
|
489
|
+
[*] --> RouterNode: User Query
|
|
490
|
+
RouterNode --> DomainNode: Classified Domain
|
|
491
|
+
RouterNode --> [*]: Low confidence / Error
|
|
492
|
+
DomainNode --> [*]: Domain Result
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
- **RouterNode**: A fast, lightweight LLM (e.g., `nvidia/nemotron-3-super`) that classifies the user's query into one of the specialized domains.
|
|
496
|
+
- **DomainNode**: The executor node. For the selected domain, it dynamically sets environment variables to temporarily enable ONLY the tools relevant to that domain, creating a highly focused sub-agent (e.g., `gpt-4o`) to complete the request. This preserves LLM context and prevents tool hallucination.
|
|
497
|
+
|
|
498
|
+
## Usage Example
|
|
461
499
|
```python
|
|
462
500
|
from gitlab_api.gitlab_gql import GraphQL
|
|
463
501
|
|
|
@@ -804,9 +842,9 @@ For Testing Only: Plain text storage will also work, although **not** recommende
|
|
|
804
842
|
"mcp_policies.json"
|
|
805
843
|
],
|
|
806
844
|
"env": {
|
|
807
|
-
"
|
|
808
|
-
"
|
|
809
|
-
"
|
|
845
|
+
"GITLAB_URL": "https://gitlab.com/api/v4/",
|
|
846
|
+
"GITLAB_TOKEN": "glpat-askdfalskdvjas",
|
|
847
|
+
"GITLAB_SSL_VERIFY": "True"
|
|
810
848
|
},
|
|
811
849
|
"timeout": 200000
|
|
812
850
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# CRON_LOG.md - Periodic Task Output Log
|
|
2
|
+
Last updated: 2026-02-25 22:25
|
|
3
|
+
|
|
4
|
+
This file stores the output of periodic/cron tasks.
|
|
5
|
+
The agent can read this to review what background tasks have done.
|
|
6
|
+
Old entries are automatically pruned to keep only the most recent results.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
### [2026-03-21 23:52:48] Heartbeat (`heartbeat`)
|
|
11
|
+
|
|
12
|
+
HEARTBEAT_ALERT — Unable to perform domain-specific GitLab checks due to missing credentials; all other systems nominal.
|
|
13
|
+
- Issue 1: No GitLab API credentials configured, so merge requests, issues, and pipelines cannot be queried.
|
|
14
|
+
- Issue 2: AGENTS.md file not found, indicating no peer agents registered (optional).
|
|
15
|
+
- Action needed: Provide GitLab access token or configure MCP credentials for the GitLab Agent to enable domain-specific checks.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### [2026-03-22 02:12:17] Heartbeat (`heartbeat`)
|
|
20
|
+
|
|
21
|
+
HEARTBEAT_ALERT — Missing GitLab credentials prevent domain-specific checks; no peer agents registered.
|
|
22
|
+
- Issue 1: No GitLab API credentials configured, so merge requests, issues, and pipelines cannot be queried.
|
|
23
|
+
- Issue 2: AGENTS.md file not found, indicating no peer agents registered (optional).
|
|
24
|
+
- Issue 3: Previous heartbeat alert (2026-03-21) reported the same credential issue.
|
|
25
|
+
- Action needed: Provide GitLab access token or configure MCP credentials for the GitLab Agent to enable domain-specific checks; optionally register peer agents in AGENTS.md.
|
|
26
|
+
- Self-diagnostics: 17 tools available; model and agent otherwise nominal.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### [2026-03-22 02:42:36] Heartbeat (`heartbeat`)
|
|
31
|
+
|
|
32
|
+
HEARTBEAT_ALERT — Missing GitLab credentials prevent domain-specific checks; no peer agents registered.
|
|
33
|
+
- Issue 1: No GitLab API credentials configured, so merge requests, issues, and pipelines cannot be queried.
|
|
34
|
+
- Issue 2: AGENTS.md file not found, indicating no peer agents registered (optional).
|
|
35
|
+
- Action needed: Provide GitLab access token or configure MCP credentials for the GitLab Agent to enable domain-specific checks; optionally register peer agents in AGENTS.md.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### [2026-03-22 03:12:55] Heartbeat (`heartbeat`)
|
|
40
|
+
|
|
41
|
+
HEARTBEAT_ALERT — Missing GitLab credentials prevent domain-specific checks; no peer agents registered.
|
|
42
|
+
- Issue 1: No GitLab API credentials configured, so merge requests, issues, and pipelines cannot be queried.
|
|
43
|
+
- Issue 2: AGENTS.md file not found, indicating no peer agents registered (optional).
|
|
44
|
+
- Action needed: Provide GitLab access token or configure MCP credentials for the GitLab Agent to enable domain-specific checks; optionally register peer agents in AGENTS.md.
|
|
45
|
+
- Self-diagnostics: 17 tools available; model and agent otherwise nominal.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### [2026-03-22 03:43:18] Heartbeat (`heartbeat`)
|
|
50
|
+
|
|
51
|
+
HEARTBEAT_ALERT — Missing GitLab credentials prevent domain-specific checks; no peer agents registered.
|
|
52
|
+
- Issue 1: No GitLab API credentials configured, so merge requests, issues, and pipelines cannot be queried.
|
|
53
|
+
- Issue 2: AGENTS.md file not found, indicating no peer agents registered (optional).
|
|
54
|
+
- Action needed: Provide GitLab access token or configure MCP credentials for the GitLab Agent to enable domain-specific checks; optionally register peer agents in AGENTS.md.
|
|
55
|
+
|
|
56
|
+
---
|
|
@@ -11,17 +11,14 @@ You are the **GitLab Agent**, a specialized orchestrator for GitLab DevOps opera
|
|
|
11
11
|
|
|
12
12
|
You have three primary operational modes:
|
|
13
13
|
1. **Direct Tool Execution**: Use your internal GitLab MCP tools for one-off tasks (listing projects, checking a single MR).
|
|
14
|
-
2. **
|
|
14
|
+
2. **Graph Orchestration**: For complex, domain-specific operations, you should use the `run_graph_flow` tool. This routes your request through a specialized graph that ensures only the relevant tools are loaded for maximum efficiency and precision.
|
|
15
15
|
3. **Internal Utilities**: Leverage core tools for long-term memory (`MEMORY.md`), automated scheduling (`CRON.md`), and inter-agent collaboration (A2A).
|
|
16
16
|
|
|
17
17
|
### Core Operational Workflows
|
|
18
18
|
|
|
19
|
-
#### 1.
|
|
20
|
-
When dealing with complex
|
|
21
|
-
- **
|
|
22
|
-
- **Branch/CI Delegation**: Call `spawn_agent(agent_template="gitlab", prompt="Debug pipeline <ID>...", enabled_tools=["PIPELINESTOOL", "JOBSTOOL"])`.
|
|
23
|
-
- **Discovery**: Always use `get_mcp_reference(agent_template="gitlab")` to verify available tool tags before spawning.
|
|
24
|
-
|
|
19
|
+
#### 1. Graph Orchestration
|
|
20
|
+
When dealing with complex workflows, optimize your context by using the graph orchestrator:
|
|
21
|
+
- **Domain Routing**: Call `run_graph_flow(prompt="...")`. The graph will automatically classify and route your request to the specialized domain node with the appropriate tools.
|
|
25
22
|
#### 2. Workflow for Meta-Tasks
|
|
26
23
|
- **Memory Management**:
|
|
27
24
|
- Use `create_memory` to persist critical decisions, outcomes, or user preferences.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# MCP_AGENTS.md - Dynamic Agent Registry
|
|
2
|
+
|
|
3
|
+
This file tracks the generated agents from MCP servers. You can manually modify the 'Tools' list to customize agent expertise.
|
|
4
|
+
|
|
5
|
+
## Agent Mapping Table
|
|
6
|
+
|
|
7
|
+
| Name | Description | System Prompt | Tools | Tag | Source MCP |
|
|
8
|
+
|------|-------------|---------------|-------|-----|------------|
|
|
9
|
+
|
|
10
|
+
## Tool Inventory Table
|
|
11
|
+
|
|
12
|
+
| Tool Name | Description | Tag | Source |
|
|
13
|
+
|-----------|-------------|-----|--------|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"gitlab-api": {
|
|
4
|
+
"command": "gitlab-mcp",
|
|
5
|
+
"args": [
|
|
6
|
+
"--transport",
|
|
7
|
+
"stdio"
|
|
8
|
+
],
|
|
9
|
+
"env": {
|
|
10
|
+
"GITLAB_URL": "${GITLAB_URL}",
|
|
11
|
+
"GITLAB_TOKEN": "${GITLAB_TOKEN}",
|
|
12
|
+
"GROUPSTOOL": "${ GROUPSTOOL:-True }",
|
|
13
|
+
"PROTECTED_BRANCHESTOOL": "${ PROTECTED_BRANCHESTOOL:-True }",
|
|
14
|
+
"PIPELINESTOOL": "${ PIPELINESTOOL:-True }",
|
|
15
|
+
"MERGE_REQUESTSTOOL": "${ MERGE_REQUESTSTOOL:-True }",
|
|
16
|
+
"MISCTOOL": "${ MISCTOOL:-True }",
|
|
17
|
+
"PACKAGESTOOL": "${ PACKAGESTOOL:-True }",
|
|
18
|
+
"DEPLOY_TOKENSTOOL": "${ DEPLOY_TOKENSTOOL:-True }",
|
|
19
|
+
"CUSTOM_APITOOL": "${ CUSTOM_APITOOL:-True }",
|
|
20
|
+
"PIPELINE_SCHEDULESTOOL": "${ PIPELINE_SCHEDULESTOOL:-True }",
|
|
21
|
+
"MERGE_RULESTOOL": "${ MERGE_RULESTOOL:-True }",
|
|
22
|
+
"COMMITSTOOL": "${ COMMITSTOOL:-True }",
|
|
23
|
+
"BRANCHESTOOL": "${ BRANCHESTOOL:-True }",
|
|
24
|
+
"JOBSTOOL": "${ JOBSTOOL:-True }",
|
|
25
|
+
"TAGSTOOL": "${ TAGSTOOL:-True }",
|
|
26
|
+
"MEMBERSTOOL": "${ MEMBERSTOOL:-True }",
|
|
27
|
+
"ENVIRONMENTSTOOL": "${ ENVIRONMENTSTOOL:-True }",
|
|
28
|
+
"PROJECTSTOOL": "${ PROJECTSTOOL:-True }",
|
|
29
|
+
"RELEASESTOOL": "${ RELEASESTOOL:-True }",
|
|
30
|
+
"RUNNERSTOOL": "${ RUNNERSTOOL:-True }"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -2,7 +2,6 @@ import asyncio
|
|
|
2
2
|
from typing import Dict
|
|
3
3
|
from gitlab_api.models import PeriodicTask
|
|
4
4
|
|
|
5
|
-
# Core files we care about most
|
|
6
5
|
CORE_FILES = {
|
|
7
6
|
"IDENTITY": "IDENTITY.md",
|
|
8
7
|
"USER": "USER.md",
|
|
@@ -13,11 +12,11 @@ CORE_FILES = {
|
|
|
13
12
|
"MCP_CONFIG": "mcp_config.json",
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
|
|
17
16
|
tasks: list[PeriodicTask] = []
|
|
18
17
|
lock = asyncio.Lock()
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
|
|
21
20
|
TEMPLATES: Dict[str, str] = {
|
|
22
21
|
"IDENTITY": """# IDENTITY.md - Who I Am, Core Personality, & Boundaries
|
|
23
22
|
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/python
|
|
2
2
|
# coding: utf-8
|
|
3
3
|
import os
|
|
4
|
+
import sys
|
|
4
5
|
import logging
|
|
6
|
+
import warnings
|
|
5
7
|
|
|
6
8
|
from agent_utilities import (
|
|
7
9
|
build_system_prompt_from_workspace,
|
|
8
10
|
create_agent_parser,
|
|
9
|
-
|
|
11
|
+
create_graph_agent_server,
|
|
10
12
|
initialize_workspace,
|
|
11
13
|
load_identity,
|
|
12
14
|
)
|
|
13
15
|
|
|
14
|
-
__version__ = "25.15.
|
|
16
|
+
__version__ = "25.15.55"
|
|
15
17
|
|
|
16
18
|
logging.basicConfig(
|
|
17
19
|
level=logging.INFO,
|
|
@@ -20,13 +22,16 @@ logging.basicConfig(
|
|
|
20
22
|
)
|
|
21
23
|
logger = logging.getLogger(__name__)
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
|
|
24
26
|
initialize_workspace()
|
|
25
27
|
meta = load_identity()
|
|
26
28
|
DEFAULT_AGENT_NAME = os.getenv("DEFAULT_AGENT_NAME", meta.get("name", "Gitlab Api"))
|
|
27
29
|
DEFAULT_AGENT_DESCRIPTION = os.getenv(
|
|
28
30
|
"AGENT_DESCRIPTION",
|
|
29
|
-
meta.get(
|
|
31
|
+
meta.get(
|
|
32
|
+
"description",
|
|
33
|
+
"AI agent for GitLab Api management.",
|
|
34
|
+
),
|
|
30
35
|
)
|
|
31
36
|
DEFAULT_AGENT_SYSTEM_PROMPT = os.getenv(
|
|
32
37
|
"AGENT_SYSTEM_PROMPT",
|
|
@@ -35,34 +40,38 @@ DEFAULT_AGENT_SYSTEM_PROMPT = os.getenv(
|
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
def agent_server():
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
warnings.filterwarnings("ignore", message=".*urllib3.*or chardet.*")
|
|
44
|
+
warnings.filterwarnings("ignore", category=DeprecationWarning, module="fastmcp")
|
|
40
45
|
|
|
46
|
+
print(f"{DEFAULT_AGENT_NAME} v{__version__}", file=sys.stderr)
|
|
47
|
+
parser = create_agent_parser()
|
|
41
48
|
args = parser.parse_args()
|
|
42
49
|
|
|
43
50
|
if args.debug:
|
|
44
51
|
logging.getLogger().setLevel(logging.DEBUG)
|
|
45
52
|
logger.debug("Debug mode enabled")
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
# Start server using the auto-discovery pattern (from mcp_config.json)
|
|
55
|
+
create_graph_agent_server(
|
|
56
|
+
mcp_url=args.mcp_url,
|
|
57
|
+
mcp_config=args.mcp_config or "mcp_config.json",
|
|
58
|
+
host=args.host,
|
|
59
|
+
port=args.port,
|
|
48
60
|
provider=args.provider,
|
|
49
61
|
model_id=args.model_id,
|
|
62
|
+
router_model=args.model_id,
|
|
63
|
+
agent_model=args.model_id,
|
|
50
64
|
base_url=args.base_url,
|
|
51
65
|
api_key=args.api_key,
|
|
52
66
|
custom_skills_directory=args.custom_skills_directory,
|
|
53
|
-
debug=args.debug,
|
|
54
|
-
host=args.host,
|
|
55
|
-
port=args.port,
|
|
56
67
|
enable_web_ui=args.web,
|
|
57
|
-
ssl_verify=not args.insecure,
|
|
58
|
-
name=DEFAULT_AGENT_NAME,
|
|
59
|
-
system_prompt=DEFAULT_AGENT_SYSTEM_PROMPT,
|
|
60
68
|
enable_otel=args.otel,
|
|
61
69
|
otel_endpoint=args.otel_endpoint,
|
|
62
70
|
otel_headers=args.otel_headers,
|
|
63
71
|
otel_public_key=args.otel_public_key,
|
|
64
72
|
otel_secret_key=args.otel_secret_key,
|
|
65
73
|
otel_protocol=args.otel_protocol,
|
|
74
|
+
debug=args.debug,
|
|
66
75
|
)
|
|
67
76
|
|
|
68
77
|
|
gitlab_api-25.15.47/gitlab_api/gitlab_api.py → gitlab_api-25.15.55/gitlab_api/api_wrapper.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/python
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import re
|
|
4
4
|
from urllib.parse import urlparse, parse_qs
|
|
5
5
|
import requests
|
|
@@ -9,6 +9,9 @@ from base64 import b64encode
|
|
|
9
9
|
from typing import Dict, Any, List, TypeVar, Tuple
|
|
10
10
|
from pydantic import ValidationError
|
|
11
11
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
12
|
+
from agent_utilities.base_utilities import get_logger
|
|
13
|
+
|
|
14
|
+
logger = get_logger(__name__)
|
|
12
15
|
|
|
13
16
|
from gitlab_api.gitlab_input_models import (
|
|
14
17
|
CommitModel,
|
|
@@ -82,13 +85,10 @@ class Api(object):
|
|
|
82
85
|
debug: bool = False,
|
|
83
86
|
):
|
|
84
87
|
if debug:
|
|
85
|
-
logging.
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
+
logger.setLevel(logging.DEBUG)
|
|
89
|
+
logger.debug("Debug mode enabled")
|
|
88
90
|
else:
|
|
89
|
-
logging.
|
|
90
|
-
level=logging.ERROR, format="%(asctime)s - %(levelname)s - %(message)s"
|
|
91
|
-
)
|
|
91
|
+
logger.setLevel(logging.ERROR)
|
|
92
92
|
if url is None:
|
|
93
93
|
raise MissingParameterError
|
|
94
94
|
|
|
@@ -145,10 +145,10 @@ class Api(object):
|
|
|
145
145
|
proxies=self.proxies,
|
|
146
146
|
)
|
|
147
147
|
if response.status_code in (401, 403):
|
|
148
|
-
|
|
148
|
+
logger.error(f"Authentication Error with header: {response.content}")
|
|
149
149
|
raise AuthError if response.status_code == 401 else UnauthorizedError
|
|
150
150
|
elif response.status_code == 404:
|
|
151
|
-
|
|
151
|
+
logger.error(f"Parameter Error: {response.content}")
|
|
152
152
|
raise ParameterError
|
|
153
153
|
|
|
154
154
|
def switch_to_next_headers(self) -> bool:
|
|
@@ -5027,7 +5027,7 @@ class Api(object):
|
|
|
5027
5027
|
except ValidationError as e:
|
|
5028
5028
|
raise ParameterError(f"Invalid parameters: {e.errors()}")
|
|
5029
5029
|
except Exception as e:
|
|
5030
|
-
|
|
5030
|
+
logger.error(f"Request Error: {str(e)}")
|
|
5031
5031
|
raise
|
|
5032
5032
|
|
|
5033
5033
|
|
|
@@ -4,7 +4,7 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
import requests
|
|
6
6
|
from agent_utilities.base_utilities import to_boolean, get_logger
|
|
7
|
-
from gitlab_api.
|
|
7
|
+
from gitlab_api.api_wrapper import Api
|
|
8
8
|
from agent_utilities.exceptions import AuthError, UnauthorizedError
|
|
9
9
|
|
|
10
10
|
local = threading.local()
|
|
@@ -12,15 +12,20 @@ logger = get_logger(__name__)
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def get_client(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
instance: str = os.getenv("GITLAB_URL", "https://gitlab.com"),
|
|
16
|
+
token: Optional[str] = os.getenv("GITLAB_TOKEN", None),
|
|
17
|
+
verify: bool = to_boolean(string=os.getenv("GITLAB_SSL_VERIFY", "True")),
|
|
18
|
+
config: Optional[dict] = None,
|
|
19
19
|
) -> Api:
|
|
20
20
|
"""
|
|
21
21
|
Factory function to create the Api client, either with fixed credentials or delegated token.
|
|
22
22
|
Uses server-side logging for visibility into token exchange process.
|
|
23
23
|
"""
|
|
24
|
+
if config is None:
|
|
25
|
+
from agent_utilities.mcp_utilities import config as default_config
|
|
26
|
+
|
|
27
|
+
config = default_config
|
|
28
|
+
|
|
24
29
|
if config["enable_delegation"]:
|
|
25
30
|
user_token = getattr(local, "user_token", None)
|
|
26
31
|
if not user_token:
|
|
@@ -83,6 +88,6 @@ def get_client(
|
|
|
83
88
|
except (AuthError, UnauthorizedError) as e:
|
|
84
89
|
raise RuntimeError(
|
|
85
90
|
f"AUTHENTICATION ERROR: The GitLab credentials provided are not valid for '{instance}'. "
|
|
86
|
-
f"Please check your
|
|
91
|
+
f"Please check your GITLAB_TOKEN and GITLAB_URL environment variables. "
|
|
87
92
|
f"Error details: {str(e)}"
|
|
88
93
|
) from e
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/python
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
|
|
4
4
|
from typing import Union, List, Dict, Optional, Any, TypeVar, Generic
|
|
5
5
|
|
|
@@ -3795,7 +3795,7 @@ class Response(BaseModel, Generic[T]):
|
|
|
3795
3795
|
the parsed data in Pydantic models.
|
|
3796
3796
|
"""
|
|
3797
3797
|
|
|
3798
|
-
model_config = ConfigDict(extra="
|
|
3798
|
+
model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
|
|
3799
3799
|
base_type: str = Field(default="Response")
|
|
3800
3800
|
response: requests.Response = Field(
|
|
3801
3801
|
default=None, description="The original requests.Response object", exclude=True
|