Skip to content
Open
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
3 changes: 2 additions & 1 deletion documentation/concepts/projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ A project includes:
- `id`: Unique identifier
- `canonical_name`: Machine-readable name (unique per developer)
- `name`: Human-readable display name
- `description`: Optional description of the project
- `metadata`: Custom attributes for the project

## Project Relationships
Expand Down Expand Up @@ -67,8 +68,8 @@ POST /projects
{
"name": "Customer Support Bot",
"canonical_name": "support-bot",
"description": "Resources for our customer support chatbot",
"metadata": {
"description": "Resources for our customer support chatbot",
"team": "customer-success"
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/agents-api/agents_api/queries/projects/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
project_id,
canonical_name,
name,
description,
metadata
)
VALUES (
$1,
$2,
$3,
$4,
$5
$5,
$6
)
RETURNING *;
"""
Expand Down Expand Up @@ -70,6 +72,7 @@ async def create_project(
project_id,
data.canonical_name,
data.name,
data.description,
data.metadata,
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
developer_id,
name,
canonical_name,
description,
metadata,
created_at,
updated_at
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BEGIN;

-- Revert the create_default_project function to not include description
CREATE OR REPLACE FUNCTION create_default_project()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO projects (
project_id,
developer_id,
canonical_name,
name,
metadata
) VALUES (
gen_random_uuid(),
NEW.developer_id,
'default',
'Default Project',
jsonb_build_object(
'is_default', true,
'description', 'Default project containing all existing resources'
)
);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

-- Remove description column from projects table
ALTER TABLE projects DROP COLUMN IF EXISTS description;

COMMIT;
39 changes: 39 additions & 0 deletions src/memory-store/migrations/000044_add_project_description.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
BEGIN;

-- Add description column to projects table
ALTER TABLE projects
ADD COLUMN description TEXT DEFAULT NULL
CONSTRAINT chk_projects_description_length CHECK (
description IS NULL
OR length(description) <= 1000
);

-- Add comment to the description column
COMMENT ON COLUMN projects.description IS 'Optional description of the project';

-- Update the create_default_project function to include description
CREATE OR REPLACE FUNCTION create_default_project()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO projects (
project_id,
developer_id,
canonical_name,
name,
description,
metadata
) VALUES (
gen_random_uuid(),
NEW.developer_id,
'default',
'Default Project',
'Default project containing all existing resources',
jsonb_build_object(
'is_default', true
)
);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

COMMIT;
3 changes: 3 additions & 0 deletions src/typespec/projects/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ model Project {
@doc("Display name of the project")
name: displayName;

@doc("Optional description of the project")
description?: string;

}

/** Payload for updating a project */
Expand Down