@flamecast/protocol 0.1.1 → 0.2.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/index.d.ts +1 -1
- package/dist/session.d.ts +4 -0
- package/dist/storage.d.ts +20 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { Runtime, RuntimeNames, RuntimeConfigFor, RuntimeInstance, RuntimeInfo, SessionContext, SessionEndReason, } from "./runtime.js";
|
|
2
2
|
export type { FileSystemEntry, PermissionRequestEvent, FilesystemSnapshotEvent, FilePreviewEvent, PermissionRespondAction, FsSnapshotAction, FilePreviewAction, SessionHostStartRequest, SessionHostStartResponse, SessionHostHealthResponse, SessionCallbackEvent, PermissionCallbackResponse, } from "./session-host.js";
|
|
3
3
|
export type { AgentSpawn, AgentTemplate, AgentTemplateRuntime, Session, SessionLog, PendingPermission, PendingPermissionOption, FileSystemSnapshot, FilePreview, QueuedPromptResponse, PromptQueueItem, PromptQueueState, CreateSessionBody, RegisterAgentTemplateBody, PromptBody, PermissionResponseBody, WebhookConfig, WebhookEventType, WebhookPayload, } from "./session.js";
|
|
4
|
-
export type { FlamecastStorage, SessionMeta, SessionRuntimeInfo, StoredSession, } from "./storage.js";
|
|
4
|
+
export type { FlamecastStorage, QueuedMessage, SessionMeta, SessionRuntimeInfo, StoredSession, } from "./storage.js";
|
|
5
5
|
export type { WsServerMessage, WsControlMessage, WsEventMessage, WsConnectedMessage, WsErrorMessage, WsPromptAction, WsPermissionRespondAction, WsCancelAction, WsTerminateAction, WsPingAction, WsQueueReorderAction, WsQueueClearAction, WsQueuePauseAction, WsQueueResumeAction, } from "./ws.js";
|
|
6
6
|
export type { RuntimeHostStartSessionRequest, RuntimeHostStartSessionResponse, RuntimeHostSessionStatus, RuntimeHostHealthResponse, RuntimeHostPromptRequest, RuntimeHostPermissionResponse, } from "./runtime-host.js";
|
|
7
7
|
export type { Channel, WsChannelServerMessage, WsChannelControlMessage, WsChannelConnectedMessage, WsSubscribedMessage, WsUnsubscribedMessage, WsChannelEventMessage, WsSessionCreatedMessage, WsSessionTerminatedMessage, WsChannelErrorMessage, WsPongMessage, WsSubscribeAction, WsUnsubscribeAction, WsChannelPromptAction, WsChannelPermissionRespondAction, WsChannelCancelAction, WsChannelTerminateAction, WsChannelQueueReorderAction, WsChannelQueueClearAction, WsChannelQueuePauseAction, WsChannelQueueResumeAction, WsChannelPingAction, } from "./ws-channels.js";
|
package/dist/session.d.ts
CHANGED
|
@@ -81,6 +81,10 @@ export interface Session {
|
|
|
81
81
|
websocketUrl?: string;
|
|
82
82
|
/** Runtime instance name this session is scoped to. */
|
|
83
83
|
runtime?: string;
|
|
84
|
+
/** Working directory the session was started in. */
|
|
85
|
+
cwd?: string;
|
|
86
|
+
/** Human-readable title derived from the first user prompt. */
|
|
87
|
+
title?: string;
|
|
84
88
|
}
|
|
85
89
|
export interface CreateSessionBody {
|
|
86
90
|
/** Client-generated session ID. If omitted the server generates one. */
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import type { RuntimeInstance } from "./runtime.js";
|
|
2
2
|
import type { AgentTemplate, Session, WebhookConfig } from "./session.js";
|
|
3
|
+
/** A message in the global message queue, persisted server-side. */
|
|
4
|
+
export interface QueuedMessage {
|
|
5
|
+
id: number;
|
|
6
|
+
sessionId: string | null;
|
|
7
|
+
text: string;
|
|
8
|
+
runtime: string;
|
|
9
|
+
agent: string;
|
|
10
|
+
agentTemplateId: string | null;
|
|
11
|
+
directory: string | null;
|
|
12
|
+
status: "pending" | "sent";
|
|
13
|
+
createdAt: string;
|
|
14
|
+
sentAt: string | null;
|
|
15
|
+
}
|
|
3
16
|
/** Durable slice of {@link Session} (everything except runtime-only state). */
|
|
4
17
|
export type SessionMeta = Omit<Session, "fileSystem" | "logs" | "promptQueue">;
|
|
5
18
|
/** Runtime connection info persisted alongside a session for recovery after restart. */
|
|
@@ -36,7 +49,7 @@ export interface FlamecastStorage {
|
|
|
36
49
|
env?: Record<string, string>;
|
|
37
50
|
}): Promise<AgentTemplate | null>;
|
|
38
51
|
createSession(meta: SessionMeta, runtimeInfo?: SessionRuntimeInfo, webhooks?: WebhookConfig[]): Promise<void>;
|
|
39
|
-
updateSession(id: string, patch: Partial<Pick<SessionMeta, "lastUpdatedAt" | "pendingPermission">>): Promise<void>;
|
|
52
|
+
updateSession(id: string, patch: Partial<Pick<SessionMeta, "lastUpdatedAt" | "pendingPermission" | "title">>): Promise<void>;
|
|
40
53
|
getSessionMeta(id: string): Promise<SessionMeta | null>;
|
|
41
54
|
getStoredSession(id: string): Promise<StoredSession | null>;
|
|
42
55
|
/** Return all sessions (active + killed), ordered by lastUpdatedAt desc. */
|
|
@@ -47,4 +60,10 @@ export interface FlamecastStorage {
|
|
|
47
60
|
saveRuntimeInstance(instance: RuntimeInstance): Promise<void>;
|
|
48
61
|
listRuntimeInstances(): Promise<RuntimeInstance[]>;
|
|
49
62
|
deleteRuntimeInstance(name: string): Promise<void>;
|
|
63
|
+
enqueueMessage(message: Omit<QueuedMessage, "id" | "createdAt" | "sentAt" | "status">): Promise<QueuedMessage>;
|
|
64
|
+
listQueuedMessages(): Promise<QueuedMessage[]>;
|
|
65
|
+
getNextPendingMessage(sessionId: string): Promise<QueuedMessage | null>;
|
|
66
|
+
markMessageSent(id: number): Promise<void>;
|
|
67
|
+
removeMessage(id: number): Promise<void>;
|
|
68
|
+
clearMessageQueue(): Promise<void>;
|
|
50
69
|
}
|