@openacp/plugin-sdk 2026.327.2 → 2026.327.3
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/config.d.ts +2 -4
- package/dist/config.js +1 -2
- package/dist/formatting.d.ts +1 -3
- package/dist/formatting.js +1 -3
- package/dist/index.d.ts +2 -9
- package/dist/index.js +4 -4
- package/dist/testing/adapter-conformance.d.ts +2 -0
- package/dist/testing/adapter-conformance.js +64 -0
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export type { ConfigFieldDef } from '@openacp/cli';
|
|
2
|
-
export { getSafeFields, resolveOptions, getConfigValue, isHotReloadable } from '@openacp/cli';
|
|
3
|
-
export { DoctorEngine } from '@openacp/cli';
|
|
4
|
-
export type { DoctorReport, PendingFix } from '@openacp/cli';
|
|
1
|
+
export type { ConfigFieldDef, DoctorReport, PendingFix } from '@openacp/cli';
|
|
2
|
+
export { DoctorEngine, getSafeFields, resolveOptions, getConfigValue, isHotReloadable } from '@openacp/cli';
|
package/dist/config.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { getSafeFields, resolveOptions, getConfigValue, isHotReloadable } from '@openacp/cli';
|
|
2
|
-
export { DoctorEngine } from '@openacp/cli';
|
|
1
|
+
export { DoctorEngine, getSafeFields, resolveOptions, getConfigValue, isHotReloadable } from '@openacp/cli';
|
package/dist/formatting.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
export type { DisplayVerbosity, ToolCallMeta, ToolUpdateMeta, ViewerLinks } from '@openacp/cli';
|
|
2
|
-
export { STATUS_ICONS, KIND_ICONS } from '@openacp/cli';
|
|
3
|
-
export { progressBar, formatTokens, truncateContent, stripCodeFences, splitMessage } from '@openacp/cli';
|
|
4
|
-
export { extractContentText, formatToolSummary, formatToolTitle, resolveToolIcon } from '@openacp/cli';
|
|
2
|
+
export { STATUS_ICONS, KIND_ICONS, progressBar, formatTokens, truncateContent, stripCodeFences, splitMessage, extractContentText, formatToolSummary, formatToolTitle, resolveToolIcon, } from '@openacp/cli';
|
package/dist/formatting.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export { STATUS_ICONS, KIND_ICONS } from '@openacp/cli';
|
|
2
|
-
export { progressBar, formatTokens, truncateContent, stripCodeFences, splitMessage } from '@openacp/cli';
|
|
3
|
-
export { extractContentText, formatToolSummary, formatToolTitle, resolveToolIcon } from '@openacp/cli';
|
|
1
|
+
export { STATUS_ICONS, KIND_ICONS, progressBar, formatTokens, truncateContent, stripCodeFences, splitMessage, extractContentText, formatToolSummary, formatToolTitle, resolveToolIcon, } from '@openacp/cli';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
export type { OpenACPPlugin, PluginContext, PluginPermission, PluginStorage, InstallContext, MigrateContext, TerminalIO, SettingsAPI, } from '@openacp/cli';
|
|
2
2
|
export type { CommandDef, CommandArgs, CommandResponse, MenuOption, ListItem, } from '@openacp/cli';
|
|
3
3
|
export type { SecurityService, FileServiceInterface, NotificationService, UsageService, SpeechServiceInterface, TunnelServiceInterface, ContextService, } from '@openacp/cli';
|
|
4
|
-
export type { IChannelAdapter, AdapterCapabilities, OutgoingMessage, PermissionRequest, PermissionOption, NotificationMessage, AgentCommand, } from '@openacp/cli';
|
|
4
|
+
export type { IChannelAdapter, AdapterCapabilities, OutgoingMessage, PermissionRequest, PermissionOption, NotificationMessage, AgentCommand, MessagingAdapterConfig, IRenderer, RenderedMessage, } from '@openacp/cli';
|
|
5
5
|
export { MessagingAdapter, StreamAdapter, BaseRenderer } from '@openacp/cli';
|
|
6
|
-
export type { MessagingAdapterConfig, IRenderer, RenderedMessage } from '@openacp/cli';
|
|
7
6
|
export { SendQueue, DraftManager, ToolCallTracker, ActivityTracker } from '@openacp/cli';
|
|
8
|
-
export type { OpenACPCore } from '@openacp/cli';
|
|
9
|
-
export type { Session } from '@openacp/cli';
|
|
10
|
-
export type { SessionEvents } from '@openacp/cli';
|
|
11
|
-
export type { SessionManager } from '@openacp/cli';
|
|
12
|
-
export type { CommandRegistry } from '@openacp/cli';
|
|
7
|
+
export type { OpenACPCore, Session, SessionEvents, SessionManager, CommandRegistry, Attachment, PlanEntry, StopReason, SessionStatus, ConfigOption, UsageRecord, InstallProgress, DisplayVerbosity, ToolCallMeta, ToolUpdateMeta, ViewerLinks, TelegramPlatformData, } from '@openacp/cli';
|
|
13
8
|
export { log, createChildLogger } from '@openacp/cli';
|
|
14
9
|
export { PRODUCT_GUIDE } from '@openacp/cli';
|
|
15
|
-
export type { Attachment, PlanEntry, StopReason, SessionStatus, ConfigOption, UsageRecord, InstallProgress, TelegramPlatformData, } from '@openacp/cli';
|
|
16
|
-
export type { DisplayVerbosity, ToolCallMeta, ToolUpdateMeta, ViewerLinks } from './formatting.js';
|
|
17
10
|
export type { ConfigFieldDef, DoctorReport, PendingFix } from './config.js';
|
package/dist/index.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
// @openacp/plugin-sdk/config — config utils, doctor engine
|
|
7
7
|
// @openacp/plugin-sdk/testing — test helpers, conformance tests
|
|
8
8
|
// ============================================================
|
|
9
|
-
// ---
|
|
9
|
+
// --- Adapter base classes (runtime) ---
|
|
10
10
|
export { MessagingAdapter, StreamAdapter, BaseRenderer } from '@openacp/cli';
|
|
11
|
-
// ---
|
|
11
|
+
// --- Adapter primitives (runtime) ---
|
|
12
12
|
export { SendQueue, DraftManager, ToolCallTracker, ActivityTracker } from '@openacp/cli';
|
|
13
|
-
// ---
|
|
13
|
+
// --- Logging (runtime) ---
|
|
14
14
|
export { log, createChildLogger } from '@openacp/cli';
|
|
15
|
-
// ---
|
|
15
|
+
// --- Data (runtime) ---
|
|
16
16
|
export { PRODUCT_GUIDE } from '@openacp/cli';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
|
+
export function runAdapterConformanceTests(createAdapter, cleanup) {
|
|
3
|
+
let adapter;
|
|
4
|
+
afterEach(async () => {
|
|
5
|
+
await cleanup?.();
|
|
6
|
+
});
|
|
7
|
+
describe('IChannelAdapter conformance', () => {
|
|
8
|
+
it('has a name', async () => {
|
|
9
|
+
adapter = await createAdapter();
|
|
10
|
+
expect(typeof adapter.name).toBe('string');
|
|
11
|
+
expect(adapter.name.length).toBeGreaterThan(0);
|
|
12
|
+
});
|
|
13
|
+
it('declares capabilities correctly', async () => {
|
|
14
|
+
adapter = await createAdapter();
|
|
15
|
+
const caps = adapter.capabilities;
|
|
16
|
+
expect(typeof caps.streaming).toBe('boolean');
|
|
17
|
+
expect(typeof caps.richFormatting).toBe('boolean');
|
|
18
|
+
expect(typeof caps.threads).toBe('boolean');
|
|
19
|
+
expect(typeof caps.reactions).toBe('boolean');
|
|
20
|
+
expect(typeof caps.fileUpload).toBe('boolean');
|
|
21
|
+
expect(typeof caps.voice).toBe('boolean');
|
|
22
|
+
});
|
|
23
|
+
it('sends text messages without error', async () => {
|
|
24
|
+
adapter = await createAdapter();
|
|
25
|
+
await expect(adapter.sendMessage('test-session', { type: 'text', text: 'hello' })).resolves.not.toThrow();
|
|
26
|
+
});
|
|
27
|
+
it('sends tool_call messages without error', async () => {
|
|
28
|
+
adapter = await createAdapter();
|
|
29
|
+
await expect(adapter.sendMessage('test-session', {
|
|
30
|
+
type: 'tool_call',
|
|
31
|
+
text: 'Read',
|
|
32
|
+
metadata: { id: 't1', name: 'Read', kind: 'read' },
|
|
33
|
+
})).resolves.not.toThrow();
|
|
34
|
+
});
|
|
35
|
+
it('sends usage messages without error', async () => {
|
|
36
|
+
adapter = await createAdapter();
|
|
37
|
+
await expect(adapter.sendMessage('test-session', {
|
|
38
|
+
type: 'usage',
|
|
39
|
+
text: '',
|
|
40
|
+
metadata: { tokensUsed: 1000, contextSize: 200000 },
|
|
41
|
+
})).resolves.not.toThrow();
|
|
42
|
+
});
|
|
43
|
+
it('sends error messages without error', async () => {
|
|
44
|
+
adapter = await createAdapter();
|
|
45
|
+
await expect(adapter.sendMessage('test-session', { type: 'error', text: 'something failed' })).resolves.not.toThrow();
|
|
46
|
+
});
|
|
47
|
+
it('handles session_end without error', async () => {
|
|
48
|
+
adapter = await createAdapter();
|
|
49
|
+
await expect(adapter.sendMessage('test-session', { type: 'session_end', text: 'finished' })).resolves.not.toThrow();
|
|
50
|
+
});
|
|
51
|
+
it('handles unknown message types gracefully', async () => {
|
|
52
|
+
adapter = await createAdapter();
|
|
53
|
+
await expect(adapter.sendMessage('test-session', { type: 'unknown_type', text: '' })).resolves.not.toThrow();
|
|
54
|
+
});
|
|
55
|
+
it('sendNotification does not throw', async () => {
|
|
56
|
+
adapter = await createAdapter();
|
|
57
|
+
await expect(adapter.sendNotification({
|
|
58
|
+
sessionId: 'test',
|
|
59
|
+
type: 'completed',
|
|
60
|
+
summary: 'done',
|
|
61
|
+
})).resolves.not.toThrow();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|