@openacp/cli 2026.410.2 → 2026.413.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.
- package/dist/{channel-CFMUPzvH.d.ts → channel-Dg1nGCYa.d.ts} +29 -1
- package/dist/cli.js +1324 -135
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +250 -22
- package/dist/index.js +322 -34
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Attachment, O as OutgoingMessage, I as IChannelAdapter,
|
|
2
|
-
export {
|
|
1
|
+
import { A as Attachment, O as OutgoingMessage, I as IChannelAdapter, T as TurnMeta, a as AgentEvent, S as StopReason, P as PermissionRequest, N as NotificationMessage, b as SessionStatus, U as UsageRecord, c as AgentCapabilities, d as AgentDefinition, M as McpServerConfig, e as SetConfigOptionValue, f as InstalledAgent, R as RegistryAgent, g as AgentListItem, h as AvailabilityResult, i as InstallProgress, j as InstallResult, k as TurnContext, C as ConfigOption, l as AgentSwitchEntry, m as AgentCommand, n as TurnRouting, o as SessionRecord, p as UsageRecordEvent, q as IncomingMessage, D as DisplayVerbosity, r as ChannelConfig, s as AdapterCapabilities, t as ToolCallMeta, V as ViewerLinks, u as OutputMode, v as PlanEntry } from './channel-Dg1nGCYa.js';
|
|
2
|
+
export { w as AgentDistribution, x as AuthMethod, y as AuthenticateRequest, z as ChannelAdapter, B as ConfigSelectChoice, E as ConfigSelectGroup, F as ContentBlock, K as KIND_ICONS, G as ModelInfo, H as NewSessionResponse, J as PermissionOption, L as PromptResponse, Q as RegistryBinaryTarget, W as RegistryDistribution, X as STATUS_ICONS, Y as SessionListItem, Z as SessionListResponse, _ as SessionMode, $ as SessionModeState, a0 as SessionModelState, a1 as TelegramPlatformData, a2 as ToolUpdateMeta, a3 as createTurnContext, a4 as getEffectiveTarget, a5 as isSystemEvent } from './channel-Dg1nGCYa.js';
|
|
3
3
|
import pino from 'pino';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { ZodSchema, z } from 'zod';
|
|
@@ -82,7 +82,17 @@ type PluginPermission =
|
|
|
82
82
|
/** Write to plugin-scoped storage */
|
|
83
83
|
| 'storage:write'
|
|
84
84
|
/** Direct access to OpenACPCore internals (sessions, config, eventBus) */
|
|
85
|
-
| 'kernel:access'
|
|
85
|
+
| 'kernel:access'
|
|
86
|
+
/** Read-only session metadata without kernel:access */
|
|
87
|
+
| 'sessions:read'
|
|
88
|
+
/** Read identity data (users, identities, search) */
|
|
89
|
+
| 'identity:read'
|
|
90
|
+
/** Write identity data (create, update, link, unlink, roles) */
|
|
91
|
+
| 'identity:write'
|
|
92
|
+
/** Register an identity source (adapters register their platform name) */
|
|
93
|
+
| 'identity:register-source'
|
|
94
|
+
/** Send push notifications to users */
|
|
95
|
+
| 'notifications:send';
|
|
86
96
|
/**
|
|
87
97
|
* The runtime plugin instance — the object a plugin module default-exports.
|
|
88
98
|
*
|
|
@@ -141,8 +151,14 @@ interface PluginStorage {
|
|
|
141
151
|
set<T>(key: string, value: T): Promise<void>;
|
|
142
152
|
delete(key: string): Promise<void>;
|
|
143
153
|
list(): Promise<string[]>;
|
|
154
|
+
/** Returns keys matching the given prefix, or all keys if prefix is omitted. */
|
|
155
|
+
keys(prefix?: string): Promise<string[]>;
|
|
156
|
+
/** Deletes all keys in this storage scope. */
|
|
157
|
+
clear(): Promise<void>;
|
|
144
158
|
/** Returns the plugin's dedicated data directory, creating it if needed */
|
|
145
159
|
getDataDir(): string;
|
|
160
|
+
/** Returns a storage instance scoped to the given session. Auto-isolated from global storage. */
|
|
161
|
+
forSession(sessionId: string): PluginStorage;
|
|
146
162
|
}
|
|
147
163
|
/**
|
|
148
164
|
* Typed API for reading and writing a plugin's settings.json file.
|
|
@@ -253,6 +269,22 @@ interface MigrateContext {
|
|
|
253
269
|
type CommandResponse = {
|
|
254
270
|
type: 'text';
|
|
255
271
|
text: string;
|
|
272
|
+
} | {
|
|
273
|
+
/**
|
|
274
|
+
* Adapter-aware response: each adapter reads its own key from `variants`.
|
|
275
|
+
* Adapters without a matching variant render `fallback` as plain text.
|
|
276
|
+
*
|
|
277
|
+
* Variant shapes by adapter ID:
|
|
278
|
+
* telegram: { text: string; parse_mode?: 'HTML' | 'Markdown' | 'MarkdownV2' }
|
|
279
|
+
* discord: { content?: string; embeds?: unknown[] }
|
|
280
|
+
* slack: { text: string; blocks?: unknown[] }
|
|
281
|
+
* sse: { text: string; format?: 'plain' | 'markdown' | 'html' }
|
|
282
|
+
*/
|
|
283
|
+
type: 'adaptive';
|
|
284
|
+
/** Plain text rendered by adapters without a matching variant */
|
|
285
|
+
fallback: string;
|
|
286
|
+
/** Per-adapter payloads, keyed by adapter ID */
|
|
287
|
+
variants?: Record<string, unknown>;
|
|
256
288
|
} | {
|
|
257
289
|
type: 'menu';
|
|
258
290
|
title: string;
|
|
@@ -423,6 +455,51 @@ interface PluginContext {
|
|
|
423
455
|
* → [HOOK: message:outgoing] → adapter.sendMessage()
|
|
424
456
|
*/
|
|
425
457
|
sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
|
|
458
|
+
/**
|
|
459
|
+
* Send a user-targeted notification. Fire-and-forget, best-effort.
|
|
460
|
+
* Resolves target via identity system — one call delivers across all linked platforms.
|
|
461
|
+
* Requires 'notifications:send' permission.
|
|
462
|
+
*/
|
|
463
|
+
notify(target: {
|
|
464
|
+
identityId: string;
|
|
465
|
+
} | {
|
|
466
|
+
userId: string;
|
|
467
|
+
} | {
|
|
468
|
+
channelId: string;
|
|
469
|
+
platformId: string;
|
|
470
|
+
}, message: {
|
|
471
|
+
type: 'text';
|
|
472
|
+
text: string;
|
|
473
|
+
}, options?: {
|
|
474
|
+
via?: 'dm' | 'thread' | 'topic';
|
|
475
|
+
topicId?: string;
|
|
476
|
+
sessionId?: string;
|
|
477
|
+
onlyPlatforms?: string[];
|
|
478
|
+
excludePlatforms?: string[];
|
|
479
|
+
}): void;
|
|
480
|
+
/**
|
|
481
|
+
* Define a custom hook that other plugins can register middleware on.
|
|
482
|
+
* The hook name is automatically prefixed with `plugin:{pluginName}:`.
|
|
483
|
+
*/
|
|
484
|
+
defineHook(name: string): void;
|
|
485
|
+
/**
|
|
486
|
+
* Fire a custom hook through the middleware chain.
|
|
487
|
+
* Name is auto-prefixed: `emitHook('foo', p)` fires `plugin:{pluginName}:foo`.
|
|
488
|
+
* Returns the final payload (possibly modified by middleware), or null if blocked.
|
|
489
|
+
*/
|
|
490
|
+
emitHook<T extends Record<string, unknown>>(name: string, payload: T): Promise<T | null>;
|
|
491
|
+
/**
|
|
492
|
+
* Read-only session metadata. Requires `sessions:read` permission.
|
|
493
|
+
* Returns undefined if the session does not exist.
|
|
494
|
+
*/
|
|
495
|
+
getSessionInfo(sessionId: string): Promise<{
|
|
496
|
+
id: string;
|
|
497
|
+
status: SessionStatus;
|
|
498
|
+
name?: string;
|
|
499
|
+
promptCount: number;
|
|
500
|
+
channelId: string;
|
|
501
|
+
agentName: string;
|
|
502
|
+
} | undefined>;
|
|
426
503
|
/** Direct access to SessionManager. Requires 'kernel:access'. */
|
|
427
504
|
sessions: SessionManager$1;
|
|
428
505
|
/** Direct access to ConfigManager. Requires 'kernel:access'. */
|
|
@@ -452,6 +529,8 @@ interface MiddlewarePayloadMap {
|
|
|
452
529
|
userId: string;
|
|
453
530
|
text: string;
|
|
454
531
|
attachments?: Attachment[];
|
|
532
|
+
/** Per-turn context bag. Undefined for messages that bypass the normal handleMessage flow. */
|
|
533
|
+
meta?: TurnMeta;
|
|
455
534
|
};
|
|
456
535
|
'message:outgoing': {
|
|
457
536
|
sessionId: string;
|
|
@@ -462,6 +541,8 @@ interface MiddlewarePayloadMap {
|
|
|
462
541
|
text: string;
|
|
463
542
|
attachments?: Attachment[];
|
|
464
543
|
sourceAdapterId?: string;
|
|
544
|
+
/** Per-turn context bag carried from message:incoming. */
|
|
545
|
+
meta?: TurnMeta;
|
|
465
546
|
};
|
|
466
547
|
'agent:beforeEvent': {
|
|
467
548
|
sessionId: string;
|
|
@@ -476,11 +557,24 @@ interface MiddlewarePayloadMap {
|
|
|
476
557
|
sessionId: string;
|
|
477
558
|
promptText: string;
|
|
478
559
|
promptNumber: number;
|
|
560
|
+
turnId: string;
|
|
561
|
+
meta?: TurnMeta;
|
|
479
562
|
};
|
|
480
563
|
'turn:end': {
|
|
481
564
|
sessionId: string;
|
|
482
565
|
stopReason: StopReason;
|
|
483
566
|
durationMs: number;
|
|
567
|
+
turnId: string;
|
|
568
|
+
meta?: TurnMeta;
|
|
569
|
+
};
|
|
570
|
+
/** Fires after the full turn response is assembled. Read-only, fire-and-forget. */
|
|
571
|
+
'agent:afterTurn': {
|
|
572
|
+
sessionId: string;
|
|
573
|
+
turnId: string;
|
|
574
|
+
/** Complete response text — all text chunks concatenated. Empty if agent produced no text. */
|
|
575
|
+
fullText: string;
|
|
576
|
+
stopReason: StopReason;
|
|
577
|
+
meta?: TurnMeta;
|
|
484
578
|
};
|
|
485
579
|
'fs:beforeRead': {
|
|
486
580
|
sessionId: string;
|
|
@@ -590,9 +684,27 @@ interface FileServiceInterface {
|
|
|
590
684
|
extensionFromMime(mimeType: string): string;
|
|
591
685
|
convertOggToWav(oggData: Buffer): Promise<Buffer>;
|
|
592
686
|
}
|
|
593
|
-
interface NotificationService {
|
|
687
|
+
interface NotificationService$1 {
|
|
594
688
|
notify(channelId: string, notification: NotificationMessage): Promise<void>;
|
|
595
689
|
notifyAll(notification: NotificationMessage): Promise<void>;
|
|
690
|
+
/** Send a notification to a user across all their linked platforms. Fire-and-forget. */
|
|
691
|
+
notifyUser?(target: {
|
|
692
|
+
identityId: string;
|
|
693
|
+
} | {
|
|
694
|
+
userId: string;
|
|
695
|
+
} | {
|
|
696
|
+
channelId: string;
|
|
697
|
+
platformId: string;
|
|
698
|
+
}, message: {
|
|
699
|
+
type: 'text';
|
|
700
|
+
text: string;
|
|
701
|
+
}, options?: {
|
|
702
|
+
via?: 'dm' | 'thread' | 'topic';
|
|
703
|
+
topicId?: string;
|
|
704
|
+
sessionId?: string;
|
|
705
|
+
onlyPlatforms?: string[];
|
|
706
|
+
excludePlatforms?: string[];
|
|
707
|
+
}): Promise<void>;
|
|
596
708
|
}
|
|
597
709
|
interface UsageService {
|
|
598
710
|
trackUsage(record: UsageRecord): Promise<void>;
|
|
@@ -1767,7 +1879,7 @@ declare class Session extends TypedEmitter<SessionEvents> {
|
|
|
1767
1879
|
* then adds it to the PromptQueue. Returns a turnId that callers can use to correlate
|
|
1768
1880
|
* queued/processing events before the prompt actually runs.
|
|
1769
1881
|
*/
|
|
1770
|
-
enqueuePrompt(text: string, attachments?: Attachment[], routing?: TurnRouting, externalTurnId?: string): Promise<string>;
|
|
1882
|
+
enqueuePrompt(text: string, attachments?: Attachment[], routing?: TurnRouting, externalTurnId?: string, meta?: TurnMeta): Promise<string>;
|
|
1771
1883
|
private processPrompt;
|
|
1772
1884
|
/**
|
|
1773
1885
|
* Transcribe audio attachments to text if the agent doesn't support audio natively.
|
|
@@ -1826,13 +1938,13 @@ declare class PromptQueue {
|
|
|
1826
1938
|
private abortController;
|
|
1827
1939
|
/** Set when abort is triggered; drainNext waits for the current processor to settle before starting the next item. */
|
|
1828
1940
|
private processorSettled;
|
|
1829
|
-
constructor(processor: (text: string, attachments?: Attachment[], routing?: TurnRouting, turnId?: string) => Promise<void>, onError?: ((err: unknown) => void) | undefined);
|
|
1941
|
+
constructor(processor: (text: string, attachments?: Attachment[], routing?: TurnRouting, turnId?: string, meta?: TurnMeta) => Promise<void>, onError?: ((err: unknown) => void) | undefined);
|
|
1830
1942
|
/**
|
|
1831
1943
|
* Add a prompt to the queue. If no prompt is currently processing, it runs
|
|
1832
1944
|
* immediately. Otherwise, it's buffered and the returned promise resolves
|
|
1833
1945
|
* only after the prompt finishes processing.
|
|
1834
1946
|
*/
|
|
1835
|
-
enqueue(text: string, attachments?: Attachment[], routing?: TurnRouting, turnId?: string): Promise<void>;
|
|
1947
|
+
enqueue(text: string, attachments?: Attachment[], routing?: TurnRouting, turnId?: string, meta?: TurnMeta): Promise<void>;
|
|
1836
1948
|
/** Run a single prompt through the processor, then drain the next queued item. */
|
|
1837
1949
|
private process;
|
|
1838
1950
|
/** Dequeue and process the next pending prompt, if any. Called after each prompt completes. */
|
|
@@ -1909,6 +2021,7 @@ interface EventBusEvents {
|
|
|
1909
2021
|
sessionId: string;
|
|
1910
2022
|
agent: string;
|
|
1911
2023
|
status: SessionStatus;
|
|
2024
|
+
userId?: string;
|
|
1912
2025
|
}) => void;
|
|
1913
2026
|
"session:updated": (data: {
|
|
1914
2027
|
sessionId: string;
|
|
@@ -2005,6 +2118,42 @@ interface EventBusEvents {
|
|
|
2005
2118
|
resumed?: boolean;
|
|
2006
2119
|
error?: string;
|
|
2007
2120
|
}) => void;
|
|
2121
|
+
"identity:created": (data: {
|
|
2122
|
+
userId: string;
|
|
2123
|
+
identityId: string;
|
|
2124
|
+
source: string;
|
|
2125
|
+
displayName: string;
|
|
2126
|
+
}) => void;
|
|
2127
|
+
"identity:updated": (data: {
|
|
2128
|
+
userId: string;
|
|
2129
|
+
changes: string[];
|
|
2130
|
+
}) => void;
|
|
2131
|
+
"identity:linked": (data: {
|
|
2132
|
+
userId: string;
|
|
2133
|
+
identityId: string;
|
|
2134
|
+
linkedFrom?: string;
|
|
2135
|
+
}) => void;
|
|
2136
|
+
"identity:unlinked": (data: {
|
|
2137
|
+
userId: string;
|
|
2138
|
+
identityId: string;
|
|
2139
|
+
newUserId: string;
|
|
2140
|
+
}) => void;
|
|
2141
|
+
"identity:userMerged": (data: {
|
|
2142
|
+
keptUserId: string;
|
|
2143
|
+
mergedUserId: string;
|
|
2144
|
+
movedIdentities: string[];
|
|
2145
|
+
}) => void;
|
|
2146
|
+
"identity:roleChanged": (data: {
|
|
2147
|
+
userId: string;
|
|
2148
|
+
oldRole: string;
|
|
2149
|
+
newRole: string;
|
|
2150
|
+
changedBy?: string;
|
|
2151
|
+
}) => void;
|
|
2152
|
+
"identity:seen": (data: {
|
|
2153
|
+
userId: string;
|
|
2154
|
+
identityId: string;
|
|
2155
|
+
sessionId: string;
|
|
2156
|
+
}) => void;
|
|
2008
2157
|
}
|
|
2009
2158
|
/**
|
|
2010
2159
|
* Global event bus for cross-cutting communication.
|
|
@@ -2106,21 +2255,62 @@ declare class SessionManager {
|
|
|
2106
2255
|
destroyAll(): Promise<void>;
|
|
2107
2256
|
}
|
|
2108
2257
|
|
|
2258
|
+
/** Target for user-directed notifications. */
|
|
2259
|
+
type NotificationTarget = {
|
|
2260
|
+
identityId: string;
|
|
2261
|
+
} | {
|
|
2262
|
+
userId: string;
|
|
2263
|
+
} | {
|
|
2264
|
+
channelId: string;
|
|
2265
|
+
platformId: string;
|
|
2266
|
+
};
|
|
2267
|
+
interface NotificationOptions {
|
|
2268
|
+
via?: 'dm' | 'thread' | 'topic';
|
|
2269
|
+
topicId?: string;
|
|
2270
|
+
sessionId?: string;
|
|
2271
|
+
onlyPlatforms?: string[];
|
|
2272
|
+
excludePlatforms?: string[];
|
|
2273
|
+
}
|
|
2274
|
+
/** User-facing notification content — distinct from system NotificationMessage. */
|
|
2275
|
+
interface UserNotificationContent {
|
|
2276
|
+
type: 'text';
|
|
2277
|
+
text: string;
|
|
2278
|
+
}
|
|
2109
2279
|
/**
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2280
|
+
* Minimal identity service interface — avoids hard dependency on identity plugin types.
|
|
2281
|
+
* NotificationService only needs resolution capabilities, not full CRUD.
|
|
2282
|
+
*/
|
|
2283
|
+
interface IdentityResolver {
|
|
2284
|
+
getIdentity(identityId: string): Promise<{
|
|
2285
|
+
userId: string;
|
|
2286
|
+
source: string;
|
|
2287
|
+
platformId: string;
|
|
2288
|
+
platformUsername?: string;
|
|
2289
|
+
} | undefined>;
|
|
2290
|
+
getUser(userId: string): Promise<{
|
|
2291
|
+
userId: string;
|
|
2292
|
+
identities: string[];
|
|
2293
|
+
} | undefined>;
|
|
2294
|
+
getIdentitiesFor(userId: string): Promise<Array<{
|
|
2295
|
+
identityId: string;
|
|
2296
|
+
source: string;
|
|
2297
|
+
platformId: string;
|
|
2298
|
+
platformUsername?: string;
|
|
2299
|
+
}>>;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Routes notifications to channel adapters. Extends the legacy NotificationManager
|
|
2303
|
+
* with user-targeted delivery via the identity system.
|
|
2116
2304
|
*
|
|
2117
|
-
*
|
|
2118
|
-
*
|
|
2119
|
-
* after this service is created are still reachable.
|
|
2305
|
+
* Legacy API (notify/notifyAll) is preserved — existing callers in SessionBridge
|
|
2306
|
+
* continue to work without changes.
|
|
2120
2307
|
*/
|
|
2121
|
-
declare class
|
|
2308
|
+
declare class NotificationService {
|
|
2122
2309
|
private adapters;
|
|
2310
|
+
private identityResolver?;
|
|
2123
2311
|
constructor(adapters: Map<string, IChannelAdapter>);
|
|
2312
|
+
/** Inject identity resolver for user-targeted notifications. */
|
|
2313
|
+
setIdentityResolver(resolver: IdentityResolver): void;
|
|
2124
2314
|
/**
|
|
2125
2315
|
* Send a notification to a specific channel adapter.
|
|
2126
2316
|
*
|
|
@@ -2135,12 +2325,18 @@ declare class NotificationManager {
|
|
|
2135
2325
|
* failure is isolated so one broken adapter cannot block the rest.
|
|
2136
2326
|
*/
|
|
2137
2327
|
notifyAll(notification: NotificationMessage): Promise<void>;
|
|
2328
|
+
/**
|
|
2329
|
+
* Send a notification to a user across all their linked platforms.
|
|
2330
|
+
* Fire-and-forget — never throws, swallows all errors.
|
|
2331
|
+
*/
|
|
2332
|
+
notifyUser(target: NotificationTarget, message: UserNotificationContent, options?: NotificationOptions): Promise<void>;
|
|
2333
|
+
private _resolveAndDeliver;
|
|
2138
2334
|
}
|
|
2139
2335
|
|
|
2140
2336
|
/** Services required by SessionBridge for message transformation, persistence, and middleware. */
|
|
2141
2337
|
interface BridgeDeps {
|
|
2142
2338
|
messageTransformer: MessageTransformer;
|
|
2143
|
-
notificationManager:
|
|
2339
|
+
notificationManager: NotificationService;
|
|
2144
2340
|
sessionManager: SessionManager;
|
|
2145
2341
|
eventBus?: EventBus;
|
|
2146
2342
|
fileService?: FileServiceInterface;
|
|
@@ -2410,6 +2606,12 @@ interface Turn {
|
|
|
2410
2606
|
content?: string;
|
|
2411
2607
|
attachments?: HistoryAttachment[];
|
|
2412
2608
|
sourceAdapterId?: string;
|
|
2609
|
+
/**
|
|
2610
|
+
* TurnMeta bag as it existed when agent:beforePrompt fired — includes anything
|
|
2611
|
+
* plugins attached during message:incoming (e.g. workspace.sender, channelUser).
|
|
2612
|
+
* Persisted so history consumers can reconstruct who sent what without a live registry.
|
|
2613
|
+
*/
|
|
2614
|
+
meta?: Record<string, unknown>;
|
|
2413
2615
|
steps?: Step[];
|
|
2414
2616
|
usage?: HistoryUsage;
|
|
2415
2617
|
stopReason?: string;
|
|
@@ -2599,10 +2801,12 @@ interface SessionCreateParams {
|
|
|
2599
2801
|
existingSessionId?: string;
|
|
2600
2802
|
initialName?: string;
|
|
2601
2803
|
isAssistant?: boolean;
|
|
2804
|
+
/** User ID from identity system — who is creating this session. */
|
|
2805
|
+
userId?: string;
|
|
2602
2806
|
}
|
|
2603
2807
|
interface SideEffectDeps {
|
|
2604
2808
|
eventBus: EventBus;
|
|
2605
|
-
notificationManager:
|
|
2809
|
+
notificationManager: NotificationService;
|
|
2606
2810
|
tunnelService?: TunnelService;
|
|
2607
2811
|
}
|
|
2608
2812
|
/**
|
|
@@ -3054,7 +3258,7 @@ declare class OpenACPCore {
|
|
|
3054
3258
|
/** Access control and rate-limiting guard (provided by security plugin). */
|
|
3055
3259
|
get securityGuard(): SecurityGuard;
|
|
3056
3260
|
/** Cross-session notification delivery (provided by notifications plugin). */
|
|
3057
|
-
get notificationManager():
|
|
3261
|
+
get notificationManager(): NotificationService;
|
|
3058
3262
|
/** File I/O service for agent attachment storage (provided by file-service plugin). */
|
|
3059
3263
|
get fileService(): FileServiceInterface;
|
|
3060
3264
|
/** Text-to-speech / speech-to-text engine (provided by speech plugin). */
|
|
@@ -3120,7 +3324,25 @@ declare class OpenACPCore {
|
|
|
3120
3324
|
*
|
|
3121
3325
|
* If no session is found, the user is told to start one with /new.
|
|
3122
3326
|
*/
|
|
3123
|
-
handleMessage(message: IncomingMessage): Promise<void>;
|
|
3327
|
+
handleMessage(message: IncomingMessage, initialMeta?: Record<string, unknown>): Promise<void>;
|
|
3328
|
+
/**
|
|
3329
|
+
* Send a message to a known session, running the full message:incoming → agent:beforePrompt
|
|
3330
|
+
* middleware chain (same as handleMessage) but without the threadId-based session lookup.
|
|
3331
|
+
*
|
|
3332
|
+
* Used by channels that already hold a direct session reference (e.g. SSE adapter), where
|
|
3333
|
+
* looking up by channelId+threadId is unreliable (API sessions may have no threadId).
|
|
3334
|
+
*
|
|
3335
|
+
* @param session The target session — caller is responsible for validating its status.
|
|
3336
|
+
* @param message Sender context and message content.
|
|
3337
|
+
* @param initialMeta Optional adapter-specific context to seed the TurnMeta bag
|
|
3338
|
+
* (e.g. channelUser with display name/username).
|
|
3339
|
+
*/
|
|
3340
|
+
handleMessageInSession(session: Session, message: {
|
|
3341
|
+
channelId: string;
|
|
3342
|
+
userId: string;
|
|
3343
|
+
text: string;
|
|
3344
|
+
attachments?: Attachment[];
|
|
3345
|
+
}, initialMeta?: Record<string, unknown>): Promise<void>;
|
|
3124
3346
|
/**
|
|
3125
3347
|
* Create (or resume) a session with full wiring: agent, adapter thread, bridge, persistence.
|
|
3126
3348
|
*
|
|
@@ -3556,6 +3778,8 @@ interface StoredToken {
|
|
|
3556
3778
|
refreshDeadline: string;
|
|
3557
3779
|
lastUsedAt?: string;
|
|
3558
3780
|
revoked: boolean;
|
|
3781
|
+
/** User ID from identity system. Null until user completes /identity/setup. */
|
|
3782
|
+
userId?: string;
|
|
3559
3783
|
}
|
|
3560
3784
|
interface CreateTokenOpts {
|
|
3561
3785
|
role: string;
|
|
@@ -3632,6 +3856,10 @@ declare class TokenStore {
|
|
|
3632
3856
|
/** Wait for any in-flight and pending saves to complete */
|
|
3633
3857
|
flush(): Promise<void>;
|
|
3634
3858
|
destroy(): void;
|
|
3859
|
+
/** Associate a user ID with a token. Called by identity plugin after /identity/setup. */
|
|
3860
|
+
setUserId(tokenId: string, userId: string): void;
|
|
3861
|
+
/** Get the user ID associated with a token. */
|
|
3862
|
+
getUserId(tokenId: string): string | undefined;
|
|
3635
3863
|
/**
|
|
3636
3864
|
* Generates a one-time authorization code that can be exchanged for a JWT.
|
|
3637
3865
|
*
|
|
@@ -4828,4 +5056,4 @@ declare class TelegramAdapter extends MessagingAdapter {
|
|
|
4828
5056
|
archiveSessionTopic(sessionId: string): Promise<void>;
|
|
4829
5057
|
}
|
|
4830
5058
|
|
|
4831
|
-
export { ActivityTracker, AdapterCapabilities, AgentCapabilities, AgentCatalog, AgentCommand, AgentDefinition, AgentEvent, AgentInstance, AgentListItem, AgentManager, AgentStore, AgentSwitchEntry, type ApiConfig, type ApiServerInstance, type ApiServerOptions, type ApiServerService, type AssistantCommand, AssistantManager, AssistantRegistry, type AssistantSection, Attachment, AvailabilityResult, BaseRenderer, type BridgeDeps, CONFIG_REGISTRY, ChannelConfig, type CleanupResult, type CommandArgs, type CommandDef, CommandRegistry, type CommandResponse, type Config, type ConfigFieldDef, ConfigManager, ConfigOption, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type ContextService, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, DisplaySpecBuilder, DisplayVerbosity, DoctorEngine, type DoctorReport, DraftManager, EntireProvider, EventBus, type EventBusEvents, type FieldDef, FileService, type FileServiceInterface, GroqSTT, IChannelAdapter, type IRenderer, IncomingMessage, type InstallContext, InstallProgress, InstallResult, InstalledAgent, type ListItem, type Logger, type LoggingConfig, McpServerConfig, type MenuItem, type MenuOption, MenuRegistry, MessageTransformer, MessagingAdapter, type MessagingAdapterConfig, type MigrateContext, NotificationManager, NotificationMessage, type NotificationService, OpenACPCore, type OpenACPPlugin, OutgoingMessage, OutputMode, OutputModeResolver, PRODUCT_GUIDE, type PendingFix, PermissionGate, PermissionRequest, PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, RegistryAgent, type RenderedMessage, SSEManager, type STTOptions, type STTProvider, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, SessionRecord, SessionStatus, type SessionSummary, SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, StopReason, StreamAdapter, type TTSOptions, type TTSProvider, type TTSResult, TelegramAdapter, type TerminalIO, ThoughtBuffer, type ThoughtDisplaySpec, ToolCallMeta, ToolCallTracker, type ToolCardSnapshot, ToolCardState, type ToolCardStateConfig, type ToolDisplaySpec, type ToolEntry, ToolStateMap, type TopicInfo, TopicManager, type TunnelServiceInterface, TurnContext, TurnRouting, TypedEmitter, UsageRecord, UsageRecordEvent, type UsageService, ViewerLinks, cleanupOldSessionLogs, createApiServer, createApiServerService, createChildLogger, createSessionLogger, expandHome, extractContentText, formatTokens, formatToolSummary, formatToolTitle, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, log, nodeToWebReadable, nodeToWebWritable, progressBar, resolveOptions, resolveToolIcon, runConfigEditor, setLogLevel, shutdownLogger, splitMessage, startDaemon, stopDaemon, stripCodeFences, truncateContent, uninstallAutoStart };
|
|
5059
|
+
export { ActivityTracker, AdapterCapabilities, AgentCapabilities, AgentCatalog, AgentCommand, AgentDefinition, AgentEvent, AgentInstance, AgentListItem, AgentManager, AgentStore, AgentSwitchEntry, type ApiConfig, type ApiServerInstance, type ApiServerOptions, type ApiServerService, type AssistantCommand, AssistantManager, AssistantRegistry, type AssistantSection, Attachment, AvailabilityResult, BaseRenderer, type BridgeDeps, CONFIG_REGISTRY, ChannelConfig, type CleanupResult, type CommandArgs, type CommandDef, CommandRegistry, type CommandResponse, type Config, type ConfigFieldDef, ConfigManager, ConfigOption, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type ContextService, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, DisplaySpecBuilder, DisplayVerbosity, DoctorEngine, type DoctorReport, DraftManager, EntireProvider, EventBus, type EventBusEvents, type FieldDef, FileService, type FileServiceInterface, GroqSTT, IChannelAdapter, type IRenderer, IncomingMessage, type InstallContext, InstallProgress, InstallResult, InstalledAgent, type ListItem, type Logger, type LoggingConfig, McpServerConfig, type MenuItem, type MenuOption, MenuRegistry, MessageTransformer, MessagingAdapter, type MessagingAdapterConfig, type MiddlewareHook, type MiddlewarePayloadMap, type MigrateContext, NotificationService as NotificationManager, NotificationMessage, type NotificationService$1 as NotificationService, OpenACPCore, type OpenACPPlugin, OutgoingMessage, OutputMode, OutputModeResolver, PRODUCT_GUIDE, type PendingFix, PermissionGate, PermissionRequest, PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, RegistryAgent, type RenderedMessage, SSEManager, type STTOptions, type STTProvider, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, SessionRecord, SessionStatus, type SessionSummary, SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, StopReason, StreamAdapter, type TTSOptions, type TTSProvider, type TTSResult, TelegramAdapter, type TerminalIO, ThoughtBuffer, type ThoughtDisplaySpec, ToolCallMeta, ToolCallTracker, type ToolCardSnapshot, ToolCardState, type ToolCardStateConfig, type ToolDisplaySpec, type ToolEntry, ToolStateMap, type TopicInfo, TopicManager, type TunnelServiceInterface, TurnContext, TurnMeta, TurnRouting, TypedEmitter, UsageRecord, UsageRecordEvent, type UsageService, ViewerLinks, cleanupOldSessionLogs, createApiServer, createApiServerService, createChildLogger, createSessionLogger, expandHome, extractContentText, formatTokens, formatToolSummary, formatToolTitle, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, log, nodeToWebReadable, nodeToWebWritable, progressBar, resolveOptions, resolveToolIcon, runConfigEditor, setLogLevel, shutdownLogger, splitMessage, startDaemon, stopDaemon, stripCodeFences, truncateContent, uninstallAutoStart };
|