@workerdeck/server 3.3.0 → 3.5.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/build/index.d.mts +40 -2
- package/build/index.mjs +1268 -459
- package/build/index.mjs.map +1 -1
- package/package.json +7 -7
package/build/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
2
2
|
import { AttachmentInput, BridgeAnswer, BrowserBridgeExecutor, ClaudeAuthProbe, CostLedgerState, EngineAdapter, EngineSessionOptions, HostToolDefinition, LanguageModel, LocalShellSource, McpConnection, ParkedExecution, Runner, RunnerSnapshot, SHELL_REFUSAL, SessionInstructions, SessionRunnerConfig, ShellDirectory, ToolExecutionCall, ToolExecutionResult, ToolExecutor, ToolSet } from "@workerdeck/core";
|
|
3
3
|
import { JobQueue, QueueAdapter } from "@workerdeck/queue";
|
|
4
|
-
import { ByModel, CreateSessionRequest, JobEvent, MessageAttachment, ModelRate, PricingTable, ProfileEngine, ProfileInfo, ProfileSpend, ProfileUsage, ProviderConfig, SdkSessionSummary, ServerFrame, SessionCapability, SessionInfo, SessionNotification, SessionWebhookConfig, ShellEndReason, ShellInfo, ShellOwner } from "@workerdeck/protocol";
|
|
4
|
+
import { AgentInfo, ByModel, CreateSessionRequest, JobEvent, MessageAttachment, ModelRate, PricingTable, ProfileEngine, ProfileInfo, ProfileSpend, ProfileUsage, ProviderConfig, SdkSessionSummary, ServerFrame, SessionCapability, SessionInfo, SessionNotification, SessionWebhookConfig, ShellEndReason, ShellInfo, ShellOwner } from "@workerdeck/protocol";
|
|
5
5
|
import { RelayOp } from "@workerdeck/relay-client";
|
|
6
6
|
//#region src/services/bridge.d.ts
|
|
7
7
|
type BridgeHubOptions = {
|
|
@@ -18,6 +18,13 @@ declare class BridgeHub {
|
|
|
18
18
|
remove(sessionId: string): void;
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
|
+
//#region src/services/context-resets.d.ts
|
|
22
|
+
type AgentContextResetOptions = {
|
|
23
|
+
default?: boolean;
|
|
24
|
+
minIntervalMs?: number;
|
|
25
|
+
maxPerHour?: number;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
21
28
|
//#region src/services/notifications.d.ts
|
|
22
29
|
type SessionNotificationOptions = {
|
|
23
30
|
webhook?: SessionWebhookConfig;
|
|
@@ -178,6 +185,31 @@ type ProfileStore = {
|
|
|
178
185
|
declare function createMemoryProfileStore(seed?: ProfileInfo[]): ProfileStore;
|
|
179
186
|
declare function createFileProfileStore(path?: string): ProfileStore;
|
|
180
187
|
//#endregion
|
|
188
|
+
//#region src/services/agent-store.d.ts
|
|
189
|
+
type StoredAgent = AgentInfo & {
|
|
190
|
+
avatarSeed: string;
|
|
191
|
+
avatarRecipe?: unknown;
|
|
192
|
+
};
|
|
193
|
+
type AgentStore = {
|
|
194
|
+
list(): StoredAgent[] | Promise<StoredAgent[]>;
|
|
195
|
+
save(agent: StoredAgent): void | Promise<void>;
|
|
196
|
+
delete(id: string): void | Promise<void>;
|
|
197
|
+
};
|
|
198
|
+
declare function createMemoryAgentStore(seed?: StoredAgent[]): AgentStore;
|
|
199
|
+
declare function createFileAgentStore(path?: string): AgentStore;
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/services/avatars.d.ts
|
|
202
|
+
type AvatarImage = {
|
|
203
|
+
png: Uint8Array;
|
|
204
|
+
etag: string;
|
|
205
|
+
durations?: number[];
|
|
206
|
+
};
|
|
207
|
+
type AvatarProvider = {
|
|
208
|
+
roll(seed: string, engine: ProfileEngine | undefined, projectKey: string | undefined): Promise<unknown>;
|
|
209
|
+
still(recipe: unknown): Promise<AvatarImage>;
|
|
210
|
+
busy(recipe: unknown): Promise<AvatarImage | undefined>;
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
181
213
|
//#region src/services/process-tree.d.ts
|
|
182
214
|
type ProcessRow = {
|
|
183
215
|
pid: number;
|
|
@@ -350,6 +382,8 @@ type WorkerServerOptions = {
|
|
|
350
382
|
};
|
|
351
383
|
profiles?: ProfileInfo[];
|
|
352
384
|
profileStore?: ProfileStore;
|
|
385
|
+
agentStore?: AgentStore;
|
|
386
|
+
avatars?: AvatarProvider;
|
|
353
387
|
allowedConfigDirRoots?: string[];
|
|
354
388
|
buildRunnerConfig?: (req: CreateSessionRequest) => SessionRunnerConfig;
|
|
355
389
|
basePath?: string;
|
|
@@ -371,6 +405,10 @@ type WorkerServerOptions = {
|
|
|
371
405
|
peers?: PeerServiceOptions;
|
|
372
406
|
relay?: RelayLinkOptions;
|
|
373
407
|
notifications?: SessionNotificationOptions;
|
|
408
|
+
engineSleepAfterMs?: number;
|
|
409
|
+
agentSleepAfterMs?: number;
|
|
410
|
+
agentContextReset?: false | AgentContextResetOptions;
|
|
411
|
+
effortDefaults?: Record<string, string>;
|
|
374
412
|
bridge?: BridgeHubOptions;
|
|
375
413
|
parking?: {
|
|
376
414
|
store?: SessionStore;
|
|
@@ -553,5 +591,5 @@ declare class ProfileUsageTracker {
|
|
|
553
591
|
usage(profile: string, now?: number): ProfileUsage | undefined;
|
|
554
592
|
}
|
|
555
593
|
//#endregion
|
|
556
|
-
export { AttachmentStore, type AttachmentStoreOptions, type Authenticator, BridgeHub, type BridgeHubOptions, type CarriedSession, type DiagnosticSink, type EngineRunnerContext, type FileSessionStoreOptions, type JsonWriteOptions, MemorySessionStore, type NotificationErrorContext, type ParkedSessionRecord, type ProcessRow, type ProcessTable, type ProducedFile, ProducedFileStore, type ProfileStore, ProfileUsageTracker, type ProviderRunnerOptions, type QueueServerOptions, type RelayLinkOptions, type ReloadPlan, SHELL_REFUSAL, type SdkSessionLister, type SessionNotificationOptions, SessionNotifier, SessionParkManager, type SessionParkOptions, SessionRegistry, type SessionRegistryOptions, type SessionStore, type ShellAgentWriteOption, type ShellDirectoryDeps, type ShellRegistry, type ShellRegistryOptions, type ShellSink, SpendLedger, type SpendRecord, type SpendStore, type StoredSessionRecord, type StoredShellIndex, type StoredShellRecord, type WorkerServer, type WorkerServerOptions, createFileProfileStore, createFileSessionStore, createFileSpendStore, createMemoryProfileStore, createProviderRunner, createShellDirectory, createShellRegistry, createWorkerServer, dayKey, isDormant, isMissing, readJsonOr, reloadPlan, sandboxedProviderProfile, shellPermitted, toDurableRecord, writeFileAtomic, writeJsonAtomic };
|
|
594
|
+
export { type AgentStore, AttachmentStore, type AttachmentStoreOptions, type Authenticator, type AvatarImage, type AvatarProvider, BridgeHub, type BridgeHubOptions, type CarriedSession, type DiagnosticSink, type EngineRunnerContext, type FileSessionStoreOptions, type JsonWriteOptions, MemorySessionStore, type NotificationErrorContext, type ParkedSessionRecord, type ProcessRow, type ProcessTable, type ProducedFile, ProducedFileStore, type ProfileStore, ProfileUsageTracker, type ProviderRunnerOptions, type QueueServerOptions, type RelayLinkOptions, type ReloadPlan, SHELL_REFUSAL, type SdkSessionLister, type SessionNotificationOptions, SessionNotifier, SessionParkManager, type SessionParkOptions, SessionRegistry, type SessionRegistryOptions, type SessionStore, type ShellAgentWriteOption, type ShellDirectoryDeps, type ShellRegistry, type ShellRegistryOptions, type ShellSink, SpendLedger, type SpendRecord, type SpendStore, type StoredAgent, type StoredSessionRecord, type StoredShellIndex, type StoredShellRecord, type WorkerServer, type WorkerServerOptions, createFileAgentStore, createFileProfileStore, createFileSessionStore, createFileSpendStore, createMemoryAgentStore, createMemoryProfileStore, createProviderRunner, createShellDirectory, createShellRegistry, createWorkerServer, dayKey, isDormant, isMissing, readJsonOr, reloadPlan, sandboxedProviderProfile, shellPermitted, toDurableRecord, writeFileAtomic, writeJsonAtomic };
|
|
557
595
|
//# sourceMappingURL=index.d.mts.map
|