@makinbakin/sdk 0.0.1-rc.2 → 0.0.1-rc.21
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/README.md +1 -0
- package/_internal/app/components/agent-select.d.ts +16 -2
- package/_internal/app/components/asset-picker.d.ts +25 -0
- package/_internal/app/components/charts/bar-chart.d.ts +16 -0
- package/_internal/app/components/charts/chart-data-table.d.ts +31 -0
- package/_internal/app/components/charts/chart-explainer.d.ts +9 -0
- package/_internal/app/components/charts/chart-tooltip.d.ts +8 -0
- package/_internal/app/components/charts/line-chart.d.ts +13 -0
- package/_internal/app/components/charts/palette.d.ts +24 -0
- package/_internal/app/components/charts/sparkline.d.ts +12 -0
- package/_internal/app/components/charts/stacked-column-chart.d.ts +40 -0
- package/_internal/app/components/confirm-dialog.d.ts +54 -0
- package/_internal/app/components/conversation/activity-group.d.ts +15 -0
- package/_internal/app/components/conversation/agent-turn.d.ts +36 -0
- package/_internal/app/components/conversation/attention.d.ts +56 -0
- package/_internal/app/components/conversation/composer.d.ts +35 -0
- package/_internal/app/components/conversation/conversation-empty-state.d.ts +8 -0
- package/_internal/app/components/conversation/conversation-panel.d.ts +33 -0
- package/_internal/app/components/conversation/conversation.d.ts +14 -0
- package/_internal/app/components/conversation/fold.d.ts +129 -0
- package/_internal/app/components/conversation/notification-sound.d.ts +8 -0
- package/_internal/app/components/conversation/relative-time.d.ts +8 -0
- package/_internal/app/components/conversation/reply-toast.d.ts +15 -0
- package/_internal/app/components/conversation/thread-id.d.ts +8 -0
- package/_internal/app/components/conversation/tool-call-drawer.d.ts +7 -0
- package/_internal/app/components/conversation/turn-recorder.d.ts +37 -0
- package/_internal/app/components/conversation/use-conversation-attention.d.ts +64 -0
- package/_internal/app/components/conversation/use-conversation-thread.d.ts +55 -0
- package/_internal/app/components/conversation/user-message.d.ts +11 -0
- package/_internal/app/components/danger-zone.d.ts +28 -0
- package/_internal/app/components/empty-state.d.ts +18 -6
- package/_internal/app/components/plugin-header.d.ts +4 -3
- package/_internal/app/components/save-bar.d.ts +32 -0
- package/_internal/app/components/score-overlay.d.ts +33 -0
- package/_internal/app/components/search-degraded-chip.d.ts +4 -0
- package/_internal/app/components/search-partial-chip.d.ts +13 -0
- package/_internal/app/components/search-unavailable.d.ts +12 -0
- package/_internal/app/components/section-card.d.ts +22 -0
- package/_internal/app/components/segmented-control.d.ts +28 -0
- package/_internal/app/components/stat-tile.d.ts +26 -0
- package/_internal/app/components/status-badge.d.ts +19 -0
- package/_internal/app/components/turn-output-view.d.ts +57 -0
- package/_internal/app/components/ui/badge.d.ts +1 -1
- package/_internal/app/components/ui/button.d.ts +1 -1
- package/_internal/app/components/underline-tabs.d.ts +6 -2
- package/_internal/app/components/unsaved-changes-guard.d.ts +34 -0
- package/_internal/app/core/conversation-turns.d.ts +148 -0
- package/_internal/app/core/logger.d.ts +1 -0
- package/_internal/app/hooks/use-available-models.d.ts +5 -0
- package/_internal/app/hooks/use-content-store.d.ts +0 -9
- package/_internal/app/hooks/use-file-drop.d.ts +25 -0
- package/_internal/app/hooks/use-history-back.d.ts +1 -0
- package/_internal/app/hooks/use-horizontal-resize.d.ts +22 -0
- package/_internal/app/hooks/use-json-fetch.d.ts +26 -0
- package/_internal/app/hooks/use-nav-badge.d.ts +13 -0
- package/_internal/app/hooks/use-plugin-event.d.ts +19 -0
- package/_internal/app/hooks/use-query-state.d.ts +2 -0
- package/_internal/app/hooks/use-resizable-pane.d.ts +35 -0
- package/_internal/app/hooks/use-schedule.d.ts +47 -1
- package/_internal/app/hooks/use-search.d.ts +27 -8
- package/_internal/app/hooks/use-task-run-history.d.ts +26 -0
- package/_internal/app/hooks/use-toast.d.ts +3 -3
- package/_internal/app/hooks/use-vertical-resize.d.ts +6 -7
- package/_internal/app/lib/browser-notify.d.ts +12 -1
- package/_internal/app/types/index.d.ts +1 -105
- package/_internal/core/adapters/runtime/concepts.d.ts +671 -99
- package/_internal/core/adapters/runtime/errors.d.ts +98 -0
- package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
- package/_internal/core/adapters/runtime/index.d.ts +7 -2
- package/_internal/core/adapters/runtime/testing.d.ts +79 -0
- package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
- package/_internal/core/adapters/shared.d.ts +122 -12
- package/_internal/core/content-dir.d.ts +9 -0
- package/_internal/core/docs/route.d.ts +1 -1
- package/_internal/core/format/structured.d.ts +44 -0
- package/_internal/core/format.d.ts +13 -0
- package/_internal/core/media/downscale.d.ts +18 -0
- package/_internal/core/media/sharp-loader.d.ts +36 -0
- package/_internal/core/plugin-types.d.ts +216 -499
- package/_internal/core/routing/define.d.ts +26 -3
- package/_internal/core/routing/dispatcher.d.ts +15 -6
- package/_internal/core/routing/index.d.ts +1 -1
- package/_internal/core/routing/types.d.ts +13 -70
- package/_internal/core/storage/atomic-write.d.ts +11 -0
- package/_internal/core/tasks/store.d.ts +129 -0
- package/_internal/core/tasks/testing.d.ts +2 -0
- package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts +1 -1
- package/_internal/plugins/team/types.d.ts +61 -4
- package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
- package/components/index.d.ts +111 -5
- package/components/index.js +61815 -30060
- package/hooks/index.d.ts +90 -9
- package/hooks/index.js +15181 -685
- package/hooks/router.d.ts +20 -4
- package/index.d.ts +20 -3
- package/index.js +297 -259
- package/internal/index.d.ts +70 -0
- package/internal/index.js +409 -0
- package/metadata/index.d.ts +14 -1
- package/package.json +9 -2
- package/register.d.ts +63 -9
- package/routing/index.d.ts +6 -1
- package/routing/index.js +187 -147
- package/slots/index.d.ts +16 -24
- package/slots/index.js +215 -30
- package/testing/index.d.ts +122 -0
- package/testing/index.js +21874 -0
- package/types/index.d.ts +19 -919
- package/types/index.js +16 -0
- package/ui/index.js +2 -1
- package/utils/index.d.ts +46 -6
- package/utils/index.js +322 -249
- package/_internal/app/components/integrated-brainstorm/activity.d.ts +0 -23
- package/_internal/app/components/integrated-brainstorm/collapsed-header.d.ts +0 -14
- package/_internal/app/components/integrated-brainstorm/empty-state.d.ts +0 -5
- package/_internal/app/components/integrated-brainstorm/index.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/input-row.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/message-list.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/session.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/sse.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/thinking-indicator.d.ts +0 -19
- package/_internal/app/components/integrated-brainstorm/types.d.ts +0 -63
- package/_internal/app/components/integrated-brainstorm/use-auto-grow.d.ts +0 -6
- package/_internal/app/components/integrated-brainstorm/use-brainstorm-state.d.ts +0 -21
- package/_internal/app/hooks/use-assets.d.ts +0 -25
package/types/index.d.ts
CHANGED
|
@@ -4,923 +4,23 @@
|
|
|
4
4
|
* This module is intentionally self-contained. External plugins must be able
|
|
5
5
|
* to typecheck against `@makinbakin/sdk/types` without resolving `@bakin/core`,
|
|
6
6
|
* Bakin source aliases, adapter packages, or another plugin's internals.
|
|
7
|
+
*
|
|
8
|
+
* Two-tier contract: this is the PUBLISHED, deliberately narrower plugin-author
|
|
9
|
+
* surface. `packages/core/src/plugin-types.ts` is the INTERNAL surface in-process
|
|
10
|
+
* core plugins receive — it carries the FULL `AgentRuntimeAdapter`, the
|
|
11
|
+
* `PluginTask` projection, `BakinPlugin.routes`, and fuller `StorageAdapter`/
|
|
12
|
+
* `NavItem`/`APIRoute`/`HookAPI`/`SkillDefinition`. Those divergences are
|
|
13
|
+
* intentional, not drift. Genuinely-identical leaf data types are single-homed
|
|
14
|
+
* HERE and re-exported by core; do not collapse the context/runtime/plugin
|
|
15
|
+
* surface across the two tiers (see core's header for the rationale).
|
|
7
16
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} | {
|
|
19
|
-
success: false;
|
|
20
|
-
error: unknown;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface SourceLocation {
|
|
24
|
-
file: string;
|
|
25
|
-
symbol?: string;
|
|
26
|
-
line?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface DocsExample {
|
|
29
|
-
title: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
code?: string;
|
|
32
|
-
request?: unknown;
|
|
33
|
-
response?: unknown;
|
|
34
|
-
test?: 'automated' | 'schema' | 'illustrative';
|
|
35
|
-
reason?: string;
|
|
36
|
-
}
|
|
37
|
-
export type PluginPermission = 'storage.read' | 'storage.write' | 'events.emit' | 'runtime.read' | 'runtime.agents' | 'runtime.messaging' | 'runtime.channels' | 'runtime.cron' | 'runtime.skills' | 'runtime.models' | 'tasks.read' | 'tasks.write' | 'search.read' | 'search.write' | 'assets.read';
|
|
38
|
-
export type RuntimeCapability = 'agents' | 'messaging' | 'channels.message' | 'channels.rich-content' | 'channels.interactive-approval' | 'channels.threaded-replies' | 'cron' | 'skills' | 'models' | 'tasks' | 'search';
|
|
39
|
-
export interface PluginEntryPoints {
|
|
40
|
-
server: string;
|
|
41
|
-
client?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface SecretDeclaration {
|
|
44
|
-
/** Canonical environment variable name, for example `ANTHROPIC_API_KEY`. */
|
|
45
|
-
name: string;
|
|
46
|
-
/** Human-readable setup note. Never include a secret value here. */
|
|
47
|
-
description: string;
|
|
48
|
-
/** Missing required secrets should be reported by setup/health checks. Defaults to true. */
|
|
49
|
-
required: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface ApiRouteContribution {
|
|
52
|
-
method: HttpMethod;
|
|
53
|
-
/** Plugin-relative path. Exposed as `/api/plugins/{pluginId}{path}`. */
|
|
54
|
-
path: string;
|
|
55
|
-
summary: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
operationId?: string;
|
|
58
|
-
tags?: string[];
|
|
59
|
-
visibility?: 'public' | 'internal' | 'experimental';
|
|
60
|
-
stability?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
61
|
-
parameters?: ApiParameterContribution[];
|
|
62
|
-
requestBody?: ApiRequestBodyContribution;
|
|
63
|
-
responses?: Record<string, ApiResponseContribution>;
|
|
64
|
-
permissions?: PluginPermission[];
|
|
65
|
-
}
|
|
66
|
-
export type JsonSchemaContribution = Record<string, unknown>;
|
|
67
|
-
export interface ApiParameterContribution {
|
|
68
|
-
name: string;
|
|
69
|
-
in: 'path' | 'query' | 'header' | 'cookie';
|
|
70
|
-
required?: boolean;
|
|
71
|
-
description?: string;
|
|
72
|
-
schema?: JsonSchemaContribution;
|
|
73
|
-
example?: unknown;
|
|
74
|
-
}
|
|
75
|
-
export interface ApiRequestBodyContribution {
|
|
76
|
-
description?: string;
|
|
77
|
-
required?: boolean;
|
|
78
|
-
contentType?: string;
|
|
79
|
-
schema?: JsonSchemaContribution;
|
|
80
|
-
example?: unknown;
|
|
81
|
-
}
|
|
82
|
-
export interface ApiResponseContribution {
|
|
83
|
-
description: string;
|
|
84
|
-
contentType?: string;
|
|
85
|
-
schema?: JsonSchemaContribution;
|
|
86
|
-
example?: unknown;
|
|
87
|
-
}
|
|
88
|
-
export interface ClientRouteContribution {
|
|
89
|
-
/** Absolute app route, e.g. `/messaging/calendar`. */
|
|
90
|
-
path: string;
|
|
91
|
-
summary: string;
|
|
92
|
-
slot?: string;
|
|
93
|
-
}
|
|
94
|
-
export interface ExecToolContribution {
|
|
95
|
-
name: string;
|
|
96
|
-
summary: string;
|
|
97
|
-
description?: string;
|
|
98
|
-
permissions?: PluginPermission[];
|
|
99
|
-
}
|
|
100
|
-
export interface CliCommandContribution {
|
|
101
|
-
name: string;
|
|
102
|
-
usage: string;
|
|
103
|
-
summary: string;
|
|
104
|
-
description?: string;
|
|
105
|
-
aliases?: string[];
|
|
106
|
-
/** Optional. When present, the manifest-driven CLI dispatcher routes the
|
|
107
|
-
* command through either the named exec-tool or the given API route.
|
|
108
|
-
* When absent, the command is documentation-only — its real
|
|
109
|
-
* implementation lives in `cli/bakin.ts`'s imperative switch. */
|
|
110
|
-
dispatch?: {
|
|
111
|
-
type: 'apiRoute';
|
|
112
|
-
method: HttpMethod;
|
|
113
|
-
path: string;
|
|
114
|
-
} | {
|
|
115
|
-
type: 'execTool';
|
|
116
|
-
name: string;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
export interface SettingsContribution {
|
|
120
|
-
key: string;
|
|
121
|
-
summary: string;
|
|
122
|
-
}
|
|
123
|
-
export interface DocsContribution {
|
|
124
|
-
slug: string;
|
|
125
|
-
}
|
|
126
|
-
export interface PluginContributions {
|
|
127
|
-
apiRoutes?: ApiRouteContribution[];
|
|
128
|
-
clientRoutes?: ClientRouteContribution[];
|
|
129
|
-
execTools?: ExecToolContribution[];
|
|
130
|
-
cliCommands?: CliCommandContribution[];
|
|
131
|
-
settings?: SettingsContribution[];
|
|
132
|
-
docs?: DocsContribution;
|
|
133
|
-
}
|
|
134
|
-
export interface PluginManifestSignature {
|
|
135
|
-
algorithm: 'ed25519';
|
|
136
|
-
/** Human-readable signer label. Trust is bound to publicKey/fingerprint, not this label. */
|
|
137
|
-
signer: string;
|
|
138
|
-
/** Base64-encoded Ed25519 SPKI DER public key. */
|
|
139
|
-
publicKey: string;
|
|
140
|
-
/** Base64-encoded signature over the canonical manifest without this signature block. */
|
|
141
|
-
signature: string;
|
|
142
|
-
}
|
|
143
|
-
export interface PluginManifest {
|
|
144
|
-
id: string;
|
|
145
|
-
name: string;
|
|
146
|
-
version: string;
|
|
147
|
-
bakin: string;
|
|
148
|
-
description: string;
|
|
149
|
-
entry: PluginEntryPoints;
|
|
150
|
-
contentFiles?: string[];
|
|
151
|
-
secrets?: SecretDeclaration[];
|
|
152
|
-
tests?: string;
|
|
153
|
-
dependencies?: string[];
|
|
154
|
-
permissions?: PluginPermission[];
|
|
155
|
-
runtimeCapabilities?: RuntimeCapability[];
|
|
156
|
-
contributes?: PluginContributions;
|
|
157
|
-
devWatch?: string[];
|
|
158
|
-
signature?: PluginManifestSignature;
|
|
159
|
-
}
|
|
160
|
-
export interface StorageStat {
|
|
161
|
-
path: string;
|
|
162
|
-
size: number;
|
|
163
|
-
mtimeMs: number;
|
|
164
|
-
isFile: boolean;
|
|
165
|
-
isDirectory: boolean;
|
|
166
|
-
}
|
|
167
|
-
export interface StorageAdapter {
|
|
168
|
-
read(path: string): string | null;
|
|
169
|
-
write(path: string, content: string): void;
|
|
170
|
-
append(path: string, content: string): void;
|
|
171
|
-
exists(path: string): boolean;
|
|
172
|
-
readAll(): Record<string, string>;
|
|
173
|
-
list?(path?: string): string[];
|
|
174
|
-
remove?(path: string): void;
|
|
175
|
-
rename?(from: string, to: string): void;
|
|
176
|
-
stat?(path: string): StorageStat | null;
|
|
177
|
-
readJson?<T = unknown>(path: string): T | null;
|
|
178
|
-
writeJson?(path: string, value: unknown): void;
|
|
179
|
-
searchPath?(path: string): string;
|
|
180
|
-
}
|
|
181
|
-
export interface EventBus {
|
|
182
|
-
emit(event: string, data?: Record<string, unknown>): void;
|
|
183
|
-
on(pattern: string, handler: (event: string, data: Record<string, unknown>) => void): () => void;
|
|
184
|
-
once(pattern: string, handler: (event: string, data: Record<string, unknown>) => void): () => void;
|
|
185
|
-
}
|
|
186
|
-
export interface ActivityAPI {
|
|
187
|
-
log(agent: string, message: string, opts?: {
|
|
188
|
-
taskId?: string;
|
|
189
|
-
category?: string;
|
|
190
|
-
}): void;
|
|
191
|
-
audit(event: string, agent: string, data?: Record<string, unknown>): void;
|
|
192
|
-
}
|
|
193
|
-
export interface PluginLogger {
|
|
194
|
-
debug(message: string, data?: Record<string, unknown>): void;
|
|
195
|
-
info(message: string, data?: Record<string, unknown>): void;
|
|
196
|
-
warn(message: string, errorOrData?: unknown, data?: Record<string, unknown>): void;
|
|
197
|
-
error(message: string, errorOrData?: unknown, data?: Record<string, unknown>): void;
|
|
198
|
-
}
|
|
199
|
-
export interface HookAPI {
|
|
200
|
-
register(name: string, handler: (data: unknown) => unknown, metadata?: HookRegistrationMetadata): () => void;
|
|
201
|
-
call<T>(name: string, data: T): Promise<T>;
|
|
202
|
-
callAll(name: string, data: Record<string, unknown>): Promise<void>;
|
|
203
|
-
has(name: string): boolean;
|
|
204
|
-
invoke<R>(name: string, data: unknown): Promise<R | undefined>;
|
|
205
|
-
}
|
|
206
|
-
export interface HookRegistrationMetadata {
|
|
207
|
-
label?: string;
|
|
208
|
-
summary: string;
|
|
209
|
-
description?: string;
|
|
210
|
-
hookKind?: HookKind;
|
|
211
|
-
input?: SchemaLike;
|
|
212
|
-
output?: SchemaLike;
|
|
213
|
-
visibility?: ContractVisibility;
|
|
214
|
-
stability?: ContractStability;
|
|
215
|
-
examples?: DocsExample[];
|
|
216
|
-
}
|
|
217
|
-
export type HookKind = 'rpc' | 'event' | 'waterfall';
|
|
218
|
-
export interface NavItem {
|
|
219
|
-
id: string;
|
|
220
|
-
label: string;
|
|
221
|
-
icon: string;
|
|
222
|
-
href: string;
|
|
223
|
-
order?: number;
|
|
224
|
-
children?: NavItem[];
|
|
225
|
-
alwaysExpanded?: boolean;
|
|
226
|
-
}
|
|
227
|
-
export interface APIRoute {
|
|
228
|
-
path: string;
|
|
229
|
-
method: HttpMethod;
|
|
230
|
-
handler: (req: Request, ctx: PluginContext) => Response | Promise<Response>;
|
|
231
|
-
summary?: string;
|
|
232
|
-
description?: string;
|
|
233
|
-
params?: string;
|
|
234
|
-
input?: SchemaLike;
|
|
235
|
-
output?: SchemaLike;
|
|
236
|
-
visibility?: ContractVisibility;
|
|
237
|
-
stability?: ContractStability;
|
|
238
|
-
examples?: DocsExample[];
|
|
239
|
-
source?: SourceLocation;
|
|
240
|
-
permissions?: string[];
|
|
241
|
-
}
|
|
242
|
-
export interface UISlotRegistration {
|
|
243
|
-
slot: string;
|
|
244
|
-
component: ComponentType<Record<string, unknown>>;
|
|
245
|
-
order?: number;
|
|
246
|
-
}
|
|
247
|
-
export interface ContentFile {
|
|
248
|
-
path: string;
|
|
249
|
-
}
|
|
250
|
-
export interface RuntimeAgent {
|
|
251
|
-
id: string;
|
|
252
|
-
name: string;
|
|
253
|
-
role?: string;
|
|
254
|
-
model?: string;
|
|
255
|
-
status?: 'active' | 'inactive' | 'unknown';
|
|
256
|
-
metadata?: Record<string, unknown>;
|
|
257
|
-
}
|
|
258
|
-
export interface RuntimeChannel {
|
|
259
|
-
id: string;
|
|
260
|
-
platform: string;
|
|
261
|
-
label: string;
|
|
262
|
-
capabilities: string[];
|
|
263
|
-
metadata?: Record<string, unknown>;
|
|
264
|
-
}
|
|
265
|
-
export type RuntimeMessageToolsMode = 'auto' | 'none';
|
|
266
|
-
export interface RuntimeMessageToolPolicy {
|
|
267
|
-
/**
|
|
268
|
-
* Controls whether runtime-native tools are available for this agent turn.
|
|
269
|
-
* `none` disables tools. Omit or use `auto` for runtime/provider defaults.
|
|
270
|
-
*/
|
|
271
|
-
toolsMode?: RuntimeMessageToolsMode;
|
|
272
|
-
/** Optional runtime-native tool allowlist for this turn. */
|
|
273
|
-
toolsAllow?: string[];
|
|
274
|
-
/** Optional runtime-native tool denylist for this turn. */
|
|
275
|
-
toolsDeny?: string[];
|
|
276
|
-
}
|
|
277
|
-
export interface RuntimeMessageArgs extends RuntimeMessageToolPolicy {
|
|
278
|
-
agentId: string;
|
|
279
|
-
content: string;
|
|
280
|
-
/**
|
|
281
|
-
* Adapter-neutral durable conversation key. Runtime adapters should map the
|
|
282
|
-
* same agentId + threadId pair to the same provider/runtime session.
|
|
283
|
-
*/
|
|
284
|
-
threadId?: string;
|
|
285
|
-
metadata?: Record<string, unknown>;
|
|
286
|
-
}
|
|
287
|
-
export interface RuntimeMessageResult {
|
|
288
|
-
id: string;
|
|
289
|
-
content?: string;
|
|
290
|
-
metadata?: Record<string, unknown>;
|
|
291
|
-
}
|
|
292
|
-
export interface RuntimeToolActivity {
|
|
293
|
-
phase: 'call' | 'result';
|
|
294
|
-
callId?: string;
|
|
295
|
-
toolName: string;
|
|
296
|
-
status?: 'running' | 'completed' | 'failed' | string;
|
|
297
|
-
summary?: string;
|
|
298
|
-
inputPreview?: string;
|
|
299
|
-
outputPreview?: string;
|
|
300
|
-
durationMs?: number;
|
|
301
|
-
exitCode?: number;
|
|
302
|
-
metadata?: Record<string, unknown>;
|
|
303
|
-
}
|
|
304
|
-
export interface RuntimeChatChunk {
|
|
305
|
-
type: 'text' | 'tool' | 'status' | 'done' | 'error';
|
|
306
|
-
content?: string;
|
|
307
|
-
data?: Record<string, unknown> | RuntimeToolActivity;
|
|
308
|
-
}
|
|
309
|
-
export interface CronJob {
|
|
310
|
-
id: string;
|
|
311
|
-
name: string;
|
|
312
|
-
schedule: string;
|
|
313
|
-
command: string;
|
|
314
|
-
enabled: boolean;
|
|
315
|
-
toolsAllow?: string[];
|
|
316
|
-
metadata?: Record<string, unknown>;
|
|
317
|
-
}
|
|
318
|
-
export interface CronRun {
|
|
319
|
-
id: string;
|
|
320
|
-
jobId: string;
|
|
321
|
-
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
322
|
-
startedAt?: string;
|
|
323
|
-
endedAt?: string;
|
|
324
|
-
output?: string;
|
|
325
|
-
error?: string;
|
|
326
|
-
}
|
|
327
|
-
export interface RuntimeSkill {
|
|
328
|
-
name: string;
|
|
329
|
-
description?: string;
|
|
330
|
-
}
|
|
331
|
-
export interface WorkspaceFile {
|
|
332
|
-
path: string;
|
|
333
|
-
content?: string;
|
|
334
|
-
}
|
|
335
|
-
export interface AgentRuntimeAdapter {
|
|
336
|
-
agents: {
|
|
337
|
-
list(): Promise<RuntimeAgent[]>;
|
|
338
|
-
get(agentId: string): Promise<RuntimeAgent | null>;
|
|
339
|
-
};
|
|
340
|
-
messaging: {
|
|
341
|
-
send(input: RuntimeMessageArgs): Promise<RuntimeMessageResult>;
|
|
342
|
-
stream(input: RuntimeMessageArgs): AsyncIterable<RuntimeChatChunk>;
|
|
343
|
-
};
|
|
344
|
-
channels: {
|
|
345
|
-
list(): Promise<RuntimeChannel[]>;
|
|
346
|
-
sendMessage(input: {
|
|
347
|
-
channels: string[];
|
|
348
|
-
message: {
|
|
349
|
-
body: string;
|
|
350
|
-
title?: string;
|
|
351
|
-
threadId?: string;
|
|
352
|
-
metadata?: Record<string, unknown>;
|
|
353
|
-
};
|
|
354
|
-
}): Promise<{
|
|
355
|
-
deliveries: Array<{
|
|
356
|
-
channelId: string;
|
|
357
|
-
ref: string;
|
|
358
|
-
renderedAt: string;
|
|
359
|
-
}>;
|
|
360
|
-
}>;
|
|
361
|
-
deliverContent(input: {
|
|
362
|
-
channels: string[];
|
|
363
|
-
content: {
|
|
364
|
-
title: string;
|
|
365
|
-
body?: string;
|
|
366
|
-
url?: string;
|
|
367
|
-
files?: AssetFileRef[];
|
|
368
|
-
metadata?: Record<string, unknown>;
|
|
369
|
-
};
|
|
370
|
-
}): Promise<{
|
|
371
|
-
deliveries: Array<{
|
|
372
|
-
channelId: string;
|
|
373
|
-
ref: string;
|
|
374
|
-
renderedAt: string;
|
|
375
|
-
}>;
|
|
376
|
-
}>;
|
|
377
|
-
};
|
|
378
|
-
cron: {
|
|
379
|
-
list(): Promise<CronJob[]>;
|
|
380
|
-
get(id: string): Promise<CronJob | null>;
|
|
381
|
-
create(input: {
|
|
382
|
-
id?: string;
|
|
383
|
-
name: string;
|
|
384
|
-
schedule: string;
|
|
385
|
-
command: string;
|
|
386
|
-
enabled?: boolean;
|
|
387
|
-
toolsAllow?: string[];
|
|
388
|
-
metadata?: Record<string, unknown>;
|
|
389
|
-
}): Promise<CronJob>;
|
|
390
|
-
update(id: string, patch: Partial<Omit<CronJob, 'id' | 'toolsAllow'>> & {
|
|
391
|
-
toolsAllow?: string[] | null;
|
|
392
|
-
}): Promise<CronJob>;
|
|
393
|
-
remove(id: string): Promise<void>;
|
|
394
|
-
runNow(id: string): Promise<CronRun>;
|
|
395
|
-
listRuns(jobId: string): Promise<CronRun[]>;
|
|
396
|
-
getRaw(id: string, reason: string): Promise<unknown | null>;
|
|
397
|
-
restoreRaw(id: string, snapshot: unknown, reason: string): Promise<CronJob>;
|
|
398
|
-
};
|
|
399
|
-
skills?: {
|
|
400
|
-
list(): Promise<RuntimeSkill[]>;
|
|
401
|
-
};
|
|
402
|
-
models?: {
|
|
403
|
-
listAvailable(opts?: {
|
|
404
|
-
includeUnavailable?: boolean;
|
|
405
|
-
}): Promise<AvailableModel[]>;
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
export interface TaskLogEntry {
|
|
409
|
-
timestamp: string;
|
|
410
|
-
author: string;
|
|
411
|
-
message: string;
|
|
412
|
-
data?: Record<string, unknown>;
|
|
413
|
-
}
|
|
414
|
-
export interface Task {
|
|
415
|
-
id: string;
|
|
416
|
-
title: string;
|
|
417
|
-
agent?: string;
|
|
418
|
-
createdBy?: string;
|
|
419
|
-
checked: boolean;
|
|
420
|
-
column: ColumnId;
|
|
421
|
-
date?: string;
|
|
422
|
-
blockedReason?: string;
|
|
423
|
-
description?: string;
|
|
424
|
-
log?: TaskLogEntry[];
|
|
425
|
-
dependsOn?: string;
|
|
426
|
-
parentId?: string | null;
|
|
427
|
-
workflowId?: string;
|
|
428
|
-
scheduleJobId?: string;
|
|
429
|
-
projectId?: string;
|
|
430
|
-
availableAt?: string;
|
|
431
|
-
dueAt?: string;
|
|
432
|
-
source?: TaskSource;
|
|
433
|
-
order?: number;
|
|
434
|
-
createdAt?: string;
|
|
435
|
-
updatedAt?: string;
|
|
436
|
-
}
|
|
437
|
-
export interface TaskSource {
|
|
438
|
-
pluginId?: string;
|
|
439
|
-
entityType?: string;
|
|
440
|
-
entityId?: string;
|
|
441
|
-
purpose?: string;
|
|
442
|
-
}
|
|
443
|
-
export interface TaskColumns {
|
|
444
|
-
backlog: Task[];
|
|
445
|
-
inProgress: Task[];
|
|
446
|
-
todo: Task[];
|
|
447
|
-
review: Task[];
|
|
448
|
-
done: Task[];
|
|
449
|
-
blocked: Task[];
|
|
450
|
-
archived: Task[];
|
|
451
|
-
}
|
|
452
|
-
export interface TaskBoard {
|
|
453
|
-
columns: TaskColumns;
|
|
454
|
-
timestamp?: string;
|
|
455
|
-
}
|
|
456
|
-
export type ColumnId = keyof TaskColumns;
|
|
457
|
-
export interface TaskCreateInput {
|
|
458
|
-
id?: string;
|
|
459
|
-
title: string;
|
|
460
|
-
description?: string;
|
|
461
|
-
agent?: string;
|
|
462
|
-
createdBy?: string;
|
|
463
|
-
column?: ColumnId;
|
|
464
|
-
date?: string;
|
|
465
|
-
workflowId?: string;
|
|
466
|
-
projectId?: string;
|
|
467
|
-
parentId?: string | null;
|
|
468
|
-
availableAt?: string;
|
|
469
|
-
dueAt?: string;
|
|
470
|
-
source?: TaskSource;
|
|
471
|
-
skipWorkflowReason?: string;
|
|
472
|
-
}
|
|
473
|
-
export interface TaskUpdateInput {
|
|
474
|
-
title?: string;
|
|
475
|
-
description?: string;
|
|
476
|
-
agent?: string;
|
|
477
|
-
createdBy?: string;
|
|
478
|
-
checked?: boolean;
|
|
479
|
-
column?: ColumnId;
|
|
480
|
-
date?: string;
|
|
481
|
-
blockedReason?: string;
|
|
482
|
-
workflowId?: string;
|
|
483
|
-
scheduleJobId?: string;
|
|
484
|
-
projectId?: string;
|
|
485
|
-
parentId?: string | null;
|
|
486
|
-
availableAt?: string | null;
|
|
487
|
-
dueAt?: string | null;
|
|
488
|
-
source?: TaskSource | null;
|
|
489
|
-
}
|
|
490
|
-
export interface TaskService {
|
|
491
|
-
create(input: TaskCreateInput): Promise<Task>;
|
|
492
|
-
update(id: string, patch: TaskUpdateInput): Promise<Task>;
|
|
493
|
-
move(id: string, column: ColumnId): Promise<Task>;
|
|
494
|
-
remove(id: string): Promise<void>;
|
|
495
|
-
get(id: string): Promise<Task | null>;
|
|
496
|
-
list(filter?: {
|
|
497
|
-
column?: ColumnId;
|
|
498
|
-
agent?: string;
|
|
499
|
-
projectId?: string;
|
|
500
|
-
}): Promise<Task[]>;
|
|
501
|
-
appendLog(id: string, entry: TaskLogEntry): Promise<void>;
|
|
502
|
-
}
|
|
503
|
-
export interface SearchSchemaField {
|
|
504
|
-
type: 'text' | 'keyword' | 'number' | 'boolean' | 'datetime' | 'array';
|
|
505
|
-
}
|
|
506
|
-
export interface SearchIndexDefinition {
|
|
507
|
-
name: string;
|
|
508
|
-
embedderRef: string;
|
|
509
|
-
embeddingTemplate?: string;
|
|
510
|
-
mediaUrlField?: string;
|
|
511
|
-
chunker?: {
|
|
512
|
-
enabled: boolean;
|
|
513
|
-
targetTokens?: number;
|
|
514
|
-
overlapTokens?: number;
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
export interface SearchContentTypeDefinition {
|
|
518
|
-
table: string;
|
|
519
|
-
schema: Record<string, SearchSchemaField>;
|
|
520
|
-
searchableFields: string[];
|
|
521
|
-
embeddingTemplate: string;
|
|
522
|
-
indexes?: SearchIndexDefinition[];
|
|
523
|
-
facets?: string[];
|
|
524
|
-
rerankField?: string;
|
|
525
|
-
ttl?: string;
|
|
526
|
-
ttlField?: string;
|
|
527
|
-
chunker?: {
|
|
528
|
-
enabled: boolean;
|
|
529
|
-
targetTokens?: number;
|
|
530
|
-
overlapTokens?: number;
|
|
531
|
-
};
|
|
532
|
-
reindex: () => AsyncGenerator<{
|
|
533
|
-
key: string;
|
|
534
|
-
doc: Record<string, unknown>;
|
|
535
|
-
}>;
|
|
536
|
-
verifyExists: (key: string) => Promise<boolean>;
|
|
537
|
-
}
|
|
538
|
-
export interface FilePatternMapper {
|
|
539
|
-
pattern: string;
|
|
540
|
-
fileToId: (relPath: string) => string | null;
|
|
541
|
-
fileToDoc: (relPath: string, content: string) => Promise<Record<string, unknown> | null>;
|
|
542
|
-
}
|
|
543
|
-
export interface FileBackedContentTypeDefinition extends SearchContentTypeDefinition {
|
|
544
|
-
filePatterns: FilePatternMapper[];
|
|
545
|
-
excludePatterns?: string[];
|
|
546
|
-
onSync?: (relPath: string, content: string) => Promise<void>;
|
|
547
|
-
onUnlink?: (relPath: string) => Promise<void>;
|
|
548
|
-
buildOnStartup?: boolean;
|
|
549
|
-
}
|
|
550
|
-
export interface SearchQueryParams {
|
|
551
|
-
q: string;
|
|
552
|
-
filters?: Record<string, string | boolean | number>;
|
|
553
|
-
facets?: string[];
|
|
554
|
-
limit?: number;
|
|
555
|
-
offset?: number;
|
|
556
|
-
rerank?: boolean;
|
|
557
|
-
aggregations?: Record<string, unknown>;
|
|
558
|
-
strategy?: 'rrf' | 'semantic_only' | 'full_text_only';
|
|
559
|
-
}
|
|
560
|
-
export interface SearchResult {
|
|
561
|
-
id: string;
|
|
562
|
-
table: string;
|
|
563
|
-
score: number;
|
|
564
|
-
fields: Record<string, unknown>;
|
|
565
|
-
rerankScore?: number;
|
|
566
|
-
}
|
|
567
|
-
export interface SearchResponse {
|
|
568
|
-
results: SearchResult[];
|
|
569
|
-
aggregations?: Record<string, Array<{
|
|
570
|
-
value: string;
|
|
571
|
-
count: number;
|
|
572
|
-
}>>;
|
|
573
|
-
rawAggregations?: Record<string, unknown>;
|
|
574
|
-
meta: {
|
|
575
|
-
query: string;
|
|
576
|
-
total: number;
|
|
577
|
-
took_ms: number;
|
|
578
|
-
source: 'search' | 'fallback';
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
export interface SearchHealthSnapshot {
|
|
582
|
-
enabled: boolean;
|
|
583
|
-
tables: Array<{
|
|
584
|
-
table: string;
|
|
585
|
-
pluginId: string;
|
|
586
|
-
stats: Record<string, unknown> | null;
|
|
587
|
-
healthy: boolean;
|
|
588
|
-
}>;
|
|
589
|
-
}
|
|
590
|
-
export interface SearchTransformOp {
|
|
591
|
-
op: '$set' | '$inc' | '$push';
|
|
592
|
-
field?: string;
|
|
593
|
-
value: unknown;
|
|
594
|
-
}
|
|
595
|
-
export interface SearchAPI {
|
|
596
|
-
registerContentType(def: SearchContentTypeDefinition): void;
|
|
597
|
-
registerFileBackedContentType(def: FileBackedContentTypeDefinition): void;
|
|
598
|
-
index(key: string, doc: Record<string, unknown>): Promise<void>;
|
|
599
|
-
remove(key: string): Promise<void>;
|
|
600
|
-
transform(key: string, operations: SearchTransformOp[]): Promise<void>;
|
|
601
|
-
query(params: SearchQueryParams): Promise<SearchResponse>;
|
|
602
|
-
health?(): Promise<SearchHealthSnapshot>;
|
|
603
|
-
}
|
|
604
|
-
export interface AssetVariantMeta {
|
|
605
|
-
role: 'thumbnail' | 'optimized' | 'webp';
|
|
606
|
-
path: string;
|
|
607
|
-
filename: string;
|
|
608
|
-
size: number;
|
|
609
|
-
mimeType: string;
|
|
610
|
-
}
|
|
611
|
-
export interface AssetMeta {
|
|
612
|
-
path: string;
|
|
613
|
-
filename: string;
|
|
614
|
-
type: 'text' | 'images' | 'video' | 'audio' | 'plans' | 'research' | 'pdf' | 'data' | 'other';
|
|
615
|
-
mimeType: string;
|
|
616
|
-
size: number;
|
|
617
|
-
mtimeMs?: number;
|
|
618
|
-
metadata: {
|
|
619
|
-
agent: string;
|
|
620
|
-
taskId: string | null;
|
|
621
|
-
created: string;
|
|
622
|
-
tool?: string;
|
|
623
|
-
description?: string;
|
|
624
|
-
tags?: string[];
|
|
625
|
-
originalFilename?: string;
|
|
626
|
-
};
|
|
627
|
-
variants?: AssetVariantMeta[];
|
|
628
|
-
}
|
|
629
|
-
export interface TrashedAssetMeta {
|
|
630
|
-
filename: string;
|
|
631
|
-
originalFilename: string;
|
|
632
|
-
type: string;
|
|
633
|
-
mimeType: string;
|
|
634
|
-
size: number;
|
|
635
|
-
deletedAt: string;
|
|
636
|
-
expiresAt: string;
|
|
637
|
-
metadata: AssetMeta['metadata'] | null;
|
|
638
|
-
}
|
|
639
|
-
export interface AssetFileRef {
|
|
640
|
-
kind: 'asset';
|
|
641
|
-
filename: string;
|
|
642
|
-
mimeType?: string;
|
|
643
|
-
}
|
|
644
|
-
export interface AssetsAPI {
|
|
645
|
-
getByFilename(filename: string): Promise<AssetMeta | null>;
|
|
646
|
-
list(filter?: {
|
|
647
|
-
type?: AssetMeta['type'];
|
|
648
|
-
taskId?: string | null;
|
|
649
|
-
}): Promise<AssetMeta[]>;
|
|
650
|
-
exists(filename: string): Promise<boolean>;
|
|
651
|
-
fileRef(filename: string): Promise<AssetFileRef>;
|
|
652
|
-
}
|
|
653
|
-
export interface ExecToolResult {
|
|
654
|
-
ok: boolean;
|
|
655
|
-
error?: string;
|
|
656
|
-
details?: unknown;
|
|
657
|
-
[key: string]: unknown;
|
|
658
|
-
}
|
|
659
|
-
export interface PluginToolContext {
|
|
660
|
-
storage: StorageAdapter;
|
|
661
|
-
events: EventBus;
|
|
662
|
-
pluginId: string;
|
|
663
|
-
runtime: AgentRuntimeAdapter;
|
|
664
|
-
tasks: TaskService;
|
|
665
|
-
search: SearchAPI;
|
|
666
|
-
assets: AssetsAPI;
|
|
667
|
-
hooks: HookAPI;
|
|
668
|
-
activity: ActivityAPI;
|
|
669
|
-
getSettings<T = Record<string, unknown>>(): T;
|
|
670
|
-
}
|
|
671
|
-
export interface ExecToolDefinition {
|
|
672
|
-
name: string;
|
|
673
|
-
description: string;
|
|
674
|
-
label?: string;
|
|
675
|
-
activityDuplicate?: boolean;
|
|
676
|
-
parameters: ZodRawShape;
|
|
677
|
-
handler: (params: Record<string, unknown>, agent: string, ctx?: PluginToolContext) => Promise<ExecToolResult>;
|
|
678
|
-
source?: string;
|
|
679
|
-
}
|
|
680
|
-
export interface SkillDefinition {
|
|
681
|
-
name: string;
|
|
682
|
-
instructions: string;
|
|
683
|
-
output_schema?: Record<string, unknown>;
|
|
684
|
-
source?: string;
|
|
685
|
-
}
|
|
686
|
-
export interface WorkflowDefinitionInput {
|
|
687
|
-
id?: string;
|
|
688
|
-
name: string;
|
|
689
|
-
description: string;
|
|
690
|
-
version: number;
|
|
691
|
-
inputs?: Record<string, unknown>;
|
|
692
|
-
steps: unknown[];
|
|
693
|
-
}
|
|
694
|
-
export type FormFieldType = 'string' | 'text' | 'number' | 'boolean' | 'select' | 'agent' | 'skill' | 'list';
|
|
695
|
-
export interface FormField {
|
|
696
|
-
name: string;
|
|
697
|
-
type: FormFieldType;
|
|
698
|
-
required?: boolean;
|
|
699
|
-
description?: string;
|
|
700
|
-
options?: {
|
|
701
|
-
value: string;
|
|
702
|
-
label: string;
|
|
703
|
-
}[];
|
|
704
|
-
}
|
|
705
|
-
export interface EdgeRules {
|
|
706
|
-
maxInbound?: number;
|
|
707
|
-
maxOutbound?: number;
|
|
708
|
-
}
|
|
709
|
-
export interface PluginNodeTypeInput<T = unknown> {
|
|
710
|
-
kind: string;
|
|
711
|
-
zodSchema: SchemaLike<T>;
|
|
712
|
-
formFields: FormField[];
|
|
713
|
-
edgeRules?: EdgeRules;
|
|
714
|
-
}
|
|
715
|
-
export interface PluginNotificationChannelInput {
|
|
716
|
-
id: string;
|
|
717
|
-
label: string;
|
|
718
|
-
initials?: string;
|
|
719
|
-
icon?: string;
|
|
720
|
-
}
|
|
721
|
-
export interface HealthCheckResult {
|
|
722
|
-
check: string;
|
|
723
|
-
status: 'ok' | 'warn' | 'error' | 'fixed';
|
|
724
|
-
message: string;
|
|
725
|
-
autoFixable: boolean;
|
|
726
|
-
}
|
|
727
|
-
export type HealthRepairSafety = 'safe' | 'manual' | 'destructive';
|
|
728
|
-
export interface HealthRepairChange {
|
|
729
|
-
kind: 'file' | 'setting' | 'service' | 'runtime' | 'task' | 'other';
|
|
730
|
-
target: string;
|
|
731
|
-
action: 'create' | 'update' | 'delete' | 'install' | 'invoke';
|
|
732
|
-
description: string;
|
|
733
|
-
}
|
|
734
|
-
export interface HealthRepairPlanItem {
|
|
735
|
-
id: string;
|
|
736
|
-
checkId: string;
|
|
737
|
-
title: string;
|
|
738
|
-
reason: string;
|
|
739
|
-
safety: HealthRepairSafety;
|
|
740
|
-
requiresConfirmation: boolean;
|
|
741
|
-
changes: HealthRepairChange[];
|
|
742
|
-
}
|
|
743
|
-
export interface HealthRepairApplyResult {
|
|
744
|
-
id: string;
|
|
745
|
-
checkId: string;
|
|
746
|
-
status: 'applied' | 'skipped' | 'failed';
|
|
747
|
-
message: string;
|
|
748
|
-
changes: HealthRepairChange[];
|
|
749
|
-
}
|
|
750
|
-
export interface HealthRepairHandler {
|
|
751
|
-
plan(rows: HealthCheckResult[]): Promise<HealthRepairPlanItem[]>;
|
|
752
|
-
apply(items: HealthRepairPlanItem[]): Promise<HealthRepairApplyResult[]>;
|
|
753
|
-
}
|
|
754
|
-
export interface PluginHealthCheckInput {
|
|
755
|
-
id: string;
|
|
756
|
-
name: string;
|
|
757
|
-
run: () => Promise<HealthCheckResult[]>;
|
|
758
|
-
autoFix?: boolean;
|
|
759
|
-
repair?: HealthRepairHandler;
|
|
760
|
-
}
|
|
761
|
-
interface BaseSettingsField {
|
|
762
|
-
key: string;
|
|
763
|
-
label: string;
|
|
764
|
-
description?: string;
|
|
765
|
-
required?: boolean;
|
|
766
|
-
}
|
|
767
|
-
export interface StringSettingsField extends BaseSettingsField {
|
|
768
|
-
type: 'string';
|
|
769
|
-
default?: string;
|
|
770
|
-
}
|
|
771
|
-
export interface NumberSettingsField extends BaseSettingsField {
|
|
772
|
-
type: 'number';
|
|
773
|
-
default?: number;
|
|
774
|
-
}
|
|
775
|
-
export interface BooleanSettingsField extends BaseSettingsField {
|
|
776
|
-
type: 'boolean';
|
|
777
|
-
default?: boolean;
|
|
778
|
-
}
|
|
779
|
-
export interface SelectSettingsField extends BaseSettingsField {
|
|
780
|
-
type: 'select';
|
|
781
|
-
options: {
|
|
782
|
-
value: string;
|
|
783
|
-
label: string;
|
|
784
|
-
}[];
|
|
785
|
-
default?: string;
|
|
786
|
-
}
|
|
787
|
-
export interface ListSettingsField extends BaseSettingsField {
|
|
788
|
-
type: 'list';
|
|
789
|
-
itemShape: Record<string, StringSettingsField | NumberSettingsField | BooleanSettingsField | SelectSettingsField>;
|
|
790
|
-
default?: unknown[];
|
|
791
|
-
addLabel?: string;
|
|
792
|
-
minItems?: number;
|
|
793
|
-
maxItems?: number;
|
|
794
|
-
uniqueField?: string;
|
|
795
|
-
}
|
|
796
|
-
export type SettingsField = StringSettingsField | NumberSettingsField | BooleanSettingsField | SelectSettingsField | ListSettingsField;
|
|
797
|
-
export interface PluginSettingsSchema {
|
|
798
|
-
fields: SettingsField[];
|
|
799
|
-
}
|
|
800
|
-
export interface PluginContext {
|
|
801
|
-
storage: StorageAdapter;
|
|
802
|
-
events: EventBus;
|
|
803
|
-
pluginId: string;
|
|
804
|
-
runtime: AgentRuntimeAdapter;
|
|
805
|
-
tasks: TaskService;
|
|
806
|
-
assets: AssetsAPI;
|
|
807
|
-
registerNav(items: NavItem[]): void;
|
|
808
|
-
registerRoute(route: APIRoute): void;
|
|
809
|
-
registerSlot(registration: UISlotRegistration): void;
|
|
810
|
-
registerExecTool(tool: ExecToolDefinition): void;
|
|
811
|
-
registerSkill(skill: SkillDefinition): void;
|
|
812
|
-
registerWorkflow(definition: WorkflowDefinitionInput, opts?: {
|
|
813
|
-
readOnly?: boolean;
|
|
814
|
-
}): void;
|
|
815
|
-
registerNodeType<T = unknown>(def: PluginNodeTypeInput<T>): string;
|
|
816
|
-
registerNotificationChannel(def: PluginNotificationChannelInput): string;
|
|
817
|
-
registerHealthCheck(def: PluginHealthCheckInput): string;
|
|
818
|
-
watchFiles(patterns: string[]): void;
|
|
819
|
-
getSettings<T = Record<string, unknown>>(): T;
|
|
820
|
-
updateSettings(patch: Record<string, unknown>): void;
|
|
821
|
-
activity: ActivityAPI;
|
|
822
|
-
log?: PluginLogger;
|
|
823
|
-
hooks: HookAPI;
|
|
824
|
-
search: SearchAPI;
|
|
825
|
-
}
|
|
826
|
-
export interface BakinPlugin {
|
|
827
|
-
id: string;
|
|
828
|
-
name: string;
|
|
829
|
-
version: string;
|
|
830
|
-
activate(ctx: PluginContext): void | Promise<void>;
|
|
831
|
-
onReady?(): void | Promise<void>;
|
|
832
|
-
onShutdown?(): void | Promise<void>;
|
|
833
|
-
onSettingsChange?(settings: Record<string, unknown>): void | Promise<void>;
|
|
834
|
-
onUninstall?(ctx: PluginContext): void | Promise<void>;
|
|
835
|
-
settingsSchema?: PluginSettingsSchema;
|
|
836
|
-
navItems?: NavItem[];
|
|
837
|
-
contentFiles?: ContentFile[];
|
|
838
|
-
}
|
|
839
|
-
export interface CalendarEvent {
|
|
840
|
-
time?: string;
|
|
841
|
-
text: string;
|
|
842
|
-
}
|
|
843
|
-
export interface CalendarDay {
|
|
844
|
-
date: string;
|
|
845
|
-
label?: string;
|
|
846
|
-
events: CalendarEvent[];
|
|
847
|
-
}
|
|
848
|
-
export interface RecurringEvent {
|
|
849
|
-
schedule: string;
|
|
850
|
-
text: string;
|
|
851
|
-
}
|
|
852
|
-
export interface MemoryEntry {
|
|
853
|
-
type: 'decision' | 'learned' | 'note';
|
|
854
|
-
text: string;
|
|
855
|
-
}
|
|
856
|
-
export interface MemoryDay {
|
|
857
|
-
date: string;
|
|
858
|
-
entries: MemoryEntry[];
|
|
859
|
-
}
|
|
860
|
-
export interface Heartbeat {
|
|
861
|
-
status: 'working' | 'idle' | 'down';
|
|
862
|
-
currentTask?: string;
|
|
863
|
-
timestamp: string;
|
|
864
|
-
}
|
|
865
|
-
export interface ProjectMeta {
|
|
866
|
-
filename: string;
|
|
867
|
-
title: string;
|
|
868
|
-
status?: string;
|
|
869
|
-
content: string;
|
|
870
|
-
}
|
|
871
|
-
export interface AvailableModel {
|
|
872
|
-
id: string;
|
|
873
|
-
name?: string;
|
|
874
|
-
provider?: string;
|
|
875
|
-
source?: string;
|
|
876
|
-
tier?: 'budget' | 'standard' | 'premium';
|
|
877
|
-
input?: string;
|
|
878
|
-
contextWindow?: number;
|
|
879
|
-
local?: boolean;
|
|
880
|
-
available?: boolean;
|
|
881
|
-
tags?: string[];
|
|
882
|
-
configured?: boolean;
|
|
883
|
-
isDefault?: boolean;
|
|
884
|
-
fallbackIndex?: number | null;
|
|
885
|
-
description?: string;
|
|
886
|
-
bestFor?: string;
|
|
887
|
-
costRange?: string;
|
|
888
|
-
contextWindowDisplay?: string;
|
|
889
|
-
kind?: 'llm' | 'image' | 'video';
|
|
890
|
-
brandIconSlug?: string;
|
|
891
|
-
providerLabel?: string;
|
|
892
|
-
providerBrandIconSlug?: string;
|
|
893
|
-
providerBrandColor?: string;
|
|
894
|
-
}
|
|
895
|
-
export interface WorkflowDefinition {
|
|
896
|
-
id?: string;
|
|
897
|
-
name: string;
|
|
898
|
-
description?: string;
|
|
899
|
-
version?: number;
|
|
900
|
-
steps: unknown[];
|
|
901
|
-
[key: string]: unknown;
|
|
902
|
-
}
|
|
903
|
-
export interface WorkflowInstance {
|
|
904
|
-
id: string;
|
|
905
|
-
taskId?: string;
|
|
906
|
-
status?: string;
|
|
907
|
-
[key: string]: unknown;
|
|
908
|
-
}
|
|
909
|
-
export interface WorkflowStep {
|
|
910
|
-
id: string;
|
|
911
|
-
type: string;
|
|
912
|
-
[key: string]: unknown;
|
|
913
|
-
}
|
|
914
|
-
export type WorkflowTemplate = WorkflowDefinition;
|
|
915
|
-
export interface BakinConfig {
|
|
916
|
-
plugins: PluginEntry[];
|
|
917
|
-
theme?: Record<string, string>;
|
|
918
|
-
storage?: {
|
|
919
|
-
contentDir?: string;
|
|
920
|
-
};
|
|
921
|
-
}
|
|
922
|
-
export interface PluginEntry {
|
|
923
|
-
path: string;
|
|
924
|
-
enabled?: boolean;
|
|
925
|
-
}
|
|
926
|
-
export {};
|
|
17
|
+
export * from './primitives/index';
|
|
18
|
+
export * from './manifest/index';
|
|
19
|
+
export * from './runtime/index';
|
|
20
|
+
export * from './services/index';
|
|
21
|
+
export * from './health/index';
|
|
22
|
+
export * from './registration/index';
|
|
23
|
+
export * from './context/index';
|
|
24
|
+
export * from './conversation-turns/index';
|
|
25
|
+
export * from './scheduled-events/index';
|
|
26
|
+
export * from './api-route/index';
|