You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enter async context: create an aiohttp ClientSession and return the client instance.
42
+
43
+
Initializes and stores an aiohttp.ClientSession on self.session for use by other methods. Returns self so the class can be used as an asynchronous context manager.
Close the client's HTTP session and WebSocket when exiting the async context manager.
51
+
52
+
If an HTTP session or WebSocket is open, they are closed asynchronously. The method does not suppress exceptions raised in the managed block (it returns None).
"""Connect to WebSocket and subscribe to session"""
94
+
"""
95
+
Establish a WebSocket connection to the server, subscribe to a session, and stream incoming messages to the message handler.
96
+
97
+
Opens a connection to self.ws_url and stores the WebSocket in self.websocket, sends a JSON subscribe message for the given session, then iterates over incoming text messages, parsing each as JSON and delegating to self.handle_message. JSON parsing errors and handler exceptions are caught and logged; connection errors from establishing the WebSocket may propagate.
98
+
Parameters:
99
+
session_id (str): The server session identifier to subscribe to.
Copy file name to clipboardExpand all lines: claudia-server/src/routes/claude.ts
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,23 @@ import type {
9
9
ErrorResponse
10
10
}from'../types/index.js';
11
11
12
+
/**
13
+
* Creates an Express Router with endpoints for managing and interacting with Claude code executions.
14
+
*
15
+
* The router exposes these routes:
16
+
* - GET /version — check Claude code version/installation status
17
+
* - POST /execute — start a new Claude execution (requires project_path, prompt, model)
18
+
* - POST /continue — continue an existing conversation (requires project_path, prompt, model)
19
+
* - POST /resume — resume a session (requires project_path, session_id, prompt, model)
20
+
* - POST /cancel/:sessionId — cancel a running execution
21
+
* - GET /sessions/running — list running Claude sessions
22
+
* - GET /sessions/:sessionId — get session information
23
+
* - GET /sessions/:sessionId/history — load session history/output
24
+
*
25
+
* All endpoints return a standardized SuccessResponse or ErrorResponse object with a timestamp and appropriate HTTP status codes for validation, not-found, and internal errors.
26
+
*
27
+
* @returns An Express Router configured with the Claude-related routes.
Copy file name to clipboardExpand all lines: claudia-server/src/routes/status.ts
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,16 @@ import type { SuccessResponse } from '../types/index.js';
3
3
import{homedir}from'os';
4
4
import{join}from'path';
5
5
6
+
/**
7
+
* Create an Express Router with status-related endpoints.
8
+
*
9
+
* Exposes three GET endpoints:
10
+
* - GET /health: returns runtime health data (status, uptime, memory usage, Node version) and a timestamp.
11
+
* - GET /info: returns server metadata (name, version, description) and runtime/environment details (node version, platform, architecture, pid, cwd, claude_home) with a timestamp.
12
+
* - GET /home: returns the current user's home directory and the server's Claude-specific directory path with a timestamp.
13
+
*
14
+
* @returns An Express Router configured with the above endpoints.
0 commit comments