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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## v0.8.41 - 2025-01-29

### Features
- **Agent Visibility System**: Added public/private agent visibility controls, allowing agents to be marked as public or private for better access management
- **Jupiter Skill Integration**: New Jupiter skill for Solana DeFi operations including token price queries and swap functionality
- **Enhanced Template Creation**: Improved agent template creation with support for visibility settings and additional field mappings

### Improvements
- **Prompt Structure**: Refined prompt structure and formatting for better clarity and consistency
- **Template Fields**: Added more comprehensive field support when creating agents from templates

### Bug Fixes
- **Template Agent Creation**: Fixed field mapping issues in template-based agent creation

**Full Changelog**: https://github.com/crestalnetwork/intentkit/compare/v0.8.40...v0.8.41

## v0.8.40 - 2025-01-31

### Features
Expand Down
32 changes: 25 additions & 7 deletions intentkit/core/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from epyxid import XID
from pydantic import BaseModel
from pydantic import Field as PydanticField
from sqlalchemy import select

from intentkit.models.agent import Agent, AgentCore, AgentTable, AgentVisibility
Expand Down Expand Up @@ -116,13 +117,30 @@ async def render_agent(agent: Agent) -> Agent:
class AgentCreationFromTemplate(BaseModel):
"""Data structure for creating an agent from a template."""

template_id: str
name: str | None = None
picture: str | None = None
description: str | None = None
readonly_wallet_address: str | None = None
weekly_spending_limit: float | None = None
extra_prompt: str | None = None
template_id: str = PydanticField(
description="ID of the template to create the agent from"
)
name: str | None = PydanticField(
default=None,
description="Name of the agent (overrides template name if provided)",
)
picture: str | None = PydanticField(
default=None,
description="Picture URL for the agent (overrides template picture if provided)",
)
description: str | None = PydanticField(
default=None, description="Description of the agent"
)
readonly_wallet_address: str | None = PydanticField(
default=None, description="Read-only wallet address for the agent"
)
weekly_spending_limit: float | None = PydanticField(
default=None, description="Weekly spending limit for the agent"
)
extra_prompt: str | None = PydanticField(
default=None,
description="Additional prompt text to be injected into the system prompt",
)
Comment on lines +140 to +143
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra_prompt field in AgentCreationFromTemplate should have validation to prevent level 1 and level 2 headings (lines starting with "# " or "## "), consistent with the validation applied to extra_prompt in AgentUpdate. Without this validation, users could create agents from templates with invalid extra_prompt content that bypasses the heading restrictions enforced elsewhere in the system.

Copilot uses AI. Check for mistakes.


async def create_agent_from_template(
Expand Down
9 changes: 8 additions & 1 deletion intentkit/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,14 @@ class AgentUpdate(AgentUserInput):
),
]

@field_validator("purpose", "personality", "principles", "prompt", "prompt_append")
@field_validator(
"purpose",
"personality",
"principles",
"prompt",
"prompt_append",
"extra_prompt",
)
@classmethod
def validate_no_level1_level2_headings(cls, v: str | None) -> str | None:
"""Validate that the text doesn't contain level 1 or level 2 headings."""
Expand Down
8 changes: 8 additions & 0 deletions tests/core/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ async def test_create_agent_from_template_without_team():
name="Private Agent",
picture="private_pic.png",
description="Created without team",
readonly_wallet_address="0x1234567890abcdef",
weekly_spending_limit=100.0,
extra_prompt="Additional task instructions",
)

# 2. Mock Database
Expand Down Expand Up @@ -157,6 +160,11 @@ async def mock_refresh(instance):
# Verify visibility is set to PRIVATE when team_id is None
assert added_agent.visibility == AgentVisibility.PRIVATE

# Verify new optional fields are correctly passed through
assert added_agent.readonly_wallet_address == "0x1234567890abcdef"
assert added_agent.weekly_spending_limit == 100.0
assert added_agent.extra_prompt == "Additional task instructions"


@pytest.mark.asyncio
async def test_create_template_from_agent():
Expand Down
Loading