@openacp/cli 2026.410.3 → 2026.414.1

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.
@@ -56,6 +56,14 @@ interface TurnContext {
56
56
  sourceAdapterId: string;
57
57
  /** Where to send the response: null = silent (suppress), undefined = same as source, string = explicit target. */
58
58
  responseAdapterId?: string | null;
59
+ /** The raw user prompt before any middleware modifications. */
60
+ userPrompt: string;
61
+ /** The final prompt text sent to the agent after all middleware transformations. */
62
+ finalPrompt: string;
63
+ /** File or media attachments included with the prompt. */
64
+ attachments?: Attachment[];
65
+ /** Caller-supplied metadata for this turn (e.g., identity, source info). */
66
+ meta?: TurnMeta;
59
67
  }
60
68
  /**
61
69
  * Routing hints attached to an incoming prompt — carried through the queue
@@ -65,11 +73,13 @@ interface TurnRouting {
65
73
  sourceAdapterId: string;
66
74
  responseAdapterId?: string | null;
67
75
  }
68
- /**
69
- * Create a new TurnContext. Called when a prompt is dequeued from the queue.
70
- * If a pre-generated turnId is provided (from enqueuePrompt), it is used; otherwise a new one is generated.
71
- */
72
- declare function createTurnContext(sourceAdapterId: string, responseAdapterId?: string | null, turnId?: string): TurnContext;
76
+ /** Identity and display info for the user who sent the turn. */
77
+ interface TurnSender {
78
+ userId: string;
79
+ identityId: string;
80
+ displayName?: string;
81
+ username?: string;
82
+ }
73
83
  /**
74
84
  * Get the effective response adapter for a turn.
75
85
  * - null → silent (no adapter renders)
@@ -77,8 +87,26 @@ declare function createTurnContext(sourceAdapterId: string, responseAdapterId?:
77
87
  * - string → explicit target
78
88
  */
79
89
  declare function getEffectiveTarget(ctx: TurnContext): string | null;
90
+ /**
91
+ * Create a new TurnContext. Called when a prompt is dequeued from the queue.
92
+ * If a pre-generated turnId is provided (from enqueuePrompt), it is used; otherwise a new one is generated.
93
+ */
94
+ declare function createTurnContext(sourceAdapterId: string, responseAdapterId: string | null | undefined, turnId: string | undefined, userPrompt: string, finalPrompt: string, attachments?: Attachment[], meta?: TurnMeta): TurnContext;
80
95
  declare function isSystemEvent(event: AgentEvent): boolean;
81
96
 
97
+ /**
98
+ * Per-turn context bag threaded through all turn-lifecycle middleware hooks.
99
+ *
100
+ * Core fills in `turnId`; plugins attach arbitrary keys at any hook and read
101
+ * them at subsequent hooks in the same turn. The object is mutable by design —
102
+ * plugins collaborating through meta should use namespaced keys to avoid clashes
103
+ * (e.g., `meta['workspace.sender']` not `meta.sender`).
104
+ */
105
+ interface TurnMeta {
106
+ /** The turn's unique ID — same value passed to session.enqueuePrompt(). */
107
+ turnId: string;
108
+ [key: string]: unknown;
109
+ }
82
110
  /**
83
111
  * A file attachment sent to or received from an agent.
84
112
  *
@@ -451,6 +479,10 @@ interface SessionRecord<P = Record<string, unknown>> {
451
479
  firstAgent?: string;
452
480
  currentPromptCount?: number;
453
481
  agentSwitchHistory?: AgentSwitchEntry[];
482
+ /** userId of the user who created this session (from identity system). */
483
+ createdBy?: string;
484
+ /** userId[] of all users who have sent messages in this session. */
485
+ participants?: string[];
454
486
  acpState?: {
455
487
  configOptions?: ConfigOption[];
456
488
  agentCapabilities?: AgentCapabilities;
@@ -734,6 +766,16 @@ interface IChannelAdapter {
734
766
  /** Flush skill commands that were queued before threadId was available. */
735
767
  flushPendingSkillCommands?(sessionId: string): Promise<void>;
736
768
  cleanupSessionState?(sessionId: string): Promise<void>;
769
+ /** Send a notification directly to a user by platform ID. Best-effort delivery. */
770
+ sendUserNotification?(platformId: string, message: NotificationMessage, options?: {
771
+ via?: 'dm' | 'thread' | 'topic';
772
+ topicId?: string;
773
+ sessionId?: string;
774
+ platformMention?: {
775
+ platformUsername?: string;
776
+ platformId: string;
777
+ };
778
+ }): Promise<void>;
737
779
  }
738
780
  /**
739
781
  * Original base class for channel adapters. Provides default no-op implementations
@@ -764,6 +806,7 @@ declare abstract class ChannelAdapter<TCore = unknown> implements IChannelAdapte
764
806
  cleanupSkillCommands(_sessionId: string): Promise<void>;
765
807
  cleanupSessionState(_sessionId: string): Promise<void>;
766
808
  archiveSessionTopic(_sessionId: string): Promise<void>;
809
+ sendUserNotification(_platformId: string, _message: NotificationMessage, _options?: any): Promise<void>;
767
810
  }
768
811
 
769
- export { type SessionModelState as $, type Attachment as A, type ConfigSelectGroup as B, type ConfigOption as C, type DisplayVerbosity as D, type ContentBlock as E, type ModelInfo as F, type NewSessionResponse as G, type PermissionOption as H, type IChannelAdapter as I, type PromptResponse as J, KIND_ICONS as K, type RegistryBinaryTarget as L, type McpServerConfig as M, type NotificationMessage as N, type OutgoingMessage as O, type PermissionRequest as P, type RegistryDistribution as Q, type RegistryAgent as R, type StopReason as S, type TurnContext as T, type UsageRecord as U, type ViewerLinks as V, STATUS_ICONS as W, type SessionListItem as X, type SessionListResponse as Y, type SessionMode as Z, type SessionModeState as _, type AgentEvent as a, type TelegramPlatformData as a0, type ToolUpdateMeta as a1, createTurnContext as a2, getEffectiveTarget as a3, isSystemEvent as a4, type AgentCapabilities as b, type AgentDefinition as c, type SetConfigOptionValue as d, type InstalledAgent as e, type AgentListItem as f, type AvailabilityResult as g, type InstallProgress as h, type InstallResult as i, type SessionStatus as j, type AgentSwitchEntry as k, type AgentCommand as l, type TurnRouting as m, type SessionRecord as n, type UsageRecordEvent as o, type IncomingMessage as p, type ChannelConfig as q, type AdapterCapabilities as r, type ToolCallMeta as s, type OutputMode as t, type PlanEntry as u, type AgentDistribution as v, type AuthMethod as w, type AuthenticateRequest as x, ChannelAdapter as y, type ConfigSelectChoice as z };
812
+ export { type SessionMode as $, type Attachment as A, ChannelAdapter as B, type ConfigOption as C, type DisplayVerbosity as D, type ConfigSelectChoice as E, type ConfigSelectGroup as F, type ContentBlock as G, type ModelInfo as H, type IChannelAdapter as I, type NewSessionResponse as J, KIND_ICONS as K, type PermissionOption as L, type McpServerConfig as M, type NotificationMessage as N, type OutgoingMessage as O, type PermissionRequest as P, type PromptResponse as Q, type RegistryAgent as R, type StopReason as S, type TurnMeta as T, type UsageRecord as U, type ViewerLinks as V, type RegistryBinaryTarget as W, type RegistryDistribution as X, STATUS_ICONS as Y, type SessionListItem as Z, type SessionListResponse as _, type AgentEvent as a, type SessionModeState as a0, type SessionModelState as a1, type TelegramPlatformData as a2, type ToolUpdateMeta as a3, createTurnContext as a4, getEffectiveTarget as a5, isSystemEvent as a6, type SessionStatus as b, type AgentCapabilities as c, type AgentDefinition as d, type SetConfigOptionValue as e, type InstalledAgent as f, type AgentListItem as g, type AvailabilityResult as h, type InstallProgress as i, type InstallResult as j, type TurnContext as k, type AgentSwitchEntry as l, type AgentCommand as m, type TurnRouting as n, type SessionRecord as o, type UsageRecordEvent as p, type TurnSender as q, type IncomingMessage as r, type ChannelConfig as s, type AdapterCapabilities as t, type ToolCallMeta as u, type OutputMode as v, type PlanEntry as w, type AgentDistribution as x, type AuthMethod as y, type AuthenticateRequest as z };