feat: personal task management tools for Inara
Adds task_list, task_create, task_update, task_complete orchestrator tools backed by inara/TASKS.json — private to each agent instance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,8 @@ from tools.ae_knowledge import journal_entry_create as _ae_journal_entry_create
|
||||
from tools.ae_tasks import task_list as _ae_task_list
|
||||
from tools.files import file_read as _file_read
|
||||
from tools.system import claude_allow_dir as _claude_allow_dir
|
||||
from tools.tasks import task_list as _task_list, task_create as _task_create
|
||||
from tools.tasks import task_update as _task_update, task_complete as _task_complete
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -173,6 +175,10 @@ _CALLABLES: dict[str, callable] = {
|
||||
"ae_task_list": _ae_task_list,
|
||||
"file_read": _file_read,
|
||||
"claude_allow_dir": _claude_allow_dir,
|
||||
"task_list": _task_list,
|
||||
"task_create": _task_create,
|
||||
"task_update": _task_update,
|
||||
"task_complete": _task_complete,
|
||||
}
|
||||
|
||||
_claude_allow_dir_declaration = types.FunctionDeclaration(
|
||||
@@ -202,6 +208,103 @@ _claude_allow_dir_declaration = types.FunctionDeclaration(
|
||||
),
|
||||
)
|
||||
|
||||
_task_list_declaration = types.FunctionDeclaration(
|
||||
name="task_list",
|
||||
description=(
|
||||
"List personal tasks from Inara's task list. "
|
||||
"Use this to check what's on the list, review pending work, or find a task ID. "
|
||||
"Optionally filter by status: 'todo', 'in_progress', or 'done'."
|
||||
),
|
||||
parameters=types.Schema(
|
||||
type=types.Type.OBJECT,
|
||||
properties={
|
||||
"status": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Filter by status: 'todo', 'in_progress', or 'done'. Omit to list all.",
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
_task_create_declaration = types.FunctionDeclaration(
|
||||
name="task_create",
|
||||
description=(
|
||||
"Add a new task to Inara's personal task list. "
|
||||
"Use this when the user asks to remember something, add a to-do, or track a follow-up."
|
||||
),
|
||||
parameters=types.Schema(
|
||||
type=types.Type.OBJECT,
|
||||
properties={
|
||||
"title": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Short task title",
|
||||
),
|
||||
"description": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Optional longer description or context",
|
||||
),
|
||||
"priority": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Priority: 'low', 'normal', or 'high'. Default: normal.",
|
||||
),
|
||||
},
|
||||
required=["title"],
|
||||
),
|
||||
)
|
||||
|
||||
_task_update_declaration = types.FunctionDeclaration(
|
||||
name="task_update",
|
||||
description=(
|
||||
"Update an existing task. Use task_list first to get the task ID. "
|
||||
"Can update status, title, description, or priority. "
|
||||
"To just mark complete, use task_complete instead."
|
||||
),
|
||||
parameters=types.Schema(
|
||||
type=types.Type.OBJECT,
|
||||
properties={
|
||||
"task_id": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Task ID (e.g. t_abc123) — get from task_list",
|
||||
),
|
||||
"status": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="New status: 'todo', 'in_progress', or 'done'",
|
||||
),
|
||||
"title": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Updated title",
|
||||
),
|
||||
"description": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Updated description",
|
||||
),
|
||||
"priority": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Updated priority: 'low', 'normal', or 'high'",
|
||||
),
|
||||
},
|
||||
required=["task_id"],
|
||||
),
|
||||
)
|
||||
|
||||
_task_complete_declaration = types.FunctionDeclaration(
|
||||
name="task_complete",
|
||||
description=(
|
||||
"Mark a task as done. Use task_list first to get the task ID. "
|
||||
"Shorthand for task_update with status='done'."
|
||||
),
|
||||
parameters=types.Schema(
|
||||
type=types.Type.OBJECT,
|
||||
properties={
|
||||
"task_id": types.Schema(
|
||||
type=types.Type.STRING,
|
||||
description="Task ID (e.g. t_abc123) — get from task_list",
|
||||
),
|
||||
},
|
||||
required=["task_id"],
|
||||
),
|
||||
)
|
||||
|
||||
# Gemini Tool object — pass this to GenerateContentConfig
|
||||
TOOL_DECLARATIONS = [
|
||||
types.Tool(function_declarations=[
|
||||
@@ -211,6 +314,10 @@ TOOL_DECLARATIONS = [
|
||||
_ae_task_list_declaration,
|
||||
_file_read_declaration,
|
||||
_claude_allow_dir_declaration,
|
||||
_task_list_declaration,
|
||||
_task_create_declaration,
|
||||
_task_update_declaration,
|
||||
_task_complete_declaration,
|
||||
])
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user