diff --git a/.env.example b/.env.example index 6ed09629..86f55baf 100644 --- a/.env.example +++ b/.env.example @@ -2,4 +2,6 @@ AGENT_BASE_URL=http://127.0.0.1:3500 # KV-store is hitting Agentuity Service API, this can be found in `agent-docs` after running `agentuity dev` -AGENTUITY_API_KEY= \ No newline at end of file +AGENTUITY_SDK_KEY= +AGENT_BEARER_TOKEN= +AGENTUITY_REGION=use \ No newline at end of file diff --git a/.github/workflows/sync-docs-full.yml b/.github/workflows/sync-docs-full.yml index 30c0f083..7aa43948 100644 --- a/.github/workflows/sync-docs-full.yml +++ b/.github/workflows/sync-docs-full.yml @@ -2,6 +2,7 @@ name: Full Docs Sync to Vector Store on: workflow_dispatch: + pull_request: jobs: sync: @@ -24,4 +25,4 @@ jobs: set -euo pipefail cat all-files.txt | \ ./bin/build-payload.sh "${{ github.repository }}" full | \ - ./bin/send-webhook.sh "https://agentuity.ai/webhook/f61d5ce9d6ed85695cc992c55ccdc2a6" "Bearer $AGENTUITY_TOKEN" \ No newline at end of file + ./bin/send-webhook.sh "https://p0f83a312791b60ff.agentuity.run/api/process-docs" "Bearer $AGENTUITY_TOKEN" \ No newline at end of file diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 87241c38..1a6193b0 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -67,4 +67,4 @@ jobs: set -euo pipefail cat changed-files.txt | \ ./bin/build-payload.sh "${{ github.repository }}" incremental | \ - ./bin/send-webhook.sh "https://agentuity.ai/webhook/f61d5ce9d6ed85695cc992c55ccdc2a6" "Bearer $AGENTUITY_TOKEN" \ No newline at end of file + ./bin/send-webhook.sh "https://p0f83a312791b60ff.agentuity.run/api/process-docs" "Bearer $AGENTUITY_TOKEN" \ No newline at end of file diff --git a/app/api/rag-search/route.ts b/app/api/rag-search/route.ts index 1e8c40ed..32cb7eed 100644 --- a/app/api/rag-search/route.ts +++ b/app/api/rag-search/route.ts @@ -1,5 +1,5 @@ import type { NextRequest } from 'next/server'; -import { getAgentQaConfig } from '@/lib/env'; +import { queryAgentQa } from '@/lib/api/services'; import { source } from '@/lib/source'; function documentPathToUrl(docPath: string): string { @@ -93,31 +93,7 @@ export async function GET(request: NextRequest) { } try { - const agentConfig = getAgentQaConfig(); - - // Prepare headers - const headers: Record = { - 'Content-Type': 'application/json', - }; - - // Add bearer token if provided - if (agentConfig.bearerToken) { - headers['Authorization'] = `Bearer ${agentConfig.bearerToken}`; - } - - const response = await fetch(agentConfig.url, { - method: 'POST', - headers, - body: JSON.stringify({ message: query }), - }); - - if (!response.ok) { - throw new Error( - `Agent API error: ${response.status} ${response.statusText}` - ); - } - - const data = await response.json(); + const data = await queryAgentQa(query); const results = []; if (data?.answer?.trim()) { diff --git a/app/api/sessions/[sessionId]/messages/route.ts b/app/api/sessions/[sessionId]/messages/route.ts index 523b43d1..e303c063 100644 --- a/app/api/sessions/[sessionId]/messages/route.ts +++ b/app/api/sessions/[sessionId]/messages/route.ts @@ -7,43 +7,14 @@ import { TutorialData, } from "@/app/chat/types"; import { toISOString, getCurrentTimestamp } from "@/app/chat/utils/dateUtils"; -import { getAgentPulseConfig } from "@/lib/env"; import { config } from "@/lib/config"; import { parseAndValidateJSON, SessionMessageRequestSchema } from "@/lib/validation/middleware"; +import { titleGeneratorService, callAgentPulseStreaming } from "@/lib/api/services"; // Constants const DEFAULT_CONVERSATION_HISTORY_LIMIT = 10; const AGENT_REQUEST_TIMEOUT = 30000; // 30 seconds - -function sanitizeTitle(input: string): string { - if (!input) return ''; - let s = input.trim(); - // Strip wrapping quotes/backticks - if ((s.startsWith('"') && s.endsWith('"')) || (s.startsWith('\'') && s.endsWith('\'')) || (s.startsWith('`') && s.endsWith('`'))) { - s = s.slice(1, -1).trim(); - } - // Remove markdown emphasis - s = s.replace(/\*\*([^*]+)\*\*|\*([^*]+)\*|__([^_]+)__|_([^_]+)_/g, (_m, a, b, c, d) => a || b || c || d || ''); - // Remove emojis (basic unicode emoji ranges) - s = s.replace(/[\u{1F300}-\u{1FAFF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu, ''); - // Collapse whitespace - s = s.replace(/\s+/g, ' ').trim(); - // Sentence case - s = sentenceCase(s); - // Trim trailing punctuation noise - s = s.replace(/[\s\-–—:;,\.]+$/g, '').trim(); - // Enforce 60 chars - if (s.length > 60) s = s.slice(0, 60).trim(); - return s; -} - -function sentenceCase(str: string): string { - if (!str) return ''; - const lower = str.toLowerCase(); - return lower.charAt(0).toUpperCase() + lower.slice(1); -} - /** * POST /api/sessions/[sessionId]/messages - Add a message to a session and process with streaming * @@ -80,15 +51,16 @@ export async function POST( } const sessionKey = `${userId}_${sessionId}`; const sessionResponse = await getKVValue(sessionKey, { - storeName: config.defaultStoreName, + storeName: config.kvStoreName, }); // Helper: background title generation and persistence - async function generateAndPersistTitle(sessionId: string, sessionKey: string, finalSession: Session) { + async function generateAndPersistTitle(sessionKey: string, finalSession: Session) { try { if ((finalSession as any).title) { return; // Title already set } + // Build compact conversation history (last 10 messages, truncate content) const HISTORY_LIMIT = 10; const MAX_CONTENT_LEN = 400; @@ -99,84 +71,22 @@ export async function POST( content: (m.content || '').slice(0, MAX_CONTENT_LEN), })); - const prompt = `Generate a very short session title summarizing the conversation topic.\n\nRequirements:\n- sentence case\n- no emojis\n- <= 60 characters\n- no quotes or markdown\n- output the title only, no extra text`; - - const agentConfig = getAgentPulseConfig(); - const headers: Record = { 'Content-Type': 'application/json' }; - if (agentConfig.bearerToken) headers['Authorization'] = `Bearer ${agentConfig.bearerToken}`; - - const controller = new AbortController(); - const timeoutId = setTimeout(() => controller.abort(), 3000); - let agentResponse: Response | null = null; - try { - agentResponse = await fetch(agentConfig.url, { - method: 'POST', - headers, - body: JSON.stringify({ - message: prompt, - conversationHistory: history, - use_direct_llm: true, - }), - signal: controller.signal, - }); - } finally { - clearTimeout(timeoutId); - } - - if (!agentResponse || !agentResponse.ok) { - console.error(`[title-gen] failed: bad response ${agentResponse ? agentResponse.status : 'no-response'}`); - return; - } - - const reader = agentResponse.body?.getReader(); - if (!reader) { - console.error('[title-gen] failed: no response body'); - return; - } - - let accumulated = ''; - const textDecoder = new TextDecoder(); - while (true) { - const { done, value } = await reader.read(); - if (done) break; - if (value) { - const text = textDecoder.decode(value); - for (const line of text.split('\n')) { - if (line.startsWith('data: ')) { - try { - const ev = JSON.parse(line.slice(6)); - if (ev.type === 'text-delta' && ev.textDelta) accumulated += ev.textDelta; - if (ev.type === 'finish') { - try { await reader.cancel(); } catch { } - break; - } - } catch { } - } - } - } - } - - const candidate = sanitizeTitle(accumulated); - const title = candidate || 'New chat'; + // Use the title generator service + const title = await titleGeneratorService.generate(history); // Re-fetch and set title only if still empty - const latest = await getKVValue(sessionKey, { storeName: config.defaultStoreName }); - if (!latest.success || !latest.data) return; + const latest = await getKVValue(sessionKey, { storeName: config.kvStoreName }); + if (!latest.exists || !latest.data) return; const current = latest.data as any; if (current.title) return; current.title = title; - await setKVValue(sessionKey, current, { storeName: config.defaultStoreName }); - + await setKVValue(sessionKey, current, { storeName: config.kvStoreName }); } catch (err) { const msg = err instanceof Error ? err.message : String(err); - if (msg.includes('The operation was aborted') || msg.includes('aborted')) { - console.error('[title-gen] timeout after 3000ms'); - } else { - console.error(`[title-gen] failed: ${msg}`); - } + console.error(`[title-gen] failed: ${msg}`); } } - if (!sessionResponse.success || !sessionResponse.data) { + if (!sessionResponse.exists || !sessionResponse.data) { return NextResponse.json({ error: "Session not found" }, { status: 404 }); } @@ -189,7 +99,7 @@ export async function POST( try { await setKVValue(sessionKey, updatedSession, { - storeName: config.defaultStoreName, + storeName: config.kvStoreName, }); } catch (error) { console.error( @@ -216,141 +126,126 @@ export async function POST( // Create assistant message placeholder for tracking const assistantMessageId = crypto.randomUUID(); - // Process with agent and stream response - const agentConfig = getAgentPulseConfig(); - const agentUrl = agentConfig.url; - // Get current tutorial state for the user const { TutorialStateManager } = await import('@/lib/tutorial/state-manager'); const currentTutorialState = await TutorialStateManager.getCurrentTutorialState(userId); const agentPayload = { message: message.content, - conversationHistory: updatedSession.messages.slice( - -DEFAULT_CONVERSATION_HISTORY_LIMIT - ), - tutorialData: currentTutorialState, + conversationHistory: updatedSession.messages + .slice(-DEFAULT_CONVERSATION_HISTORY_LIMIT) + .map(msg => ({ + author: msg.author, + content: msg.content, + })), + tutorialData: currentTutorialState ?? undefined, }; - // Prepare headers with optional bearer token - const headers: Record = { - "Content-Type": "application/json", - }; - if (agentConfig.bearerToken) { - headers["Authorization"] = `Bearer ${agentConfig.bearerToken}`; - } - - // Real agent call (SSE response expected) - const agentResponse = await fetch(agentUrl, { - method: 'POST', - headers, - body: JSON.stringify(agentPayload), - signal: AbortSignal.timeout(AGENT_REQUEST_TIMEOUT), - }); + // Create a readable stream to send SSE events to the client + const stream = new ReadableStream({ + async start(controller) { + const encoder = new TextEncoder(); + let accumulatedContent = ""; + let finalTutorialData: TutorialData | undefined = undefined; - if (!agentResponse.ok) { - throw new Error(`Agent responded with status: ${agentResponse.status}`); - } - - // Process streaming response - let accumulatedContent = ""; - let finalTutorialData: TutorialData | undefined = undefined; - - const transformStream = new TransformStream({ - async transform(chunk, controller) { - // Forward the chunk to the client - controller.enqueue(chunk); - - // Process the chunk to accumulate the full response - const text = new TextDecoder().decode(chunk); - const lines = text.split("\n"); - - for (const line of lines) { - if (line.startsWith("data: ")) { - try { - const data = JSON.parse(line.slice(6)) as StreamingChunk; - - if (data.type === "text-delta" && data.textDelta) { - accumulatedContent += data.textDelta; - } else if (data.type === "tutorial-data" && data.tutorialData) { - finalTutorialData = data.tutorialData; - - // Update user's tutorial progress - await TutorialStateManager.updateTutorialProgress( - userId, - finalTutorialData.tutorialId, - finalTutorialData.currentStep, - finalTutorialData.totalSteps - ); - } else if (data.type === "finish") { - // When the stream is finished, save the assistant message - const assistantMessage: Message = { - id: assistantMessageId, - author: "ASSISTANT", - content: accumulatedContent, - timestamp: getCurrentTimestamp(), - tutorialData: finalTutorialData, - }; - - const finalSession = { - ...updatedSession, - messages: [...updatedSession.messages, assistantMessage], - }; - - await setKVValue(sessionKey, finalSession, { - storeName: config.defaultStoreName, - }); - - // Trigger background title generation if missing - // Do not await to avoid delaying the client stream completion - void generateAndPersistTitle(sessionId, sessionKey, finalSession); - - // Send the final session in the finish event - controller.enqueue( - new TextEncoder().encode( - `data: ${JSON.stringify({ - type: "finish", - session: finalSession, - })}\n\n` - ) - ); - } - } catch (error) { - console.error("Error processing stream chunk:", error); - } - } + try { + // Call agent-pulse via service with streaming callbacks + await callAgentPulseStreaming(agentPayload, { + onTextDelta: (text) => { + accumulatedContent += text; + controller.enqueue( + encoder.encode(`data: ${JSON.stringify({ type: 'text-delta', textDelta: text })}\n\n`) + ); + }, + + onStatus: (message, category) => { + controller.enqueue( + encoder.encode( + `data: ${JSON.stringify({ type: 'status', message, category })}\n\n` + ) + ); + }, + + onTutorialData: async (data) => { + finalTutorialData = data; + + // Update user's tutorial progress + await TutorialStateManager.updateTutorialProgress( + userId, + data.tutorialId, + data.currentStep, + data.totalSteps + ); + + controller.enqueue( + encoder.encode( + `data: ${JSON.stringify({ type: 'tutorial-data', tutorialData: data })}\n\n` + ) + ); + }, + + onFinish: async () => { + // Save the assistant message + const assistantMessage: Message = { + id: assistantMessageId, + author: "ASSISTANT", + content: accumulatedContent, + timestamp: getCurrentTimestamp(), + tutorialData: finalTutorialData, + }; + + const finalSession = { + ...updatedSession, + messages: [...updatedSession.messages, assistantMessage], + }; + + await setKVValue(sessionKey, finalSession, { + storeName: config.kvStoreName, + }); + + // Trigger background title generation if missing + // Do not await to avoid delaying the client stream completion + void generateAndPersistTitle(sessionKey, finalSession); + + // Send the final session in the finish event + controller.enqueue( + encoder.encode( + `data: ${JSON.stringify({ + type: "finish", + session: finalSession, + })}\n\n` + ) + ); + + controller.close(); + }, + + onError: (error) => { + console.error('Agent error:', error); + controller.enqueue( + encoder.encode( + `data: ${JSON.stringify({ type: 'error', error })}\n\n` + ) + ); + controller.close(); + }, + }); + } catch (error) { + console.error('Error in agent stream:', error); + controller.enqueue( + encoder.encode( + `data: ${JSON.stringify({ + type: 'error', + error: error instanceof Error ? error.message : 'Unknown error', + })}\n\n` + ) + ); + controller.close(); } }, }); - // Pipe the agent response through our transform stream - const reader = agentResponse.body?.getReader(); - if (!reader) { - throw new Error("No response body from agent"); - } - const writer = transformStream.writable.getWriter(); - (async () => { - try { - while (true) { - const { done, value } = await reader.read(); - if (done) { - break; - } - try { - await writer.write(value); - } catch (writeError) { - console.error('Error writing to transform stream:', writeError); - throw writeError; - } - } - await writer.close(); - } catch (error) { - console.error('Error in stream processing:', error); - writer.abort(error); - } - })(); - - return new NextResponse(transformStream.readable, { + return new NextResponse(stream, { headers: { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", diff --git a/app/api/sessions/[sessionId]/route.ts b/app/api/sessions/[sessionId]/route.ts index a3900650..b69e4cae 100644 --- a/app/api/sessions/[sessionId]/route.ts +++ b/app/api/sessions/[sessionId]/route.ts @@ -21,12 +21,12 @@ export async function GET( const paramsData = await params; const sessionId = paramsData.sessionId; const sessionKey = `${userId}_${sessionId}`; - const response = await getKVValue(sessionKey, { storeName: config.defaultStoreName }); + const response = await getKVValue(sessionKey, { storeName: config.kvStoreName }); - if (!response.success) { + if (!response.exists) { return NextResponse.json( - { error: response.error || 'Session not found' }, - { status: response.statusCode || 404 } + { error: 'Session not found' }, + { status: 404 } ); } @@ -84,36 +84,36 @@ export async function PUT( } // Update the individual session - const response = await setKVValue( + const success = await setKVValue( sessionKey, session, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!response.success) { + if (!success) { return NextResponse.json( - { error: response.error || 'Failed to update session' }, - { status: response.statusCode || 500 } + { error: 'Failed to update session' }, + { status: 500 } ); } // Update the master list if needed (ensure the session ID is in the list) - const allSessionsResponse = await getKVValue(userId, { storeName: config.defaultStoreName }); - const sessionIds = allSessionsResponse.success ? allSessionsResponse.data || [] : []; + const allSessionsResponse = await getKVValue(userId, { storeName: config.kvStoreName }); + const sessionIds = allSessionsResponse.exists ? allSessionsResponse.data || [] : []; // If the session ID isn't in the list, add it to the beginning if (!sessionIds.includes(sessionKey)) { const updatedSessionIds = [sessionKey, ...sessionIds]; - const sessionsListResponse = await setKVValue( + const sessionsListSuccess = await setKVValue( userId, updatedSessionIds, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!sessionsListResponse.success) { + if (!sessionsListSuccess) { // Log the error but don't fail the request - console.error('Failed to update sessions list:', sessionsListResponse.error); + console.error('Failed to update sessions list'); } } @@ -143,34 +143,34 @@ export async function DELETE( const sessionId = paramsData.sessionId; const sessionKey = `${userId}_${sessionId}`; // Delete the session data - const sessionResponse = await deleteKVValue( + const sessionDeleteSuccess = await deleteKVValue( sessionKey, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!sessionResponse.success) { + if (!sessionDeleteSuccess) { return NextResponse.json( - { error: sessionResponse.error || 'Failed to delete session' }, - { status: sessionResponse.statusCode || 500 } + { error: 'Failed to delete session' }, + { status: 500 } ); } // Remove from sessions list - const allSessionsResponse = await getKVValue(userId, { storeName: config.defaultStoreName }); - const sessionIds = allSessionsResponse.success ? allSessionsResponse.data || [] : []; + const allSessionsResponse = await getKVValue(userId, { storeName: config.kvStoreName }); + const sessionIds = allSessionsResponse.exists ? allSessionsResponse.data || [] : []; const updatedSessionIds = sessionIds.filter(id => id !== sessionKey); - const sessionsListResponse = await setKVValue( + const sessionsListSuccess = await setKVValue( userId, updatedSessionIds, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!sessionsListResponse.success) { + if (!sessionsListSuccess) { return NextResponse.json( - { error: sessionsListResponse.error || 'Failed to update sessions list' }, - { status: sessionsListResponse.statusCode || 500 } + { error: 'Failed to update sessions list' }, + { status: 500 } ); } @@ -209,8 +209,8 @@ export async function POST( const { message } = validation.data; // Get current session - const sessionResponse = await getKVValue(sessionKey, { storeName: config.defaultStoreName }); - if (!sessionResponse.success || !sessionResponse.data) { + const sessionResponse = await getKVValue(sessionKey, { storeName: config.kvStoreName }); + if (!sessionResponse.exists || !sessionResponse.data) { return NextResponse.json( { error: 'Session not found' }, { status: 404 } @@ -224,36 +224,36 @@ export async function POST( }; // Update the individual session - const updateResponse = await setKVValue( + const updateSuccess = await setKVValue( sessionKey, updatedSession, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!updateResponse.success) { + if (!updateSuccess) { return NextResponse.json( - { error: updateResponse.error || 'Failed to update session' }, - { status: updateResponse.statusCode || 500 } + { error: 'Failed to update session' }, + { status: 500 } ); } // Move this session ID to the top of the master list (most recently used) - const allSessionsResponse = await getKVValue(userId, { storeName: config.defaultStoreName }); - const sessionIds = allSessionsResponse.success ? allSessionsResponse.data || [] : []; + const allSessionsResponse = await getKVValue(userId, { storeName: config.kvStoreName }); + const sessionIds = allSessionsResponse.exists ? allSessionsResponse.data || [] : []; // Remove the current session ID if it exists and add it to the beginning const filteredSessionIds = sessionIds.filter(id => id !== sessionKey); const updatedSessionIds = [sessionKey, ...filteredSessionIds]; - const sessionsListResponse = await setKVValue( + const sessionsListSuccess = await setKVValue( userId, updatedSessionIds, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!sessionsListResponse.success) { + if (!sessionsListSuccess) { // Log the error but don't fail the request since we already updated the individual session - console.error('Failed to update sessions list:', sessionsListResponse.error); + console.error('Failed to update sessions list'); } return NextResponse.json({ success: true, session: updatedSession }); diff --git a/app/api/sessions/route.ts b/app/api/sessions/route.ts index bd6a97f2..99c0dcb8 100644 --- a/app/api/sessions/route.ts +++ b/app/api/sessions/route.ts @@ -26,17 +26,11 @@ export async function GET(request: NextRequest) { const limit = Number.isFinite(parsedLimit) ? Math.min(Math.max(parsedLimit, 1), MAX_SESSIONS_LIMIT) : DEFAULT_SESSIONS_LIMIT; const cursor = Number.isFinite(parsedCursor) ? Math.max(parsedCursor, 0) : 0; - const response = await getKVValue(userId, { storeName: config.defaultStoreName }); - if (!response.success) { - if (response.statusCode === 404) { - return NextResponse.json({ sessions: [], pagination: { cursor, nextCursor: null, hasMore: false, total: 0, limit } }); - } - return NextResponse.json( - { error: response.error || 'Failed to retrieve sessions' }, - { status: response.statusCode || 500 } - ); + const response = await getKVValue(userId, { storeName: config.kvStoreName }); + if (!response.exists) { + return NextResponse.json({ sessions: [], pagination: { cursor, nextCursor: null, hasMore: false, total: 0, limit } }); } - + if (!response.data?.length) { return NextResponse.json({ sessions: [], pagination: { cursor, nextCursor: null, hasMore: false, total: 0, limit } }); } @@ -48,10 +42,10 @@ export async function GET(request: NextRequest) { const end = Math.min(start + limit, total); const pageIds = sessionIds.slice(start, end); - const sessionPromises = pageIds.map(sessionId => getKVValue(sessionId, { storeName: config.defaultStoreName })); + const sessionPromises = pageIds.map(sessionId => getKVValue(sessionId, { storeName: config.kvStoreName })); const sessionResults = await Promise.all(sessionPromises); const sessions = sessionResults - .filter(result => result.success && result.data) + .filter(result => result.exists && result.data) .map(result => result.data as Session); const hasMore = end < total; @@ -102,36 +96,36 @@ export async function POST(request: NextRequest) { const sessionKey = `${userId}_${session.sessionId}`; // Save the session data - const sessionResponse = await setKVValue( + const sessionSuccess = await setKVValue( sessionKey, session, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!sessionResponse.success) { + if (!sessionSuccess) { return NextResponse.json( - { error: sessionResponse.error || 'Failed to create session' }, - { status: sessionResponse.statusCode || 500 } + { error: 'Failed to create session' }, + { status: 500 } ); } // Update the sessions list with just the session ID - const allSessionsResponse = await getKVValue(userId, { storeName: config.defaultStoreName }); - const sessionIds = allSessionsResponse.success ? allSessionsResponse.data || [] : []; + const allSessionsResponse = await getKVValue(userId, { storeName: config.kvStoreName }); + const sessionIds = allSessionsResponse.exists ? allSessionsResponse.data || [] : []; // Add the new session ID to the beginning of the array const updatedSessionIds = [sessionKey, ...sessionIds.filter(id => id !== sessionKey)]; - const sessionsListResponse = await setKVValue( + const sessionsListSuccess = await setKVValue( userId, updatedSessionIds, - { storeName: config.defaultStoreName } + { storeName: config.kvStoreName } ); - if (!sessionsListResponse.success) { + if (!sessionsListSuccess) { return NextResponse.json( - { error: sessionsListResponse.error || 'Failed to update sessions list' }, - { status: sessionsListResponse.statusCode || 500 } + { error: 'Failed to update sessions list' }, + { status: 500 } ); } diff --git a/app/api/users/tutorial-state/route.ts b/app/api/users/tutorial-state/route.ts index 70557fa7..a30e8958 100644 --- a/app/api/users/tutorial-state/route.ts +++ b/app/api/users/tutorial-state/route.ts @@ -94,14 +94,14 @@ export async function DELETE(request: NextRequest) { delete state.tutorials[tutorialId]; // Save the updated state - const kvResponse = await setKVValue(`tutorial_state_${userId}`, state, { - storeName: config.defaultStoreName + const success = await setKVValue(`tutorial_state_${userId}`, state, { + storeName: config.kvStoreName }); - if (!kvResponse.success) { + if (!success) { return NextResponse.json( - { error: kvResponse.error || 'Failed to reset tutorial state' }, - { status: kvResponse.statusCode || 500 } + { error: 'Failed to reset tutorial state' }, + { status: 500 } ); } diff --git a/app/layout.tsx b/app/layout.tsx index 6c55a977..ac6b118c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,19 +2,8 @@ import { RootProvider } from 'fumadocs-ui/provider'; import { GeistSans } from 'geist/font/sans'; import type { Metadata } from 'next'; import type { ReactNode } from 'react'; -import { validateEnv } from '@/lib/env'; import './global.css'; -// Validate environment variables at startup (server-side only) -if (typeof window === 'undefined') { - const isValid = validateEnv(); - if (!isValid) { - console.warn( - 'Environment validation failed during build – this is expected at build time' - ); - } -} - export const metadata: Metadata = { metadataBase: new URL('https://www.agentuity.dev'), title: 'Agentuity Docs', diff --git a/doc-agents/.agents/agentuity/sdk/agent/AGENTS.md b/doc-agents/.agents/agentuity/sdk/agent/AGENTS.md new file mode 100644 index 00000000..3c5330d3 --- /dev/null +++ b/doc-agents/.agents/agentuity/sdk/agent/AGENTS.md @@ -0,0 +1,308 @@ +# Agents Folder Guide + +This folder contains AI agents for your Agentuity application. Each agent is organized in its own subdirectory. + +## Generated Types + +The `src/generated/` folder contains auto-generated TypeScript files: + +- `registry.ts` - Agent registry with strongly-typed agent definitions and schema types +- `routes.ts` - Route registry for API, WebSocket, and SSE endpoints +- `app.ts` - Application entry point (regenerated on every build) + +**Important:** Never edit files in `src/generated/` - they are overwritten on every build. + +Import generated types in your agents: + +```typescript +import type { HelloInput, HelloOutput } from '../generated/registry'; +``` + +## Directory Structure + +Each agent folder must contain: + +- **agent.ts** (required) - Agent definition with schema and handler + +Example structure: + +``` +src/agent/ +├── hello/ +│ └── agent.ts +├── process-data/ +│ └── agent.ts +└── (generated files in src/generated/) +``` + +**Note:** HTTP routes are defined separately in `src/api/` - see the API folder guide for details. + +## Creating an Agent + +### Basic Agent (agent.ts) + +```typescript +import { createAgent } from '@agentuity/runtime'; +import { s } from '@agentuity/schema'; + +const agent = createAgent('my-agent', { + description: 'What this agent does', + schema: { + input: s.object({ + name: s.string(), + age: s.number(), + }), + output: s.string(), + }, + handler: async (ctx, input) => { + // Access context: ctx.app, ctx.config, ctx.logger, ctx.kv, ctx.vector, ctx.stream + return `Hello, ${input.name}! You are ${input.age} years old.`; + }, +}); + +export default agent; +``` + +### Agent with Lifecycle (setup/shutdown) + +```typescript +import { createAgent } from '@agentuity/runtime'; +import { s } from '@agentuity/schema'; + +const agent = createAgent('lifecycle-agent', { + description: 'Agent with setup and shutdown', + schema: { + input: s.object({ message: s.string() }), + output: s.object({ result: s.string() }), + }, + setup: async (app) => { + // Initialize resources (runs once on startup) + // app contains: appName, version, startedAt, config + return { + agentId: `agent-${Math.random().toString(36).substr(2, 9)}`, + connectionPool: ['conn-1', 'conn-2'], + }; + }, + handler: async (ctx, input) => { + // Access setup config via ctx.config (fully typed) + ctx.logger.info('Agent ID:', ctx.config.agentId); + ctx.logger.info('Connections:', ctx.config.connectionPool); + return { result: `Processed: ${input.message}` }; + }, + shutdown: async (app, config) => { + // Cleanup resources (runs on shutdown) + console.log('Shutting down agent:', config.agentId); + }, +}); + +export default agent; +``` + +### Agent with Event Listeners + +```typescript +import { createAgent } from '@agentuity/runtime'; +import { s } from '@agentuity/schema'; + +const agent = createAgent('event-agent', { + schema: { + input: s.object({ data: s.string() }), + output: s.string(), + }, + handler: async (ctx, input) => { + return `Processed: ${input.data}`; + }, +}); + +agent.addEventListener('started', (eventName, agent, ctx) => { + ctx.logger.info('Agent started'); +}); + +agent.addEventListener('completed', (eventName, agent, ctx) => { + ctx.logger.info('Agent completed'); +}); + +agent.addEventListener('errored', (eventName, agent, ctx, error) => { + ctx.logger.error('Agent errored:', error); +}); + +export default agent; +``` + +## Agent Context (ctx) + +The handler receives a context object with: + +- **ctx.app** - Application state (appName, version, startedAt, config from createApp) +- **ctx.config** - Agent-specific config (from setup return value, fully typed) +- **ctx.logger** - Structured logger (info, warn, error, debug, trace) +- **ctx.tracer** - OpenTelemetry tracer for custom spans +- **ctx.sessionId** - Unique session identifier +- **ctx.kv** - Key-value storage +- **ctx.vector** - Vector storage for embeddings +- **ctx.stream** - Stream storage for real-time data +- **ctx.state** - In-memory request-scoped state (Map) +- **ctx.thread** - Thread information for multi-turn conversations +- **ctx.session** - Session information +- **ctx.waitUntil** - Schedule background tasks + +## Examples + +### Using Key-Value Storage + +```typescript +handler: async (ctx, input) => { + await ctx.kv.set('user:123', { name: 'Alice', age: 30 }); + const user = await ctx.kv.get('user:123'); + await ctx.kv.delete('user:123'); + const keys = await ctx.kv.list('user:*'); + return user; +}; +``` + +### Using Vector Storage + +```typescript +handler: async (ctx, input) => { + await ctx.vector.upsert('docs', [ + { id: '1', values: [0.1, 0.2, 0.3], metadata: { text: 'Hello' } }, + ]); + const results = await ctx.vector.query('docs', [0.1, 0.2, 0.3], { topK: 5 }); + return results; +}; +``` + +### Using Streams + +```typescript +handler: async (ctx, input) => { + const stream = await ctx.stream.create('agent-logs'); + await ctx.stream.write(stream.id, 'Processing step 1'); + await ctx.stream.write(stream.id, 'Processing step 2'); + return { streamId: stream.id }; +}; +``` + +### Background Tasks with waitUntil + +```typescript +handler: async (ctx, input) => { + // Schedule background work that continues after response + ctx.waitUntil(async () => { + await ctx.kv.set('processed', Date.now()); + ctx.logger.info('Background task complete'); + }); + + return { status: 'processing' }; +}; +``` + +### Calling Another Agent + +```typescript +// Import the agent directly +import otherAgent from '../other-agent/agent'; + +handler: async (ctx, input) => { + const result = await otherAgent.run({ data: input.value }); + return `Other agent returned: ${result}`; +}; +``` + +## Subagents (Nested Agents) + +Agents can have subagents organized one level deep. This is useful for grouping related functionality. + +### Directory Structure for Subagents + +``` +src/agent/ +└── team/ # Parent agent + ├── agent.ts # Parent agent + ├── members/ # Subagent + │ └── agent.ts + └── tasks/ # Subagent + └── agent.ts +``` + +### Parent Agent + +```typescript +import { createAgent } from '@agentuity/runtime'; +import { s } from '@agentuity/schema'; + +const agent = createAgent('team', { + description: 'Team Manager', + schema: { + input: s.object({ action: s.union([s.literal('info'), s.literal('count')]) }), + output: s.object({ + message: s.string(), + timestamp: s.string(), + }), + }, + handler: async (ctx, { action }) => { + return { + message: 'Team parent agent - manages members and tasks', + timestamp: new Date().toISOString(), + }; + }, +}); + +export default agent; +``` + +### Subagent (Accessing Parent) + +```typescript +import { createAgent } from '@agentuity/runtime'; +import { s } from '@agentuity/schema'; +import parentAgent from '../agent'; + +const agent = createAgent('team.members', { + description: 'Members Subagent', + schema: { + input: s.object({ + action: s.union([s.literal('list'), s.literal('add'), s.literal('remove')]), + name: s.optional(s.string()), + }), + output: s.object({ + members: s.array(s.string()), + parentInfo: s.optional(s.string()), + }), + }, + handler: async (ctx, { action, name }) => { + // Call parent agent directly + const parentResult = await parentAgent.run({ action: 'info' }); + const parentInfo = `Parent says: ${parentResult.message}`; + + let members = ['Alice', 'Bob']; + if (action === 'add' && name) { + members.push(name); + } + + return { members, parentInfo }; + }, +}); + +export default agent; +``` + +### Key Points About Subagents + +- **One level deep**: Only one level of nesting is supported (no nested subagents) +- **Access parent**: Import and call parent agents directly +- **Agent names**: Subagents have dotted names like `"team.members"` +- **Shared context**: Subagents share the same app context (kv, logger, etc.) + +## Rules + +- Each agent folder name becomes the agent's route name (e.g., `hello/` → `/agent/hello`) +- **agent.ts** must export default the agent instance +- The first argument to `createAgent()` is the agent name (must match folder structure) +- Input/output schemas are enforced with @agentuity/schema validation +- Setup return value type automatically flows to ctx.config (fully typed) +- Use ctx.logger for logging, not console.log +- Import agents directly to call them (recommended approach) +- Subagents are one level deep only (team/members/, not team/members/subagent/) + + diff --git a/doc-agents/.agents/agentuity/sdk/api/AGENTS.md b/doc-agents/.agents/agentuity/sdk/api/AGENTS.md new file mode 100644 index 00000000..e6c32b3f --- /dev/null +++ b/doc-agents/.agents/agentuity/sdk/api/AGENTS.md @@ -0,0 +1,367 @@ +# APIs Folder Guide + +This folder contains REST API routes for your Agentuity application. Each API is organized in its own subdirectory. + +## Generated Types + +The `src/generated/` folder contains auto-generated TypeScript files: + +- `routes.ts` - Route registry with strongly-typed route definitions and schema types +- `registry.ts` - Agent registry (for calling agents from routes) +- `app.ts` - Application entry point (regenerated on every build) + +**Important:** Never edit files in `src/generated/` - they are overwritten on every build. + +Import generated types in your routes: + +```typescript +import type { POST_Api_UsersInput, POST_Api_UsersOutput } from '../generated/routes'; +``` + +## Directory Structure + +Each API folder must contain: + +- **route.ts** (required) - HTTP route definitions using Hono router + +Example structure: + +``` +src/api/ +├── index.ts (optional, mounted at /api) +├── status/ +│ └── route.ts (mounted at /api/status) +├── users/ +│ └── route.ts (mounted at /api/users) +├── agent-call/ + └── route.ts (mounted at /api/agent-call) +``` + +## Creating an API + +### Basic API (route.ts) + +```typescript +import { createRouter } from '@agentuity/runtime'; + +const router = createRouter(); + +// GET /api/status +router.get('/', (c) => { + return c.json({ + status: 'ok', + timestamp: new Date().toISOString(), + version: '1.0.0', + }); +}); + +// POST /api/status +router.post('/', async (c) => { + const body = await c.req.json(); + return c.json({ received: body }); +}); + +export default router; +``` + +### API with Request Validation + +```typescript +import { createRouter } from '@agentuity/runtime'; +import { s } from '@agentuity/schema'; +import { validator } from 'hono/validator'; + +const router = createRouter(); + +const createUserSchema = s.object({ + name: s.string(), + email: s.string(), + age: s.number(), +}); + +router.post( + '/', + validator('json', (value, c) => { + const result = createUserSchema['~standard'].validate(value); + if (result.issues) { + return c.json({ error: 'Validation failed', issues: result.issues }, 400); + } + return result.value; + }), + async (c) => { + const data = c.req.valid('json'); + // data is fully typed: { name: string, email: string, age: number } + return c.json({ + success: true, + user: data, + }); + } +); + +export default router; +``` + +### API Calling Agents + +APIs can call agents directly by importing them: + +```typescript +import { createRouter } from '@agentuity/runtime'; +import helloAgent from '@agent/hello'; + +const router = createRouter(); + +router.get('/', async (c) => { + // Call an agent directly + const result = await helloAgent.run({ name: 'API Caller', age: 42 }); + + return c.json({ + success: true, + agentResult: result, + }); +}); + +router.post('/with-input', async (c) => { + const body = await c.req.json(); + const { name, age } = body; + + // Call agent with dynamic input + const result = await helloAgent.run({ name, age }); + + return c.json({ + success: true, + agentResult: result, + }); +}); + +export default router; +``` + +### API with Agent Validation + +Use `agent.validator()` for automatic input validation from agent schemas: + +```typescript +import { createRouter } from '@agentuity/runtime'; +import myAgent from '@agent/my-agent'; + +const router = createRouter(); + +// POST with automatic validation using agent's input schema +router.post('/', myAgent.validator(), async (c) => { + const data = c.req.valid('json'); // Fully typed from agent schema! + const result = await myAgent.run(data); + return c.json({ success: true, result }); +}); + +export default router; +``` + +### API with Logging + +```typescript +import { createRouter } from '@agentuity/runtime'; + +const router = createRouter(); + +router.get('/log-test', (c) => { + c.var.logger.info('Info message'); + c.var.logger.error('Error message'); + c.var.logger.warn('Warning message'); + c.var.logger.debug('Debug message'); + c.var.logger.trace('Trace message'); + + return c.text('Check logs'); +}); + +export default router; +``` + +## Route Context (c) + +The route handler receives a Hono context object with: + +- **c.req** - Request object (c.req.json(), c.req.param(), c.req.query(), etc.) +- **c.json()** - Return JSON response +- **c.text()** - Return text response +- **c.html()** - Return HTML response +- **c.redirect()** - Redirect to URL +- **c.var.logger** - Structured logger (info, warn, error, debug, trace) +- **c.var.kv** - Key-value storage +- **c.var.vector** - Vector storage +- **c.var.stream** - Stream management +- **Import agents directly** - Import and call agents directly (recommended) + +## HTTP Methods + +```typescript +const router = createRouter(); + +router.get('/path', (c) => { + /* ... */ +}); +router.post('/path', (c) => { + /* ... */ +}); +router.put('/path', (c) => { + /* ... */ +}); +router.patch('/path', (c) => { + /* ... */ +}); +router.delete('/path', (c) => { + /* ... */ +}); +router.options('/path', (c) => { + /* ... */ +}); +``` + +## Path Parameters + +```typescript +// GET /api/users/:id +router.get('/:id', (c) => { + const id = c.req.param('id'); + return c.json({ userId: id }); +}); + +// GET /api/posts/:postId/comments/:commentId +router.get('/:postId/comments/:commentId', (c) => { + const postId = c.req.param('postId'); + const commentId = c.req.param('commentId'); + return c.json({ postId, commentId }); +}); +``` + +## Query Parameters + +```typescript +// GET /api/search?q=hello&limit=10 +router.get('/search', (c) => { + const query = c.req.query('q'); + const limit = c.req.query('limit') || '20'; + return c.json({ query, limit: parseInt(limit) }); +}); +``` + +## Request Body + +```typescript +// JSON body +router.post('/', async (c) => { + const body = await c.req.json(); + return c.json({ received: body }); +}); + +// Form data +router.post('/upload', async (c) => { + const formData = await c.req.formData(); + const file = formData.get('file'); + return c.json({ fileName: file?.name }); +}); +``` + +## Error Handling + +```typescript +import myAgent from '@agent/my-agent'; + +router.get('/', async (c) => { + try { + const result = await myAgent.run({ data: 'test' }); + return c.json({ success: true, result }); + } catch (error) { + c.var.logger.error('Agent call failed:', error); + return c.json( + { + success: false, + error: error instanceof Error ? error.message : String(error), + }, + 500 + ); + } +}); +``` + +## Response Types + +```typescript +// JSON response +return c.json({ data: 'value' }); + +// Text response +return c.text('Hello World'); + +// HTML response +return c.html('

Hello

'); + +// Custom status code +return c.json({ error: 'Not found' }, 404); + +// Redirect +return c.redirect('/new-path'); + +// Headers +return c.json({ data: 'value' }, 200, { + 'X-Custom-Header': 'value', +}); +``` + +## Streaming Routes + +```typescript +import { createRouter, stream, sse, websocket } from '@agentuity/runtime'; + +const router = createRouter(); + +// Stream response (use with POST) +router.post( + '/events', + stream((c) => { + return new ReadableStream({ + start(controller) { + controller.enqueue('event 1\n'); + controller.enqueue('event 2\n'); + controller.close(); + }, + }); + }) +); + +// Server-Sent Events (use with GET) +router.get( + '/notifications', + sse((c, stream) => { + stream.writeSSE({ data: 'Hello', event: 'message' }); + stream.writeSSE({ data: 'World', event: 'message' }); + }) +); + +// WebSocket (use with GET) +router.get( + '/ws', + websocket((c, ws) => { + ws.onOpen(() => { + ws.send('Connected!'); + }); + ws.onMessage((event) => { + ws.send(`Echo: ${event.data}`); + }); + }) +); + +export default router; +``` + +## Rules + +- Each API folder name becomes the route name (e.g., `status/` → `/api/status`) +- **route.ts** must export default the router instance +- Use c.var.logger for logging, not console.log +- Import agents directly to call them (e.g., `import agent from '@agent/name'`) +- Validation should use @agentuity/schema or agent.validator() for type safety +- Return appropriate HTTP status codes +- APIs run at `/api/{folderName}` by default + + diff --git a/doc-agents/.agents/agentuity/sdk/web/AGENTS.md b/doc-agents/.agents/agentuity/sdk/web/AGENTS.md new file mode 100644 index 00000000..2a6eb0da --- /dev/null +++ b/doc-agents/.agents/agentuity/sdk/web/AGENTS.md @@ -0,0 +1,511 @@ +# Web Folder Guide + +This folder contains your React-based web application that communicates with your Agentuity agents. + +## Generated Types + +The `src/generated/` folder contains auto-generated TypeScript files: + +- `routes.ts` - Route registry with type-safe API, WebSocket, and SSE route definitions +- `registry.ts` - Agent registry with input/output types + +**Important:** Never edit files in `src/generated/` - they are overwritten on every build. + +Import generated types in your components: + +```typescript +// Routes are typed automatically via module augmentation +import { useAPI } from '@agentuity/react'; + +// The route 'GET /api/users' is fully typed +const { data } = useAPI('GET /api/users'); +``` + +## Directory Structure + +Required files: + +- **App.tsx** (required) - Main React application component +- **frontend.tsx** (required) - Frontend entry point with client-side rendering +- **index.html** (required) - HTML template +- **public/** (optional) - Static assets (images, CSS, JS files) + +Example structure: + +``` +src/web/ +├── App.tsx +├── frontend.tsx +├── index.html +└── public/ + ├── styles.css + ├── logo.svg + └── script.js +``` + +## Creating the Web App + +### App.tsx - Main Component + +```typescript +import { AgentuityProvider, useAPI } from '@agentuity/react'; +import { useState } from 'react'; + +function HelloForm() { + const [name, setName] = useState('World'); + const { invoke, isLoading, data: greeting } = useAPI('POST /api/hello'); + + return ( +
+ setName(e.target.value)} + disabled={isLoading} + /> + + + +
{greeting ?? 'Waiting for response'}
+
+ ); +} + +export function App() { + return ( + +
+

Welcome to Agentuity

+ +
+
+ ); +} +``` + +### frontend.tsx - Entry Point + +```typescript +import { createRoot } from 'react-dom/client'; +import { App } from './App'; + +const root = document.getElementById('root'); +if (!root) throw new Error('Root element not found'); + +createRoot(root).render(); +``` + +### index.html - HTML Template + +```html + + + + + + My Agentuity App + + +
+ + + +``` + +## React Hooks + +All hooks from `@agentuity/react` must be used within an `AgentuityProvider`. **Always use these hooks instead of raw `fetch()` calls** - they provide type safety, automatic error handling, and integration with the Agentuity platform. + +### useAPI - Type-Safe API Calls + +The primary hook for making HTTP requests. **Use this instead of `fetch()`.** + +```typescript +import { useAPI } from '@agentuity/react'; + +function MyComponent() { + // GET requests auto-execute and return refetch + const { data, isLoading, error, refetch } = useAPI('GET /api/users'); + + // POST/PUT/DELETE return invoke for manual execution + const { invoke, data: result, isLoading: saving } = useAPI('POST /api/users'); + + const handleCreate = async () => { + // Input is fully typed from route schema! + await invoke({ name: 'Alice', email: 'alice@example.com' }); + }; + + return ( +
+ + {result &&

Created: {result.name}

} +
+ ); +} +``` + +**useAPI Return Values:** + +| Property | Type | Description | +| ------------ | ------------------------ | ----------------------------------------- | +| `data` | `T \| undefined` | Response data (typed from route schema) | +| `error` | `Error \| null` | Error if request failed | +| `isLoading` | `boolean` | True during initial load | +| `isFetching` | `boolean` | True during any fetch (including refetch) | +| `isSuccess` | `boolean` | True if last request succeeded | +| `isError` | `boolean` | True if last request failed | +| `invoke` | `(input?) => Promise` | Manual trigger (POST/PUT/DELETE) | +| `refetch` | `() => Promise` | Refetch data (GET) | +| `reset` | `() => void` | Reset state to initial | + +### useAPI Options + +```typescript +// GET with query parameters and caching +const { data } = useAPI({ + route: 'GET /api/search', + query: { q: 'react', limit: '10' }, + staleTime: 5000, // Cache for 5 seconds + refetchInterval: 10000, // Auto-refetch every 10 seconds + enabled: true, // Set to false to disable auto-fetch +}); + +// POST with callbacks +const { invoke } = useAPI({ + route: 'POST /api/users', + onSuccess: (data) => console.log('Created:', data), + onError: (error) => console.error('Failed:', error), +}); + +// Streaming responses with onChunk +const { invoke } = useAPI({ + route: 'POST /api/stream', + onChunk: (chunk) => console.log('Received chunk:', chunk), + delimiter: '\n', // Split stream by newlines (default) +}); + +// Custom headers +const { data } = useAPI({ + route: 'GET /api/protected', + headers: { 'X-Custom-Header': 'value' }, +}); +``` + +### useWebsocket - WebSocket Connection + +For bidirectional real-time communication. Automatically handles reconnection. + +```typescript +import { useWebsocket } from '@agentuity/react'; + +function ChatComponent() { + const { isConnected, data, send, messages, clearMessages, error, reset } = useWebsocket('/api/chat'); + + return ( +
+

Status: {isConnected ? 'Connected' : 'Disconnected'}

+ +
+ {messages.map((msg, i) => ( +

{JSON.stringify(msg)}

+ ))} +
+ +
+ ); +} +``` + +**useWebsocket Return Values:** + +| Property | Type | Description | +| --------------- | ---------------- | ---------------------------------------- | +| `isConnected` | `boolean` | True when WebSocket is connected | +| `data` | `T \| undefined` | Most recent message received | +| `messages` | `T[]` | Array of all received messages | +| `send` | `(data) => void` | Send a message (typed from route schema) | +| `clearMessages` | `() => void` | Clear the messages array | +| `close` | `() => void` | Close the connection | +| `error` | `Error \| null` | Error if connection failed | +| `isError` | `boolean` | True if there's an error | +| `reset` | `() => void` | Reset state and reconnect | +| `readyState` | `number` | WebSocket ready state | + +### useEventStream - Server-Sent Events + +For server-to-client streaming (one-way). Use when server pushes updates to client. + +```typescript +import { useEventStream } from '@agentuity/react'; + +function NotificationsComponent() { + const { isConnected, data, error, close, reset } = useEventStream('/api/notifications'); + + return ( +
+

Connected: {isConnected ? 'Yes' : 'No'}

+ {error &&

Error: {error.message}

} +

Latest: {JSON.stringify(data)}

+ +
+ ); +} +``` + +**useEventStream Return Values:** + +| Property | Type | Description | +| ------------- | ---------------- | ---------------------------------- | +| `isConnected` | `boolean` | True when EventSource is connected | +| `data` | `T \| undefined` | Most recent event data | +| `error` | `Error \| null` | Error if connection failed | +| `isError` | `boolean` | True if there's an error | +| `close` | `() => void` | Close the connection | +| `reset` | `() => void` | Reset state and reconnect | +| `readyState` | `number` | EventSource ready state | + +### useAgentuity - Access Context + +Access the Agentuity context for base URL and configuration. + +```typescript +import { useAgentuity } from '@agentuity/react'; + +function MyComponent() { + const { baseUrl } = useAgentuity(); + + return

API Base: {baseUrl}

; +} +``` + +### useAuth - Authentication State + +Access and manage authentication state. + +```typescript +import { useAuth } from '@agentuity/react'; + +function AuthStatus() { + const { isAuthenticated, authHeader, setAuthHeader, authLoading } = useAuth(); + + const handleLogin = async (token: string) => { + setAuthHeader?.(`Bearer ${token}`); + }; + + const handleLogout = () => { + setAuthHeader?.(null); + }; + + if (authLoading) return

Loading...

; + + return ( +
+ {isAuthenticated ? ( + + ) : ( + + )} +
+ ); +} +``` + +**useAuth Return Values:** + +| Property | Type | Description | +| ----------------- | ------------------- | ------------------------------------------- | +| `isAuthenticated` | `boolean` | True if user has auth token and not loading | +| `authHeader` | `string \| null` | Current auth header (e.g., "Bearer ...") | +| `setAuthHeader` | `(token) => void` | Set auth header (null to clear) | +| `authLoading` | `boolean` | True during auth state changes | +| `setAuthLoading` | `(loading) => void` | Set auth loading state | + +## Complete Example + +```typescript +import { AgentuityProvider, useAPI, useWebsocket } from '@agentuity/react'; +import { useEffect, useState } from 'react'; + +function Dashboard() { + const [count, setCount] = useState(0); + const { invoke, data: agentResult } = useAPI('POST /api/process'); + const { isConnected, send, data: wsMessage } = useWebsocket('/api/live'); + + useEffect(() => { + if (isConnected) { + const interval = setInterval(() => { + send({ ping: Date.now() }); + }, 1000); + return () => clearInterval(interval); + } + }, [isConnected, send]); + + return ( +
+

My Agentuity App

+ +
+

Count: {count}

+ +
+ +
+ +

{JSON.stringify(agentResult)}

+
+ +
+ WebSocket: + {isConnected ? JSON.stringify(wsMessage) : 'Not connected'} +
+
+ ); +} + +export function App() { + return ( + + + + ); +} +``` + +## Static Assets + +Place static files in the **public/** folder: + +``` +src/web/public/ +├── logo.svg +├── styles.css +└── script.js +``` + +Reference them in your HTML or components: + +```html + + + +``` + +```typescript +// In React components +Logo +``` + +## Styling + +### Inline Styles + +```typescript +
+ Styled content +
+``` + +### CSS Files + +Create `public/styles.css`: + +```css +body { + background-color: #09090b; + color: #fff; + font-family: sans-serif; +} +``` + +Import in `index.html`: + +```html + +``` + +### Style Tag in Component + +```typescript +
+ + +
+``` + +## RPC-Style API Client + +For non-React contexts (like utility functions or event handlers), use `createClient`: + +```typescript +import { createClient } from '@agentuity/react'; + +// Create a typed client (uses global baseUrl and auth from AgentuityProvider) +const api = createClient(); + +// Type-safe RPC-style calls - routes become nested objects +// Route 'GET /api/users' becomes api.users.get() +// Route 'POST /api/users' becomes api.users.post() +// Route 'GET /api/users/:id' becomes api.users.id.get({ id: '123' }) + +async function fetchData() { + const users = await api.users.get(); + const newUser = await api.users.post({ name: 'Alice', email: 'alice@example.com' }); + const user = await api.users.id.get({ id: '123' }); + return { users, newUser, user }; +} +``` + +**When to use `createClient` vs `useAPI`:** + +| Use Case | Recommendation | +| ------------------------- | -------------- | +| React component rendering | `useAPI` hook | +| Event handlers | Either works | +| Utility functions | `createClient` | +| Non-React code | `createClient` | +| Need loading/error state | `useAPI` hook | +| Need caching/refetch | `useAPI` hook | + +## Best Practices + +- Wrap your app with **AgentuityProvider** for hooks to work +- **Always use `useAPI` instead of `fetch()`** for type safety and error handling +- Use **useAPI** for type-safe HTTP requests (GET, POST, PUT, DELETE) +- Use **useWebsocket** for bidirectional real-time communication +- Use **useEventStream** for server-to-client streaming +- Use **useAuth** for authentication state management +- Handle loading and error states in UI +- Place reusable components in separate files +- Keep static assets in the **public/** folder + +## Rules + +- **App.tsx** must export a function named `App` +- **frontend.tsx** must render the `App` component to `#root` +- **index.html** must have a `
` +- Routes are typed via module augmentation from `src/generated/routes.ts` +- The web app is served at `/` by default +- Static files in `public/` are served at `/public/*` +- Module script tag: `` +- **Never use raw `fetch()` calls** - always use `useAPI` or `createClient` + + diff --git a/doc-agents/.agents/skills/README.md b/doc-agents/.agents/skills/README.md new file mode 100644 index 00000000..289c5cd8 --- /dev/null +++ b/doc-agents/.agents/skills/README.md @@ -0,0 +1,158 @@ +# Agentuity CLI Skills + +This directory contains auto-generated [Agent Skills](https://agentskills.io) for the Agentuity CLI. + +## What are Agent Skills? + +Agent Skills are modular capabilities that extend AI coding agents. Each skill is a directory +containing a `SKILL.md` file with instructions that agents read when performing relevant tasks. + +Learn more at the [Agent Skills Specification](https://agentskills.io/specification). + +## Generated From + +- **CLI Version**: 0.0.105 +- **Generated**: 2026-01-06 +- **Total Skills**: 88 + +## Available Skills + +### auth + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-auth-login](./agentuity-cli-auth-login) | `agentuity auth login` | Login to the Agentuity Platform using a browser-based authen... | +| [agentuity-cli-auth-logout](./agentuity-cli-auth-logout) | `agentuity auth logout` | Logout of the Agentuity Cloud Platform | +| [agentuity-cli-auth-ssh-add](./agentuity-cli-auth-ssh-add) | `agentuity auth ssh add` | Add an SSH public key to your account (reads from file or st... | +| [agentuity-cli-auth-ssh-delete](./agentuity-cli-auth-ssh-delete) | `agentuity auth ssh delete` | Delete an SSH key from your account | +| [agentuity-cli-auth-ssh-list](./agentuity-cli-auth-ssh-list) | `agentuity auth ssh list` | List all SSH keys on your account | +| [agentuity-cli-auth-whoami](./agentuity-cli-auth-whoami) | `agentuity auth whoami` | Display information about the currently authenticated user | + +### build + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-build](./agentuity-cli-build) | `agentuity build` | Build Agentuity application for deployment | + +### cloud + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-cloud-agent-get](./agentuity-cli-cloud-agent-get) | `agentuity cloud agent get` | Get details about a specific agent | +| [agentuity-cli-cloud-agent-list](./agentuity-cli-cloud-agent-list) | `agentuity cloud agent list` | List agents for a project | +| [agentuity-cli-cloud-apikey-create](./agentuity-cli-cloud-apikey-create) | `agentuity cloud apikey create` | Create a new API key | +| [agentuity-cli-cloud-apikey-delete](./agentuity-cli-cloud-apikey-delete) | `agentuity cloud apikey delete` | Delete an API key (soft delete) | +| [agentuity-cli-cloud-apikey-get](./agentuity-cli-cloud-apikey-get) | `agentuity cloud apikey get` | Get a specific API key by id | +| [agentuity-cli-cloud-apikey-list](./agentuity-cli-cloud-apikey-list) | `agentuity cloud apikey list` | List all API keys | +| [agentuity-cli-cloud-db-create](./agentuity-cli-cloud-db-create) | `agentuity cloud db create` | Create a new database resource | +| [agentuity-cli-cloud-db-delete](./agentuity-cli-cloud-db-delete) | `agentuity cloud db delete` | Delete a database resource | +| [agentuity-cli-cloud-db-get](./agentuity-cli-cloud-db-get) | `agentuity cloud db get` | Show details about a specific database | +| [agentuity-cli-cloud-db-list](./agentuity-cli-cloud-db-list) | `agentuity cloud db list` | List database resources | +| [agentuity-cli-cloud-db-logs](./agentuity-cli-cloud-db-logs) | `agentuity cloud db logs` | Get query logs for a specific database | +| [agentuity-cli-cloud-db-sql](./agentuity-cli-cloud-db-sql) | `agentuity cloud db sql` | Execute SQL query on a database | +| [agentuity-cli-cloud-deploy](./agentuity-cli-cloud-deploy) | `agentuity cloud deploy` | Deploy project to the Agentuity Cloud | +| [agentuity-cli-cloud-deployment-list](./agentuity-cli-cloud-deployment-list) | `agentuity cloud deployment list` | List deployments | +| [agentuity-cli-cloud-deployment-logs](./agentuity-cli-cloud-deployment-logs) | `agentuity cloud deployment logs` | View logs for a specific deployment | +| [agentuity-cli-cloud-deployment-remove](./agentuity-cli-cloud-deployment-remove) | `agentuity cloud deployment remove` | Remove a specific deployment | +| [agentuity-cli-cloud-deployment-rollback](./agentuity-cli-cloud-deployment-rollback) | `agentuity cloud deployment rollback` | Rollback the latest to the previous deployment | +| [agentuity-cli-cloud-deployment-show](./agentuity-cli-cloud-deployment-show) | `agentuity cloud deployment show` | Show details about a specific deployment | +| [agentuity-cli-cloud-deployment-undeploy](./agentuity-cli-cloud-deployment-undeploy) | `agentuity cloud deployment undeploy` | Undeploy the latest deployment | +| [agentuity-cli-cloud-env-delete](./agentuity-cli-cloud-env-delete) | `agentuity cloud env delete` | Delete an environment variable | +| [agentuity-cli-cloud-env-get](./agentuity-cli-cloud-env-get) | `agentuity cloud env get` | Get an environment variable value | +| [agentuity-cli-cloud-env-import](./agentuity-cli-cloud-env-import) | `agentuity cloud env import` | Import environment variables from a file to cloud and local ... | +| [agentuity-cli-cloud-env-list](./agentuity-cli-cloud-env-list) | `agentuity cloud env list` | List all environment variables | +| [agentuity-cli-cloud-env-pull](./agentuity-cli-cloud-env-pull) | `agentuity cloud env pull` | Pull environment variables from cloud to local .env.producti... | +| [agentuity-cli-cloud-env-push](./agentuity-cli-cloud-env-push) | `agentuity cloud env push` | Push environment variables from local .env.production file t... | +| [agentuity-cli-cloud-env-set](./agentuity-cli-cloud-env-set) | `agentuity cloud env set` | Set an environment variable | +| [agentuity-cli-cloud-keyvalue-create-namespace](./agentuity-cli-cloud-keyvalue-create-namespace) | `agentuity cloud keyvalue create-namespace` | Create a new keyvalue namespace | +| [agentuity-cli-cloud-keyvalue-delete](./agentuity-cli-cloud-keyvalue-delete) | `agentuity cloud keyvalue delete` | Delete a key from the keyvalue storage | +| [agentuity-cli-cloud-keyvalue-delete-namespace](./agentuity-cli-cloud-keyvalue-delete-namespace) | `agentuity cloud keyvalue delete-namespace` | Delete a keyvalue namespace and all its keys | +| [agentuity-cli-cloud-keyvalue-get](./agentuity-cli-cloud-keyvalue-get) | `agentuity cloud keyvalue get` | Get a value from the keyvalue storage | +| [agentuity-cli-cloud-keyvalue-keys](./agentuity-cli-cloud-keyvalue-keys) | `agentuity cloud keyvalue keys` | List all keys in a keyvalue namespace | +| [agentuity-cli-cloud-keyvalue-list-namespaces](./agentuity-cli-cloud-keyvalue-list-namespaces) | `agentuity cloud keyvalue list-namespaces` | List all keyvalue namespaces | +| [agentuity-cli-cloud-keyvalue-repl](./agentuity-cli-cloud-keyvalue-repl) | `agentuity cloud keyvalue repl` | Start an interactive repl for working with keyvalue database | +| [agentuity-cli-cloud-keyvalue-search](./agentuity-cli-cloud-keyvalue-search) | `agentuity cloud keyvalue search` | Search for keys matching a keyword in a keyvalue namespace | +| [agentuity-cli-cloud-keyvalue-set](./agentuity-cli-cloud-keyvalue-set) | `agentuity cloud keyvalue set` | Set a key and value in the keyvalue storage | +| [agentuity-cli-cloud-keyvalue-stats](./agentuity-cli-cloud-keyvalue-stats) | `agentuity cloud keyvalue stats` | Get statistics for keyvalue storage | +| [agentuity-cli-cloud-redis-show](./agentuity-cli-cloud-redis-show) | `agentuity cloud redis show` | Show Redis connection URL | +| [agentuity-cli-cloud-scp-download](./agentuity-cli-cloud-scp-download) | `agentuity cloud scp download` | Download a file using security copy | +| [agentuity-cli-cloud-scp-upload](./agentuity-cli-cloud-scp-upload) | `agentuity cloud scp upload` | Upload a file using security copy | +| [agentuity-cli-cloud-secret-delete](./agentuity-cli-cloud-secret-delete) | `agentuity cloud secret delete` | Delete a secret | +| [agentuity-cli-cloud-secret-get](./agentuity-cli-cloud-secret-get) | `agentuity cloud secret get` | Get a secret value | +| [agentuity-cli-cloud-secret-import](./agentuity-cli-cloud-secret-import) | `agentuity cloud secret import` | Import secrets from a file to cloud and local .env.productio... | +| [agentuity-cli-cloud-secret-list](./agentuity-cli-cloud-secret-list) | `agentuity cloud secret list` | List all secrets | +| [agentuity-cli-cloud-secret-pull](./agentuity-cli-cloud-secret-pull) | `agentuity cloud secret pull` | Pull secrets from cloud to local .env.production file | +| [agentuity-cli-cloud-secret-push](./agentuity-cli-cloud-secret-push) | `agentuity cloud secret push` | Push secrets from local .env.production file to cloud | +| [agentuity-cli-cloud-secret-set](./agentuity-cli-cloud-secret-set) | `agentuity cloud secret set` | Set a secret | +| [agentuity-cli-cloud-session-get](./agentuity-cli-cloud-session-get) | `agentuity cloud session get` | Get details about a specific session | +| [agentuity-cli-cloud-session-list](./agentuity-cli-cloud-session-list) | `agentuity cloud session list` | List recent sessions | +| [agentuity-cli-cloud-session-logs](./agentuity-cli-cloud-session-logs) | `agentuity cloud session logs` | Get logs for a specific session | +| [agentuity-cli-cloud-ssh](./agentuity-cli-cloud-ssh) | `agentuity cloud ssh` | SSH into a cloud project | +| [agentuity-cli-cloud-storage-create](./agentuity-cli-cloud-storage-create) | `agentuity cloud storage create` | Create a new storage resource | +| [agentuity-cli-cloud-storage-delete](./agentuity-cli-cloud-storage-delete) | `agentuity cloud storage delete` | Delete a storage resource or file | +| [agentuity-cli-cloud-storage-download](./agentuity-cli-cloud-storage-download) | `agentuity cloud storage download` | Download a file from storage bucket | +| [agentuity-cli-cloud-storage-get](./agentuity-cli-cloud-storage-get) | `agentuity cloud storage get` | Show details about a specific storage bucket | +| [agentuity-cli-cloud-storage-list](./agentuity-cli-cloud-storage-list) | `agentuity cloud storage list` | List storage resources or files in a bucket | +| [agentuity-cli-cloud-storage-upload](./agentuity-cli-cloud-storage-upload) | `agentuity cloud storage upload` | Upload a file to storage bucket | +| [agentuity-cli-cloud-stream-delete](./agentuity-cli-cloud-stream-delete) | `agentuity cloud stream delete` | Delete a stream by ID (soft delete) | +| [agentuity-cli-cloud-stream-get](./agentuity-cli-cloud-stream-get) | `agentuity cloud stream get` | Get detailed information about a specific stream | +| [agentuity-cli-cloud-stream-list](./agentuity-cli-cloud-stream-list) | `agentuity cloud stream list` | List recent streams with optional filtering | +| [agentuity-cli-cloud-thread-delete](./agentuity-cli-cloud-thread-delete) | `agentuity cloud thread delete` | Delete a thread | +| [agentuity-cli-cloud-thread-get](./agentuity-cli-cloud-thread-get) | `agentuity cloud thread get` | Get details about a specific thread | +| [agentuity-cli-cloud-thread-list](./agentuity-cli-cloud-thread-list) | `agentuity cloud thread list` | List recent threads | +| [agentuity-cli-cloud-vector-delete](./agentuity-cli-cloud-vector-delete) | `agentuity cloud vector delete` | Delete one or more vectors by key | +| [agentuity-cli-cloud-vector-delete-namespace](./agentuity-cli-cloud-vector-delete-namespace) | `agentuity cloud vector delete-namespace` | Delete a vector namespace and all its vectors | +| [agentuity-cli-cloud-vector-get](./agentuity-cli-cloud-vector-get) | `agentuity cloud vector get` | Get a specific vector entry by key | +| [agentuity-cli-cloud-vector-list-namespaces](./agentuity-cli-cloud-vector-list-namespaces) | `agentuity cloud vector list-namespaces` | List all vector namespaces | +| [agentuity-cli-cloud-vector-search](./agentuity-cli-cloud-vector-search) | `agentuity cloud vector search` | Search for vectors using semantic similarity | +| [agentuity-cli-cloud-vector-stats](./agentuity-cli-cloud-vector-stats) | `agentuity cloud vector stats` | Get statistics for vector storage | +| [agentuity-cli-cloud-vector-upsert](./agentuity-cli-cloud-vector-upsert) | `agentuity cloud vector upsert` | Add or update vectors in the vector storage | + +### dev + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-dev](./agentuity-cli-dev) | `agentuity dev` | Build and run the development server | + +### profile + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-profile-create](./agentuity-cli-profile-create) | `agentuity profile create` | Create a new configuration profile | +| [agentuity-cli-profile-current](./agentuity-cli-profile-current) | `agentuity profile current` | Show the name of the currently active profile | +| [agentuity-cli-profile-delete](./agentuity-cli-profile-delete) | `agentuity profile delete` | Delete a configuration profile | +| [agentuity-cli-profile-list](./agentuity-cli-profile-list) | `agentuity profile list` | List all available profiles | +| [agentuity-cli-profile-show](./agentuity-cli-profile-show) | `agentuity profile show` | Show the configuration of a profile | +| [agentuity-cli-profile-use](./agentuity-cli-profile-use) | `agentuity profile use` | Switch to a different configuration profile | + +### project + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-project-create](./agentuity-cli-project-create) | `agentuity project create` | Create a new project | +| [agentuity-cli-project-delete](./agentuity-cli-project-delete) | `agentuity project delete` | Delete a project | +| [agentuity-cli-project-list](./agentuity-cli-project-list) | `agentuity project list` | List all projects | +| [agentuity-cli-project-show](./agentuity-cli-project-show) | `agentuity project show` | Show project detail | + +### repl + +| Skill | Command | Description | +|-------|---------|-------------| +| [agentuity-cli-repl](./agentuity-cli-repl) | `agentuity repl` | interactive REPL for testing | + +## Usage + +These skills are designed for AI coding agents that support the Agent Skills format. +Place this directory in your project or install globally for your agent to discover. + +## Regenerating + +To regenerate these skills with the latest CLI schema: + +```bash +agentuity ai skills generate --output ./skills +``` + +--- + +*This file was auto-generated by the Agentuity CLI. Do not edit manually.* diff --git a/doc-agents/.agents/skills/agentuity-cli-auth-login/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-auth-login/SKILL.md new file mode 100644 index 00000000..9a6dffc8 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-auth-login/SKILL.md @@ -0,0 +1,34 @@ +--- +name: agentuity-cli-auth-login +description: "Login to the Agentuity Platform using a browser-based authentication flow. Use for managing authentication credentials" +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity auth login" + tags: "mutating creates-resource slow api-intensive" +--- + +# Auth Login + +Login to the Agentuity Platform using a browser-based authentication flow + +## Usage + +```bash +agentuity auth login +``` + +## Examples + +Login to account: + +```bash +bunx @agentuity/cli auth login +``` + +Login to account: + +```bash +bunx @agentuity/cli login +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-auth-logout/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-auth-logout/SKILL.md new file mode 100644 index 00000000..1c4611de --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-auth-logout/SKILL.md @@ -0,0 +1,34 @@ +--- +name: agentuity-cli-auth-logout +description: Logout of the Agentuity Cloud Platform. Use for managing authentication credentials +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity auth logout" + tags: "mutating deletes-resource fast requires-auth" +--- + +# Auth Logout + +Logout of the Agentuity Cloud Platform + +## Usage + +```bash +agentuity auth logout +``` + +## Examples + +Logout from account: + +```bash +bunx @agentuity/cli auth logout +``` + +Logout from account: + +```bash +bunx @agentuity/cli logout +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-auth-ssh-add/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-auth-ssh-add/SKILL.md new file mode 100644 index 00000000..f5deb901 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-auth-ssh-add/SKILL.md @@ -0,0 +1,76 @@ +--- +name: agentuity-cli-auth-ssh-add +description: Add an SSH public key to your account (reads from file or stdin). Requires authentication. Use for managing authentication credentials +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity auth ssh add" + tags: "mutating creates-resource slow requires-auth" +--- + +# Auth Ssh Add + +Add an SSH public key to your account (reads from file or stdin) + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity auth ssh add [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--file` | string | Yes | - | File containing the public key | + +## Examples + +Add SSH key interactively: + +```bash +bunx @agentuity/cli auth ssh add +``` + +Add SSH key from file: + +```bash +bunx @agentuity/cli auth ssh add --file ~/.ssh/id_ed25519.pub +``` + +Add deploy key from file: + +```bash +bunx @agentuity/cli auth ssh add --file ./deploy_key.pub +``` + +Add SSH key from stdin: + +```bash +cat ~/.ssh/id_rsa.pub | bunx @agentuity/cli auth ssh add +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "fingerprint": "string", + "keyType": "string", + "added": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `fingerprint` | string | SSH key fingerprint | +| `keyType` | string | SSH key type (e.g., ssh-rsa, ssh-ed25519) | +| `added` | number | Number of keys added | diff --git a/doc-agents/.agents/skills/agentuity-cli-auth-ssh-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-auth-ssh-delete/SKILL.md new file mode 100644 index 00000000..9ca7c364 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-auth-ssh-delete/SKILL.md @@ -0,0 +1,81 @@ +--- +name: agentuity-cli-auth-ssh-delete +description: Delete an SSH key from your account. Requires authentication. Use for managing authentication credentials +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[fingerprints...]" +metadata: + command: "agentuity auth ssh delete" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Auth Ssh Delete + +Delete an SSH key from your account + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity auth ssh delete [fingerprints...] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | array | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | No | `true` | prompt for confirmation before deletion | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli auth ssh delete +``` + +Delete item: + +```bash +bunx @agentuity/cli auth ssh delete +``` + +Delete item: + +```bash +bunx @agentuity/cli --explain auth ssh delete abc123 +``` + +Delete item: + +```bash +bunx @agentuity/cli --dry-run auth ssh delete abc123 +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "removed": "number", + "fingerprints": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `removed` | number | Number of keys removed | +| `fingerprints` | array | Fingerprints of removed keys | diff --git a/doc-agents/.agents/skills/agentuity-cli-auth-ssh-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-auth-ssh-list/SKILL.md new file mode 100644 index 00000000..fd23385e --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-auth-ssh-list/SKILL.md @@ -0,0 +1,48 @@ +--- +name: agentuity-cli-auth-ssh-list +description: List all SSH keys on your account. Requires authentication. Use for managing authentication credentials +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity auth ssh list" + tags: "read-only fast requires-auth" +--- + +# Auth Ssh List + +List all SSH keys on your account + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity auth ssh list +``` + +## Examples + +List items: + +```bash +bunx @agentuity/cli auth ssh list +``` + +List items: + +```bash +bunx @agentuity/cli auth ssh ls +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json auth ssh list +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-auth-whoami/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-auth-whoami/SKILL.md new file mode 100644 index 00000000..7cea490d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-auth-whoami/SKILL.md @@ -0,0 +1,58 @@ +--- +name: agentuity-cli-auth-whoami +description: Display information about the currently authenticated user. Requires authentication. Use for managing authentication credentials +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity auth whoami" + tags: "read-only fast requires-auth" +--- + +# Auth Whoami + +Display information about the currently authenticated user + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity auth whoami +``` + +## Examples + +Show current user: + +```bash +bunx @agentuity/cli auth whoami +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json auth whoami +``` + +## Output + +Returns JSON object: + +```json +{ + "userId": "string", + "firstName": "string", + "lastName": "string", + "organizations": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `userId` | string | Unique user identifier | +| `firstName` | string | User first name | +| `lastName` | string | User last name | +| `organizations` | array | Organizations the user belongs to | diff --git a/doc-agents/.agents/skills/agentuity-cli-build/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-build/SKILL.md new file mode 100644 index 00000000..20620237 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-build/SKILL.md @@ -0,0 +1,40 @@ +--- +name: agentuity-cli-build +description: Build Agentuity application for deployment +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity build" + tags: "read-only slow requires-project" +--- + +# Build + +Build Agentuity application for deployment + +## Usage + +```bash +agentuity build +``` + +## Examples + +Build the project: + +```bash +bunx @agentuity/cli build +``` + +Run in development mode: + +```bash +bunx @agentuity/cli build --dev +``` + +Bundle the project: + +```bash +bunx @agentuity/cli bundle +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-agent-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-agent-get/SKILL.md new file mode 100644 index 00000000..985c9a58 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-agent-get/SKILL.md @@ -0,0 +1,77 @@ +--- +name: agentuity-cli-cloud-agent-get +description: Get details about a specific agent. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud agent get" +--- + +# Cloud Agent Get + +Get details about a specific agent + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud agent get +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Get item details: + +```bash +bunx @agentuity/cli cloud agent get agent_abc123 +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json cloud agent get agent_abc123 +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "name": "string", + "description": "unknown", + "identifier": "string", + "deploymentId": "unknown", + "devmode": "boolean", + "metadata": "unknown", + "createdAt": "string", + "updatedAt": "string", + "evals": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | - | +| `name` | string | - | +| `description` | unknown | - | +| `identifier` | string | - | +| `deploymentId` | unknown | - | +| `devmode` | boolean | - | +| `metadata` | unknown | - | +| `createdAt` | string | - | +| `updatedAt` | string | - | +| `evals` | array | - | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-agent-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-agent-list/SKILL.md new file mode 100644 index 00000000..963f5e06 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-agent-list/SKILL.md @@ -0,0 +1,55 @@ +--- +name: agentuity-cli-cloud-agent-list +description: List agents for a project. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud agent list" +--- + +# Cloud Agent List + +List agents for a project + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud agent list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--deploymentId` | string | Yes | - | Filter by deployment ID | +| `--verbose` | boolean | No | `false` | Show full descriptions | + +## Examples + +List items: + +```bash +bunx @agentuity/cli cloud agent list +``` + +Use verbose option: + +```bash +bunx @agentuity/cli cloud agent list --verbose +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json cloud agent list +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-create/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-create/SKILL.md new file mode 100644 index 00000000..81c9d029 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-create/SKILL.md @@ -0,0 +1,69 @@ +--- +name: agentuity-cli-cloud-apikey-create +description: Create a new API key. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud apikey create" + tags: "destructive creates-resource slow requires-auth" +--- + +# Cloud Apikey Create + +Create a new API key + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud apikey create [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--name` | string | Yes | - | the name for the API key | +| `--expires-at` | string | Yes | - | expiration date as ISO 8601 (2025-12-31T23:59:59Z) or duration (1h, 2d, 30d, 1y) | +| `--confirm` | boolean | Yes | - | Skip confirmation prompts (required for non-TTY) | + +## Examples + +Create API key with 1 year expiration: + +```bash +bunx @agentuity/cli cloud apikey create --name "My API Key" --expires-at 1y +``` + +Create API key with 30 day expiration: + +```bash +bunx @agentuity/cli cloud apikey create --name "Short-lived Key" --expires-at 30d +``` + +Create API key with specific date and skip confirmation: + +```bash +bunx @agentuity/cli cloud apikey create --name "Production Key" --expires-at 2026-01-01T00:00:00Z --confirm +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "value": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | the API key id | +| `value` | string | the API key value | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-delete/SKILL.md new file mode 100644 index 00000000..a15c4afd --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-delete/SKILL.md @@ -0,0 +1,67 @@ +--- +name: agentuity-cli-cloud-apikey-delete +description: Delete an API key (soft delete). Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud apikey delete" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Cloud Apikey Delete + +Delete an API key (soft delete) + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud apikey delete +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli cloud apikey delete +``` + +Run command: + +```bash +bunx @agentuity/cli cloud apikey del +``` + +Delete item: + +```bash +bunx @agentuity/cli cloud apikey rm +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "id": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `id` | string | API key id that was deleted | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-get/SKILL.md new file mode 100644 index 00000000..61fc210b --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-get/SKILL.md @@ -0,0 +1,39 @@ +--- +name: agentuity-cli-cloud-apikey-get +description: Get a specific API key by id. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud apikey get" + tags: "read-only fast requires-auth" +--- + +# Cloud Apikey Get + +Get a specific API key by id + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud apikey get +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Get item details: + +```bash +bunx @agentuity/cli cloud apikey get +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-list/SKILL.md new file mode 100644 index 00000000..55614890 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-apikey-list/SKILL.md @@ -0,0 +1,45 @@ +--- +name: agentuity-cli-cloud-apikey-list +description: List all API keys. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud apikey list" + tags: "read-only fast requires-auth" +--- + +# Cloud Apikey List + +List all API keys + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud apikey list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--orgId` | string | Yes | - | filter by organization id | +| `--projectId` | string | Yes | - | filter by project id | + +## Examples + +List items: + +```bash +bunx @agentuity/cli cloud apikey list +``` + +List items: + +```bash +bunx @agentuity/cli cloud apikey ls +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-db-create/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-db-create/SKILL.md new file mode 100644 index 00000000..dca92730 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-db-create/SKILL.md @@ -0,0 +1,73 @@ +--- +name: agentuity-cli-cloud-db-create +description: Create a new database resource. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud db create" + tags: "mutating creates-resource slow requires-auth requires-deployment" +--- + +# Cloud Db Create + +Create a new database resource + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud db create [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--name` | string | Yes | - | Custom database name | + +## Examples + +Create new item: + +```bash +bunx @agentuity/cli cloud db create +``` + +Run new command: + +```bash +bunx @agentuity/cli cloud db new +``` + +Create new item: + +```bash +bunx @agentuity/cli cloud db create --name my-db +``` + +Create new item: + +```bash +bunx @agentuity/cli --dry-run cloud db create +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether creation succeeded | +| `name` | string | Created database name | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-db-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-db-delete/SKILL.md new file mode 100644 index 00000000..1292f189 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-db-delete/SKILL.md @@ -0,0 +1,80 @@ +--- +name: agentuity-cli-cloud-db-delete +description: Delete a database resource. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name]" +metadata: + command: "agentuity cloud db delete" + tags: "destructive deletes-resource slow requires-auth requires-deployment" +--- + +# Cloud Db Delete + +Delete a database resource + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud db delete [name] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | Yes | - | Skip confirmation prompts | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli cloud db delete my-database +``` + +Delete item: + +```bash +bunx @agentuity/cli cloud db rm my-database +``` + +Delete item: + +```bash +bunx @agentuity/cli cloud db delete +``` + +Delete item: + +```bash +bunx @agentuity/cli --dry-run cloud db delete my-database +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether deletion succeeded | +| `name` | string | Deleted database name | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-db-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-db-get/SKILL.md new file mode 100644 index 00000000..52074f9f --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-db-get/SKILL.md @@ -0,0 +1,78 @@ +--- +name: agentuity-cli-cloud-db-get +description: Show details about a specific database. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud db get" + tags: "read-only fast requires-auth" +--- + +# Cloud Db Get + +Show details about a specific database + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud db get [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--showCredentials` | boolean | Yes | - | Show credentials in plain text (default: masked in terminal, unmasked in JSON) | +| `--showTables` | boolean | Yes | - | Fetch table schemas from the database | +| `--sql` | boolean | Yes | - | Output table schemas as SQL CREATE statements | + +## Examples + +Get database details: + +```bash +bunx @agentuity/cli cloud db get my-database +``` + +Show database information: + +```bash +bunx @agentuity/cli cloud db show my-database +``` + +Get database with credentials: + +```bash +bunx @agentuity/cli cloud db get my-database --show-credentials +``` + +Get table schemas from the database: + +```bash +bunx @agentuity/cli cloud db get my-database --show-tables +``` + +Get table schemas as SQL CREATE statements: + +```bash +bunx @agentuity/cli cloud db get my-database --show-tables --sql +``` + +Get table schemas as JSON: + +```bash +bunx @agentuity/cli cloud db get my-database --show-tables --json +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-db-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-db-list/SKILL.md new file mode 100644 index 00000000..cbbc36c0 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-db-list/SKILL.md @@ -0,0 +1,72 @@ +--- +name: agentuity-cli-cloud-db-list +description: List database resources. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud db list" + tags: "read-only fast requires-auth" +--- + +# Cloud Db List + +List database resources + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud db list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--showCredentials` | boolean | Yes | - | Show credentials in plain text (default: masked in terminal, unmasked in JSON) | +| `--nameOnly` | boolean | Yes | - | Print the name only | + +## Examples + +List items: + +```bash +bunx @agentuity/cli cloud db list +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json cloud db list +``` + +List items: + +```bash +bunx @agentuity/cli cloud db ls +``` + +Use show credentials option: + +```bash +bunx @agentuity/cli cloud db list --show-credentials +``` + +## Output + +Returns JSON object: + +```json +{ + "databases": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `databases` | array | List of database resources | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-db-logs/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-db-logs/SKILL.md new file mode 100644 index 00000000..cee871c9 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-db-logs/SKILL.md @@ -0,0 +1,108 @@ +--- +name: agentuity-cli-cloud-db-logs +description: Get query logs for a specific database. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud db logs" + tags: "read-only slow requires-auth" +--- + +# Cloud Db Logs + +Get query logs for a specific database + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud db logs [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--startDate` | string | Yes | - | Start date for filtering logs | +| `--endDate` | string | Yes | - | End date for filtering logs | +| `--username` | string | Yes | - | Filter by username | +| `--command` | string | Yes | - | Filter by SQL command type | +| `--hasError` | boolean | Yes | - | Show only queries with errors | +| `--sessionId` | string | Yes | - | Filter by session ID (trace ID) | +| `--showSessionId` | boolean | No | `false` | Show session ID column in output | +| `--showUsername` | boolean | No | `false` | Show username column in output | +| `--pretty` | boolean | No | `false` | Show full formatted SQL on separate line | +| `--limit` | number | No | `100` | Maximum number of logs to return | +| `--timestamps` | boolean | No | `true` | Show timestamps in output | + +## Examples + +View query logs for database: + +```bash +bunx @agentuity/cli cloud db logs my-database +``` + +Limit to 50 log entries: + +```bash +bunx @agentuity/cli cloud db logs my-database --limit=50 +``` + +Show only queries with errors: + +```bash +bunx @agentuity/cli cloud db logs my-database --has-error +``` + +Filter by username: + +```bash +bunx @agentuity/cli cloud db logs my-database --username=user123 +``` + +Filter by SQL command type: + +```bash +bunx @agentuity/cli cloud db logs my-database --command=SELECT +``` + +Filter by session ID: + +```bash +bunx @agentuity/cli cloud db logs my-database --session-id=sess_abc123 +``` + +Show session ID column: + +```bash +bunx @agentuity/cli cloud db logs my-database --show-session-id +``` + +Show username column: + +```bash +bunx @agentuity/cli cloud db logs my-database --show-username +``` + +Show full formatted SQL on separate lines: + +```bash +bunx @agentuity/cli cloud db logs my-database --pretty +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-db-sql/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-db-sql/SKILL.md new file mode 100644 index 00000000..0b090e41 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-db-sql/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-cloud-db-sql +description: Execute SQL query on a database. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud db sql" + tags: "slow requires-auth" +--- + +# Cloud Db Sql + +Execute SQL query on a database + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud db sql +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Execute SQL query: + +```bash +bunx @agentuity/cli cloud db sql my-database "SELECT * FROM users LIMIT 10" +``` + +Execute query with JSON output: + +```bash +bunx @agentuity/cli cloud db exec my-database "SELECT COUNT(*) FROM orders" --json +``` + +Query with filter: + +```bash +bunx @agentuity/cli cloud db query my-database "SELECT * FROM products WHERE price > 100" +``` + +## Output + +Returns JSON object: + +```json +{ + "rows": "array", + "rowCount": "number", + "truncated": "boolean" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `rows` | array | Query results | +| `rowCount` | number | Number of rows returned | +| `truncated` | boolean | Whether results were truncated | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deploy/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deploy/SKILL.md new file mode 100644 index 00000000..c02189c1 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deploy/SKILL.md @@ -0,0 +1,83 @@ +--- +name: agentuity-cli-cloud-deploy +description: Deploy project to the Agentuity Cloud. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud deploy" + tags: "mutating creates-resource slow api-intensive requires-auth requires-project" +--- + +# Cloud Deploy + +Deploy project to the Agentuity Cloud + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) +- auth login + +## Usage + +```bash +agentuity cloud deploy [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--tag` | array | No | `["latest"]` | One or more tags to add to the deployment | +| `--logsUrl` | string | Yes | - | The url to the CI build logs | +| `--trigger` | string | No | `"cli"` | The trigger that caused the build | +| `--commitUrl` | string | Yes | - | The url to the CI commit | +| `--message` | string | Yes | - | The message to associate with this deployment | +| `--provider` | string | Yes | - | The CI provider name (attempts to autodetect) | +| `--event` | string | No | `"manual"` | The event that triggered the deployment | +| `--pullRequestNumber` | number | Yes | - | the pull request number | +| `--pullRequestCommentId` | string | Yes | - | the pull request comment id | +| `--pullRequestURL` | string | Yes | - | the pull request url | + +## Examples + +Deploy current project: + +```bash +bunx @agentuity/cli cloud deploy +``` + +Deploy with verbose output: + +```bash +bunx @agentuity/cli cloud deploy --log-level=debug +``` + +Deploy with specific tags: + +```bash +bunx @agentuity/cli cloud deploy --tag a --tag b +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "deploymentId": "string", + "projectId": "string", + "logs": "array", + "urls": "object" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether deployment succeeded | +| `deploymentId` | string | Deployment ID | +| `projectId` | string | Project ID | +| `logs` | array | The deployment startup logs | +| `urls` | object | Deployment URLs | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-list/SKILL.md new file mode 100644 index 00000000..2b4862eb --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-list/SKILL.md @@ -0,0 +1,55 @@ +--- +name: agentuity-cli-cloud-deployment-list +description: List deployments. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud deployment list" + tags: "read-only slow requires-auth" +--- + +# Cloud Deployment List + +List deployments + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud deployment list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--project-id` | string | Yes | - | Project ID | +| `--count` | number | No | `10` | Number of deployments to list (1–100) | + +## Examples + +List 10 most recent deployments: + +```bash +bunx @agentuity/cli cloud deployment list +``` + +List 25 most recent deployments: + +```bash +bunx @agentuity/cli cloud deployment list --count=25 +``` + +List deployments for specific project: + +```bash +bunx @agentuity/cli cloud deployment list --project-id=proj_abc123xyz +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-logs/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-logs/SKILL.md new file mode 100644 index 00000000..731963d7 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-logs/SKILL.md @@ -0,0 +1,70 @@ +--- +name: agentuity-cli-cloud-deployment-logs +description: View logs for a specific deployment. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud deployment logs" + tags: "read-only fast requires-auth requires-deployment" +--- + +# Cloud Deployment Logs + +View logs for a specific deployment + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud deployment logs [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--projectId` | string | Yes | - | Project ID | +| `--limit` | number | No | `100` | Maximum number of logs to return | +| `--timestamps` | boolean | No | `true` | Show timestamps in output | + +## Examples + +View logs for deployment: + +```bash +bunx @agentuity/cli cloud deployment logs deploy_abc123xyz +``` + +Limit to 50 log entries: + +```bash +bunx @agentuity/cli cloud deployment logs deploy_abc123xyz --limit=50 +``` + +Hide timestamps: + +```bash +bunx @agentuity/cli cloud deployment logs deploy_abc123xyz --no-timestamps +``` + +View logs with specific project: + +```bash +bunx @agentuity/cli cloud deployment logs deploy_abc123xyz --project-id=proj_abc123xyz +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-remove/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-remove/SKILL.md new file mode 100644 index 00000000..f38d737b --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-remove/SKILL.md @@ -0,0 +1,77 @@ +--- +name: agentuity-cli-cloud-deployment-remove +description: Remove a specific deployment. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud deployment remove" + tags: "destructive deletes-resource slow requires-auth requires-deployment" +--- + +# Cloud Deployment Remove + +Remove a specific deployment + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud deployment remove [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--project-id` | string | Yes | - | Project ID | +| `--force` | boolean | No | `false` | Force removal without confirmation | + +## Examples + +Remove with confirmation: + +```bash +bunx @agentuity/cli cloud deployment remove dep_abc123xyz +``` + +Remove without confirmation: + +```bash +bunx @agentuity/cli cloud deployment remove dep_abc123xyz --force +``` + +Remove deployment from specific project: + +```bash +bunx @agentuity/cli cloud deployment remove deployment-2024-11-20 --project-id=proj_abc123xyz +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "projectId": "string", + "deploymentId": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the removal succeeded | +| `projectId` | string | Project ID | +| `deploymentId` | string | Deployment ID that was removed | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-rollback/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-rollback/SKILL.md new file mode 100644 index 00000000..d7bea8d2 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-rollback/SKILL.md @@ -0,0 +1,63 @@ +--- +name: agentuity-cli-cloud-deployment-rollback +description: Rollback the latest to the previous deployment. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud deployment rollback" + tags: "destructive deletes-resource updates-resource slow api-intensive requires-auth requires-deployment" +--- + +# Cloud Deployment Rollback + +Rollback the latest to the previous deployment + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud deployment rollback [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--project-id` | string | Yes | - | Project ID | + +## Examples + +Rollback to previous deployment: + +```bash +bunx @agentuity/cli cloud deployment rollback +``` + +Rollback specific project: + +```bash +bunx @agentuity/cli cloud deployment rollback --project-id=proj_abc123xyz +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "projectId": "string", + "targetDeploymentId": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the rollback succeeded | +| `projectId` | string | Project ID | +| `targetDeploymentId` | string | Deployment ID that was rolled back to | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-show/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-show/SKILL.md new file mode 100644 index 00000000..ef52de21 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-show/SKILL.md @@ -0,0 +1,92 @@ +--- +name: agentuity-cli-cloud-deployment-show +description: Show details about a specific deployment. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud deployment show" + tags: "read-only fast requires-auth requires-deployment" +--- + +# Cloud Deployment Show + +Show details about a specific deployment + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud deployment show [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--project-id` | string | Yes | - | Project ID | + +## Examples + +Show deployment details by ID: + +```bash +bunx @agentuity/cli cloud deployment show dep_abc123xyz +``` + +Show deployment for specific project: + +```bash +bunx @agentuity/cli cloud deployment show deployment-2024-11-20 --project-id=proj_abc123xyz +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "state": "string", + "active": "boolean", + "createdAt": "string", + "updatedAt": "string", + "message": "string", + "tags": "array", + "customDomains": "array", + "cloudRegion": "string", + "resourceDb": "unknown", + "resourceStorage": "unknown", + "deploymentLogsURL": "unknown", + "buildLogsURL": "unknown", + "metadata": "object" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | Deployment ID | +| `state` | string | Deployment state | +| `active` | boolean | Whether deployment is active | +| `createdAt` | string | Creation timestamp | +| `updatedAt` | string | Last update timestamp | +| `message` | string | Deployment message | +| `tags` | array | Deployment tags | +| `customDomains` | array | Custom domains | +| `cloudRegion` | string | Cloud region | +| `resourceDb` | unknown | the database name | +| `resourceStorage` | unknown | the storage name | +| `deploymentLogsURL` | unknown | the url to the deployment logs | +| `buildLogsURL` | unknown | the url to the build logs | +| `metadata` | object | Deployment metadata | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-undeploy/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-undeploy/SKILL.md new file mode 100644 index 00000000..76913643 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-deployment-undeploy/SKILL.md @@ -0,0 +1,52 @@ +--- +name: agentuity-cli-cloud-deployment-undeploy +description: Undeploy the latest deployment. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud deployment undeploy" + tags: "destructive deletes-resource slow requires-auth requires-deployment" +--- + +# Cloud Deployment Undeploy + +Undeploy the latest deployment + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud deployment undeploy [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--project-id` | string | Yes | - | Project ID | +| `--force` | boolean | No | `false` | Force undeploy without confirmation | + +## Examples + +Undeploy with confirmation: + +```bash +bunx @agentuity/cli cloud deployment undeploy +``` + +Undeploy without confirmation: + +```bash +bunx @agentuity/cli cloud deployment undeploy --force +``` + +Undeploy specific project: + +```bash +bunx @agentuity/cli cloud deployment undeploy --project-id=proj_abc123xyz +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-delete/SKILL.md new file mode 100644 index 00000000..1a05687a --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-delete/SKILL.md @@ -0,0 +1,64 @@ +--- +name: agentuity-cli-cloud-env-delete +description: Delete an environment variable. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud env delete" + tags: "destructive deletes-resource slow requires-auth requires-project" +--- + +# Cloud Env Delete + +Delete an environment variable + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud env delete +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli env delete OLD_FEATURE_FLAG +``` + +Delete item: + +```bash +bunx @agentuity/cli env rm PORT +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "key": "string", + "path": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `key` | string | Environment variable key that was deleted | +| `path` | string | Local file path where env var was removed | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-get/SKILL.md new file mode 100644 index 00000000..1af6e931 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-get/SKILL.md @@ -0,0 +1,68 @@ +--- +name: agentuity-cli-cloud-env-get +description: Get an environment variable value. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud env get" + tags: "read-only fast requires-auth requires-project" +--- + +# Cloud Env Get + +Get an environment variable value + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud env get [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--mask` | boolean | No | `false` | mask the value in output (default: true in TTY, false otherwise) | + +## Examples + +Get item details: + +```bash +bunx @agentuity/cli env get NODE_ENV +``` + +Get item details: + +```bash +bunx @agentuity/cli env get LOG_LEVEL +``` + +## Output + +Returns JSON object: + +```json +{ + "key": "string", + "value": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `key` | string | Environment variable key name | +| `value` | string | Environment variable value | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-import/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-import/SKILL.md new file mode 100644 index 00000000..4dcf7baf --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-import/SKILL.md @@ -0,0 +1,68 @@ +--- +name: agentuity-cli-cloud-env-import +description: Import environment variables from a file to cloud and local .env.production. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud env import" + tags: "mutating creates-resource slow api-intensive requires-auth requires-project" +--- + +# Cloud Env Import + +Import environment variables from a file to cloud and local .env.production + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud env import +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Import environment variables from .env file: + +```bash +bunx @agentuity/cli cloud env import .env +``` + +Import from .env.local file: + +```bash +bunx @agentuity/cli cloud env import .env.local +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "imported": "number", + "skipped": "number", + "path": "string", + "file": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether import succeeded | +| `imported` | number | Number of items imported | +| `skipped` | number | Number of items skipped | +| `path` | string | Local file path where variables were saved | +| `file` | string | Source file path | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-list/SKILL.md new file mode 100644 index 00000000..a6f12ecb --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-list/SKILL.md @@ -0,0 +1,49 @@ +--- +name: agentuity-cli-cloud-env-list +description: List all environment variables. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud env list" + tags: "read-only fast requires-auth requires-project" +--- + +# Cloud Env List + +List all environment variables + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud env list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--mask` | boolean | No | `false` | mask the values in output (default: false for env vars) | + +## Examples + +List items: + +```bash +bunx @agentuity/cli env list +``` + +Use mask option: + +```bash +bunx @agentuity/cli env list --mask +``` + +## Output + +Returns: `object` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-pull/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-pull/SKILL.md new file mode 100644 index 00000000..9e9ed8b1 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-pull/SKILL.md @@ -0,0 +1,66 @@ +--- +name: agentuity-cli-cloud-env-pull +description: Pull environment variables from cloud to local .env.production file. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud env pull" + tags: "slow requires-auth requires-project" +--- + +# Cloud Env Pull + +Pull environment variables from cloud to local .env.production file + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) +- cloud deploy + +## Usage + +```bash +agentuity cloud env pull [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--force` | boolean | No | `false` | overwrite local values with cloud values | + +## Examples + +Run pull command: + +```bash +bunx @agentuity/cli env pull +``` + +Use force option: + +```bash +bunx @agentuity/cli env pull --force +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "pulled": "number", + "path": "string", + "force": "boolean" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether pull succeeded | +| `pulled` | number | Number of items pulled | +| `path` | string | Local file path where variables were saved | +| `force` | boolean | Whether force mode was used | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-push/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-push/SKILL.md new file mode 100644 index 00000000..a6101d8a --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-push/SKILL.md @@ -0,0 +1,52 @@ +--- +name: agentuity-cli-cloud-env-push +description: Push environment variables from local .env.production file to cloud. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud env push" + tags: "mutating updates-resource slow api-intensive requires-auth requires-project" +--- + +# Cloud Env Push + +Push environment variables from local .env.production file to cloud + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) +- env set + +## Usage + +```bash +agentuity cloud env push +``` + +## Examples + +Run push command: + +```bash +bunx @agentuity/cli env push +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "pushed": "number", + "source": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether push succeeded | +| `pushed` | number | Number of items pushed | +| `source` | string | Source file path | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-env-set/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-env-set/SKILL.md new file mode 100644 index 00000000..50536f42 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-env-set/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-cloud-env-set +description: Set an environment variable. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud env set" + tags: "mutating updates-resource slow requires-auth requires-project" +--- + +# Cloud Env Set + +Set an environment variable + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud env set +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Run production command: + +```bash +bunx @agentuity/cli env set NODE_ENV production +``` + +Run 3000 command: + +```bash +bunx @agentuity/cli env set PORT 3000 +``` + +Run debug command: + +```bash +bunx @agentuity/cli env set LOG_LEVEL debug +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "key": "string", + "path": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `key` | string | Environment variable key | +| `path` | string | Local file path where env var was saved | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-create-namespace/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-create-namespace/SKILL.md new file mode 100644 index 00000000..26cdfca3 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-create-namespace/SKILL.md @@ -0,0 +1,70 @@ +--- +name: agentuity-cli-cloud-keyvalue-create-namespace +description: Create a new keyvalue namespace. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud keyvalue create-namespace" + tags: "mutating creates-resource slow requires-auth" +--- + +# Cloud Keyvalue Create-namespace + +Create a new keyvalue namespace + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue create-namespace +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Create production namespace: + +```bash +bunx @agentuity/cli kv create-namespace production +``` + +Create staging namespace (using alias): + +```bash +bunx @agentuity/cli kv create staging +``` + +Create cache namespace: + +```bash +bunx @agentuity/cli kv create cache +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "message": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `namespace` | string | Namespace name | +| `message` | string | Success message | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-delete-namespace/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-delete-namespace/SKILL.md new file mode 100644 index 00000000..692fa145 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-delete-namespace/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-cloud-keyvalue-delete-namespace +description: Delete a keyvalue namespace and all its keys. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud keyvalue delete-namespace" + tags: "destructive deletes-resource slow requires-auth requires-project" +--- + +# Cloud Keyvalue Delete-namespace + +Delete a keyvalue namespace and all its keys + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue delete-namespace +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Delete staging namespace (interactive): + +```bash +bunx @agentuity/cli kv delete-namespace staging +``` + +Delete cache without confirmation: + +```bash +bunx @agentuity/cli kv rm-namespace cache --confirm +``` + +Force delete production: + +```bash +bunx @agentuity/cli kv delete-namespace production --confirm +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "message": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the deletion succeeded | +| `namespace` | string | Deleted namespace name | +| `message` | string | Confirmation message | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-delete/SKILL.md new file mode 100644 index 00000000..1b83a443 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-delete/SKILL.md @@ -0,0 +1,73 @@ +--- +name: agentuity-cli-cloud-keyvalue-delete +description: Delete a key from the keyvalue storage. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud keyvalue delete" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Cloud Keyvalue Delete + +Delete a key from the keyvalue storage + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue delete +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Delete user data: + +```bash +bunx @agentuity/cli kv delete production user:123 +``` + +Delete cached session: + +```bash +bunx @agentuity/cli kv delete cache session:abc +``` + +Delete homepage cache (using alias): + +```bash +bunx @agentuity/cli kv rm staging cache:homepage +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "key": "string", + "durationMs": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `namespace` | string | Namespace name | +| `key` | string | Key name | +| `durationMs` | number | Operation duration in milliseconds | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-get/SKILL.md new file mode 100644 index 00000000..f1762645 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-get/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-cloud-keyvalue-get +description: Get a value from the keyvalue storage. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud keyvalue get" + tags: "read-only fast requires-auth" +--- + +# Cloud Keyvalue Get + +Get a value from the keyvalue storage + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue get +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Get user data: + +```bash +bunx @agentuity/cli kv get production user:123 +``` + +Get cached session: + +```bash +bunx @agentuity/cli kv get cache session:abc +``` + +Get homepage cache: + +```bash +bunx @agentuity/cli kv get staging cache:homepage +``` + +## Output + +Returns JSON object: + +```json +{ + "exists": "boolean", + "data": "unknown", + "contentType": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `exists` | boolean | Whether the key exists | +| `data` | unknown | Value data (string or binary) | +| `contentType` | string | Content type | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-keys/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-keys/SKILL.md new file mode 100644 index 00000000..e63fda63 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-keys/SKILL.md @@ -0,0 +1,68 @@ +--- +name: agentuity-cli-cloud-keyvalue-keys +description: List all keys in a keyvalue namespace. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud keyvalue keys" + tags: "read-only slow requires-auth" +--- + +# Cloud Keyvalue Keys + +List all keys in a keyvalue namespace + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue keys +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +List all keys in production: + +```bash +bunx @agentuity/cli kv keys production +``` + +List all cached keys (using alias): + +```bash +bunx @agentuity/cli kv ls cache +``` + +List all staging keys: + +```bash +bunx @agentuity/cli kv list staging +``` + +## Output + +Returns JSON object: + +```json +{ + "namespace": "string", + "keys": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `namespace` | string | Namespace name | +| `keys` | array | List of keys in the namespace | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-list-namespaces/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-list-namespaces/SKILL.md new file mode 100644 index 00000000..319dee10 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-list-namespaces/SKILL.md @@ -0,0 +1,49 @@ +--- +name: agentuity-cli-cloud-keyvalue-list-namespaces +description: List all keyvalue namespaces. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud keyvalue list-namespaces" + tags: "read-only fast requires-auth" +--- + +# Cloud Keyvalue List-namespaces + +List all keyvalue namespaces + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue list-namespaces +``` + +## Examples + +List all namespaces: + +```bash +bunx @agentuity/cli kv list-namespaces +``` + +List namespaces (using alias): + +```bash +bunx @agentuity/cli kv namespaces +``` + +List namespaces (short alias): + +```bash +bunx @agentuity/cli kv ns +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-repl/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-repl/SKILL.md new file mode 100644 index 00000000..4d4aa816 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-repl/SKILL.md @@ -0,0 +1,33 @@ +--- +name: agentuity-cli-cloud-keyvalue-repl +description: Start an interactive repl for working with keyvalue database. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud keyvalue repl" + tags: "slow requires-auth" +--- + +# Cloud Keyvalue Repl + +Start an interactive repl for working with keyvalue database + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue repl +``` + +## Examples + +Start interactive KV session: + +```bash +bunx @agentuity/cli kv repl +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-search/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-search/SKILL.md new file mode 100644 index 00000000..e522c9bd --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-search/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-cloud-keyvalue-search +description: Search for keys matching a keyword in a keyvalue namespace. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud keyvalue search" + tags: "read-only slow requires-auth" +--- + +# Cloud Keyvalue Search + +Search for keys matching a keyword in a keyvalue namespace + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue search +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Find all user-related keys: + +```bash +bunx @agentuity/cli kv search production user +``` + +Find all session keys in cache: + +```bash +bunx @agentuity/cli kv search cache session +``` + +Find all config keys: + +```bash +bunx @agentuity/cli kv search staging config +``` + +## Output + +Returns JSON object: + +```json +{ + "namespace": "string", + "keyword": "string", + "results": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `namespace` | string | Namespace name | +| `keyword` | string | Search keyword used | +| `results` | array | - | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-set/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-set/SKILL.md new file mode 100644 index 00000000..4e2a6d20 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-set/SKILL.md @@ -0,0 +1,79 @@ +--- +name: agentuity-cli-cloud-keyvalue-set +description: Set a key and value in the keyvalue storage. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " [ttl]" +metadata: + command: "agentuity cloud keyvalue set" + tags: "mutating updates-resource slow requires-auth" +--- + +# Cloud Keyvalue Set + +Set a key and value in the keyvalue storage + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue set [ttl] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | +| `` | string | Yes | - | +| `` | string | No | - | + +## Examples + +Store user data: + +```bash +bunx @agentuity/cli kv set production user:123 '{"name":"Alice","email":"alice@example.com"}' +``` + +Store session with 1h TTL: + +```bash +bunx @agentuity/cli kv set cache session:abc "session-data-here" --ttl 3600 +``` + +Cache homepage for 10m: + +```bash +bunx @agentuity/cli kv set staging cache:homepage "..." --ttl 600 +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "key": "string", + "contentType": "string", + "durationMs": "number", + "ttl": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `namespace` | string | Namespace name | +| `key` | string | Key name | +| `contentType` | string | Content type (application/json or text/plain) | +| `durationMs` | number | Operation duration in milliseconds | +| `ttl` | number | TTL in seconds if set | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-stats/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-stats/SKILL.md new file mode 100644 index 00000000..e2abfc7d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-keyvalue-stats/SKILL.md @@ -0,0 +1,52 @@ +--- +name: agentuity-cli-cloud-keyvalue-stats +description: Get statistics for keyvalue storage. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name]" +metadata: + command: "agentuity cloud keyvalue stats" + tags: "read-only fast requires-auth" +--- + +# Cloud Keyvalue Stats + +Get statistics for keyvalue storage + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud keyvalue stats [name] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Examples + +Show stats for all namespaces: + +```bash +bunx @agentuity/cli kv stats +``` + +Show stats for production namespace: + +```bash +bunx @agentuity/cli kv stats production +``` + +Show stats for cache namespace: + +```bash +bunx @agentuity/cli kv stats cache +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-redis-show/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-redis-show/SKILL.md new file mode 100644 index 00000000..97219275 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-redis-show/SKILL.md @@ -0,0 +1,65 @@ +--- +name: agentuity-cli-cloud-redis-show +description: Show Redis connection URL. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud redis show" + tags: "read-only fast requires-auth" +--- + +# Cloud Redis Show + +Show Redis connection URL + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud redis show [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--showCredentials` | boolean | Yes | - | Show credentials in plain text (default: masked in terminal, unmasked in JSON) | + +## Examples + +Show Redis connection URL: + +```bash +bunx @agentuity/cli cloud redis show +``` + +Show Redis URL with credentials visible: + +```bash +bunx @agentuity/cli cloud redis show --show-credentials +``` + +Show Redis URL as JSON: + +```bash +bunx @agentuity/cli --json cloud redis show +``` + +## Output + +Returns JSON object: + +```json +{ + "url": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `url` | string | Redis connection URL | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-scp-download/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-scp-download/SKILL.md new file mode 100644 index 00000000..645aebea --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-scp-download/SKILL.md @@ -0,0 +1,85 @@ +--- +name: agentuity-cli-cloud-scp-download +description: Download a file using security copy. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " [destination]" +metadata: + command: "agentuity cloud scp download" + tags: "read-only slow requires-auth requires-deployment" +--- + +# Cloud Scp Download + +Download a file using security copy + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud scp download [destination] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--identifier` | string | Yes | - | The project or deployment id to use | + +## Examples + +Download to current directory: + +```bash +bunx @agentuity/cli cloud scp download /var/log/app.log +``` + +Download to specific path: + +```bash +bunx @agentuity/cli cloud scp download /var/log/app.log ./logs/ +``` + +Download from specific project: + +```bash +bunx @agentuity/cli cloud scp download /app/config.json --identifier=proj_abc123xyz +``` + +Download multiple files: + +```bash +bunx @agentuity/cli cloud scp download ~/logs/*.log ./logs/ +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "source": "string", + "destination": "string", + "identifier": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether download succeeded | +| `source` | string | Remote source path | +| `destination` | string | Local destination path | +| `identifier` | string | Project or deployment identifier | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-scp-upload/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-scp-upload/SKILL.md new file mode 100644 index 00000000..1efd04aa --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-scp-upload/SKILL.md @@ -0,0 +1,85 @@ +--- +name: agentuity-cli-cloud-scp-upload +description: Upload a file using security copy. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " [destination]" +metadata: + command: "agentuity cloud scp upload" + tags: "mutating updates-resource slow requires-auth requires-deployment" +--- + +# Cloud Scp Upload + +Upload a file using security copy + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud scp upload [destination] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--identifier` | string | Yes | - | The project or deployment id to use | + +## Examples + +Upload to remote home directory: + +```bash +bunx @agentuity/cli cloud scp upload ./config.json +``` + +Upload to specific path: + +```bash +bunx @agentuity/cli cloud scp upload ./config.json /app/config.json +``` + +Upload to specific project: + +```bash +bunx @agentuity/cli cloud scp upload ./config.json --identifier=proj_abc123xyz +``` + +Upload multiple files: + +```bash +bunx @agentuity/cli cloud scp upload ./logs/*.log ~/logs/ +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "source": "string", + "destination": "string", + "identifier": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether upload succeeded | +| `source` | string | Local source path | +| `destination` | string | Remote destination path | +| `identifier` | string | Project or deployment identifier | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-delete/SKILL.md new file mode 100644 index 00000000..68ce9284 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-delete/SKILL.md @@ -0,0 +1,64 @@ +--- +name: agentuity-cli-cloud-secret-delete +description: Delete a secret. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud secret delete" + tags: "destructive deletes-resource slow requires-auth requires-project" +--- + +# Cloud Secret Delete + +Delete a secret + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud secret delete +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli secret delete OLD_API_KEY +``` + +Delete item: + +```bash +bunx @agentuity/cli secret rm DATABASE_URL +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "key": "string", + "path": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `key` | string | Secret key name that was deleted | +| `path` | string | Local file path where secret was removed | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-get/SKILL.md new file mode 100644 index 00000000..1ba03cae --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-get/SKILL.md @@ -0,0 +1,68 @@ +--- +name: agentuity-cli-cloud-secret-get +description: Get a secret value. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud secret get" + tags: "read-only fast requires-auth requires-project" +--- + +# Cloud Secret Get + +Get a secret value + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud secret get [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--mask` | boolean | No | `true` | mask the value in output (default: true in TTY, false otherwise) | + +## Examples + +Get item details: + +```bash +bunx @agentuity/cli secret get DATABASE_URL +``` + +Use no mask option: + +```bash +bunx @agentuity/cli secret get STRIPE_SECRET_KEY --no-mask +``` + +## Output + +Returns JSON object: + +```json +{ + "key": "string", + "value": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `key` | string | Secret key name | +| `value` | string | Secret value | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-import/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-import/SKILL.md new file mode 100644 index 00000000..168a7027 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-import/SKILL.md @@ -0,0 +1,68 @@ +--- +name: agentuity-cli-cloud-secret-import +description: Import secrets from a file to cloud and local .env.production. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud secret import" + tags: "mutating creates-resource slow api-intensive requires-auth requires-project" +--- + +# Cloud Secret Import + +Import secrets from a file to cloud and local .env.production + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud secret import +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Run .env.local command: + +```bash +bunx @agentuity/cli secret import .env.local +``` + +Run .env.production.backup command: + +```bash +bunx @agentuity/cli secret import .env.production.backup +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "imported": "number", + "skipped": "number", + "path": "string", + "file": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether import succeeded | +| `imported` | number | Number of items imported | +| `skipped` | number | Number of items skipped | +| `path` | string | Local file path where secrets were saved | +| `file` | string | Source file path | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-list/SKILL.md new file mode 100644 index 00000000..49d9bf55 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-list/SKILL.md @@ -0,0 +1,49 @@ +--- +name: agentuity-cli-cloud-secret-list +description: List all secrets. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud secret list" + tags: "read-only fast requires-auth requires-project" +--- + +# Cloud Secret List + +List all secrets + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud secret list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--mask` | boolean | No | `true` | mask the values in output (default: true in TTY for secrets) | + +## Examples + +List items: + +```bash +bunx @agentuity/cli secret list +``` + +Use no mask option: + +```bash +bunx @agentuity/cli secret list --no-mask +``` + +## Output + +Returns: `object` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-pull/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-pull/SKILL.md new file mode 100644 index 00000000..9beba945 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-pull/SKILL.md @@ -0,0 +1,66 @@ +--- +name: agentuity-cli-cloud-secret-pull +description: Pull secrets from cloud to local .env.production file. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud secret pull" + tags: "slow requires-auth requires-project" +--- + +# Cloud Secret Pull + +Pull secrets from cloud to local .env.production file + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) +- cloud deploy + +## Usage + +```bash +agentuity cloud secret pull [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--force` | boolean | No | `false` | overwrite local values with cloud values | + +## Examples + +Run pull command: + +```bash +bunx @agentuity/cli secret pull +``` + +Use force option: + +```bash +bunx @agentuity/cli secret pull --force +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "pulled": "number", + "path": "string", + "force": "boolean" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether pull succeeded | +| `pulled` | number | Number of items pulled | +| `path` | string | Local file path where secrets were saved | +| `force` | boolean | Whether force mode was used | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-push/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-push/SKILL.md new file mode 100644 index 00000000..0400222d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-push/SKILL.md @@ -0,0 +1,52 @@ +--- +name: agentuity-cli-cloud-secret-push +description: Push secrets from local .env.production file to cloud. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud secret push" + tags: "mutating updates-resource slow api-intensive requires-auth requires-project" +--- + +# Cloud Secret Push + +Push secrets from local .env.production file to cloud + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) +- secret set + +## Usage + +```bash +agentuity cloud secret push +``` + +## Examples + +Run push command: + +```bash +bunx @agentuity/cli secret push +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "pushed": "number", + "source": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether push succeeded | +| `pushed` | number | Number of items pushed | +| `source` | string | Source file path | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-secret-set/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-set/SKILL.md new file mode 100644 index 00000000..0f1cbbc4 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-secret-set/SKILL.md @@ -0,0 +1,65 @@ +--- +name: agentuity-cli-cloud-secret-set +description: Set a secret. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud secret set" + tags: "mutating updates-resource slow requires-auth requires-project" +--- + +# Cloud Secret Set + +Set a secret + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud secret set +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Set the DATABASE_URL environment secret: + +```bash +bunx @agentuity/cli secret set DATABASE_URL "postgres://user:pass@host:5432/db" +``` + +Set the STRIPE_SECRET_KEY environment secret: + +```bash +bunx @agentuity/cli secret set STRIPE_SECRET_KEY "sk_live_..." +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "key": "string", + "path": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `key` | string | Secret key name | +| `path` | string | Local file path where secret was saved | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-session-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-session-get/SKILL.md new file mode 100644 index 00000000..7bb70a7f --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-session-get/SKILL.md @@ -0,0 +1,97 @@ +--- +name: agentuity-cli-cloud-session-get +description: Get details about a specific session. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud session get" + tags: "read-only fast requires-auth" +--- + +# Cloud Session Get + +Get details about a specific session + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud session get +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Get a session by ID: + +```bash +bunx @agentuity/cli cloud session get sess_abc123xyz +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "created_at": "string", + "start_time": "string", + "end_time": "unknown", + "duration": "unknown", + "org_id": "string", + "project_id": "string", + "deployment_id": "string", + "agent_ids": "array", + "trigger": "string", + "env": "string", + "devmode": "boolean", + "pending": "boolean", + "success": "boolean", + "error": "unknown", + "method": "string", + "url": "string", + "route_id": "string", + "thread_id": "string", + "agents": "array", + "eval_runs": "array", + "timeline": "unknown", + "route": "unknown" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | Session ID | +| `created_at` | string | Creation timestamp | +| `start_time` | string | Start time | +| `end_time` | unknown | End time | +| `duration` | unknown | Duration in nanoseconds | +| `org_id` | string | Organization ID | +| `project_id` | string | Project ID | +| `deployment_id` | string | Deployment ID | +| `agent_ids` | array | Agent IDs | +| `trigger` | string | Trigger type | +| `env` | string | Environment | +| `devmode` | boolean | Dev mode | +| `pending` | boolean | Pending | +| `success` | boolean | Success | +| `error` | unknown | Error message | +| `method` | string | HTTP method | +| `url` | string | Request URL | +| `route_id` | string | Route ID | +| `thread_id` | string | Thread ID | +| `agents` | array | Agents | +| `eval_runs` | array | Eval runs | +| `timeline` | unknown | Session timeline | +| `route` | unknown | Route information | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-session-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-session-list/SKILL.md new file mode 100644 index 00000000..bd40056a --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-session-list/SKILL.md @@ -0,0 +1,94 @@ +--- +name: agentuity-cli-cloud-session-list +description: List recent sessions. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud session list" + tags: "read-only fast requires-auth" +--- + +# Cloud Session List + +List recent sessions + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud session list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--count` | number | No | `10` | Number of sessions to list (1–100) | +| `--projectId` | string | Yes | - | Filter by project ID | +| `--deploymentId` | string | Yes | - | Filter by deployment ID | +| `--trigger` | string | Yes | - | Filter by trigger type (api, cron, webhook) | +| `--env` | string | Yes | - | Filter by environment | +| `--threadId` | string | Yes | - | Filter by thread ID | +| `--agentIdentifier` | string | Yes | - | Filter by agent identifier | +| `--devmode` | boolean | Yes | - | Filter by dev mode (true/false) | +| `--success` | boolean | Yes | - | Filter by success status (true/false) | +| `--startAfter` | string | Yes | - | Filter by start time after (ISO 8601) | +| `--startBefore` | string | Yes | - | Filter by start time before (ISO 8601) | + +## Examples + +List 10 most recent sessions: + +```bash +bunx @agentuity/cli cloud session list +``` + +List 25 most recent sessions: + +```bash +bunx @agentuity/cli cloud session list --count=25 +``` + +Filter by project: + +```bash +bunx @agentuity/cli cloud session list --project-id=proj_* +``` + +Filter by deployment: + +```bash +bunx @agentuity/cli cloud session list --deployment-id=* +``` + +Only successful sessions: + +```bash +bunx @agentuity/cli cloud session list --success=true +``` + +Only production sessions: + +```bash +bunx @agentuity/cli cloud session list --devmode=false +``` + +Only API triggered sessions: + +```bash +bunx @agentuity/cli cloud session list --trigger=api +``` + +Only production environment: + +```bash +bunx @agentuity/cli cloud session list --env=production +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-session-logs/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-session-logs/SKILL.md new file mode 100644 index 00000000..38f569c2 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-session-logs/SKILL.md @@ -0,0 +1,57 @@ +--- +name: agentuity-cli-cloud-session-logs +description: Get logs for a specific session. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud session logs" + tags: "read-only slow requires-auth" +--- + +# Cloud Session Logs + +Get logs for a specific session + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud session logs [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--projectId` | string | Yes | - | Project ID (for display purposes) | +| `--deploymentId` | string | Yes | - | Deployment ID (for display purposes) | +| `--timestamps` | boolean | No | `true` | Show timestamps in output | + +## Examples + +View logs for session: + +```bash +bunx @agentuity/cli cloud session logs sess_abc123xyz +``` + +Hide timestamps: + +```bash +bunx @agentuity/cli cloud session logs sess_abc123xyz --no-timestamps +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-ssh/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-ssh/SKILL.md new file mode 100644 index 00000000..eaccd8bd --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-ssh/SKILL.md @@ -0,0 +1,77 @@ +--- +name: agentuity-cli-cloud-ssh +description: SSH into a cloud project. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[identifier] [command]" +metadata: + command: "agentuity cloud ssh" + tags: "read-only slow requires-auth requires-deployment" +--- + +# Cloud Ssh + +SSH into a cloud project + +## Prerequisites + +- Authenticated with `agentuity auth login` +- cloud deploy + +## Usage + +```bash +agentuity cloud ssh [identifier] [command] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--show` | boolean | Yes | - | Show the command and exit | + +## Examples + +SSH into current project: + +```bash +bunx @agentuity/cli cloud ssh +``` + +SSH into specific project: + +```bash +bunx @agentuity/cli cloud ssh proj_abc123xyz +``` + +SSH into specific deployment: + +```bash +bunx @agentuity/cli cloud ssh deploy_abc123xyz +``` + +Run command and exit: + +```bash +bunx @agentuity/cli cloud ssh 'ps aux' +``` + +Run command on specific project: + +```bash +bunx @agentuity/cli cloud ssh proj_abc123xyz 'tail -f /var/log/app.log' +``` + +Show SSH command without executing: + +```bash +bunx @agentuity/cli cloud ssh --show +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-storage-create/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-create/SKILL.md new file mode 100644 index 00000000..caf06e00 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-create/SKILL.md @@ -0,0 +1,61 @@ +--- +name: agentuity-cli-cloud-storage-create +description: Create a new storage resource. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud storage create" + tags: "mutating creates-resource slow requires-auth requires-deployment" +--- + +# Cloud Storage Create + +Create a new storage resource + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud storage create +``` + +## Examples + +Create a new cloud storage bucket: + +```bash +bunx @agentuity/cli cloud storage create +``` + +Alias for "cloud storage create" (shorthand "new"): + +```bash +bunx @agentuity/cli cloud storage new +``` + +Dry-run: display what would be created without making changes: + +```bash +bunx @agentuity/cli --dry-run cloud storage create +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether creation succeeded | +| `name` | string | Created storage bucket name | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-storage-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-delete/SKILL.md new file mode 100644 index 00000000..22897b11 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-delete/SKILL.md @@ -0,0 +1,81 @@ +--- +name: agentuity-cli-cloud-storage-delete +description: Delete a storage resource or file. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name] [filename]" +metadata: + command: "agentuity cloud storage delete" + tags: "destructive deletes-resource slow requires-auth requires-deployment" +--- + +# Cloud Storage Delete + +Delete a storage resource or file + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud storage delete [name] [filename] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | Yes | - | Skip confirmation prompts | + +## Examples + +Delete a storage bucket: + +```bash +bunx @agentuity/cli cloud storage delete my-bucket +``` + +Delete a file from a bucket: + +```bash +bunx @agentuity/cli cloud storage rm my-bucket file.txt +``` + +Interactive selection to delete a bucket: + +```bash +bunx @agentuity/cli cloud storage delete +``` + +Dry-run: show what would be deleted without making changes: + +```bash +bunx @agentuity/cli --dry-run cloud storage delete my-bucket +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether deletion succeeded | +| `name` | string | Deleted bucket or file name | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-storage-download/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-download/SKILL.md new file mode 100644 index 00000000..880b930a --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-download/SKILL.md @@ -0,0 +1,90 @@ +--- +name: agentuity-cli-cloud-storage-download +description: Download a file from storage bucket. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " [output]" +metadata: + command: "agentuity cloud storage download" + tags: "read-only requires-auth" +--- + +# Cloud Storage Download + +Download a file from storage bucket + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud storage download [output] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--metadata` | boolean | Yes | - | Download metadata only (not file contents) | + +## Examples + +Download file from bucket: + +```bash +bunx @agentuity/cli cloud storage download my-bucket file.txt +``` + +Download file to specific path: + +```bash +bunx @agentuity/cli cloud storage download my-bucket file.txt output.txt +``` + +Download file to stdout: + +```bash +bunx @agentuity/cli cloud storage download my-bucket file.txt - > output.txt +``` + +Download metadata only: + +```bash +bunx @agentuity/cli cloud storage download my-bucket file.txt --metadata +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "bucket": "string", + "filename": "string", + "size": "number", + "contentType": "string", + "lastModified": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether download succeeded | +| `bucket` | string | Bucket name | +| `filename` | string | Downloaded filename | +| `size` | number | File size in bytes | +| `contentType` | string | Content type | +| `lastModified` | string | Last modified timestamp | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-storage-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-get/SKILL.md new file mode 100644 index 00000000..6603f317 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-get/SKILL.md @@ -0,0 +1,80 @@ +--- +name: agentuity-cli-cloud-storage-get +description: Show details about a specific storage bucket. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud storage get" + tags: "read-only fast requires-auth" +--- + +# Cloud Storage Get + +Show details about a specific storage bucket + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud storage get [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--showCredentials` | boolean | Yes | - | Show credentials in plain text (default: masked in terminal, unmasked in JSON) | + +## Examples + +Get bucket details: + +```bash +bunx @agentuity/cli cloud storage get my-bucket +``` + +Show bucket information: + +```bash +bunx @agentuity/cli cloud storage show my-bucket +``` + +Get bucket with credentials: + +```bash +bunx @agentuity/cli cloud storage get my-bucket --show-credentials +``` + +## Output + +Returns JSON object: + +```json +{ + "bucket_name": "string", + "access_key": "string", + "secret_key": "string", + "region": "string", + "endpoint": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `bucket_name` | string | Storage bucket name | +| `access_key` | string | S3 access key | +| `secret_key` | string | S3 secret key | +| `region` | string | S3 region | +| `endpoint` | string | S3 endpoint URL | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-storage-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-list/SKILL.md new file mode 100644 index 00000000..2330622d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-list/SKILL.md @@ -0,0 +1,94 @@ +--- +name: agentuity-cli-cloud-storage-list +description: List storage resources or files in a bucket. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name] [prefix]" +metadata: + command: "agentuity cloud storage list" + tags: "read-only fast requires-auth" +--- + +# Cloud Storage List + +List storage resources or files in a bucket + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud storage list [name] [prefix] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--showCredentials` | boolean | Yes | - | Show credentials in plain text (default: masked in terminal, unmasked in JSON) | +| `--nameOnly` | boolean | Yes | - | Print the name only | + +## Examples + +List items: + +```bash +bunx @agentuity/cli cloud storage list +``` + +List items: + +```bash +bunx @agentuity/cli cloud storage list my-bucket +``` + +List items: + +```bash +bunx @agentuity/cli cloud storage list my-bucket path/prefix +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json cloud storage list +``` + +List items: + +```bash +bunx @agentuity/cli cloud storage ls +``` + +Use show credentials option: + +```bash +bunx @agentuity/cli cloud storage list --show-credentials +``` + +## Output + +Returns JSON object: + +```json +{ + "buckets": "array", + "files": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `buckets` | array | List of storage resources | +| `files` | array | List of files in bucket | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-storage-upload/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-upload/SKILL.md new file mode 100644 index 00000000..cbe6df9b --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-storage-upload/SKILL.md @@ -0,0 +1,92 @@ +--- +name: agentuity-cli-cloud-storage-upload +description: Upload a file to storage bucket. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud storage upload" + tags: "write requires-auth" +--- + +# Cloud Storage Upload + +Upload a file to storage bucket + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Organization context required (`--org-id` or default org) + +## Usage + +```bash +agentuity cloud storage upload [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--key` | string | Yes | - | Remote object key (defaults to basename or "stdin" for piped uploads) | +| `--contentType` | string | Yes | - | Content type (auto-detected if not provided) | + +## Examples + +Upload file to bucket: + +```bash +bunx @agentuity/cli cloud storage upload my-bucket file.txt +``` + +Upload file with content type: + +```bash +bunx @agentuity/cli cloud storage put my-bucket file.txt --content-type text/plain +``` + +Upload file with custom object key: + +```bash +bunx @agentuity/cli cloud storage upload my-bucket file.txt --key custom-name.txt +``` + +Upload from stdin: + +```bash +cat file.txt | bunx @agentuity/cli cloud storage upload my-bucket - +``` + +Upload from stdin with custom key: + +```bash +cat data.json | bunx @agentuity/cli cloud storage upload my-bucket - --key data.json +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "bucket": "string", + "filename": "string", + "size": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether upload succeeded | +| `bucket` | string | Bucket name | +| `filename` | string | Uploaded filename | +| `size` | number | File size in bytes | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-stream-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-stream-delete/SKILL.md new file mode 100644 index 00000000..3ca28b6f --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-stream-delete/SKILL.md @@ -0,0 +1,66 @@ +--- +name: agentuity-cli-cloud-stream-delete +description: Delete a stream by ID (soft delete). Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud stream delete" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Cloud Stream Delete + +Delete a stream by ID (soft delete) + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud stream delete +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Delete a stream: + +```bash +bunx @agentuity/cli stream delete stream-id-123 +``` + +Delete stream (using alias): + +```bash +bunx @agentuity/cli stream rm stream-id-456 +``` + +Delete stream (using alias): + +```bash +bunx @agentuity/cli stream del stream-id-789 +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | Stream ID | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-stream-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-stream-get/SKILL.md new file mode 100644 index 00000000..b311282f --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-stream-get/SKILL.md @@ -0,0 +1,86 @@ +--- +name: agentuity-cli-cloud-stream-get +description: Get detailed information about a specific stream. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud stream get" + tags: "read-only slow requires-auth" +--- + +# Cloud Stream Get + +Get detailed information about a specific stream + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud stream get [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--output` | string | Yes | - | download stream content to file | + +## Examples + +Get stream details: + +```bash +bunx @agentuity/cli stream get stream-id-123 +``` + +Get stream as JSON: + +```bash +bunx @agentuity/cli stream get stream-id-123 --json +``` + +Download stream to file: + +```bash +bunx @agentuity/cli stream get stream-id-123 --output stream.dat +``` + +Download stream (short flag): + +```bash +bunx @agentuity/cli stream get stream-id-123 -o stream.dat +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "name": "string", + "metadata": "object", + "url": "string", + "sizeBytes": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | Stream ID | +| `name` | string | Stream name | +| `metadata` | object | Stream metadata | +| `url` | string | Public URL | +| `sizeBytes` | number | Size in bytes | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-stream-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-stream-list/SKILL.md new file mode 100644 index 00000000..630eddfc --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-stream-list/SKILL.md @@ -0,0 +1,82 @@ +--- +name: agentuity-cli-cloud-stream-list +description: List recent streams with optional filtering. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud stream list" + tags: "read-only slow requires-auth" +--- + +# Cloud Stream List + +List recent streams with optional filtering + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud stream list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--size` | number | Yes | - | maximum number of streams to return (default: 100) | +| `--offset` | number | Yes | - | number of streams to skip for pagination | +| `--name` | string | Yes | - | filter by stream name | +| `--metadata` | string | Yes | - | filter by metadata (format: key=value or key1=value1,key2=value2) | + +## Examples + +List all streams: + +```bash +bunx @agentuity/cli cloud stream list +``` + +List 50 most recent streams: + +```bash +bunx @agentuity/cli cloud stream ls --size 50 +``` + +Filter by name: + +```bash +bunx @agentuity/cli cloud stream list --name agent-logs +``` + +Filter by metadata: + +```bash +bunx @agentuity/cli cloud stream list --metadata type=export +``` + +Output as JSON: + +```bash +bunx @agentuity/cli cloud stream ls --json +``` + +## Output + +Returns JSON object: + +```json +{ + "streams": "array", + "total": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `streams` | array | List of streams | +| `total` | number | Total count of matching streams | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-thread-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-thread-delete/SKILL.md new file mode 100644 index 00000000..fd7160c8 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-thread-delete/SKILL.md @@ -0,0 +1,39 @@ +--- +name: agentuity-cli-cloud-thread-delete +description: Delete a thread. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud thread delete" + tags: "destructive requires-auth" +--- + +# Cloud Thread Delete + +Delete a thread + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud thread delete +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Delete a thread by ID: + +```bash +bunx @agentuity/cli cloud thread delete thrd_abc123xyz +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-thread-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-thread-get/SKILL.md new file mode 100644 index 00000000..9ee36145 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-thread-get/SKILL.md @@ -0,0 +1,69 @@ +--- +name: agentuity-cli-cloud-thread-get +description: Get details about a specific thread. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud thread get" + tags: "read-only fast requires-auth" +--- + +# Cloud Thread Get + +Get details about a specific thread + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud thread get +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Get a thread by ID: + +```bash +bunx @agentuity/cli cloud thread get thrd_abc123xyz +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "created_at": "string", + "updated_at": "string", + "deleted": "boolean", + "deleted_at": "unknown", + "deleted_by": "unknown", + "org_id": "string", + "project_id": "string", + "user_data": "unknown" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | Thread ID | +| `created_at` | string | Creation timestamp | +| `updated_at` | string | Update timestamp | +| `deleted` | boolean | Deleted status | +| `deleted_at` | unknown | Deletion timestamp | +| `deleted_by` | unknown | Deleted by | +| `org_id` | string | Organization ID | +| `project_id` | string | Project ID | +| `user_data` | unknown | User data as JSON | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-thread-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-thread-list/SKILL.md new file mode 100644 index 00000000..d325596a --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-thread-list/SKILL.md @@ -0,0 +1,62 @@ +--- +name: agentuity-cli-cloud-thread-list +description: List recent threads. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud thread list" + tags: "read-only fast requires-auth" +--- + +# Cloud Thread List + +List recent threads + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity cloud thread list [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--count` | number | No | `10` | Number of threads to list (1–100) | +| `--orgId` | string | Yes | - | Filter by organization ID | +| `--projectId` | string | Yes | - | Filter by project ID | + +## Examples + +List 10 most recent threads: + +```bash +bunx @agentuity/cli cloud thread list +``` + +List 25 most recent threads: + +```bash +bunx @agentuity/cli cloud thread list --count=25 +``` + +Filter by project: + +```bash +bunx @agentuity/cli cloud thread list --project-id=proj_* +``` + +Filter by organization: + +```bash +bunx @agentuity/cli cloud thread list --org-id=org_* +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-delete-namespace/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-delete-namespace/SKILL.md new file mode 100644 index 00000000..3b35e555 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-delete-namespace/SKILL.md @@ -0,0 +1,76 @@ +--- +name: agentuity-cli-cloud-vector-delete-namespace +description: Delete a vector namespace and all its vectors. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity cloud vector delete-namespace" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Cloud Vector Delete-namespace + +Delete a vector namespace and all its vectors + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector delete-namespace [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | No | `false` | if true will not prompt for confirmation | + +## Examples + +Delete staging namespace (interactive): + +```bash +bunx @agentuity/cli vector delete-namespace staging +``` + +Delete cache without confirmation: + +```bash +bunx @agentuity/cli vector rm-namespace cache --confirm +``` + +Force delete old-data namespace: + +```bash +bunx @agentuity/cli vector delete-namespace old-data --confirm +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "message": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the deletion succeeded | +| `namespace` | string | Deleted namespace name | +| `message` | string | Confirmation message | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-delete/SKILL.md new file mode 100644 index 00000000..5ac49b0b --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-delete/SKILL.md @@ -0,0 +1,83 @@ +--- +name: agentuity-cli-cloud-vector-delete +description: Delete one or more vectors by key. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud vector delete" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Cloud Vector Delete + +Delete one or more vectors by key + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector delete [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | array | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | No | `false` | if true will not prompt for confirmation | + +## Examples + +Delete a single vector (interactive): + +```bash +bunx @agentuity/cli vector delete products chair-001 +``` + +Delete multiple vectors without confirmation: + +```bash +bunx @agentuity/cli vector rm knowledge-base doc-123 doc-456 --confirm +``` + +Bulk delete without confirmation: + +```bash +bunx @agentuity/cli vector del embeddings old-profile-1 old-profile-2 --confirm +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "keys": "array", + "deleted": "number", + "durationMs": "number", + "message": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `namespace` | string | Namespace name | +| `keys` | array | Keys that were deleted | +| `deleted` | number | Number of vectors deleted | +| `durationMs` | number | Operation duration in milliseconds | +| `message` | string | Confirmation message | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-get/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-get/SKILL.md new file mode 100644 index 00000000..d387ca3a --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-get/SKILL.md @@ -0,0 +1,77 @@ +--- +name: agentuity-cli-cloud-vector-get +description: Get a specific vector entry by key. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud vector get" + tags: "read-only fast requires-auth" +--- + +# Cloud Vector Get + +Get a specific vector entry by key + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector get +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Examples + +Get a specific product vector: + +```bash +bunx @agentuity/cli vector get products chair-001 +``` + +Get a document from knowledge base: + +```bash +bunx @agentuity/cli vector get knowledge-base doc-123 +``` + +Get user profile embedding: + +```bash +bunx @agentuity/cli vector get embeddings user-profile-456 +``` + +## Output + +Returns JSON object: + +```json +{ + "exists": "boolean", + "key": "string", + "id": "string", + "metadata": "object", + "document": "string", + "similarity": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `exists` | boolean | Whether the vector exists | +| `key` | string | Vector key | +| `id` | string | Vector ID | +| `metadata` | object | Vector metadata | +| `document` | string | Original document text | +| `similarity` | number | Similarity score | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-list-namespaces/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-list-namespaces/SKILL.md new file mode 100644 index 00000000..e36ade11 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-list-namespaces/SKILL.md @@ -0,0 +1,49 @@ +--- +name: agentuity-cli-cloud-vector-list-namespaces +description: List all vector namespaces. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity cloud vector list-namespaces" + tags: "read-only fast requires-auth" +--- + +# Cloud Vector List-namespaces + +List all vector namespaces + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector list-namespaces +``` + +## Examples + +List all namespaces: + +```bash +bunx @agentuity/cli vector list-namespaces +``` + +List namespaces (using alias): + +```bash +bunx @agentuity/cli vector namespaces +``` + +List namespaces (short alias): + +```bash +bunx @agentuity/cli vector ns +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-search/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-search/SKILL.md new file mode 100644 index 00000000..a7121d8d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-search/SKILL.md @@ -0,0 +1,93 @@ +--- +name: agentuity-cli-cloud-vector-search +description: Search for vectors using semantic similarity. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " " +metadata: + command: "agentuity cloud vector search" + tags: "read-only slow requires-auth" +--- + +# Cloud Vector Search + +Search for vectors using semantic similarity + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector search [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--limit` | number | Yes | - | maximum number of results to return (default: 10) | +| `--similarity` | number | Yes | - | minimum similarity threshold (0.0-1.0) | +| `--metadata` | string | Yes | - | filter by metadata (format: key=value or key1=value1,key2=value2) | + +## Examples + +Search for similar products: + +```bash +bunx @agentuity/cli vector search products "comfortable office chair" +``` + +Search knowledge base: + +```bash +bunx @agentuity/cli vector list knowledge-base "machine learning" +``` + +Limit results: + +```bash +bunx @agentuity/cli vector search docs "API documentation" --limit 5 +``` + +Set minimum similarity: + +```bash +bunx @agentuity/cli vector search products "ergonomic" --similarity 0.8 +``` + +Filter by metadata: + +```bash +bunx @agentuity/cli vector ls embeddings "neural networks" --metadata category=ai +``` + +## Output + +Returns JSON object: + +```json +{ + "namespace": "string", + "query": "string", + "results": "array", + "count": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `namespace` | string | Namespace name | +| `query` | string | Search query used | +| `results` | array | Search results | +| `count` | number | Number of results found | diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-stats/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-stats/SKILL.md new file mode 100644 index 00000000..db6b460d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-stats/SKILL.md @@ -0,0 +1,52 @@ +--- +name: agentuity-cli-cloud-vector-stats +description: Get statistics for vector storage. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name]" +metadata: + command: "agentuity cloud vector stats" + tags: "read-only fast requires-auth" +--- + +# Cloud Vector Stats + +Get statistics for vector storage + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector stats [name] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Examples + +Show stats for all namespaces: + +```bash +bunx @agentuity/cli vector stats +``` + +Show detailed stats for products namespace: + +```bash +bunx @agentuity/cli vector stats products +``` + +Show stats for embeddings: + +```bash +bunx @agentuity/cli vector stats embeddings +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-cloud-vector-upsert/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-upsert/SKILL.md new file mode 100644 index 00000000..e9f84d4b --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-cloud-vector-upsert/SKILL.md @@ -0,0 +1,96 @@ +--- +name: agentuity-cli-cloud-vector-upsert +description: Add or update vectors in the vector storage. Requires authentication. Use for Agentuity cloud platform operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: " [key]" +metadata: + command: "agentuity cloud vector upsert" + tags: "mutating updates-resource slow requires-auth" +--- + +# Cloud Vector Upsert + +Add or update vectors in the vector storage + +## Prerequisites + +- Authenticated with `agentuity auth login` +- Project context required (run from project directory or use `--project-id`) + +## Usage + +```bash +agentuity cloud vector upsert [key] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--document` | string | Yes | - | document text to embed | +| `--embeddings` | string | Yes | - | pre-computed embeddings as JSON array | +| `--metadata` | string | Yes | - | metadata as JSON object | +| `--file` | string | Yes | - | path to JSON file containing vectors, or "-" for stdin | + +## Examples + +Upsert a single vector with document text: + +```bash +bunx @agentuity/cli vector upsert products doc1 --document "Comfortable office chair" +``` + +Upsert with metadata: + +```bash +bunx @agentuity/cli vector upsert products doc1 --document "Chair" --metadata '{"category":"furniture"}' +``` + +Upsert with pre-computed embeddings: + +```bash +bunx @agentuity/cli vector upsert embeddings vec1 --embeddings "[0.1, 0.2, 0.3]" +``` + +Bulk upsert from JSON file: + +```bash +bunx @agentuity/cli vector upsert products --file vectors.json +``` + +Bulk upsert from stdin: + +```bash +cat vectors.json | bunx @agentuity/cli vector upsert products - +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "namespace": "string", + "count": "number", + "results": "array", + "durationMs": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `namespace` | string | Namespace name | +| `count` | number | Number of vectors upserted | +| `results` | array | Upsert results with key-to-id mappings | +| `durationMs` | number | Operation duration in milliseconds | diff --git a/doc-agents/.agents/skills/agentuity-cli-dev/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-dev/SKILL.md new file mode 100644 index 00000000..a7008fd0 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-dev/SKILL.md @@ -0,0 +1,46 @@ +--- +name: agentuity-cli-dev +description: Build and run the development server +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity dev" + tags: "mutating slow requires-project" +--- + +# Dev + +Build and run the development server + +## Usage + +```bash +agentuity dev +``` + +## Examples + +Start development server: + +```bash +bunx @agentuity/cli dev +``` + +Specify custom port: + +```bash +bunx @agentuity/cli dev --port 8080 +``` + +Run in local mode: + +```bash +bunx @agentuity/cli dev --local +``` + +Disable public URL: + +```bash +bunx @agentuity/cli dev --no-public +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-profile-create/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-profile-create/SKILL.md new file mode 100644 index 00000000..55acefb2 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-profile-create/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-profile-create +description: Create a new configuration profile +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity profile create" + tags: "mutating creates-resource fast" +--- + +# Profile Create + +Create a new configuration profile + +## Usage + +```bash +agentuity profile create [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--switch` | boolean | Yes | - | switch to this profile (if more than one) | + +## Examples + +Create new item: + +```bash +bunx @agentuity/cli profile create production +``` + +Use switch option: + +```bash +bunx @agentuity/cli profile create staging --switch +``` + +Create new item: + +```bash +bunx @agentuity/cli profile create development +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string", + "path": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether creation succeeded | +| `name` | string | Profile name | +| `path` | string | Profile file path | diff --git a/doc-agents/.agents/skills/agentuity-cli-profile-current/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-profile-current/SKILL.md new file mode 100644 index 00000000..f1769211 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-profile-current/SKILL.md @@ -0,0 +1,38 @@ +--- +name: agentuity-cli-profile-current +description: Show the name of the currently active profile +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity profile current" + tags: "read-only fast" +--- + +# Profile Current + +Show the name of the currently active profile + +## Usage + +```bash +agentuity profile current +``` + +## Examples + +Show current profile: + +```bash +bunx @agentuity/cli profile current +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli profile current --json +``` + +## Output + +Returns: `string` diff --git a/doc-agents/.agents/skills/agentuity-cli-profile-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-profile-delete/SKILL.md new file mode 100644 index 00000000..4f05ee43 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-profile-delete/SKILL.md @@ -0,0 +1,69 @@ +--- +name: agentuity-cli-profile-delete +description: Delete a configuration profile +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name]" +metadata: + command: "agentuity profile delete" + tags: "destructive deletes-resource fast" +--- + +# Profile Delete + +Delete a configuration profile + +## Usage + +```bash +agentuity profile delete [name] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | Yes | - | Skip confirmation prompt | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli profile delete staging +``` + +Use confirm option: + +```bash +bunx @agentuity/cli profile delete old-dev --confirm +``` + +Delete item: + +```bash +bunx @agentuity/cli profile delete +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether deletion succeeded | +| `name` | string | Deleted profile name | diff --git a/doc-agents/.agents/skills/agentuity-cli-profile-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-profile-list/SKILL.md new file mode 100644 index 00000000..f710ada5 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-profile-list/SKILL.md @@ -0,0 +1,38 @@ +--- +name: agentuity-cli-profile-list +description: List all available profiles +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity profile list" + tags: "read-only fast" +--- + +# Profile List + +List all available profiles + +## Usage + +```bash +agentuity profile list +``` + +## Examples + +List items: + +```bash +bunx @agentuity/cli profile list +``` + +List items: + +```bash +bunx @agentuity/cli profile ls +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-profile-show/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-profile-show/SKILL.md new file mode 100644 index 00000000..316ba38e --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-profile-show/SKILL.md @@ -0,0 +1,71 @@ +--- +name: agentuity-cli-profile-show +description: Show the configuration of a profile +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name]" +metadata: + command: "agentuity profile show" + tags: "read-only fast" +--- + +# Profile Show + +Show the configuration of a profile + +## Usage + +```bash +agentuity profile show [name] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Examples + +Show details: + +```bash +bunx @agentuity/cli profile show +``` + +Show details: + +```bash +bunx @agentuity/cli profile show production +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli profile show staging --json +``` + +## Output + +Returns JSON object: + +```json +{ + "name": "string", + "auth": "object", + "devmode": "object", + "overrides": "unknown", + "preferences": "object", + "gravity": "object" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `name` | string | Profile name | +| `auth` | object | Authentication credentials (managed by login/logout commands) | +| `devmode` | object | Development mode configuration | +| `overrides` | unknown | URL and behavior overrides | +| `preferences` | object | User preferences | +| `gravity` | object | the gravity client information | diff --git a/doc-agents/.agents/skills/agentuity-cli-profile-use/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-profile-use/SKILL.md new file mode 100644 index 00000000..e03fc304 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-profile-use/SKILL.md @@ -0,0 +1,47 @@ +--- +name: agentuity-cli-profile-use +description: Switch to a different configuration profile +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[name]" +metadata: + command: "agentuity profile use" + tags: "mutating updates-resource fast" +--- + +# Profile Use + +Switch to a different configuration profile + +## Usage + +```bash +agentuity profile use [name] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Examples + +Switch to the "production" profile: + +```bash +bunx @agentuity/cli profile use production +``` + +Switch to the "staging" profile: + +```bash +bunx @agentuity/cli profile switch staging +``` + +Show interactive profile selection menu: + +```bash +bunx @agentuity/cli profile use +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-project-create/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-project-create/SKILL.md new file mode 100644 index 00000000..dd048e37 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-project-create/SKILL.md @@ -0,0 +1,95 @@ +--- +name: agentuity-cli-project-create +description: Create a new project. Use for project management operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity project create" + tags: "mutating creates-resource slow" +--- + +# Project Create + +Create a new project + +## Usage + +```bash +agentuity project create [options] +``` + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--name` | string | Yes | - | Project name | +| `--dir` | string | Yes | - | Directory to create the project in | +| `--domains` | array | Yes | - | Array of custom domains | +| `--template` | string | Yes | - | Template to use | +| `--templateDir` | string | Yes | - | Local template directory for testing (e.g., ./packages/templates) | +| `--templateBranch` | string | Yes | - | GitHub branch to use for templates (default: main) | +| `--install` | boolean | No | `true` | Run bun install after creating the project (use --no-install to skip) | +| `--build` | boolean | No | `true` | Run bun run build after installing (use --no-build to skip) | +| `--confirm` | boolean | Yes | - | Skip confirmation prompts | +| `--register` | boolean | No | `true` | Register the project, if authenticated (use --no-register to skip) | + +## Examples + +Create new item: + +```bash +bunx @agentuity/cli project create +``` + +Create new item: + +```bash +bunx @agentuity/cli project create --name my-ai-agent +``` + +Create new item: + +```bash +bunx @agentuity/cli project create --name customer-service-bot --dir ~/projects/agent +``` + +Use no install option: + +```bash +bunx @agentuity/cli project create --template basic --no-install +``` + +Use no register option: + +```bash +bunx @agentuity/cli project new --no-register +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "name": "string", + "path": "string", + "projectId": "string", + "template": "string", + "installed": "boolean", + "built": "boolean", + "domains": "array" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the operation succeeded | +| `name` | string | Project name | +| `path` | string | Project directory path | +| `projectId` | string | Project ID if registered | +| `template` | string | Template used | +| `installed` | boolean | Whether dependencies were installed | +| `built` | boolean | Whether the project was built | +| `domains` | array | Array of custom domains | diff --git a/doc-agents/.agents/skills/agentuity-cli-project-delete/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-project-delete/SKILL.md new file mode 100644 index 00000000..cbac05df --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-project-delete/SKILL.md @@ -0,0 +1,93 @@ +--- +name: agentuity-cli-project-delete +description: Delete a project. Requires authentication. Use for project management operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "[id]" +metadata: + command: "agentuity project delete" + tags: "destructive deletes-resource slow requires-auth" +--- + +# Project Delete + +Delete a project + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity project delete [id] [options] +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | No | - | + +## Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `--confirm` | boolean | Yes | - | Skip confirmation prompts | + +## Examples + +Delete item: + +```bash +bunx @agentuity/cli project delete +``` + +Delete item: + +```bash +bunx @agentuity/cli project delete proj_abc123def456 +``` + +Use confirm option: + +```bash +bunx @agentuity/cli project delete proj_abc123def456 --confirm +``` + +Delete item: + +```bash +bunx @agentuity/cli project rm proj_abc123def456 +``` + +Delete item: + +```bash +bunx @agentuity/cli --explain project delete proj_abc123def456 +``` + +Delete item: + +```bash +bunx @agentuity/cli --dry-run project delete proj_abc123def456 +``` + +## Output + +Returns JSON object: + +```json +{ + "success": "boolean", + "projectIds": "array", + "count": "number" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `success` | boolean | Whether the deletion succeeded | +| `projectIds` | array | Deleted project IDs | +| `count` | number | Number of projects deleted | diff --git a/doc-agents/.agents/skills/agentuity-cli-project-list/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-project-list/SKILL.md new file mode 100644 index 00000000..f823c74d --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-project-list/SKILL.md @@ -0,0 +1,48 @@ +--- +name: agentuity-cli-project-list +description: List all projects. Requires authentication. Use for project management operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity project list" + tags: "read-only slow requires-auth" +--- + +# Project List + +List all projects + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity project list +``` + +## Examples + +List projects (human-readable): + +```bash +bunx @agentuity/cli project list +``` + +List projects in JSON format: + +```bash +bunx @agentuity/cli --json project list +``` + +Alias for "project list" — list projects (human-readable): + +```bash +bunx @agentuity/cli project ls +``` + +## Output + +Returns: `array` diff --git a/doc-agents/.agents/skills/agentuity-cli-project-show/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-project-show/SKILL.md new file mode 100644 index 00000000..f86ddd98 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-project-show/SKILL.md @@ -0,0 +1,77 @@ +--- +name: agentuity-cli-project-show +description: Show project detail. Requires authentication. Use for project management operations +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +argument-hint: "" +metadata: + command: "agentuity project show" + tags: "read-only fast requires-auth requires-project" +--- + +# Project Show + +Show project detail + +## Prerequisites + +- Authenticated with `agentuity auth login` + +## Usage + +```bash +agentuity project show +``` + +## Arguments + +| Argument | Type | Required | Description | +|----------|------|----------|-------------| +| `` | string | Yes | - | + +## Examples + +Show details: + +```bash +bunx @agentuity/cli project show proj_abc123def456 +``` + +Show output in JSON format: + +```bash +bunx @agentuity/cli --json project show proj_abc123def456 +``` + +Get item details: + +```bash +bunx @agentuity/cli project get proj_abc123def456 +``` + +## Output + +Returns JSON object: + +```json +{ + "id": "string", + "name": "string", + "description": "unknown", + "tags": "unknown", + "orgId": "string", + "secrets": "object", + "env": "object" +} +``` + +| Field | Type | Description | +|-------|------|-------------| +| `id` | string | Project ID | +| `name` | string | Project name | +| `description` | unknown | Project description | +| `tags` | unknown | Project tags | +| `orgId` | string | Organization ID | +| `secrets` | object | Project secrets (masked) | +| `env` | object | Environment variables | diff --git a/doc-agents/.agents/skills/agentuity-cli-repl/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-repl/SKILL.md new file mode 100644 index 00000000..d80eed72 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-repl/SKILL.md @@ -0,0 +1,28 @@ +--- +name: agentuity-cli-repl +description: interactive REPL for testing +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity repl" + tags: "slow" +--- + +# Repl + +interactive REPL for testing + +## Usage + +```bash +agentuity repl +``` + +## Examples + +Run repl command: + +```bash +bunx @agentuity/cli repl +``` diff --git a/doc-agents/.agents/skills/agentuity-cli-upgrade/SKILL.md b/doc-agents/.agents/skills/agentuity-cli-upgrade/SKILL.md new file mode 100644 index 00000000..8e27ee66 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-cli-upgrade/SKILL.md @@ -0,0 +1,34 @@ +--- +name: agentuity-cli-upgrade +description: Upgrade the CLI to the latest version +version: "0.0.105" +license: Apache-2.0 +allowed-tools: "Bash(agentuity:*)" +metadata: + command: "agentuity upgrade" + tags: "update" +--- + +# Upgrade + +Upgrade the CLI to the latest version + +## Usage + +```bash +agentuity upgrade +``` + +## Examples + +Check for updates and prompt to upgrade: + +```bash +agentuity upgrade +``` + +Force upgrade even if already on latest version: + +```bash +agentuity upgrade --force +``` diff --git a/doc-agents/.agents/skills/agentuity-version.txt b/doc-agents/.agents/skills/agentuity-version.txt new file mode 100644 index 00000000..b7119478 --- /dev/null +++ b/doc-agents/.agents/skills/agentuity-version.txt @@ -0,0 +1 @@ +0.0.105 \ No newline at end of file diff --git a/doc-agents/.gitignore b/doc-agents/.gitignore new file mode 100644 index 00000000..6767817a --- /dev/null +++ b/doc-agents/.gitignore @@ -0,0 +1,43 @@ +# dependencies (bun install) + +node_modules + +# output + +out +dist +*.tgz + +# code coverage + +coverage +*.lcov + +# logs + +/logs +_.log +report.[0-9]_.[0-9]_.[0-9]_.[0-9]\*.json + +# dotenv environment variable files + +.env +.env.\* + +# caches + +.eslintcache +.cache +*.tsbuildinfo + +# IntelliJ based IDEs + +.idea + +# Finder (MacOS) folder config + +.DS_Store + +# Agentuity build files + +.agentuity diff --git a/doc-agents/.vscode/settings.json b/doc-agents/.vscode/settings.json new file mode 100644 index 00000000..8b2c0232 --- /dev/null +++ b/doc-agents/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "search.exclude": { + "**/.git/**": true, + "**/node_modules/**": true, + "**/bun.lock": true, + "**/.agentuity/**": true + }, + "json.schemas": [ + { + "fileMatch": [ + "agentuity.json" + ], + "url": "https://agentuity.dev/schema/cli/v1/agentuity.json" + } + ] +} \ No newline at end of file diff --git a/doc-agents/AGENTS.md b/doc-agents/AGENTS.md new file mode 100644 index 00000000..55f22493 --- /dev/null +++ b/doc-agents/AGENTS.md @@ -0,0 +1,64 @@ +# Agent Guidelines for doc_agents + +## Commands + +- **Build**: `bun run build` (compiles your application) +- **Dev**: `bun run dev` (starts development server) +- **Typecheck**: `bun run typecheck` (runs TypeScript type checking) +- **Deploy**: `bun run deploy` (deploys your app to the Agentuity cloud) + +## Agent-Friendly CLI + +The Agentuity CLI is designed to be agent-friendly with programmatic interfaces, structured output, and comprehensive introspection. + +Read the [AGENTS.md](./node_modules/@agentuity/cli/AGENTS.md) file in the Agentuity CLI for more information on how to work with this project. + +## Instructions + +- This project uses Bun instead of NodeJS and TypeScript for all source code +- This is an Agentuity Agent project + +## Web Frontend (src/web/) + +The `src/web/` folder contains your React frontend, which is automatically bundled by the Agentuity build system. + +**File Structure:** + +- `index.html` - Main HTML file with ` + + +``` + +## React Hooks + +All hooks from `@agentuity/react` must be used within an `AgentuityProvider`. **Always use these hooks instead of raw `fetch()` calls** - they provide type safety, automatic error handling, and integration with the Agentuity platform. + +### useAPI - Type-Safe API Calls + +The primary hook for making HTTP requests. **Use this instead of `fetch()`.** + +```typescript +import { useAPI } from '@agentuity/react'; + +function MyComponent() { + // GET requests auto-execute and return refetch + const { data, isLoading, error, refetch } = useAPI('GET /api/users'); + + // POST/PUT/DELETE return invoke for manual execution + const { invoke, data: result, isLoading: saving } = useAPI('POST /api/users'); + + const handleCreate = async () => { + // Input is fully typed from route schema! + await invoke({ name: 'Alice', email: 'alice@example.com' }); + }; + + return ( +
+ + {result &&

Created: {result.name}

} +
+ ); +} +``` + +**useAPI Return Values:** + +| Property | Type | Description | +| ------------ | ------------------------ | ----------------------------------------- | +| `data` | `T \| undefined` | Response data (typed from route schema) | +| `error` | `Error \| null` | Error if request failed | +| `isLoading` | `boolean` | True during initial load | +| `isFetching` | `boolean` | True during any fetch (including refetch) | +| `isSuccess` | `boolean` | True if last request succeeded | +| `isError` | `boolean` | True if last request failed | +| `invoke` | `(input?) => Promise` | Manual trigger (POST/PUT/DELETE) | +| `refetch` | `() => Promise` | Refetch data (GET) | +| `reset` | `() => void` | Reset state to initial | + +### useAPI Options + +```typescript +// GET with query parameters and caching +const { data } = useAPI({ + route: 'GET /api/search', + query: { q: 'react', limit: '10' }, + staleTime: 5000, // Cache for 5 seconds + refetchInterval: 10000, // Auto-refetch every 10 seconds + enabled: true, // Set to false to disable auto-fetch +}); + +// POST with callbacks +const { invoke } = useAPI({ + route: 'POST /api/users', + onSuccess: (data) => console.log('Created:', data), + onError: (error) => console.error('Failed:', error), +}); + +// Streaming responses with onChunk +const { invoke } = useAPI({ + route: 'POST /api/stream', + onChunk: (chunk) => console.log('Received chunk:', chunk), + delimiter: '\n', // Split stream by newlines (default) +}); + +// Custom headers +const { data } = useAPI({ + route: 'GET /api/protected', + headers: { 'X-Custom-Header': 'value' }, +}); +``` + +### useWebsocket - WebSocket Connection + +For bidirectional real-time communication. Automatically handles reconnection. + +```typescript +import { useWebsocket } from '@agentuity/react'; + +function ChatComponent() { + const { isConnected, data, send, messages, clearMessages, error, reset } = useWebsocket('/api/chat'); + + return ( +
+

Status: {isConnected ? 'Connected' : 'Disconnected'}

+ +
+ {messages.map((msg, i) => ( +

{JSON.stringify(msg)}

+ ))} +
+ +
+ ); +} +``` + +**useWebsocket Return Values:** + +| Property | Type | Description | +| --------------- | ---------------- | ---------------------------------------- | +| `isConnected` | `boolean` | True when WebSocket is connected | +| `data` | `T \| undefined` | Most recent message received | +| `messages` | `T[]` | Array of all received messages | +| `send` | `(data) => void` | Send a message (typed from route schema) | +| `clearMessages` | `() => void` | Clear the messages array | +| `close` | `() => void` | Close the connection | +| `error` | `Error \| null` | Error if connection failed | +| `isError` | `boolean` | True if there's an error | +| `reset` | `() => void` | Reset state and reconnect | +| `readyState` | `number` | WebSocket ready state | + +### useEventStream - Server-Sent Events + +For server-to-client streaming (one-way). Use when server pushes updates to client. + +```typescript +import { useEventStream } from '@agentuity/react'; + +function NotificationsComponent() { + const { isConnected, data, error, close, reset } = useEventStream('/api/notifications'); + + return ( +
+

Connected: {isConnected ? 'Yes' : 'No'}

+ {error &&

Error: {error.message}

} +

Latest: {JSON.stringify(data)}

+ +
+ ); +} +``` + +**useEventStream Return Values:** + +| Property | Type | Description | +| ------------- | ---------------- | ---------------------------------- | +| `isConnected` | `boolean` | True when EventSource is connected | +| `data` | `T \| undefined` | Most recent event data | +| `error` | `Error \| null` | Error if connection failed | +| `isError` | `boolean` | True if there's an error | +| `close` | `() => void` | Close the connection | +| `reset` | `() => void` | Reset state and reconnect | +| `readyState` | `number` | EventSource ready state | + +### useAgentuity - Access Context + +Access the Agentuity context for base URL and configuration. + +```typescript +import { useAgentuity } from '@agentuity/react'; + +function MyComponent() { + const { baseUrl } = useAgentuity(); + + return

API Base: {baseUrl}

; +} +``` + +### useAuth - Authentication State + +Access and manage authentication state. + +```typescript +import { useAuth } from '@agentuity/react'; + +function AuthStatus() { + const { isAuthenticated, authHeader, setAuthHeader, authLoading } = useAuth(); + + const handleLogin = async (token: string) => { + setAuthHeader?.(`Bearer ${token}`); + }; + + const handleLogout = () => { + setAuthHeader?.(null); + }; + + if (authLoading) return

Loading...

; + + return ( +
+ {isAuthenticated ? ( + + ) : ( + + )} +
+ ); +} +``` + +**useAuth Return Values:** + +| Property | Type | Description | +| ----------------- | ------------------- | ------------------------------------------- | +| `isAuthenticated` | `boolean` | True if user has auth token and not loading | +| `authHeader` | `string \| null` | Current auth header (e.g., "Bearer ...") | +| `setAuthHeader` | `(token) => void` | Set auth header (null to clear) | +| `authLoading` | `boolean` | True during auth state changes | +| `setAuthLoading` | `(loading) => void` | Set auth loading state | + +## Complete Example + +```typescript +import { AgentuityProvider, useAPI, useWebsocket } from '@agentuity/react'; +import { useEffect, useState } from 'react'; + +function Dashboard() { + const [count, setCount] = useState(0); + const { invoke, data: agentResult } = useAPI('POST /api/process'); + const { isConnected, send, data: wsMessage } = useWebsocket('/api/live'); + + useEffect(() => { + if (isConnected) { + const interval = setInterval(() => { + send({ ping: Date.now() }); + }, 1000); + return () => clearInterval(interval); + } + }, [isConnected, send]); + + return ( +
+

My Agentuity App

+ +
+

Count: {count}

+ +
+ +
+ +

{JSON.stringify(agentResult)}

+
+ +
+ WebSocket: + {isConnected ? JSON.stringify(wsMessage) : 'Not connected'} +
+
+ ); +} + +export function App() { + return ( + + + + ); +} +``` + +## Static Assets + +Place static files in the **public/** folder: + +``` +src/web/public/ +├── logo.svg +├── styles.css +└── script.js +``` + +Reference them in your HTML or components: + +```html + + + +``` + +```typescript +// In React components +Logo +``` + +## Styling + +### Inline Styles + +```typescript +
+ Styled content +
+``` + +### CSS Files + +Create `public/styles.css`: + +```css +body { + background-color: #09090b; + color: #fff; + font-family: sans-serif; +} +``` + +Import in `index.html`: + +```html + +``` + +### Style Tag in Component + +```typescript +
+ + +
+``` + +## RPC-Style API Client + +For non-React contexts (like utility functions or event handlers), use `createClient`: + +```typescript +import { createClient } from '@agentuity/react'; + +// Create a typed client (uses global baseUrl and auth from AgentuityProvider) +const api = createClient(); + +// Type-safe RPC-style calls - routes become nested objects +// Route 'GET /api/users' becomes api.users.get() +// Route 'POST /api/users' becomes api.users.post() +// Route 'GET /api/users/:id' becomes api.users.id.get({ id: '123' }) + +async function fetchData() { + const users = await api.users.get(); + const newUser = await api.users.post({ name: 'Alice', email: 'alice@example.com' }); + const user = await api.users.id.get({ id: '123' }); + return { users, newUser, user }; +} +``` + +**When to use `createClient` vs `useAPI`:** + +| Use Case | Recommendation | +| ------------------------- | -------------- | +| React component rendering | `useAPI` hook | +| Event handlers | Either works | +| Utility functions | `createClient` | +| Non-React code | `createClient` | +| Need loading/error state | `useAPI` hook | +| Need caching/refetch | `useAPI` hook | + +## Best Practices + +- Wrap your app with **AgentuityProvider** for hooks to work +- **Always use `useAPI` instead of `fetch()`** for type safety and error handling +- Use **useAPI** for type-safe HTTP requests (GET, POST, PUT, DELETE) +- Use **useWebsocket** for bidirectional real-time communication +- Use **useEventStream** for server-to-client streaming +- Use **useAuth** for authentication state management +- Handle loading and error states in UI +- Place reusable components in separate files +- Keep static assets in the **public/** folder + +## Rules + +- **App.tsx** must export a function named `App` +- **frontend.tsx** must render the `App` component to `#root` +- **index.html** must have a `
` +- Routes are typed via module augmentation from `src/generated/routes.ts` +- The web app is served at `/` by default +- Static files in `public/` are served at `/public/*` +- Module script tag: `` +- **Never use raw `fetch()` calls** - always use `useAPI` or `createClient` + + diff --git a/doc-agents/src/web/App.tsx b/doc-agents/src/web/App.tsx new file mode 100644 index 00000000..18684156 --- /dev/null +++ b/doc-agents/src/web/App.tsx @@ -0,0 +1,451 @@ +import { useAPI } from '@agentuity/react'; +import { type ChangeEvent, useState } from 'react'; + +const WORKBENCH_PATH = process.env.AGENTUITY_PUBLIC_WORKBENCH_PATH; + +export function App() { + const [prompt, setPrompt] = useState('What is Agentuity?'); + const { data: result, invoke, isLoading: running } = useAPI('POST /api/doc-qa'); + + return ( +
+
+
+ + +

Welcome to Agentuity

+ +

+ The Full-Stack Platform for AI Agents +

+
+ +
+

+ Ask about Agentuity Documentation +

+ +
+ ) => + setPrompt(e.currentTarget.value) + } + placeholder="Ask a question about Agentuity..." + type="text" + value={prompt} + /> + +
+
+
+ +
+
+ +
+ {result ? ( +
+
{result.answer}
+ {result.documents && result.documents.length > 0 && ( +
+ Sources: +
    + {result.documents.map((doc, idx) => ( +
  • {doc}
  • + ))} +
+
+ )} +
+ ) : ( + 'Waiting for question' + )} +
+
+ +
+

Next Steps

+ +
+ {[ + { + key: 'customize-agent', + title: 'Customize the Q&A Agent', + text: ( + <> + Edit src/agent/doc_qa/agent.ts or src/agent/doc_qa/rag.ts to modify the + documentation Q&A behavior. + + ), + }, + { + key: 'add-vector-store', + title: 'Configure Vector Storage', + text: ( + <> + Update the vector store configuration in src/config.ts to point to your documentation embeddings. + + ), + }, + { + key: 'update-frontend', + title: 'Enhance the UI', + text: ( + <> + Modify src/web/App.tsx to add more features like chat history or document filters. + + ), + }, + WORKBENCH_PATH + ? { + key: 'try-workbench', + title: ( + <> + Try{' '} + + Workbench + + + ), + text: <>A chat interface to test your agents in isolation., + } + : null, + ] + .filter(Boolean) + .map((step) => ( +
+
+ +
+ +
+

{step!.title}

+

{step!.text}

+
+
+ ))} +
+
+
+ + +
+ ); +} diff --git a/doc-agents/src/web/frontend.tsx b/doc-agents/src/web/frontend.tsx new file mode 100644 index 00000000..96996781 --- /dev/null +++ b/doc-agents/src/web/frontend.tsx @@ -0,0 +1,29 @@ +/** + * This file is the entry point for the React app, it sets up the root + * element and renders the App component to the DOM. + * + * It is included in `src/index.html`. + */ + +import React, { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; +import { AgentuityProvider } from '@agentuity/react'; +import { App } from './App'; + +const elem = document.getElementById('root')!; +const app = ( + + + + + +); + +if (import.meta.hot) { + // With hot module reloading, `import.meta.hot.data` is persisted. + const root = (import.meta.hot.data.root ??= createRoot(elem)); + root.render(app); +} else { + // The hot module reloading API is not available in production. + createRoot(elem).render(app); +} diff --git a/doc-agents/src/web/index.html b/doc-agents/src/web/index.html new file mode 100644 index 00000000..053d07b7 --- /dev/null +++ b/doc-agents/src/web/index.html @@ -0,0 +1,13 @@ + + + + + + + Agentuity + Bun + React + + + +
+ + diff --git a/doc-agents/src/web/public/.gitkeep b/doc-agents/src/web/public/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/doc-agents/src/web/public/favicon.ico b/doc-agents/src/web/public/favicon.ico new file mode 100644 index 00000000..21f46e6f Binary files /dev/null and b/doc-agents/src/web/public/favicon.ico differ diff --git a/doc-agents/tsconfig.json b/doc-agents/tsconfig.json new file mode 100644 index 00000000..7f774deb --- /dev/null +++ b/doc-agents/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "lib": ["ESNext", "DOM", "DOM.Iterable"], + "target": "ESNext", + "module": "Preserve", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false, + "paths": { + "@agent/*": ["./src/agent/*"], + "@api/*": ["./src/api/*"], + "@middleware/*": ["./src/middleware/*"] + } + }, + "include": ["src/**/*", "app.ts"] +} diff --git a/lib/api/client.ts b/lib/api/client.ts new file mode 100644 index 00000000..23f5f98d --- /dev/null +++ b/lib/api/client.ts @@ -0,0 +1,121 @@ +/** + * Base HTTP client for API communication + * Handles common concerns: auth, errors, timeouts + */ + +import { ApiError, ApiRequestOptions } from './types'; +import { config } from '@/lib/config'; + +const DEFAULT_TIMEOUT = 30000; // 30 seconds + +function buildUrl(baseUrl: string, endpoint: string): string { + const cleanEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`; + return `${baseUrl}${cleanEndpoint}`; +} + +function buildHeaders( + customHeaders?: Record, + bearerToken?: string +): Record { + const headers: Record = { + 'Content-Type': 'application/json', + ...customHeaders, + }; + + if (bearerToken) { + headers['Authorization'] = `Bearer ${bearerToken}`; + } + + return headers; +} + +/** + * Make a fetch request with common handling + */ +export async function apiRequest( + endpoint: string, + options: ApiRequestOptions = {}, + baseUrl: string = config.agentBaseUrl, + bearerToken?: string +): Promise { + const url = buildUrl(baseUrl, endpoint); + const headers = buildHeaders(options.headers, bearerToken); + const timeout = options.timeout ?? DEFAULT_TIMEOUT; + + // Create abort controller for timeout + const controller = options.signal ? undefined : new AbortController(); + const signal = options.signal || controller?.signal; + + let timeoutId: NodeJS.Timeout | undefined; + + try { + // Set timeout if using our own abort controller + if (controller && timeout > 0) { + timeoutId = setTimeout(() => controller.abort(), timeout); + } + + const fetchOptions: RequestInit = { + method: options.method || 'GET', + headers, + signal, + }; + + if (options.body) { + fetchOptions.body = JSON.stringify(options.body); + } + + const response = await fetch(url, fetchOptions); + + if (!response.ok) { + let errorDetails: unknown; + try { + errorDetails = await response.json(); + } catch { + errorDetails = response.statusText; + } + + throw new ApiError( + `API request failed: ${response.statusText}`, + response.status, + errorDetails + ); + } + + const data = await response.json(); + return data as T; + } catch (error) { + if (error instanceof ApiError) { + throw error; + } + + if (error instanceof Error) { + if (error.name === 'AbortError') { + throw new ApiError(`Request timeout after ${timeout}ms`, 408); + } + throw new ApiError(error.message, 500, error); + } + + throw new ApiError('Unknown error occurred', 500, error); + } finally { + if (timeoutId) { + clearTimeout(timeoutId); + } + } +} + +/** + * Helper methods for common HTTP methods + */ +export const apiClient = { + get: (endpoint: string, options?: ApiRequestOptions) => + apiRequest(endpoint, { ...options, method: 'GET' }), + + post: (endpoint: string, body?: unknown, options?: ApiRequestOptions) => + apiRequest(endpoint, { ...options, method: 'POST', body }), + + put: (endpoint: string, body?: unknown, options?: ApiRequestOptions) => + apiRequest(endpoint, { ...options, method: 'PUT', body }), + + delete: (endpoint: string, options?: ApiRequestOptions) => + apiRequest(endpoint, { ...options, method: 'DELETE' }), +}; diff --git a/lib/api/services/agentPulse.ts b/lib/api/services/agentPulse.ts new file mode 100644 index 00000000..147fc319 --- /dev/null +++ b/lib/api/services/agentPulse.ts @@ -0,0 +1,150 @@ +/** + * Agent Pulse Service + * Handles communication with the agent-pulse streaming endpoint + */ + +import { config } from '@/lib/config'; + +interface ConversationMessage { + author: 'USER' | 'ASSISTANT'; + content: string; +} + +interface TutorialState { + tutorialId: string; + currentStep: number; +} + +export interface AgentPulseRequest { + message: string; + conversationHistory?: ConversationMessage[]; + tutorialData?: TutorialState; +} + +export interface StreamingChunk { + type: 'text-delta' | 'status' | 'tutorial-data' | 'finish' | 'error'; + textDelta?: string; + message?: string; + category?: string; + tutorialData?: any; + error?: string; + details?: string; +} + +export interface AgentPulseCallbacks { + onTextDelta?: (text: string) => void; + onStatus?: (message: string, category?: string) => void; + onTutorialData?: (data: any) => void; + onFinish?: () => void; + onError?: (error: string) => void; +} + +const AGENT_PULSE_TIMEOUT = 30000; // 30 seconds + +/** + * Call agent-pulse endpoint with streaming response + * Processes SSE events and calls appropriate callbacks + */ +export async function callAgentPulseStreaming( + payload: AgentPulseRequest, + callbacks: AgentPulseCallbacks +): Promise { + try { + const headers: Record = { + 'Content-Type': 'application/json', + }; + + if (process.env.AGENT_BEARER_TOKEN) { + headers['Authorization'] = `Bearer ${process.env.AGENT_BEARER_TOKEN}`; + } + + const url = `${config.agentBaseUrl}/api/agent_pulse`; + + const controller = new AbortController(); + const timeoutId = setTimeout(() => controller.abort(), AGENT_PULSE_TIMEOUT); + + try { + const response = await fetch(url, { + method: 'POST', + headers, + body: JSON.stringify(payload), + signal: controller.signal, + }); + + if (!response.ok) { + const errorText = await response.text(); + console.error('[agentPulse] Error response:', errorText); + throw new Error(`Agent responded with status: ${response.status}`); + } + + const reader = response.body?.getReader(); + if (!reader) { + throw new Error('No response body from agent'); + } + + const decoder = new TextDecoder(); + let buffer = ''; + + while (true) { + const { done, value } = await reader.read(); + + if (done) break; + + const decoded = decoder.decode(value, { stream: true }); + buffer += decoded; + + // Process complete lines + const lines = buffer.split('\n'); + buffer = lines.pop() || ''; // Keep the last incomplete line + + for (const line of lines) { + if (line.startsWith('data: ')) { + try { + const jsonStr = line.slice(6); + const chunk = JSON.parse(jsonStr) as StreamingChunk; + + if (chunk.type === 'text-delta' && chunk.textDelta) { + callbacks.onTextDelta?.(chunk.textDelta); + } else if (chunk.type === 'status') { + callbacks.onStatus?.(chunk.message || '', chunk.category); + } else if (chunk.type === 'tutorial-data' && chunk.tutorialData) { + callbacks.onTutorialData?.(chunk.tutorialData); + } else if (chunk.type === 'finish') { + callbacks.onFinish?.(); + } else if (chunk.type === 'error') { + callbacks.onError?.(chunk.error || 'Unknown error'); + } + } catch (error) { + console.error('[agentPulse] Error parsing SSE chunk:', error); + } + } + } + } + + // Process any remaining data + if (buffer.length > 0 && buffer.startsWith('data: ')) { + try { + const chunk = JSON.parse(buffer.slice(6)) as StreamingChunk; + if (chunk.type === 'text-delta' && chunk.textDelta) { + callbacks.onTextDelta?.(chunk.textDelta); + } else if (chunk.type === 'finish') { + callbacks.onFinish?.(); + } + } catch (error) { + console.error('Error parsing final SSE chunk:', error); + } + } + } finally { + clearTimeout(timeoutId); + } + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + console.error('[agentPulse] call failed:', message); + callbacks.onError?.(message); + } +} + +// Alias for backwards compatibility +export const agentPulseService = { + callStreaming: callAgentPulseStreaming, +}; diff --git a/lib/api/services/agentQa.ts b/lib/api/services/agentQa.ts new file mode 100644 index 00000000..cfe52f05 --- /dev/null +++ b/lib/api/services/agentQa.ts @@ -0,0 +1,45 @@ +/** + * Agent QA Service + * Handles communication with the doc-qa agent + */ + +import { apiRequest } from '../client'; + +interface AgentQaRequest { + message: string; +} + +interface AgentQaResponse { + answer: string; + documents?: string[]; +} + +const AGENT_QA_TIMEOUT = 30000; // 30 seconds + +/** + * Query the doc-qa agent for answers and related documents + */ +export async function queryAgentQa(message: string): Promise { + try { + const response = await apiRequest( + '/api/doc-qa', + { + method: 'POST', + body: { message }, + timeout: AGENT_QA_TIMEOUT, + }, + undefined, // use default baseUrl from config + process.env.AGENT_BEARER_TOKEN + ); + + return response; + } catch (error) { + console.error('[agentQa] call failed:', error); + throw error; + } +} + +// Alias for backwards compatibility if needed +export const agentQaService = { + query: queryAgentQa, +}; diff --git a/lib/api/services/index.ts b/lib/api/services/index.ts new file mode 100644 index 00000000..50dffe9d --- /dev/null +++ b/lib/api/services/index.ts @@ -0,0 +1,11 @@ +/** + * API Services + * Centralized exports for all API service modules + */ + +export { generateTitle, titleGeneratorService } from './titleGenerator'; + +export { callAgentPulseStreaming, agentPulseService } from './agentPulse'; +export type { AgentPulseRequest, StreamingChunk, AgentPulseCallbacks } from './agentPulse'; + +export { queryAgentQa, agentQaService } from './agentQa'; \ No newline at end of file diff --git a/lib/api/services/titleGenerator.ts b/lib/api/services/titleGenerator.ts new file mode 100644 index 00000000..246aa1d9 --- /dev/null +++ b/lib/api/services/titleGenerator.ts @@ -0,0 +1,44 @@ +/** + * Title Generator Service + * Handles session title generation via the title-generator API + */ + +import { apiRequest } from '../client'; + +interface ConversationMessage { + author: 'USER' | 'ASSISTANT'; + content: string; +} + +interface TitleGeneratorResponse { + title: string; +} + +const TITLE_GEN_TIMEOUT = 3000; // 3 seconds for title generation + +/** + * Generate a title from conversation history + */ +export async function generateTitle(conversationHistory: ConversationMessage[]): Promise { + try { + const response = await apiRequest( + '/api/title-generator', + { + method: 'POST', + body: { conversationHistory }, + timeout: TITLE_GEN_TIMEOUT, + } + ); + + return response.title || 'New chat'; + } catch (error) { + console.error('[title-gen] failed:', error); + // Return default on error - don't break the flow + return 'New chat'; + } +} + +// Alias for backwards compatibility if needed +export const titleGeneratorService = { + generate: generateTitle, +}; diff --git a/lib/api/types.ts b/lib/api/types.ts new file mode 100644 index 00000000..c3bc5833 --- /dev/null +++ b/lib/api/types.ts @@ -0,0 +1,22 @@ +/** + * Shared API types and interfaces + */ + +export interface ApiRequestOptions { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; + headers?: Record; + body?: unknown; + timeout?: number; + signal?: AbortSignal; +} + +export class ApiError extends Error { + constructor( + message: string, + public status: number = 500, + public details?: unknown + ) { + super(message); + this.name = 'ApiError'; + } +} diff --git a/lib/config.ts b/lib/config.ts index b329b851..2380c88a 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -4,9 +4,7 @@ */ export const config = { - baseUrl: 'https://api.agentuity.com', - defaultStoreName: 'chat-sessions', - agentBaseUrl: process.env.AGENT_BASE_URL || 'https://agentuity.ai/api', - agentQaId: '9ccc5545e93644bd9d7954e632a55a61', - agentPulseId: 'ddcb59aa4473f1323be5d9f5fb62b74e' + kvStoreName: 'docs-sandbox-chat-sessions', + // V1 Agent endpoints - use base URL + specific endpoint paths + agentBaseUrl: process.env.AGENT_BASE_URL || 'http://127.0.0.1:3500', } as const; diff --git a/lib/env.ts b/lib/env.ts deleted file mode 100644 index bd3b8069..00000000 --- a/lib/env.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Environment variable validation and configuration utility - */ -export interface AgentConfig { - url: string; - bearerToken?: string; -} -/** - * Builds agent configuration using non-secret IDs from config - */ -import { config } from '@/lib/config'; - -const buildAgentConfig = (agentId: string): AgentConfig => { - const baseUrl = config.agentBaseUrl; - const bearerToken = process.env.AGENT_BEARER_TOKEN; - - if (!baseUrl) { - throw new Error( - 'Missing required configuration. Set AGENT_BASE_URL or ensure config.agentBaseUrl is defined.' - ); - } - if (!agentId) { - throw new Error('Missing required agent ID in config'); - } - - // For localhost/127.0.0.1, ensure agent ID has 'agent_' prefix - let finalAgentId = agentId; - if (baseUrl.includes('127.0.0.1') || baseUrl.includes('localhost')) { - if (!agentId.startsWith('agent_')) { - finalAgentId = `agent_${agentId}`; - } - } - - return { - url: `${baseUrl}/${finalAgentId}`, - bearerToken: bearerToken || undefined, - }; -}; - -export const getAgentQaConfig = (): AgentConfig => { - return buildAgentConfig(config.agentQaId); -}; - -export const getAgentPulseConfig = (): AgentConfig => { - return buildAgentConfig(config.agentPulseId); -}; - -/** - * Validates environment variables at startup - */ -export const validateEnv = (): boolean => { - try { - getAgentQaConfig(); - console.log('✓ Environment variables validated'); - return true; - } catch (error) { - console.error('❌ Environment validation failed:', error); - console.error('💡 Make sure to set base URL via:'); - console.error(' - AGENT_BASE_URL env var, or'); - console.error(' - Use default from config.baseUrl'); - console.error('💡 Optionally set AGENT_BEARER_TOKEN for authentication'); - return false; - } -}; - -/** - * Environment variable types - * Use .env.local for development and .env.production for production - */ -declare global { - interface ProcessEnv { - AGENT_BASE_URL?: string; - AGENT_BEARER_TOKEN?: string; - } -} diff --git a/lib/kv-store.ts b/lib/kv-store.ts index ca6cbdaf..13ad8d51 100644 --- a/lib/kv-store.ts +++ b/lib/kv-store.ts @@ -1,8 +1,13 @@ /** - * KV Store utility functions for Agentuity - * Handles communication with the Agentuity KV store API + * KV Store utility functions for Agentuity V1 SDK + * Uses the native KeyValueStorageService from @agentuity/core + * + * IMPORTANT: Only use in server-side code (API routes, server actions) + * Never expose AGENTUITY_SDK_KEY to the browser */ +import { KeyValueStorageService } from '@agentuity/core'; +import { createServerFetchAdapter, getServiceUrls, createLogger } from '@agentuity/server'; import { config } from './config'; // Types @@ -10,103 +15,62 @@ export interface KVStoreOptions { storeName?: string; } -export interface KVStoreResponse { - success: boolean; +export interface KVGetResult { + exists: boolean; data?: T; - error?: string; - statusCode?: number; } -/** - * Shared validation function for KV store operations - */ -function validateKVRequest(key: string): KVStoreResponse | null { - if (!key) { - return { - success: false, - error: 'Key parameter is required' - }; - } +export interface KVSetOptions extends KVStoreOptions { + ttl?: number; // TTL in seconds, minimum 60 +} - if (!process.env.AGENTUITY_API_KEY) { - return { - success: false, - error: 'AGENTUITY_API_KEY environment variable is required' - }; +export interface KVDeleteResult { + exists: boolean; +} + +// Create logger for SDK +const logger = createLogger('info'); + +// Initialize the KV service +function initializeKVService() { + if (!process.env.AGENTUITY_SDK_KEY || !process.env.AGENTUITY_REGION) { + throw new Error('AGENTUITY_SDK_KEY and AGENTUITY_REGION environment variables are required'); } - return null; + const adapter = createServerFetchAdapter({ + headers: { + Authorization: `Bearer ${process.env.AGENTUITY_SDK_KEY}` + }, + }, logger); + + const serviceUrls = getServiceUrls(process.env.AGENTUITY_REGION); + return new KeyValueStorageService(serviceUrls.keyvalue, adapter); } /** * Retrieve a value from the KV store * @param key - The key to retrieve - * @param options - Optional configuration - * @returns Promise> + * @param options - Optional configuration with storeName + * @returns Promise> */ export async function getKVValue( key: string, options: KVStoreOptions = {} -): Promise> { - const { storeName } = options; - const finalStoreName = storeName || config.defaultStoreName; - - // Validate required parameters - const validationError = validateKVRequest(key); - if (validationError) { - return validationError; - } +): Promise> { + const storeName = options.storeName || config.kvStoreName; try { - const url = `${config.baseUrl}/sdk/kv/${encodeURIComponent(finalStoreName)}/${encodeURIComponent(key)}`; - const response = await fetch(url, { - method: 'GET', - headers: { - 'Authorization': `Bearer ${process.env.AGENTUITY_API_KEY}`, - 'Content-Type': 'application/json', - 'User-Agent': 'Next.js KV Client' - } - }); - - if (response.status === 404) { - return { - success: false, - error: `Key '${key}' not found in store '${finalStoreName}'`, - statusCode: 404 - }; - } - - if (!response.ok) { - const errorText = await response.text(); - return { - success: false, - error: `HTTP ${response.status}: ${errorText}`, - statusCode: response.status - }; - } - - const data = await response.text(); - - try { - const jsonData = JSON.parse(data) as T; - return { - success: true, - data: jsonData, - statusCode: response.status - }; - } catch (parseError) { - // Return raw data if JSON parsing fails - return { - success: true, - data: data as T, - statusCode: response.status - }; - } + const kv = initializeKVService(); + const result = await kv.get(storeName, key); + return { + exists: result.exists, + data: result.data as T + }; } catch (error) { + console.error(`Failed to get KV value for key '${key}':`, error); return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error occurred' + exists: false }; } } @@ -115,174 +79,51 @@ export async function getKVValue( * Set a value in the KV store * @param key - The key to set * @param value - The value to store - * @param options - Optional configuration including TTL - * @returns Promise + * @param options - Optional configuration with storeName and TTL (in seconds, min 60) + * @returns Promise */ export async function setKVValue( key: string, value: any, - options: KVStoreOptions & { ttl?: number } = {} -): Promise { - const { storeName, ttl } = options; - const finalStoreName = storeName || config.defaultStoreName; - - // Validate required parameters - const validationError = validateKVRequest(key); - if (validationError) { - return validationError; + options: KVSetOptions = {} +): Promise { + const storeName = options.storeName || config.kvStoreName; + const ttl = options.ttl; + + // Validate TTL if provided + if (ttl !== undefined && ttl < 60) { + throw new Error('TTL must be at least 60 seconds'); } try { - const ttlStr = ttl ? `/${ttl}` : ''; - const url = `${config.baseUrl}/sdk/kv/${encodeURIComponent(finalStoreName)}/${encodeURIComponent(key)}${ttlStr}`; - - const response = await fetch(url, { - method: 'PUT', - headers: { - 'Authorization': `Bearer ${process.env.AGENTUITY_API_KEY}`, - 'Content-Type': 'application/json', - 'User-Agent': 'Next.js KV Client' - }, - body: JSON.stringify(value) - }); - - if (!response.ok) { - const errorText = await response.text(); - return { - success: false, - error: `HTTP ${response.status}: ${errorText}`, - statusCode: response.status - }; - } - - return { - success: true, - statusCode: response.status - }; - + const kv = initializeKVService(); + const setOptions = ttl ? { ttl } : undefined; + await kv.set(storeName, key, value, setOptions); + return true; } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error occurred' - }; + console.error(`Failed to set KV value for key '${key}':`, error); + return false; } } /** * Delete a value from the KV store * @param key - The key to delete - * @param options - Optional configuration - * @returns Promise + * @param options - Optional configuration with storeName + * @returns Promise */ export async function deleteKVValue( key: string, options: KVStoreOptions = {} -): Promise { - const { storeName } = options; - const finalStoreName = storeName || config.defaultStoreName; - - // Validate required parameters - const validationError = validateKVRequest(key); - if (validationError) { - return validationError; - } +): Promise { + const storeName = options.storeName || config.kvStoreName; try { - const url = `${config.baseUrl}/sdk/kv/${encodeURIComponent(finalStoreName)}/${encodeURIComponent(key)}`; - - const response = await fetch(url, { - method: 'DELETE', - headers: { - 'Authorization': `Bearer ${process.env.AGENTUITY_API_KEY}`, - 'User-Agent': 'Next.js KV Client' - } - }); - - if (!response.ok) { - const errorText = await response.text(); - return { - success: false, - error: `HTTP ${response.status}: ${errorText}`, - statusCode: response.status - }; - } - - return { - success: true, - statusCode: response.status - }; - + const kv = initializeKVService(); + await kv.delete(storeName, key); + return true; } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error occurred' - }; - } -} - -/** - * Search for keys in the KV store by keyword pattern - * @param keyword - The keyword pattern to search for - * @param options - Optional configuration - * @returns Promise>> - */ -export async function searchKVByKeyword( - keyword: string, - options: KVStoreOptions = {} -): Promise>> { - const { storeName } = options; - const finalStoreName = storeName || config.defaultStoreName; - - // Validate API key - if (!process.env.AGENTUITY_API_KEY) { - return { - success: false, - error: 'AGENTUITY_API_KEY environment variable is required' - }; - } - - try { - const url = `${config.baseUrl}/sdk/kv/search/${encodeURIComponent(finalStoreName)}/${encodeURIComponent(keyword)}`; - - const response = await fetch(url, { - method: 'GET', - headers: { - 'Authorization': `Bearer ${process.env.AGENTUITY_API_KEY}`, - 'Content-Type': 'application/json', - 'User-Agent': 'Next.js KV Client' - } - }); - - if (!response.ok) { - const errorText = await response.text(); - return { - success: false, - error: `HTTP ${response.status}: ${errorText}`, - statusCode: response.status - }; - } - - const data = await response.text(); - - try { - const jsonData = JSON.parse(data); - return { - success: true, - data: jsonData, - statusCode: response.status - }; - } catch (parseError) { - return { - success: false, - error: 'Failed to parse search results as JSON', - statusCode: response.status - }; - } - - } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error occurred' - }; + console.error(`Failed to delete KV value for key '${key}':`, error); + return false; } } \ No newline at end of file diff --git a/lib/tutorial/state-manager.ts b/lib/tutorial/state-manager.ts index 0cf04401..3badd518 100644 --- a/lib/tutorial/state-manager.ts +++ b/lib/tutorial/state-manager.ts @@ -1,121 +1,138 @@ import { getKVValue, setKVValue } from "@/lib/kv-store"; -import { config } from '../config'; +import { config } from "../config"; import type { UserTutorialState, TutorialProgress, TutorialState } from './types'; -export class TutorialStateManager { - private static getTutorialKey(userId: string): string { - return `tutorial_state_${userId}`; - } +function getTutorialKey(userId: string): string { + return `tutorial_state_${userId}`; +} - /** - * Get the complete tutorial state for a user - */ - static async getUserTutorialState(userId: string): Promise { - const key = this.getTutorialKey(userId); - const response = await getKVValue(key, { - storeName: config.defaultStoreName - }); - - return response.success && response.data ? response.data : { - userId, - tutorials: {} - }; - } +/** + * Get the complete tutorial state for a user + */ +async function getUserTutorialState(userId: string): Promise { + const key = getTutorialKey(userId); + const response = await getKVValue(key, { + storeName: config.kvStoreName + }); + + return response.exists && response.data ? response.data : { + userId, + tutorials: {} + }; +} - /** - * Update tutorial progress for a user - */ - static async updateTutorialProgress( - userId: string, - tutorialId: string, - currentStep: number, - totalSteps: number - ): Promise { - const state = await this.getUserTutorialState(userId); - - const existing = state.tutorials[tutorialId]; - const now = new Date().toISOString(); - - state.tutorials[tutorialId] = { - tutorialId, - currentStep, - totalSteps, - startedAt: existing?.startedAt || now, - lastAccessedAt: now, - ...(currentStep >= totalSteps ? { completedAt: now } : {}) - }; - - const key = this.getTutorialKey(userId); - try { - await setKVValue(key, state, { storeName: config.defaultStoreName }); - } catch (error) { - console.error( - `Failed to update tutorial state. UserId: ${userId}, Error details:`, - error instanceof Error ? error.message : String(error) - ); - } +/** + * Update tutorial progress for a user + */ +async function updateTutorialProgress( + userId: string, + tutorialId: string, + currentStep: number, + totalSteps: number +): Promise { + const state = await getUserTutorialState(userId); + + const existing = state.tutorials[tutorialId]; + const now = new Date().toISOString(); + + state.tutorials[tutorialId] = { + tutorialId, + currentStep, + totalSteps, + startedAt: existing?.startedAt || now, + lastAccessedAt: now, + ...(currentStep >= totalSteps ? { completedAt: now } : {}) + }; + + const key = getTutorialKey(userId); + const success = await setKVValue(key, state, { storeName: config.kvStoreName }); + + if (!success) { + console.error(`Failed to update tutorial state. UserId: ${userId}`); } +} - /** - * Get the current active tutorial state for agent communication - * Returns the most recently accessed tutorial - */ - static async getCurrentTutorialState(userId: string): Promise { - const state = await this.getUserTutorialState(userId); +/** + * Get the current active tutorial state for agent communication + * Returns the most recently accessed tutorial + */ +async function getCurrentTutorialState(userId: string): Promise { + const state = await getUserTutorialState(userId); - const tutorials = Object.values(state.tutorials); - if (tutorials.length === 0) return null; + const tutorials = Object.values(state.tutorials); + if (tutorials.length === 0) return null; - // Find the most recently accessed tutorial that's not completed - const activeTutorials = tutorials.filter(t => !t.completedAt); - if (activeTutorials.length === 0) return null; + // Find the most recently accessed tutorial that's not completed + const activeTutorials = tutorials.filter(t => !t.completedAt); + if (activeTutorials.length === 0) return null; - const mostRecent = activeTutorials.reduce((latest, current) => - new Date(current.lastAccessedAt) > new Date(latest.lastAccessedAt) ? current : latest - ); + const mostRecent = activeTutorials.reduce((latest, current) => + new Date(current.lastAccessedAt) > new Date(latest.lastAccessedAt) ? current : latest + ); - return { - tutorialId: mostRecent.tutorialId, - currentStep: mostRecent.currentStep - }; - } + return { + tutorialId: mostRecent.tutorialId, + currentStep: mostRecent.currentStep + }; +} - /** - * Get tutorial progress for a specific tutorial - */ - static async getTutorialProgress(userId: string, tutorialId: string): Promise { - const state = await this.getUserTutorialState(userId); - return state.tutorials[tutorialId] || null; - } +/** + * Get tutorial progress for a specific tutorial + */ +async function getTutorialProgress(userId: string, tutorialId: string): Promise { + const state = await getUserTutorialState(userId); + return state.tutorials[tutorialId] || null; +} - /** - * Mark a tutorial as completed - */ - static async completeTutorial(userId: string, tutorialId: string): Promise { - const state = await this.getUserTutorialState(userId); +/** + * Mark a tutorial as completed + */ +async function completeTutorial(userId: string, tutorialId: string): Promise { + const state = await getUserTutorialState(userId); - if (state.tutorials[tutorialId]) { - state.tutorials[tutorialId].completedAt = new Date().toISOString(); - state.tutorials[tutorialId].lastAccessedAt = new Date().toISOString(); + if (state.tutorials[tutorialId]) { + state.tutorials[tutorialId].completedAt = new Date().toISOString(); + state.tutorials[tutorialId].lastAccessedAt = new Date().toISOString(); - const key = this.getTutorialKey(userId); - await setKVValue(key, state, { storeName: config.defaultStoreName }); - } + const key = getTutorialKey(userId); + await setKVValue(key, state, { storeName: config.kvStoreName }); } +} - /** - * Get all completed tutorials for a user - */ - static async getCompletedTutorials(userId: string): Promise { - const state = await this.getUserTutorialState(userId); - return Object.values(state.tutorials).filter(t => t.completedAt); - } +/** + * Get all completed tutorials for a user + */ +async function getCompletedTutorials(userId: string): Promise { + const state = await getUserTutorialState(userId); + return Object.values(state.tutorials).filter(t => t.completedAt); +} - /** - * Get all active (in-progress) tutorials for a user - */ - static async getActiveTutorials(userId: string): Promise { - const state = await this.getUserTutorialState(userId); - return Object.values(state.tutorials).filter(t => !t.completedAt); - } +/** + * Get all active (in-progress) tutorials for a user + */ +async function getActiveTutorials(userId: string): Promise { + const state = await getUserTutorialState(userId); + return Object.values(state.tutorials).filter(t => !t.completedAt); } + +// Backward compatibility alias (following pattern in other services) +export const TutorialStateManager = { + getUserTutorialState, + updateTutorialProgress, + getCurrentTutorialState, + getTutorialProgress, + completeTutorial, + getCompletedTutorials, + getActiveTutorials, +}; + +// Export functions for direct import if needed +export { + getUserTutorialState, + updateTutorialProgress, + getCurrentTutorialState, + getTutorialProgress, + completeTutorial, + getCompletedTutorials, + getActiveTutorials, +}; diff --git a/package.json b/package.json index eff5a819..141d6498 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,12 @@ "validate-env": "node -e \"require('./lib/env').validateEnv()\"" }, "dependencies": { + "@agentuity/auth": "^0.0.111", + "@agentuity/core": "^0.0.111", + "@agentuity/react": "^0.0.111", + "@agentuity/server": "^0.0.111", + "@clerk/backend": "^2.29.0", + "@clerk/clerk-react": "^5.59.2", "@radix-ui/react-dialog": "^1.1.14", "@radix-ui/react-visually-hidden": "^1.2.3", "allotment": "^1.20.4",