Compare commits
2 Commits
chore/ms23
...
feat/ms23-
| Author | SHA1 | Date | |
|---|---|---|---|
| 184a5234ae | |||
| 18ed3a5411 |
@@ -126,7 +126,7 @@ Target version: `v0.0.23`
|
|||||||
| MS23-P0-003 | done | p0-foundation | Orchestrator API: GET /agents/:id/messages + SSE stream endpoint | #693 | orchestrator | feat/ms23-p0-stream | MS23-P0-001 | MS23-P0-006 | codex | 2026-03-06 | 2026-03-07 | 20K | — | |
|
| MS23-P0-003 | done | p0-foundation | Orchestrator API: GET /agents/:id/messages + SSE stream endpoint | #693 | orchestrator | feat/ms23-p0-stream | MS23-P0-001 | MS23-P0-006 | codex | 2026-03-06 | 2026-03-07 | 20K | — | |
|
||||||
| MS23-P0-004 | done | p0-foundation | Orchestrator API: POST /agents/:id/inject + pause/resume endpoints | #693 | orchestrator | feat/ms23-p0-controls | MS23-P0-001 | MS23-P0-006 | codex | 2026-03-07 | 2026-03-07 | 15K | — | |
|
| MS23-P0-004 | done | p0-foundation | Orchestrator API: POST /agents/:id/inject + pause/resume endpoints | #693 | orchestrator | feat/ms23-p0-controls | MS23-P0-001 | MS23-P0-006 | codex | 2026-03-07 | 2026-03-07 | 15K | — | |
|
||||||
| MS23-P0-005 | done | p0-foundation | Subagent tree: parentAgentId on spawn registration + GET /agents/tree | #693 | orchestrator | feat/ms23-p0-tree | MS23-P0-001 | MS23-P0-006 | — | — | — | 15K | — | |
|
| MS23-P0-005 | done | p0-foundation | Subagent tree: parentAgentId on spawn registration + GET /agents/tree | #693 | orchestrator | feat/ms23-p0-tree | MS23-P0-001 | MS23-P0-006 | — | — | — | 15K | — | |
|
||||||
| MS23-P0-006 | in-progress | p0-foundation | Unit + integration tests for all P0 orchestrator endpoints | #693 | orchestrator | test/ms23-p0 | MS23-P0-002,MS23-P0-003,MS23-P0-004,MS23-P0-005 | MS23-P1-001 | codex | 2026-03-07 | — | 20K | — | Phase 0 gate: SSE stream verified via curl |
|
| MS23-P0-006 | done | p0-foundation | Unit + integration tests for all P0 orchestrator endpoints | #693 | orchestrator | test/ms23-p0 | MS23-P0-002,MS23-P0-003,MS23-P0-004,MS23-P0-005 | MS23-P1-001 | codex | 2026-03-07 | 2026-03-07 | 20K | — | Phase 0 gate: SSE stream verified via curl |
|
||||||
|
|
||||||
### Phase 1 — Provider Interface (Plugin Architecture)
|
### Phase 1 — Provider Interface (Plugin Architecture)
|
||||||
|
|
||||||
|
|||||||
78
packages/shared/src/types/agent-provider.types.ts
Normal file
78
packages/shared/src/types/agent-provider.types.ts
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
// Agent message roles
|
||||||
|
export type AgentMessageRole = "user" | "assistant" | "system" | "tool";
|
||||||
|
|
||||||
|
// A single message in an agent conversation
|
||||||
|
export interface AgentMessage {
|
||||||
|
id: string;
|
||||||
|
sessionId: string;
|
||||||
|
role: AgentMessageRole;
|
||||||
|
content: string;
|
||||||
|
timestamp: Date;
|
||||||
|
metadata?: Record<string, unknown>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Session lifecycle status
|
||||||
|
export type AgentSessionStatus = "active" | "paused" | "completed" | "failed" | "idle";
|
||||||
|
|
||||||
|
// An agent session (conversation thread)
|
||||||
|
export interface AgentSession {
|
||||||
|
id: string;
|
||||||
|
providerId: string; // which provider owns this session
|
||||||
|
providerType: string; // "internal" | "openclaw" | etc.
|
||||||
|
label?: string;
|
||||||
|
status: AgentSessionStatus;
|
||||||
|
parentSessionId?: string; // for subagent trees
|
||||||
|
createdAt: Date;
|
||||||
|
updatedAt: Date;
|
||||||
|
metadata?: Record<string, unknown>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Result of listing sessions
|
||||||
|
export interface AgentSessionList {
|
||||||
|
sessions: AgentSession[];
|
||||||
|
total: number;
|
||||||
|
cursor?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Result of injecting a message
|
||||||
|
export interface InjectResult {
|
||||||
|
accepted: boolean;
|
||||||
|
messageId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The IAgentProvider interface — every provider (internal, OpenClaw, future) implements this
|
||||||
|
export interface IAgentProvider {
|
||||||
|
readonly providerId: string;
|
||||||
|
readonly providerType: string;
|
||||||
|
readonly displayName: string;
|
||||||
|
|
||||||
|
// Session management
|
||||||
|
listSessions(cursor?: string, limit?: number): Promise<AgentSessionList>;
|
||||||
|
getSession(sessionId: string): Promise<AgentSession | null>;
|
||||||
|
getMessages(sessionId: string, limit?: number, before?: string): Promise<AgentMessage[]>;
|
||||||
|
|
||||||
|
// Control operations
|
||||||
|
injectMessage(sessionId: string, content: string): Promise<InjectResult>;
|
||||||
|
pauseSession(sessionId: string): Promise<void>;
|
||||||
|
resumeSession(sessionId: string): Promise<void>;
|
||||||
|
killSession(sessionId: string, force?: boolean): Promise<void>;
|
||||||
|
|
||||||
|
// SSE streaming — returns an AsyncIterable of AgentMessage events
|
||||||
|
streamMessages(sessionId: string): AsyncIterable<AgentMessage>;
|
||||||
|
|
||||||
|
// Health
|
||||||
|
isAvailable(): Promise<boolean>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Provider configuration stored in DB (AgentProviderConfig model from P0 schema)
|
||||||
|
export interface AgentProviderConfig {
|
||||||
|
id: string;
|
||||||
|
providerId: string;
|
||||||
|
providerType: string;
|
||||||
|
displayName: string;
|
||||||
|
baseUrl?: string;
|
||||||
|
apiToken?: string;
|
||||||
|
enabled: boolean;
|
||||||
|
createdAt: Date;
|
||||||
|
updatedAt: Date;
|
||||||
|
}
|
||||||
@@ -134,3 +134,6 @@ export * from "./widget.types";
|
|||||||
|
|
||||||
// Export WebSocket types
|
// Export WebSocket types
|
||||||
export * from "./websocket.types";
|
export * from "./websocket.types";
|
||||||
|
|
||||||
|
// Export agent provider types
|
||||||
|
export * from "./agent-provider.types";
|
||||||
|
|||||||
Reference in New Issue
Block a user