@makinbakin/sdk 0.0.0-bootstrap.0 → 0.0.1-rc.10
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 +21 -10
- package/_internal/app/components/agent-select.d.ts +7 -2
- package/_internal/app/components/integrated-brainstorm/activity.d.ts +23 -0
- package/_internal/app/components/integrated-brainstorm/index.d.ts +6 -1
- package/_internal/app/components/integrated-brainstorm/session.d.ts +16 -0
- package/_internal/app/components/integrated-brainstorm/sse.d.ts +8 -0
- package/_internal/app/components/integrated-brainstorm/types.d.ts +7 -5
- package/_internal/app/components/ui/badge.d.ts +1 -1
- package/_internal/app/components/ui/button.d.ts +1 -1
- package/_internal/app/hooks/use-content-store.d.ts +2 -0
- package/_internal/app/hooks/use-nav-badge.d.ts +13 -0
- package/_internal/app/types/index.d.ts +0 -42
- package/_internal/core/adapters/runtime/concepts.d.ts +119 -2
- package/_internal/core/adapters/runtime/index.d.ts +1 -1
- package/_internal/core/constants.d.ts +15 -0
- package/_internal/core/content-dir.d.ts +42 -0
- package/_internal/core/generated-version.d.ts +1 -0
- package/_internal/core/logger.d.ts +8 -0
- package/_internal/core/plugin-types.d.ts +168 -37
- package/_internal/core/routing/index.d.ts +1 -1
- package/_internal/plugins/team/types.d.ts +12 -2
- package/components/index.d.ts +39 -3
- package/components/index.js +16257 -1550
- package/hooks/index.d.ts +58 -9
- package/hooks/index.js +14414 -413
- package/index.d.ts +43 -10
- package/index.js +400 -1
- package/metadata/index.d.ts +16 -3
- package/package.json +2 -2
- package/register.d.ts +20 -9
- package/routing/index.d.ts +8 -3
- package/routing/index.js +327 -0
- package/slots/index.d.ts +1 -1
- package/slots/index.js +20 -1
- package/types/index.d.ts +431 -50
- package/ui/index.d.ts +2 -2
- package/ui/index.js +2 -1
- package/utils/index.d.ts +24 -2
- package/utils/index.js +269 -1
- package/_internal/app/hooks/use-assets.d.ts +0 -25
package/README.md
CHANGED
|
@@ -9,6 +9,12 @@ runtime React + `@makinbakin/sdk/*` are externalized and resolved through
|
|
|
9
9
|
the host's import map — so plugins don't ship a second copy of any of
|
|
10
10
|
them.
|
|
11
11
|
|
|
12
|
+
Full SDK docs:
|
|
13
|
+
|
|
14
|
+
- [SDK overview](https://makinbakin.com/docs/extending/sdk/overview/)
|
|
15
|
+
- [SDK reference](https://makinbakin.com/docs/reference/generated/sdk/)
|
|
16
|
+
- [Build a plugin](https://makinbakin.com/docs/extending/plugins/build/)
|
|
17
|
+
|
|
12
18
|
## Install
|
|
13
19
|
|
|
14
20
|
```sh
|
|
@@ -26,7 +32,7 @@ the actual instances at runtime.
|
|
|
26
32
|
bakin plugins scaffold my-plugin
|
|
27
33
|
cd my-plugin
|
|
28
34
|
bun install
|
|
29
|
-
bakin plugins install .
|
|
35
|
+
bakin plugins install --dev .
|
|
30
36
|
```
|
|
31
37
|
|
|
32
38
|
## Minimal client entry
|
|
@@ -80,21 +86,26 @@ component for a slot via `registerPlugin({ slots: { 'slot-name': Component } })`
|
|
|
80
86
|
| `task-assets` | Task drawer, asset attachments section |
|
|
81
87
|
| `task-sidebar` | Task drawer sidebar (custom panels for a plugin's tasks) |
|
|
82
88
|
| `home-widget` | Dashboard home widget grid |
|
|
89
|
+
| `nav-badge-providers` | Background hook runners (render `null`) that drive `setNavBadge` |
|
|
83
90
|
| `page:/<route>` | Full-page mount at `<route>` |
|
|
84
91
|
|
|
85
92
|
## Sub-path imports
|
|
86
93
|
|
|
87
|
-
The
|
|
94
|
+
The public npm package exposes these sub-paths:
|
|
88
95
|
|
|
89
96
|
| Import path | What it exposes |
|
|
90
97
|
| ------------------------ | -------------------------------------------- |
|
|
91
|
-
| `@makinbakin/sdk`
|
|
92
|
-
| `@makinbakin/sdk/ui`
|
|
93
|
-
| `@makinbakin/sdk/hooks`
|
|
94
|
-
| `@makinbakin/sdk/components`
|
|
95
|
-
| `@makinbakin/sdk/slots`
|
|
96
|
-
| `@makinbakin/sdk/types`
|
|
97
|
-
| `@makinbakin/sdk/utils`
|
|
98
|
+
| `@makinbakin/sdk` | Plugin registration, route helpers, top-level exports |
|
|
99
|
+
| `@makinbakin/sdk/ui` | Base UI components |
|
|
100
|
+
| `@makinbakin/sdk/hooks` | Shared React hooks |
|
|
101
|
+
| `@makinbakin/sdk/components` | Higher-level shell components |
|
|
102
|
+
| `@makinbakin/sdk/slots` | Slot runtime and provider |
|
|
103
|
+
| `@makinbakin/sdk/types` | TypeScript contract types |
|
|
104
|
+
| `@makinbakin/sdk/utils` | Shared utilities |
|
|
105
|
+
| `@makinbakin/sdk/metadata` | Docs-aware contract metadata helpers |
|
|
106
|
+
| `@makinbakin/sdk/routing` | Typed declarative route helpers |
|
|
107
|
+
|
|
108
|
+
Use `@makinbakin/sdk/*` imports for external plugin code.
|
|
98
109
|
|
|
99
110
|
## Repository
|
|
100
111
|
|
|
@@ -104,4 +115,4 @@ This package is developed alongside Bakin in the
|
|
|
104
115
|
|
|
105
116
|
## License
|
|
106
117
|
|
|
107
|
-
|
|
118
|
+
Apache-2.0
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AriaAttributes } from 'react';
|
|
2
|
+
interface AgentSelectProps extends Pick<AriaAttributes, 'aria-describedby' | 'aria-invalid'> {
|
|
3
|
+
id?: string;
|
|
2
4
|
value: string;
|
|
3
5
|
onValueChange: (value: string) => void;
|
|
6
|
+
/** Include the workflow/task runtime assignee token (`$assigned`) */
|
|
7
|
+
includeAssigned?: boolean;
|
|
8
|
+
assignedLabel?: string;
|
|
4
9
|
/** Show a "None" / "Unassigned" option at the top (default: false) */
|
|
5
10
|
allowNone?: boolean;
|
|
6
11
|
/** Label for the none option (default: "Unassigned") */
|
|
@@ -11,5 +16,5 @@ interface AgentSelectProps {
|
|
|
11
16
|
agentIds?: string[];
|
|
12
17
|
className?: string;
|
|
13
18
|
}
|
|
14
|
-
export declare function AgentSelect({ value, onValueChange, allowNone, noneLabel, placeholder, agentIds, className, }: AgentSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function AgentSelect({ value, onValueChange, includeAssigned, assignedLabel, allowNone, noneLabel, placeholder, agentIds, className, id, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, }: AgentSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
15
20
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RuntimeChatChunk } from '@makinbakin/sdk/types';
|
|
2
|
+
import type { BrainstormMessage } from './types';
|
|
3
|
+
export interface BrainstormActivityInput {
|
|
4
|
+
kind: string;
|
|
5
|
+
content: string;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface BrainstormTimelineMessageInput {
|
|
9
|
+
id: string;
|
|
10
|
+
role: 'user' | 'assistant' | 'agent';
|
|
11
|
+
content: string;
|
|
12
|
+
timestamp?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BrainstormTimelineActivityInput extends BrainstormActivityInput {
|
|
15
|
+
id: string;
|
|
16
|
+
timestamp?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function runtimeChunkToBrainstormActivity(chunk: RuntimeChatChunk): BrainstormActivityInput | null;
|
|
19
|
+
export declare function brainstormActivityMessageFromCustom(name: string, data: unknown): BrainstormMessage | null;
|
|
20
|
+
export declare function toBrainstormTimeline(agentId: string, input: {
|
|
21
|
+
messages: BrainstormTimelineMessageInput[];
|
|
22
|
+
activities?: BrainstormTimelineActivityInput[];
|
|
23
|
+
}): BrainstormMessage[];
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { IntegratedBrainstormProps } from './types';
|
|
2
2
|
export type { BrainstormMessage, IntegratedBrainstormProps, BrainstormOnSend, SendContext, AssistantTransformed, } from './types';
|
|
3
|
-
export
|
|
3
|
+
export { brainstormActivityMessageFromCustom, runtimeChunkToBrainstormActivity, toBrainstormTimeline, } from './activity';
|
|
4
|
+
export { brainstormThreadId, normalizeBrainstormActivityForStorage, normalizeBrainstormActivityMessageForStorage, } from './session';
|
|
5
|
+
export type { BrainstormActivityInput, BrainstormTimelineActivityInput, BrainstormTimelineMessageInput, } from './activity';
|
|
6
|
+
export type { BrainstormActivityStorageInput, BrainstormActivityStorageRecord, } from './session';
|
|
7
|
+
export { readBrainstormSseResponse } from './sse';
|
|
8
|
+
export declare function IntegratedBrainstorm({ messages, onMessagesChange, onSend, agentId, onAgentChange, label, icon, placeholder, emptyState, collapsible, defaultOpen, defaultHeight, minHeight, maxHeight, maxInputHeight, storageKey, fitParent, showHeader, readOnly, readOnlyNotice, transformAssistantMessage, }: IntegratedBrainstormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BrainstormMessage } from './types';
|
|
2
|
+
export interface BrainstormActivityStorageInput {
|
|
3
|
+
id?: string;
|
|
4
|
+
kind?: string;
|
|
5
|
+
content?: string;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
timestamp?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BrainstormActivityStorageRecord {
|
|
10
|
+
kind: string;
|
|
11
|
+
content: string;
|
|
12
|
+
data?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare function brainstormThreadId(scope: string, entityId: string, agentId: string): string;
|
|
15
|
+
export declare function normalizeBrainstormActivityForStorage(activity: BrainstormActivityStorageInput): BrainstormActivityStorageRecord | null;
|
|
16
|
+
export declare function normalizeBrainstormActivityMessageForStorage(activity: BrainstormActivityStorageInput): Pick<BrainstormMessage, 'role' | 'kind' | 'content' | 'data'> | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SendContext } from './types';
|
|
2
|
+
interface BrainstormSseReadOptions {
|
|
3
|
+
onCustomEvent?: (event: string, data: unknown) => boolean | void;
|
|
4
|
+
}
|
|
5
|
+
export declare function readBrainstormSseResponse(response: Response, ctx: SendContext, options?: BrainstormSseReadOptions): Promise<{
|
|
6
|
+
content: string;
|
|
7
|
+
}>;
|
|
8
|
+
export {};
|
|
@@ -2,9 +2,11 @@ import type { LucideIcon } from 'lucide-react';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export interface BrainstormMessage {
|
|
4
4
|
id: string;
|
|
5
|
-
role: 'user' | 'assistant';
|
|
5
|
+
role: 'user' | 'assistant' | 'activity';
|
|
6
6
|
content: string;
|
|
7
7
|
agentId?: string;
|
|
8
|
+
kind?: 'runtime_status' | 'tool_call' | 'error' | string;
|
|
9
|
+
data?: unknown;
|
|
8
10
|
timestamp?: string;
|
|
9
11
|
}
|
|
10
12
|
export interface SendContext {
|
|
@@ -38,16 +40,16 @@ export interface IntegratedBrainstormProps {
|
|
|
38
40
|
position?: 'bottom';
|
|
39
41
|
collapsible?: boolean;
|
|
40
42
|
defaultOpen?: boolean;
|
|
41
|
-
|
|
43
|
+
defaultHeight?: number;
|
|
42
44
|
minHeight?: number;
|
|
43
45
|
maxHeight?: number;
|
|
44
46
|
maxInputHeight?: number;
|
|
45
47
|
storageKey?: string;
|
|
46
48
|
/**
|
|
47
49
|
* Fill parent height via flex-1/h-full instead of a fixed pixel height.
|
|
48
|
-
* Drops the drag handle
|
|
49
|
-
*
|
|
50
|
-
*
|
|
50
|
+
* Drops the drag handle because there is nothing fixed to drag against. Use
|
|
51
|
+
* when the panel IS the pane — e.g. a dedicated chat route — rather than a
|
|
52
|
+
* bottom sheet above other content.
|
|
51
53
|
*/
|
|
52
54
|
fitParent?: boolean;
|
|
53
55
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
7
7
|
export { Badge, badgeVariants };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "info" | "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | "warning" | "accent" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | "icon" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,7 @@ interface ContentStore extends ContentState {
|
|
|
15
15
|
activityEvents: ActivityEvent[];
|
|
16
16
|
sseConnected: boolean;
|
|
17
17
|
taskboardVersion: number;
|
|
18
|
+
doctorVersion: number;
|
|
18
19
|
debug: boolean;
|
|
19
20
|
reindexProgress: Record<string, ReindexProgressEntry>;
|
|
20
21
|
setFiles: (files: Record<string, string>) => void;
|
|
@@ -26,6 +27,7 @@ interface ContentStore extends ContentState {
|
|
|
26
27
|
setActivityEvents: (events: ActivityEvent[]) => void;
|
|
27
28
|
setSseConnected: (connected: boolean) => void;
|
|
28
29
|
bumpTaskboard: () => void;
|
|
30
|
+
bumpDoctor: () => void;
|
|
29
31
|
setDebug: (debug: boolean) => void;
|
|
30
32
|
toggleDebug: () => void;
|
|
31
33
|
setReindexProgress: (table: string, indexed: number, done: boolean) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type NavBadge } from '@makinbakin/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Sync a nav item's badge to the value passed each render. Calls
|
|
4
|
+
* `setNavBadge(pluginId, navItemId, badge)` only when the badge's value
|
|
5
|
+
* actually changes — the effect is keyed on a serialization of `count` +
|
|
6
|
+
* `tone`, not the object identity (which a parent recreates every render).
|
|
7
|
+
*
|
|
8
|
+
* This is the recommended glue for a badge provider: keep your own summary
|
|
9
|
+
* hook (fetch + refresh) per plugin, derive a `NavBadge | null`, and pass it
|
|
10
|
+
* here. Teardown is handled by `unregisterPlugin`, so this does not clear on
|
|
11
|
+
* unmount (which would flicker on dev hot-reload).
|
|
12
|
+
*/
|
|
13
|
+
export declare function useNavBadge(pluginId: string, navItemId: string, badge: NavBadge | null): void;
|
|
@@ -56,48 +56,6 @@ export interface ProjectMeta {
|
|
|
56
56
|
status?: string;
|
|
57
57
|
content: string;
|
|
58
58
|
}
|
|
59
|
-
export interface AssetVariantMeta {
|
|
60
|
-
role: 'thumbnail' | 'optimized' | 'webp';
|
|
61
|
-
path: string;
|
|
62
|
-
filename: string;
|
|
63
|
-
size: number;
|
|
64
|
-
mimeType: string;
|
|
65
|
-
}
|
|
66
|
-
export interface AssetMeta {
|
|
67
|
-
path: string;
|
|
68
|
-
filename: string;
|
|
69
|
-
type: 'text' | 'images' | 'video' | 'audio' | 'plans' | 'research' | 'pdf' | 'data' | 'other';
|
|
70
|
-
mimeType: string;
|
|
71
|
-
size: number;
|
|
72
|
-
mtimeMs?: number;
|
|
73
|
-
metadata: {
|
|
74
|
-
agent: string;
|
|
75
|
-
taskId: string | null;
|
|
76
|
-
created: string;
|
|
77
|
-
tool?: string;
|
|
78
|
-
description?: string;
|
|
79
|
-
tags?: string[];
|
|
80
|
-
originalFilename?: string;
|
|
81
|
-
};
|
|
82
|
-
variants?: AssetVariantMeta[];
|
|
83
|
-
}
|
|
84
|
-
export interface TrashedAssetMeta {
|
|
85
|
-
filename: string;
|
|
86
|
-
originalFilename: string;
|
|
87
|
-
type: string;
|
|
88
|
-
mimeType: string;
|
|
89
|
-
size: number;
|
|
90
|
-
deletedAt: string;
|
|
91
|
-
expiresAt: string;
|
|
92
|
-
metadata: {
|
|
93
|
-
agent: string;
|
|
94
|
-
taskId: string | null;
|
|
95
|
-
created: string;
|
|
96
|
-
tool?: string;
|
|
97
|
-
description?: string;
|
|
98
|
-
tags?: string[];
|
|
99
|
-
} | null;
|
|
100
|
-
}
|
|
101
59
|
export interface OfficeData {
|
|
102
60
|
asciiMap: string;
|
|
103
61
|
statusTable: {
|
|
@@ -38,9 +38,25 @@ export interface WorkspaceFile {
|
|
|
38
38
|
updatedAt?: string;
|
|
39
39
|
metadata?: RuntimeMetadata;
|
|
40
40
|
}
|
|
41
|
-
export
|
|
41
|
+
export type RuntimeMessageToolsMode = 'auto' | 'none';
|
|
42
|
+
export interface RuntimeMessageToolPolicy {
|
|
43
|
+
/**
|
|
44
|
+
* Controls whether runtime-native tools are available for this agent turn.
|
|
45
|
+
* `none` disables tools. Omit or use `auto` for runtime/provider defaults.
|
|
46
|
+
*/
|
|
47
|
+
toolsMode?: RuntimeMessageToolsMode;
|
|
48
|
+
/** Optional runtime-native tool allowlist for this turn. */
|
|
49
|
+
toolsAllow?: string[];
|
|
50
|
+
/** Optional runtime-native tool denylist for this turn. */
|
|
51
|
+
toolsDeny?: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface MessageArgs extends RuntimeMessageToolPolicy {
|
|
42
54
|
agentId: string;
|
|
43
55
|
content: string;
|
|
56
|
+
/**
|
|
57
|
+
* Adapter-neutral durable conversation key. Runtime adapters should map the
|
|
58
|
+
* same agentId + threadId pair to the same provider/runtime session.
|
|
59
|
+
*/
|
|
44
60
|
threadId?: string;
|
|
45
61
|
metadata?: RuntimeMetadata;
|
|
46
62
|
}
|
|
@@ -49,10 +65,22 @@ export interface MessageResult {
|
|
|
49
65
|
content?: string;
|
|
50
66
|
metadata?: RuntimeMetadata;
|
|
51
67
|
}
|
|
68
|
+
export interface RuntimeToolActivity {
|
|
69
|
+
phase: 'call' | 'result';
|
|
70
|
+
callId?: string;
|
|
71
|
+
toolName: string;
|
|
72
|
+
status?: 'running' | 'completed' | 'failed' | string;
|
|
73
|
+
summary?: string;
|
|
74
|
+
inputPreview?: string;
|
|
75
|
+
outputPreview?: string;
|
|
76
|
+
durationMs?: number;
|
|
77
|
+
exitCode?: number;
|
|
78
|
+
metadata?: RuntimeMetadata;
|
|
79
|
+
}
|
|
52
80
|
export interface ChatChunk {
|
|
53
81
|
type: 'text' | 'tool' | 'status' | 'done' | 'error';
|
|
54
82
|
content?: string;
|
|
55
|
-
data?:
|
|
83
|
+
data?: RuntimeMetadata | RuntimeToolActivity;
|
|
56
84
|
}
|
|
57
85
|
export interface ToolDefinition {
|
|
58
86
|
name: string;
|
|
@@ -280,6 +308,94 @@ export interface RuntimeAvailableModel {
|
|
|
280
308
|
tags?: string[];
|
|
281
309
|
metadata?: RuntimeMetadata;
|
|
282
310
|
}
|
|
311
|
+
export type RuntimeImageOutputFormat = 'png' | 'jpeg' | 'jpg' | 'webp';
|
|
312
|
+
export type RuntimeImageBackground = 'transparent' | 'opaque' | 'auto';
|
|
313
|
+
/**
|
|
314
|
+
* Image capability is intentionally all-optional. A thin runtime that exposes a
|
|
315
|
+
* single image tool maps on by filling minimal fields (e.g. one synthesized
|
|
316
|
+
* provider with a defaultModel); a rich runtime fills more. Consumers MUST
|
|
317
|
+
* treat a sparse capability as normal and never require a field a thin runtime
|
|
318
|
+
* cannot provide — gaps are filled below, in the adapter/shim, not pushed up
|
|
319
|
+
* into plugins. See .claude/specs/media-generation-adapter-architecture.md.
|
|
320
|
+
*/
|
|
321
|
+
export interface RuntimeImageProviderCapabilities {
|
|
322
|
+
generate?: {
|
|
323
|
+
maxCount?: number;
|
|
324
|
+
supportsSize?: boolean;
|
|
325
|
+
supportsAspectRatio?: boolean;
|
|
326
|
+
supportsResolution?: boolean;
|
|
327
|
+
};
|
|
328
|
+
edit?: {
|
|
329
|
+
enabled?: boolean;
|
|
330
|
+
maxCount?: number;
|
|
331
|
+
maxInputImages?: number;
|
|
332
|
+
supportsSize?: boolean;
|
|
333
|
+
supportsAspectRatio?: boolean;
|
|
334
|
+
supportsResolution?: boolean;
|
|
335
|
+
};
|
|
336
|
+
geometry?: {
|
|
337
|
+
sizes?: string[];
|
|
338
|
+
aspectRatios?: string[];
|
|
339
|
+
resolutions?: string[];
|
|
340
|
+
};
|
|
341
|
+
output?: {
|
|
342
|
+
formats?: string[];
|
|
343
|
+
qualities?: string[];
|
|
344
|
+
backgrounds?: string[];
|
|
345
|
+
};
|
|
346
|
+
metadata?: RuntimeMetadata;
|
|
347
|
+
}
|
|
348
|
+
export interface RuntimeImageProvider {
|
|
349
|
+
id: string;
|
|
350
|
+
label?: string;
|
|
351
|
+
defaultModel?: string;
|
|
352
|
+
models?: string[];
|
|
353
|
+
available?: boolean;
|
|
354
|
+
configured?: boolean;
|
|
355
|
+
selected?: boolean;
|
|
356
|
+
capabilities?: RuntimeImageProviderCapabilities;
|
|
357
|
+
metadata?: RuntimeMetadata;
|
|
358
|
+
}
|
|
359
|
+
export interface RuntimeImageGenerateInput {
|
|
360
|
+
prompt: string;
|
|
361
|
+
provider?: string;
|
|
362
|
+
model?: string;
|
|
363
|
+
count?: number;
|
|
364
|
+
width?: number;
|
|
365
|
+
height?: number;
|
|
366
|
+
size?: string;
|
|
367
|
+
aspectRatio?: string;
|
|
368
|
+
resolution?: string;
|
|
369
|
+
outputFormat?: RuntimeImageOutputFormat;
|
|
370
|
+
background?: RuntimeImageBackground;
|
|
371
|
+
timeoutMs?: number;
|
|
372
|
+
metadata?: RuntimeMetadata;
|
|
373
|
+
}
|
|
374
|
+
export interface RuntimeImageEditInput extends RuntimeImageGenerateInput {
|
|
375
|
+
files: string[];
|
|
376
|
+
}
|
|
377
|
+
export interface RuntimeImageFile {
|
|
378
|
+
filePath: string;
|
|
379
|
+
mimeType?: string;
|
|
380
|
+
width?: number;
|
|
381
|
+
height?: number;
|
|
382
|
+
provider?: string;
|
|
383
|
+
model?: string;
|
|
384
|
+
url?: string;
|
|
385
|
+
metadata?: RuntimeMetadata;
|
|
386
|
+
}
|
|
387
|
+
export interface RuntimeImageGenerationResult {
|
|
388
|
+
images: RuntimeImageFile[];
|
|
389
|
+
provider?: string;
|
|
390
|
+
model?: string;
|
|
391
|
+
providerText?: string;
|
|
392
|
+
metadata?: RuntimeMetadata;
|
|
393
|
+
}
|
|
394
|
+
export interface RuntimeImagesAccess {
|
|
395
|
+
providers(): Promise<RuntimeImageProvider[]>;
|
|
396
|
+
generate(input: RuntimeImageGenerateInput): Promise<RuntimeImageGenerationResult>;
|
|
397
|
+
edit(input: RuntimeImageEditInput): Promise<RuntimeImageGenerationResult>;
|
|
398
|
+
}
|
|
283
399
|
export interface TaskDispatchArgs {
|
|
284
400
|
bakinTaskId: string;
|
|
285
401
|
agentId?: string;
|
|
@@ -436,6 +552,7 @@ export interface AgentRuntimeAdapter {
|
|
|
436
552
|
includeUnavailable?: boolean;
|
|
437
553
|
}): Promise<RuntimeAvailableModel[]>;
|
|
438
554
|
};
|
|
555
|
+
images?: RuntimeImagesAccess;
|
|
439
556
|
tasks: {
|
|
440
557
|
dispatch(args: TaskDispatchArgs): Promise<TaskDispatchResult>;
|
|
441
558
|
getExecutionStatus(flowId: string): Promise<TaskExecutionStatus>;
|
|
@@ -2,4 +2,4 @@ export type { AdapterAuditEvent, AdapterHealthCheckDefinition, AdapterHealthChec
|
|
|
2
2
|
export type { ChannelCapability } from './capabilities';
|
|
3
3
|
export { hasChannelCapability } from './capabilities';
|
|
4
4
|
export { getRuntimeMainAgent, getRuntimeMainAgentId, getRuntimeMainAgentName, selectRuntimeMainAgent, } from './helpers';
|
|
5
|
-
export type { AgentRuntimeAdapter, ApprovalDelivery, ApprovalOption, ApprovalPatch, ApprovalRenderRef, ApprovalRenderResult, ApprovalResolveEvent, ApprovalResponse, CancelApprovalArgs, ChannelInfo, ChannelInteractionEvent, ChannelMessageArgs, ChannelMessageEvent, ChatChunk, ContentDeliveryArgs, CreateApprovalArgs, CreateCronJobInput, CreateRuntimeAgentInput, CronJob, CronRun, DeliveryResult, DurableApprovalRecord, EditApprovalArgs, ListExecutionsOpts, MessageArgs, MessageResult, NotificationArgs, ResolveApprovalArgs, RuntimeAgent, RuntimeAllowlistPatch, RuntimeAvailableModel, RuntimeConfigAccess, RuntimeMemoryEntry, RuntimeMemoryEntryStat, RuntimeMemoryPathMatch, RuntimeMemoryReadRange, RuntimeMemorySearchResult, RuntimeMemoryTier, RuntimeMetadata, RuntimePermissionPatch, RawCronSnapshot, RuntimeSession, RuntimeSkill, TaskDispatchArgs, TaskDispatchResult, TaskExecutionEvent, TaskExecutionStatus, ToolDefinition, ToolResult, UpdateCronJobInput, UpdateRuntimeAgentInput, WorkspaceFile, } from './concepts';
|
|
5
|
+
export type { AgentRuntimeAdapter, ApprovalDelivery, ApprovalOption, ApprovalPatch, ApprovalRenderRef, ApprovalRenderResult, ApprovalResolveEvent, ApprovalResponse, CancelApprovalArgs, ChannelInfo, ChannelInteractionEvent, ChannelMessageArgs, ChannelMessageEvent, ChatChunk, ContentDeliveryArgs, CreateApprovalArgs, CreateCronJobInput, CreateRuntimeAgentInput, CronJob, CronRun, DeliveryResult, DurableApprovalRecord, EditApprovalArgs, ListExecutionsOpts, MessageArgs, MessageResult, NotificationArgs, ResolveApprovalArgs, RuntimeAgent, RuntimeAllowlistPatch, RuntimeToolActivity, RuntimeAvailableModel, RuntimeConfigAccess, RuntimeImageBackground, RuntimeImageEditInput, RuntimeImageFile, RuntimeImageGenerateInput, RuntimeImageGenerationResult, RuntimeImageOutputFormat, RuntimeImageProvider, RuntimeImageProviderCapabilities, RuntimeImagesAccess, RuntimeMemoryEntry, RuntimeMemoryEntryStat, RuntimeMemoryPathMatch, RuntimeMemoryReadRange, RuntimeMemorySearchResult, RuntimeMemoryTier, RuntimeMessageToolPolicy, RuntimeMessageToolsMode, RuntimeMetadata, RuntimePermissionPatch, RawCronSnapshot, RuntimeSession, RuntimeSkill, TaskDispatchArgs, TaskDispatchResult, TaskExecutionEvent, TaskExecutionStatus, ToolDefinition, ToolResult, UpdateCronJobInput, UpdateRuntimeAgentInput, WorkspaceFile, } from './concepts';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core branding and identity constants for Bakin.
|
|
3
|
+
*
|
|
4
|
+
* Change these values to rebrand the entire application.
|
|
5
|
+
* Every file that needs the app name, slug, or paths imports from here.
|
|
6
|
+
*/
|
|
7
|
+
export declare const APP_NAME = "Bakin";
|
|
8
|
+
export declare const APP_SLUG = "bakin";
|
|
9
|
+
export { APP_VERSION } from './generated-version';
|
|
10
|
+
export declare const APP_HOME_DEFAULT = "~/.bakin";
|
|
11
|
+
export declare const CONFIG_FILE = "bakin.config.ts";
|
|
12
|
+
export declare const PLUGIN_MANIFEST_FILE = "bakin-plugin.json";
|
|
13
|
+
export declare const MAIN_AGENT_ROLE = "orchestrator";
|
|
14
|
+
export declare const DEFAULT_PORT = 3737;
|
|
15
|
+
export declare const ENV_PREFIX = "BAKIN";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the content directory path.
|
|
3
|
+
*/
|
|
4
|
+
export declare function getContentDir(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the content dir is inside the supported Bakin home contract.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isUsingBakinHome(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Reset the resolved content dir (for testing).
|
|
11
|
+
*/
|
|
12
|
+
export declare function resetContentDir(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Well-known content paths. Agents and CLI use these instead of constructing paths.
|
|
15
|
+
*/
|
|
16
|
+
export interface BakinPaths {
|
|
17
|
+
home: string;
|
|
18
|
+
memoryLog: string;
|
|
19
|
+
audit: string;
|
|
20
|
+
assets: string;
|
|
21
|
+
'assets.store': string;
|
|
22
|
+
'assets.inbox': string;
|
|
23
|
+
'assets.trash': string;
|
|
24
|
+
agents: string;
|
|
25
|
+
personas: string;
|
|
26
|
+
team: string;
|
|
27
|
+
heartbeats: string;
|
|
28
|
+
inbox: string;
|
|
29
|
+
tasks: string;
|
|
30
|
+
workflows: string;
|
|
31
|
+
settings: string;
|
|
32
|
+
logs: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function getBakinPaths(): BakinPaths;
|
|
35
|
+
/**
|
|
36
|
+
* Initialize the ~/.bakin/ directory structure.
|
|
37
|
+
* Called by `bakin mkdir` CLI command or on first run.
|
|
38
|
+
*/
|
|
39
|
+
export declare function initBakinHome(targetDir?: string): {
|
|
40
|
+
created: string[];
|
|
41
|
+
seeded: string[];
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const APP_VERSION = "0.0.0-dev";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare function createLogger(module: string): {
|
|
2
|
+
debug: (message: string, data?: Record<string, unknown>) => void;
|
|
3
|
+
info: (message: string, data?: Record<string, unknown>) => void;
|
|
4
|
+
warn: (message: string, errorOrData?: unknown, data?: Record<string, unknown>) => void;
|
|
5
|
+
error: (message: string, errorOrData?: unknown, data?: Record<string, unknown>) => void;
|
|
6
|
+
};
|
|
7
|
+
export type Logger = ReturnType<typeof createLogger>;
|
|
8
|
+
export { createLogger };
|