@agentapplicationprotocol/sdk 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/types.d.ts +3 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentResponse, CreateSessionRequest, MetaResponse, SessionListResponse, SessionResponse, SessionTurnRequest, SSEEvent } from "./types";
|
|
1
|
+
import { AgentResponse, CreateSessionRequest, CreateSessionResponse, MetaResponse, SessionListResponse, SessionResponse, SessionTurnRequest, SSEEvent } from "./types";
|
|
2
2
|
export interface ClientOptions {
|
|
3
3
|
baseUrl: string;
|
|
4
4
|
apiKey: string;
|
|
@@ -29,7 +29,7 @@ export declare class Client {
|
|
|
29
29
|
/** PUT /session — non-streaming */
|
|
30
30
|
createSession(req: CreateSessionRequest & {
|
|
31
31
|
stream?: "none";
|
|
32
|
-
}): Promise<
|
|
32
|
+
}): Promise<CreateSessionResponse>;
|
|
33
33
|
/** PUT /session — SSE streaming */
|
|
34
34
|
createSession(req: CreateSessionRequest & {
|
|
35
35
|
stream: "delta" | "message";
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import type { Context } from "hono";
|
|
3
|
-
import { AgentResponse, CreateSessionRequest, MetaResponse, SessionListResponse, SessionResponse, SessionTurnRequest, SSEEvent } from "./types";
|
|
3
|
+
import { AgentResponse, CreateSessionRequest, CreateSessionResponse, MetaResponse, SessionListResponse, SessionResponse, SessionTurnRequest, SSEEvent } from "./types";
|
|
4
4
|
export interface ServerHandler {
|
|
5
5
|
getMeta(): Promise<MetaResponse>;
|
|
6
6
|
listSessions(params: {
|
|
@@ -8,7 +8,7 @@ export interface ServerHandler {
|
|
|
8
8
|
}): Promise<SessionListResponse>;
|
|
9
9
|
getSession(sessionId: string): Promise<SessionResponse>;
|
|
10
10
|
/** The last message in `req.messages` is guaranteed to be a user message. */
|
|
11
|
-
createSession(req: CreateSessionRequest): Promise<
|
|
11
|
+
createSession(req: CreateSessionRequest): Promise<CreateSessionResponse | AsyncIterable<SSEEvent>>;
|
|
12
12
|
sendTurn(sessionId: string, req: SessionTurnRequest): Promise<AgentResponse | AsyncIterable<SSEEvent>>;
|
|
13
13
|
deleteSession(sessionId: string): Promise<void>;
|
|
14
14
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -170,11 +170,12 @@ export interface SessionTurnRequest {
|
|
|
170
170
|
}
|
|
171
171
|
/** JSON response body for non-streaming (`stream: "none"`) requests. */
|
|
172
172
|
export interface AgentResponse {
|
|
173
|
-
/** Present in `PUT /session` response only. */
|
|
174
|
-
sessionId?: string;
|
|
175
173
|
stopReason: StopReason;
|
|
176
174
|
messages: HistoryMessage[];
|
|
177
175
|
}
|
|
176
|
+
export interface CreateSessionResponse extends AgentResponse {
|
|
177
|
+
sessionId: string;
|
|
178
|
+
}
|
|
178
179
|
/** Response body for `GET /session/:id`. */
|
|
179
180
|
export interface SessionResponse {
|
|
180
181
|
sessionId: string;
|