Tekton Jumpstarter人工智能代理
一 自主AI代理 智能管理Jumpstarter更改中的Tekton任务更新。超越了简单的CLI自动化,具有推理、记忆、规划和决策能力。
🚀 新来的? 看看 快速启动.md 5分钟动手介绍指南!
📋 目录
它的作用
当您的Jumpstarter环境获得新功能时,此代理会自动更新Tekton CI/CD任务定义的过程。
视觉概述
┌─────────────────────────────────────────────────────────────────┐
│ INPUT │
│ ┌────────────────┐ ┌────────────────────┐ │
│ │ Tekton Task │ │ Jumpstarter Changes│ │
│ │ YAML │ │ (JSON) │ │
│ │ - params │ │ - New capabilities │ │
│ │ - steps │ │ - Network configs │ │
│ │ - results │ │ - Security needs │ │
│ └────────────────┘ └────────────────────┘ │
└────────────────────────┬─────────────────┬─────────────────────┘
│ │
└────────┬────────┘
▼
┌─────────────────────────┐
│ AI AGENT PROCESSING │
│ │
│ 1. Observe & Analyze │
│ 2. Reason about Risk │
│ 3. Decide Action │
│ 4. Execute Update │
│ 5. Learn & Remember │
└────────────┬────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ OUTPUT │
│ ┌────────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ Updated YAML │ │ Risk Score │ │ Reasoning │ │
│ │ + new params │ │ 0.35 = Safe │ │ "Low impact, │ │
│ │ + new steps │ │ 0.85 = Review│ │ auto-applied" │ │
│ │ + validated │ │ │ │ │ │
│ └────────────────┘ └──────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────────┘关键能力
输入:
- 您现有的Tekton任务YAML
- Jumpstarter更改说明(新功能、网络配置等)
处理:
- 🧠 原因 关于使用LLM+规则的影响和风险
- 💾 学习 根据过去的更新和结果
- 🎯 决定 自主申请或审核
- 📊 轨迹 随时间变化的成功/失败模式
输出:
- 使用适当的参数、步骤和配置更新了任务YAML
- 风险评估得分(0-1,其中>0.7=需要审查)
- 所有决策的透明推理
- 根据Tekton模式进行验证
快速开始
1.安装
# Clone the repo
git clone
cd jmp-MCP-server
# Install dependencies
pnpm install # or: npm install / yarn
# Build TypeScript
pnpm build
# Set up OpenAI API (required for LLM features)
export OPENAI_API_KEY="sk-your-key-here"2.运行第一次更新
# Try the interactive demo
./examples/agent-demo.sh
# Or manually propose an update
pnpm agent propose \
--task examples/task.yaml \
--changes examples/input-change.json \
--out /tmp/updated-task.yaml
# Review the output
cat /tmp/updated-task.yaml3.检查代理人学到了什么
pnpm agent state --verbose就是这样! 现在,您有一个自主代理管理您的Tekton更新。
常见工作流
工作流程1:安全生产更新
场景:您有更改要应用,但想先验证安全性。
# Step 1: Analyze the risk
pnpm agent analyze \
--task production-task.yaml \
--changes latest-changes.json
# Output shows:
# Impact Score: 0.35
# Requires Review: NO
# Recommendation: auto-apply
# Step 2: Let agent decide and apply
pnpm agent auto-update \
--task production-task.yaml \
--changes latest-changes.json \
--out production-task.yaml \
--threshold 0.7
# Agent will auto-apply if safe, or request review if risky工作流2:跨多个任务进行批量更新
场景:您需要将相同的更改应用于50多个任务定义。
# Create directory structure
mkdir -p updated-tasks
# Let the agent process all tasks intelligently
pnpm agent batch \
--tasks-dir ./tekton-tasks \
--changes quarterly-updates.json \
--out-dir ./updated-tasks
# Review results
# Agent applies different strategies per task based on complexity工作流程3:持续集成
场景:检测到更改时自动更新任务。
# In your CI pipeline
#!/bin/bash
set -e
# Pull latest changes
git pull origin main
# Agent analyzes and applies safe updates
pnpm agent auto-update \
--task ./tasks/build-task.yaml \
--changes ./changes/latest.json \
--out ./tasks/build-task.yaml \
--threshold 0.6
# Commit if changes were made
if git diff --quiet ./tasks/build-task.yaml; then
echo "No changes needed"
else
git add ./tasks/build-task.yaml
git commit -m "Auto-update: Applied low-impact changes"
git push
fi工作流程4:与人工智能助理(Cursor/Claude)合作
场景:使用自然语言通过IDE更新任务。
# Start MCP server
pnpm agent mcp-server然后在Cursor/Claude中:
You: "Update all my Tekton tasks to support the new Multus networking configuration"
AI: *Uses propose_tekton_update tool*
"I've analyzed your tasks and proposed updates. Task 1 needs review (high impact),
but Tasks 2-5 can be auto-applied. Would you like me to proceed?"命令参考
pnpm agent propose
使用AI推理对Tekton任务提出更新。
pnpm agent propose \
--task
\
--changes
\
[--out ]选项:
--task(必填)-Tekton任务YAML的路径--changes(必填)-跳转启动器的路径更改JSON--out(可选)-保存更新的YAML的位置(如果省略,则打印到stdout)
示例:
pnpm agent propose \
--task ./my-task.yaml \
--changes ./new-features.json \
--out ./my-task-updated.yamlpnpm agent analyze
在不应用的情况下分析拟议变更的影响和风险。
pnpm agent analyze \
--task
\
--changes
输出:
Impact Score: 0.42
Requires Review: NO
Recommendation: auto-apply
Reasoning: Changes affect network configuration but are low risk示例:
pnpm agent analyze \
--task ./critical-task.yaml \
--changes ./breaking-changes.jsonpnpm agent auto-update
如果代理确定更改是安全的,则自动应用更改。
pnpm agent auto-update \
--task
\
--changes
\
--out \
[--threshold ]选项:
--threshold(可选,默认值:0.7)-自动应用的影响分数阈值
- 更低=更谨慎(0.5=只有非常安全的更改) - 更高=更具攻击性(0.9=几乎适用所有内容)
示例:
# Cautious mode
pnpm agent auto-update \
--task ./prod.yaml \
--changes ./changes.json \
--out ./prod.yaml \
--threshold 0.5
# Aggressive mode
pnpm agent auto-update \
--task ./dev.yaml \
--changes ./changes.json \
--out ./dev.yaml \
--threshold 0.9pnpm agent batch
以批处理模式处理多个Tekton任务。
pnpm agent batch \
--tasks-dir \
--changes
\
--out-dir 示例:
pnpm agent batch \
--tasks-dir ./catalog/tasks \
--changes ./updates/q1-2026.json \
--out-dir ./catalog/tasks-v2pnpm agent state
查看代理的内存、学习历史和统计数据。
pnpm agent state [--verbose]示例:
# Quick summary
pnpm agent state
# Detailed history
pnpm agent state --verbosepnpm agent mcp-server
启动MCP服务器进行AI助手集成。
pnpm agent mcp-server [--state-dir
]示例:
# Start with default state directory
pnpm agent mcp-server
# Custom state directory
pnpm agent mcp-server --state-dir /path/to/state传统命令(向后兼容)
原始CLI命令仍然有效:
# Old propose command
pnpm propose --change changes.json --task task.yaml > output.yaml
# Old apply command
pnpm apply --task task.yaml --patch patch.yaml --out output.yaml代理功能
🧠 智能决策
代理不会盲目地应用更改——它 原因 关于他们:
输出示例:
$ pnpm agent auto-update --task task.yaml --changes changes.json --out task.yaml
[Agent] Starting task: update-task
[Agent] Reasoning about next action...
[Agent] Decision: auto-apply
[Agent] Reasoning: Impact score 0.35. Changes affect network params but are low risk.
No security or RBAC modifications detected.
[Agent] Executing: propose-with-llm
[Agent] Task completed successfully
✓ Changes auto-applied successfully
Output: task.yaml
Impact Score: 0.35💾 记忆与学习
代理在运行过程中保持持久状态,并从经验中学习:
$ pnpm agent state --verbose
Agent State:
Total Tasks: 23
Successful: 21
Failed: 2
Total Memories: 67
Last Run: 2026-01-08T14:23:15Z
Recent Memories:
1. propose-with-llm - ✓ (confidence: 0.85)
Reasoning: Changes are complex, using LLM for sophisticated analysis
2. auto-apply - ✓ (confidence: 0.92)
Reasoning: Impact score 0.25, safe to auto-apply
3. high-impact-review - ✓ (confidence: 0.95)
Reasoning: Impact score 0.85. High impact detected, requesting review记忆是如何工作的:
- 存储每个决定及其结果
- 利用过去的经验为未来的决策提供信息
- 避免重复错误
- 随着时间的推移,提高信心得分
📦 批处理智能
代理使用每任务策略处理多个任务:
$ pnpm agent batch --tasks-dir ./tasks --changes updates.json --out-dir ./updated
[Orchestrator] Found 12 task files
[Orchestrator] Processing task 1/12: build-task.yaml
[Agent] Impact score: 0.25 → auto-applying
[Orchestrator] Processing task 2/12: deploy-task.yaml
[Agent] Impact score: 0.82 → requires review
...
Batch Update Results:
Total: 12
Successful: 10
Failed: 0
Requires Review: 2
Details:
build-task.yaml: ✓ (auto-applied)
deploy-task.yaml: ⚠ (requires review - high impact)
test-task.yaml: ✓ (auto-applied)
...⚡ 风险评估
自动影响评分可帮助您做出安全决策:
| 影响评分 | 风险等级 | 行动 | 示例 |
|---|---|---|---|
| 0.0-0.3 | 低 | 自动应用 | 网络参数、存储配置 |
| 0.3-0.7 | 中等 | 先分析 | 资源限制,新步骤 |
| 0.7-1.0 | 高 | 手动审查 | 安全上下文、RBAC、serviceAccount |
风险因素:
- +0.4:安全上下文或服务帐户更改
- +0.3:RBAC或权限修改
- +0.2:网络、存储或资源更改
- +0.1-0.2:复杂性(描述长度、更改次数)
MCP集成
使用光标进行设置
- 启动MCP服务器:
pnpm agent mcp-server- 添加到光标设置(
~/.cursor/config.json或工作空间设置):
{
"mcpServers": {
"tekton-agent": {
"command": "pnpm",
"args": ["agent", "mcp-server"],
"cwd": "/home/you/dev/jmp-MCP-server",
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}- 在自然语言的游标中使用:
You: "Analyze the impact of adding Multus networking to my build task"
Cursor: *Uses analyze_change_impact tool*
"The impact score is 0.42 (medium risk). Changes affect networking
but don't modify security contexts..."
You: "Go ahead and apply it"
Cursor: *Uses propose_tekton_update tool*
"Done! Updated task saved. The agent added secondaryNetworkNAD param
and updated the pod spec."使用Claude Desktop进行设置
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"tekton-agent": {
"command": "pnpm",
"args": ["agent", "mcp-server"],
"cwd": "/home/you/dev/jmp-MCP-server",
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}可用的MCP工具
该代理提供了5个强大的工具:
| 工具 | 描述 | 用例 |
|---|---|---|
propose_tekton_update | 通过推理提出YAML更新 | “用新的更改更新此任务” |
analyze_change_impact | 计算风险评分 | “应用此方法安全吗?” |
monitor_jumpstarter_changes | 注意新的更改 | “监视我的更改目录” |
get_agent_state | 查询代理内存 | “显示代理学到了什么” |
batch_update_tasks | 处理多个任务 | “更新此目录中的所有任务” |
MCP使用示例
通过Cursor/Claude:
You: Update my Tekton task with these Jumpstarter changes:
- Add support for Multus secondary network
- Export image digest to Quay
- Use custom service account for registry access
Cursor: *Analyzes changes*
Impact Score: 0.45 (medium risk)
- Network changes: +0.2
- Registry config: +0.15
- Service account: +0.1
This looks safe to auto-apply. Should I proceed?
You: Yes, go ahead
Cursor: *Applies updates*
✓ Added secondaryNetworkNAD param
✓ Added artifactDigest result
✓ Added quayUrl param
✓ Updated step to use custom SA
Updated task saved to build-task.yaml配置
环境变量
# Required for LLM features
export OPENAI_API_KEY="sk-your-api-key-here"
# Optional: Custom OpenAI endpoint (for Azure, local models, etc.)
export OPENAI_BASE="https://api.openai.com/v1"
# Optional: Choose model (default: gpt-4o-mini)
export OPENAI_MODEL="gpt-4o-mini"
# Other options: gpt-4, gpt-3.5-turbo, etc.
# Agent behavior tuning
export AGENT_AUTO_APPLY_THRESHOLD="0.7" # 0-1, lower = more cautious
export AGENT_MAX_RETRIES="3" # Retry failed tasks
export AGENT_STATE_DIR=".agent-state" # Where to store memory配置文件(可选)
创建 .agent-config.json 在项目根目录中:
{
"maxMemories": 100,
"maxRetries": 3,
"autoApplyThreshold": 0.7,
"stateDir": ".agent-state",
"enableLLM": true
}调整自动应用阈值
阈值决定代理何时自动应用更改:
# Conservative (only auto-apply very safe changes)
export AGENT_AUTO_APPLY_THRESHOLD="0.5"
pnpm agent auto-update ... --threshold 0.5
# Balanced (default - good for most use cases)
export AGENT_AUTO_APPLY_THRESHOLD="0.7"
pnpm agent auto-update ... --threshold 0.7
# Aggressive (auto-apply most changes)
export AGENT_AUTO_APPLY_THRESHOLD="0.9"
pnpm agent auto-update ... --threshold 0.9建议:
- 生产:0.5-0.6(保守)
- 暂存:0.7-0.8(平衡)
- 发展:0.8-0.9(攻击性)
例子
示例1:低冲击变化(自动应用)
输入更改 (changes.json):
[
{
"id": "CHG-001",
"title": "Add secondary network support",
"description": "Jumpstarter now supports Multus NAD for secondary networking",
"impactAreas": ["network"],
"suggestedParams": {
"secondaryNetworkNAD": "nad/example"
}
}
]运行代理:
$ pnpm agent auto-update --task task.yaml --changes changes.json --out task.yaml
[Agent] Impact score: 0.20 (network only)
[Agent] Decision: auto-apply
✓ Changes applied successfully结果: secondaryNetworkNAD 参数已自动添加。
______________________________________________________________________
示例2:高影响变更(需要审查)
输入更改 (security-changes.json):
[
{
"id": "CHG-002",
"title": "Add privileged security context for hardware access",
"description": "Requires privileged container and custom service account",
"impactAreas": ["security", "serviceAccount", "rbac"],
"suggestedParams": {
"serviceAccount": "jumpstarter-privileged",
"securityContext": {
"privileged": true
}
}
}
]运行代理:
$ pnpm agent analyze --task task.yaml --changes security-changes.json
Impact Analysis:
Impact Score: 0.85
Requires Review: YES
Recommendation: high-impact-review
Reasoning: Changes affect serviceAccount (0.30), security context (0.40),
and RBAC (0.15). High risk modifications detected.
⚠ Manual review required before applying these changes结果:代理阻止自动应用并请求人工审核。
______________________________________________________________________
示例3:混合结果的批量更新
目录结构:
tasks/
├── build-task.yaml (low impact changes)
├── deploy-task.yaml (high impact changes)
├── test-task.yaml (low impact changes)
└── secure-task.yaml (high impact changes)运行批处理:
$ pnpm agent batch --tasks-dir ./tasks --changes changes.json --out-dir ./updated
[Orchestrator] Found 4 task files
Processing:
✓ build-task.yaml (impact: 0.25) - auto-applied
⚠ deploy-task.yaml (impact: 0.82) - requires review
✓ test-task.yaml (impact: 0.30) - auto-applied
⚠ secure-task.yaml (impact: 0.78) - requires review
Results:
Total: 4
Auto-applied: 2
Requires Review: 2______________________________________________________________________
示例4:CI/CD集成
GitHub操作工作流 (.github/workflows/auto-update-tasks.yml):
name: Auto-Update Tekton Tasks
on:
push:
paths:
- 'jumpstarter-changes/**'
workflow_dispatch:
jobs:
update-tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
working-directory: ./tekton-agent
- name: Auto-update tasks
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AGENT_AUTO_APPLY_THRESHOLD: "0.6"
run: |
pnpm agent batch \
--tasks-dir ./tekton-tasks \
--changes ./jumpstarter-changes/latest.json \
--out-dir ./tekton-tasks-updated
working-directory: ./tekton-agent
- name: Create PR if changes
run: |
if [ -n "$(git status --porcelain)" ]; then
git config user.name "Tekton Agent"
git config user.email "agent@example.com"
git checkout -b auto-update-$(date +%Y%m%d-%H%M%S)
git add ./tekton-tasks-updated
git commit -m "Auto-update Tekton tasks"
git push origin HEAD
# Create PR using gh CLI or API
fi______________________________________________________________________
示例5:与自定义LLM端点一起使用
适用于Azure OpenAI:
export OPENAI_API_KEY="your-azure-key"
export OPENAI_BASE="https://your-resource.openai.azure.com/openai/deployments/gpt-4"
export OPENAI_MODEL="gpt-4"
pnpm agent propose --task task.yaml --changes changes.json本地模特(LM工作室,Ollama):
export OPENAI_BASE="http://localhost:1234/v1"
export OPENAI_MODEL="local-model"
export OPENAI_API_KEY="not-needed"
pnpm agent propose --task task.yaml --changes changes.json建筑
代理核心组件
┌─────────────────────────────────────────┐
│ Agent Orchestrator │
│ (Planning, Scheduling, Coordination) │
└──────────────┬──────────────────────────┘
│
┌──────────────▼──────────────────────────┐
│ Agent Core │
│ (Reasoning, Decision Making, Memory) │
└──────────────┬──────────────────────────┘
│
┌───────┴────────┐
│ │
┌──────▼────────┐ ┌───▼────────────┐
│ State Manager │ │ LLM Provider │
│ (Memory) │ │ (OpenAI API) │
└───────────────┘ └────────────────┘决策流程
- 观察 -收集当前形势的背景
- 理由 -分析并决定最佳行动
- 执行 -执行决定的行动
- 更新 -将结果存储在内存中
- 重复 -继续,直到任务完成
故障排除
问题:“未设置OPENAI_API_KEY”
解决方案:
# Set your API key
export OPENAI_API_KEY="sk-your-key-here"
# Or run without LLM (uses deterministic rules only)
unset OPENAI_API_KEY
pnpm agent propose --task task.yaml --changes changes.json
# Note: Limited to pattern-based rules问题:“代理人过于谨慎/过于激进”
解决方案:调整阈值
# More cautious (safer for production)
pnpm agent auto-update ... --threshold 0.5
# More aggressive (good for dev environments)
pnpm agent auto-update ... --threshold 0.9问题:“代理人做出了错误的决定”
解决方案:代理人从经验中学习
# Check what it learned
pnpm agent state --verbose
# Clear memory if needed
rm -rf .agent-state
# Provide more context in change descriptions
# The agent uses description text for reasoning问题:“任务验证失败”
原因:生成的YAML与Tekton架构不匹配
解决方案:
# Check the validation error
pnpm agent propose --task task.yaml --changes changes.json 2>&1 | grep -A5 "validation"
# Simplify your changes or provide more specific descriptions
# The agent validates all outputs against tekton/schemas/task.schema.json问题:“MCP服务器在Cursor中无法工作”
解决方案:
- 检查服务器是否手动启动:
pnpm agent mcp-server
# Should show: [MCP Server] Agent initialized and ready- 验证光标配置(命令面板→ “MCP:显示MCP设置”):
{
"mcpServers": {
"tekton-agent": {
"command": "pnpm",
"args": ["agent", "mcp-server"],
"cwd": "/absolute/path/to/jmp-MCP-server"
}
}
}- 在Cursor:命令面板中检查日志→ “MCP:显示MCP日志”
问题:“批处理速度慢”
原因:每个任务都需要LLM调用(如果启用)
解决方案:
# 1. Use deterministic rules only (fast)
unset OPENAI_API_KEY
pnpm agent batch ...
# 2. Process subset first
pnpm agent batch --tasks-dir ./high-priority --changes changes.json --out-dir ./updated
# 3. Adjust LLM timeout (future feature)获取帮助
- 文档:参见
AGENT_GUIDE.md了解架构细节 - 例子:检查
examples/目录 - 演示:运行
./examples/agent-demo.sh - 状态:使用
pnpm agent state --verbose理解决策
快速参考卡
最常见的命令
# 1. Propose updates (safe, just shows what would change)
pnpm agent propose --task task.yaml --changes changes.json --out updated.yaml
# 2. Check risk level before applying
pnpm agent analyze --task task.yaml --changes changes.json
# 3. Let agent decide and apply if safe
pnpm agent auto-update --task task.yaml --changes changes.json --out task.yaml
# 4. Update multiple tasks at once
pnpm agent batch --tasks-dir ./tasks --changes changes.json --out-dir ./updated
# 5. Check what agent has learned
pnpm agent state --verbose决策指南
| 你的目标 | 命令 | 阈值 |
|---|---|---|
| 只需查看拟议的更改 | propose | 无 |
| 检查更改是否安全 | analyze | 无 |
| 如果非常安全,则自动应用 | auto-update | 0.5 |
| 如果合理安全,则自动应用 | auto-update | 0.7 |
| 自动应用大多数更改 | auto-update | 0.9 |
| 处理许多任务 | batch | 无 |
环境设置
# Minimum required
export OPENAI_API_KEY="sk-..."
# Optional customization
export OPENAI_MODEL="gpt-4o-mini" # or gpt-4, gpt-3.5-turbo
export AGENT_AUTO_APPLY_THRESHOLD="0.7" # 0.0=cautious, 1.0=aggressive
export AGENT_STATE_DIR=".agent-state" # where to store memory运作原理
两阶段处理
该代理使用混合方法来实现最大的效率和智能:
第一阶段:确定性规则(快速)
无需LLM即可立即应用:
| 规则 | 触发器 | 动作 |
|---|---|---|
| 二级网络 | 提及“multus”、“NAD”、”二级网络“ | 添加 secondaryNetworkNAD param |
| 文物出口 | 提及“工件”、“导出”、“结果” | 添加 artifactDigest 结果 |
| 码头一体化 | 提及“quay.io”或“quay” | 添加 quayUrl param |
第二阶段:LLM分析(智能)
对于复杂的更改:
- 语义理解:解释自然语言描述
- YAML生成:创建适当的Tekton结构
- 验证:确保符合Tekton模式
- 解释:为所有更改提供推理
影响评分算法
Score = base_risk + complexity_factor
Where:
base_risk =
+ 0.40 if security/serviceAccount changes
+ 0.30 if RBAC modifications
+ 0.20 if network/storage changes
+ 0.15 if resource limits affected
complexity_factor =
+ 0.20 if description > 200 chars
+ 0.15 if num_changes > 5
+ 0.10 if multiple impact areas
Threshold:
score = 0.7 → Require manual review (high risk)高级用法
扩展代理
添加自定义推理策略 (src/agent/core.ts):
private async reasonCustom(observation: any, task: AgentTask): Promise {
// Your logic here
return {
action: "custom-action",
reasoning: "Why this action was chosen",
confidence: 0.85,
final: false
};
}添加自定义工作流 (src/agent/orchestrator.ts):
async customWorkflow(params: any): Promise {
const task: AgentTask = {
id: `custom-${Date.now()}`,
type: "custom-type",
data: params
};
await this.agent.run(task);
return this.agent.getState();
}添加MCP工具 (src/agent/mcp-server.ts):
{
name: "custom_tool",
description: "What it does",
inputSchema: {
type: "object",
properties: {
param: { type: "string" }
}
}
}程序化API
使用您自己代码中的代理:
import { AgentOrchestrator } from 'ai-tekton-jumpstarter-agent';
const agent = new AgentOrchestrator({
autoApplyThreshold: 0.7,
stateDir: '.my-agent-state'
});
await agent.initialize();
// Propose updates
const yaml = await agent.proposeUpdateWorkflow(
'path/to/task.yaml',
'path/to/changes.json',
'output.yaml'
);
// Analyze impact
const analysis = await agent.analyzeImpactWorkflow(
'path/to/task.yaml',
'path/to/changes.json'
);
console.log(`Impact: ${analysis.impactScore}`);
console.log(`Safe to apply: ${!analysis.requiresReview}`);性能和限制
演出
- 确定性规则:每个任务\<100ms
- LLM分析:每个任务2-5秒(取决于API延迟)
- 批量处理:LLM每项任务约3-5秒
- 内存使用:~50MB基本+每个内存条目的1KB
局限性
- LLM必修:复杂推理需要OpenAI API(或兼容)
- 模式验证:仅验证Tekton v1任务(尚未验证管道)
- 顺序处理:批处理模式逐一处理任务
- 仅限英语:更改说明应使用英文,以获得最佳效果
路线图
- \[\]支持Tekton管道(不仅仅是任务)
- \[\]并行批处理
- \[\]从用户更正中学习
- \[\]Git存储库集成
- \[\]对变更监控的Webhook支持
- \[\]多语言支持
- \[\]当地LLM支持(Ollama等)
常见问题解答
Q: 我需要一个OpenAI API密钥吗?\ A: 对于完整的功能,是的。但确定性规则在没有它的情况下是有效的。
Q: 我可以使用其他LLM提供商吗?\ A: 是的!集 OPENAI_BASE 任何与OpenAI兼容的端点(Azure、本地模型等)
Q: 生产安全吗?\ A: 是的!高风险变更始终需要人工审查。默认情况下,代理是保守的。
Q: 它会自动修改我的文件吗?\ A: 只有当你使用 auto-update 影响得分低于阈值。 propose 和 analyze 永远不要修改文件。
Q: 如何重置代理的内存?\ A: 删除状态目录: rm -rf .agent-state
Q: 我可以在CI/CD中运行这个吗?\ A: 当然!请参阅示例部分中的GitHub操作示例。
Q: 如果代理人犯了错误怎么办?\ A: 所有输出均根据Tekton模式进行验证。手动审查影响较大的更改。
贡献
我们欢迎捐款!需要帮助的领域:
- 新的确定性规则:为常见更改添加模式匹配
- 测试:帮助测试各种Tekton任务结构
- 文档:改进示例和指南
- 集成:添加对其他CI/CD系统的支持
看 AGENT_GUIDE.md 了解架构细节。
资源
- 文档
- 完整代理指南 -建筑深度挖掘 - 转换摘要 -我们如何建立代理
- 例子
- 相关项目
- 泰克顿文件 - Jumpstarter项目 - MCP规范
许可证
看 许可证 文件以获取详细信息。
______________________________________________________________________
建于❤️ 为Tekton和Jumpstarter社区
有问题吗?检查 故障排除 部分或打开一个问题!
