@makinbakin/sdk 0.0.1-rc.20 → 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.
Files changed (110) hide show
  1. package/_internal/app/components/agent-select.d.ts +10 -1
  2. package/_internal/app/components/asset-picker.d.ts +25 -0
  3. package/_internal/app/components/charts/bar-chart.d.ts +16 -0
  4. package/_internal/app/components/charts/chart-data-table.d.ts +31 -0
  5. package/_internal/app/components/charts/chart-explainer.d.ts +9 -0
  6. package/_internal/app/components/charts/chart-tooltip.d.ts +8 -0
  7. package/_internal/app/components/charts/line-chart.d.ts +13 -0
  8. package/_internal/app/components/charts/palette.d.ts +24 -0
  9. package/_internal/app/components/charts/sparkline.d.ts +12 -0
  10. package/_internal/app/components/charts/stacked-column-chart.d.ts +40 -0
  11. package/_internal/app/components/confirm-dialog.d.ts +23 -2
  12. package/_internal/app/components/conversation/activity-group.d.ts +15 -0
  13. package/_internal/app/components/conversation/agent-turn.d.ts +36 -0
  14. package/_internal/app/components/conversation/attention.d.ts +56 -0
  15. package/_internal/app/components/conversation/composer.d.ts +35 -0
  16. package/_internal/app/components/conversation/conversation-empty-state.d.ts +8 -0
  17. package/_internal/app/components/conversation/conversation-panel.d.ts +33 -0
  18. package/_internal/app/components/conversation/conversation.d.ts +14 -0
  19. package/_internal/app/components/conversation/fold.d.ts +129 -0
  20. package/_internal/app/components/conversation/notification-sound.d.ts +8 -0
  21. package/_internal/app/components/conversation/relative-time.d.ts +8 -0
  22. package/_internal/app/components/conversation/reply-toast.d.ts +15 -0
  23. package/_internal/app/components/conversation/thread-id.d.ts +8 -0
  24. package/_internal/app/components/conversation/tool-call-drawer.d.ts +7 -0
  25. package/_internal/app/components/conversation/turn-recorder.d.ts +37 -0
  26. package/_internal/app/components/conversation/use-conversation-attention.d.ts +64 -0
  27. package/_internal/app/components/conversation/use-conversation-thread.d.ts +55 -0
  28. package/_internal/app/components/conversation/user-message.d.ts +11 -0
  29. package/_internal/app/components/danger-zone.d.ts +28 -0
  30. package/_internal/app/components/empty-state.d.ts +5 -2
  31. package/_internal/app/components/plugin-header.d.ts +4 -3
  32. package/_internal/app/components/save-bar.d.ts +32 -0
  33. package/_internal/app/components/score-overlay.d.ts +33 -0
  34. package/_internal/app/components/search-degraded-chip.d.ts +4 -0
  35. package/_internal/app/components/search-partial-chip.d.ts +13 -0
  36. package/_internal/app/components/search-unavailable.d.ts +12 -0
  37. package/_internal/app/components/section-card.d.ts +22 -0
  38. package/_internal/app/components/segmented-control.d.ts +28 -0
  39. package/_internal/app/components/stat-tile.d.ts +26 -0
  40. package/_internal/app/components/status-badge.d.ts +19 -0
  41. package/_internal/app/components/turn-output-view.d.ts +57 -0
  42. package/_internal/app/components/ui/button.d.ts +1 -1
  43. package/_internal/app/components/underline-tabs.d.ts +6 -2
  44. package/_internal/app/components/unsaved-changes-guard.d.ts +34 -0
  45. package/_internal/app/core/conversation-turns.d.ts +148 -0
  46. package/_internal/app/core/logger.d.ts +1 -0
  47. package/_internal/app/hooks/use-file-drop.d.ts +25 -0
  48. package/_internal/app/hooks/use-history-back.d.ts +1 -0
  49. package/_internal/app/hooks/use-json-fetch.d.ts +5 -0
  50. package/_internal/app/hooks/use-query-state.d.ts +2 -0
  51. package/_internal/app/hooks/use-schedule.d.ts +45 -0
  52. package/_internal/app/hooks/use-search.d.ts +27 -8
  53. package/_internal/app/hooks/use-toast.d.ts +3 -3
  54. package/_internal/app/lib/browser-notify.d.ts +12 -1
  55. package/_internal/core/adapters/runtime/concepts.d.ts +547 -49
  56. package/_internal/core/adapters/runtime/errors.d.ts +13 -1
  57. package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
  58. package/_internal/core/adapters/runtime/index.d.ts +5 -2
  59. package/_internal/core/adapters/runtime/testing.d.ts +79 -0
  60. package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
  61. package/_internal/core/adapters/shared.d.ts +122 -12
  62. package/_internal/core/content-dir.d.ts +8 -0
  63. package/_internal/core/docs/route.d.ts +1 -1
  64. package/_internal/core/format/structured.d.ts +44 -0
  65. package/_internal/core/format.d.ts +5 -1
  66. package/_internal/core/media/downscale.d.ts +18 -0
  67. package/_internal/core/media/sharp-loader.d.ts +36 -0
  68. package/_internal/core/plugin-types.d.ts +102 -39
  69. package/_internal/core/routing/define.d.ts +26 -3
  70. package/_internal/core/routing/dispatcher.d.ts +15 -6
  71. package/_internal/core/routing/index.d.ts +1 -1
  72. package/_internal/core/routing/types.d.ts +13 -70
  73. package/_internal/core/storage/atomic-write.d.ts +11 -0
  74. package/_internal/core/tasks/store.d.ts +129 -0
  75. package/_internal/core/tasks/testing.d.ts +2 -0
  76. package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts +1 -1
  77. package/_internal/plugins/team/types.d.ts +47 -0
  78. package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
  79. package/components/index.d.ts +87 -19
  80. package/components/index.js +32904 -15368
  81. package/hooks/index.d.ts +24 -4
  82. package/hooks/index.js +837 -561
  83. package/hooks/router.d.ts +20 -4
  84. package/index.d.ts +5 -50
  85. package/index.js +223 -406
  86. package/internal/index.d.ts +70 -0
  87. package/internal/index.js +409 -0
  88. package/package.json +9 -2
  89. package/register.d.ts +19 -1
  90. package/routing/index.js +175 -147
  91. package/slots/index.js +20 -1
  92. package/testing/index.d.ts +122 -0
  93. package/testing/index.js +21874 -0
  94. package/types/index.d.ts +4 -0
  95. package/types/index.js +16 -0
  96. package/utils/index.d.ts +28 -25
  97. package/utils/index.js +279 -263
  98. package/_internal/app/components/integrated-brainstorm/activity.d.ts +0 -23
  99. package/_internal/app/components/integrated-brainstorm/collapsed-header.d.ts +0 -14
  100. package/_internal/app/components/integrated-brainstorm/empty-state.d.ts +0 -5
  101. package/_internal/app/components/integrated-brainstorm/index.d.ts +0 -8
  102. package/_internal/app/components/integrated-brainstorm/input-row.d.ts +0 -16
  103. package/_internal/app/components/integrated-brainstorm/message-list.d.ts +0 -8
  104. package/_internal/app/components/integrated-brainstorm/session.d.ts +0 -16
  105. package/_internal/app/components/integrated-brainstorm/sse.d.ts +0 -8
  106. package/_internal/app/components/integrated-brainstorm/thinking-indicator.d.ts +0 -19
  107. package/_internal/app/components/integrated-brainstorm/types.d.ts +0 -63
  108. package/_internal/app/components/integrated-brainstorm/use-auto-grow.d.ts +0 -6
  109. package/_internal/app/components/integrated-brainstorm/use-brainstorm-state.d.ts +0 -21
  110. /package/_internal/{plugins/models → app}/hooks/use-available-models.d.ts +0 -0
@@ -0,0 +1,148 @@
1
+ import type { PluginContext } from '../../core/plugin-types';
2
+ import type { ChatChunk, MessageUsage } from '../../core/adapters/runtime';
3
+ /** The engine needs only messaging + the event bus from a plugin context. */
4
+ export type TurnContext = Pick<PluginContext, 'runtime' | 'events'>;
5
+ export interface TurnAttachment {
6
+ name: string;
7
+ mimeType: string;
8
+ path: string;
9
+ }
10
+ /**
11
+ * The durable transcript row shape (identical to chat's schema-v2 rows —
12
+ * user attachments are path-addressed server-side; display URLs are a
13
+ * client concern).
14
+ */
15
+ export type ConversationTurnRow = {
16
+ kind: 'user';
17
+ ts: string;
18
+ content: string;
19
+ attachments?: TurnAttachment[];
20
+ } | {
21
+ kind: 'assistant';
22
+ ts: string;
23
+ turnId?: string;
24
+ content: string;
25
+ } | {
26
+ kind: 'tool';
27
+ ts: string;
28
+ turnId?: string;
29
+ callId?: string;
30
+ toolName: string;
31
+ status: 'completed' | 'failed';
32
+ summary?: string;
33
+ inputPreview?: string;
34
+ outputPreview?: string;
35
+ durationMs?: number;
36
+ metadata?: Record<string, unknown>;
37
+ } | {
38
+ kind: 'error';
39
+ ts: string;
40
+ turnId?: string;
41
+ message: string;
42
+ errorKind?: string;
43
+ } | {
44
+ kind: 'aborted';
45
+ ts: string;
46
+ turnId?: string;
47
+ };
48
+ export interface TurnOutcome {
49
+ aborted: boolean;
50
+ errored: boolean;
51
+ }
52
+ export type StartTurnResult = 'accepted' | 'not_found' | 'busy';
53
+ export interface InflightTurnInfo {
54
+ key: string;
55
+ agentId: string;
56
+ turnId: string;
57
+ startedAt: number;
58
+ }
59
+ export interface ConversationTurnServiceConfig {
60
+ /** Consumer label for log lines (e.g. 'chat', 'projects.brainstorm'). */
61
+ name: string;
62
+ /** Bus event names — the consumer's wire contract (e.g. chat.chunk/done/error).
63
+ * `started` (optional) fires at turn-accept, BEFORE any runtime chunk —
64
+ * attention providers light the working dot instantly instead of waiting
65
+ * out model latency for the first chunk (#707). */
66
+ events: {
67
+ chunk: string;
68
+ done: string;
69
+ error: string;
70
+ started?: string;
71
+ };
72
+ /** Base payload identifying the thread on every event (e.g. key => ({ chatId: key })). */
73
+ payload: (key: string) => Record<string, unknown>;
74
+ /** Resolve the thread's agent; null → start() returns 'not_found'. */
75
+ resolveThread: (key: string) => {
76
+ agentId: string;
77
+ } | null | Promise<{
78
+ agentId: string;
79
+ } | null>;
80
+ /** Append one durable transcript row. Failures are logged, never thrown into the turn. */
81
+ appendRow: (key: string, row: ConversationTurnRow) => void | Promise<void>;
82
+ /**
83
+ * Runtime session thread id (e.g. key => `chat:${key}`). Called once per
84
+ * turn — per-turn thread schemes (brands' ephemeral randomUUID threads)
85
+ * are legitimate.
86
+ */
87
+ threadId: (key: string, agentId: string) => string;
88
+ /** Per-turn delivery framing appended to the runtime content; never persisted. */
89
+ framing?: string;
90
+ /** Run turns as ephemeral runtime sessions (no provider-side accumulation). */
91
+ ephemeral?: boolean;
92
+ hooks?: {
93
+ /** Read-only tap on EVERY runtime chunk (e.g. messaging proposal parsing). */
94
+ onChunk?: (key: string, chunk: ChatChunk) => void;
95
+ /** Spend attribution, once per turn — success and abort, never error. */
96
+ meter?: (info: {
97
+ key: string;
98
+ agentId: string;
99
+ turnId: string;
100
+ usage?: MessageUsage;
101
+ }) => Promise<void> | void;
102
+ /**
103
+ * Success/abort path only, AFTER final row persistence but BEFORE the
104
+ * done event — finalize derived state (e.g. messaging's proposal
105
+ * linking) so it is durable when clients react to done. Errors are
106
+ * logged, never thrown into the turn.
107
+ */
108
+ onTurnComplete?: (info: {
109
+ key: string;
110
+ aborted: boolean;
111
+ }) => Promise<void> | void;
112
+ /** Runs after the slot releases; waitFor() resolves after it completes. */
113
+ onSettled?: (info: {
114
+ ctx: TurnContext;
115
+ key: string;
116
+ outcome: TurnOutcome;
117
+ }) => Promise<unknown> | unknown;
118
+ };
119
+ }
120
+ export interface StartTurnOptions {
121
+ attachments?: TurnAttachment[];
122
+ /** Per-turn agent override (surfaces with an agent picker); default = resolveThread's. */
123
+ agentId?: string;
124
+ /**
125
+ * Pre-assembled runtime content for THIS turn (embedded surfaces inject
126
+ * doc/context prompts here). The persisted user row always keeps the
127
+ * clean `content`; when omitted, the runtime gets content + framing.
128
+ */
129
+ runtimeContent?: string;
130
+ }
131
+ export interface ConversationTurnService {
132
+ start(ctx: TurnContext, key: string, content: string, opts?: StartTurnOptions): Promise<StartTurnResult>;
133
+ /** Abort the in-flight turn; false when the thread is idle. */
134
+ abort(key: string): boolean;
135
+ isInFlight(key: string): boolean;
136
+ /** Assistant text streamed so far for the in-flight turn (null when idle) —
137
+ * lets GET responses seed mid-turn rehydration without the missing-start gap. */
138
+ inflightPreview(key: string): string | null;
139
+ /**
140
+ * Await the current turn; when called while the turn is in flight this
141
+ * also covers its onSettled tail. Resolves immediately when idle
142
+ * (including during onSettled itself — the slot has already released).
143
+ */
144
+ waitFor(key: string): Promise<void>;
145
+ /** Every in-flight turn — consumers build active-turn resolution on top. */
146
+ listInFlight(): InflightTurnInfo[];
147
+ }
148
+ export declare function createConversationTurnService(config: ConversationTurnServiceConfig): ConversationTurnService;
@@ -0,0 +1 @@
1
+ export { createLogger } from '../../core/logger';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * useFileDrop — the headless drag-drop file intake every upload surface
3
+ * repeats (drag-over state, dragOver/dragLeave/drop handlers, accept
4
+ * filtering). Four components hand-rolled this dance; compose the hook and
5
+ * style your own zone.
6
+ */
7
+ import { type DragEvent } from 'react';
8
+ export interface UseFileDropOptions {
9
+ /** MIME prefix/type filter, e.g. ['image/'] or ['image/', 'application/pdf']. Omit = accept all. */
10
+ accept?: string[];
11
+ multiple?: boolean;
12
+ onFiles: (files: File[]) => void;
13
+ /** Called when a drop contained ONLY rejected files — surface it, never swallow. */
14
+ onRejected?: (files: File[]) => void;
15
+ }
16
+ export interface UseFileDropResult {
17
+ dragOver: boolean;
18
+ /** Spread onto the drop target. */
19
+ dropProps: {
20
+ onDragOver: (e: DragEvent) => void;
21
+ onDragLeave: (e: DragEvent) => void;
22
+ onDrop: (e: DragEvent) => void;
23
+ };
24
+ }
25
+ export declare function useFileDrop({ accept, multiple, onFiles, onRejected }: UseFileDropOptions): UseFileDropResult;
@@ -0,0 +1 @@
1
+ export declare function useHistoryBack(fallbackTo: string): () => void;
@@ -19,3 +19,8 @@ export interface UseJsonFetchResult<T> {
19
19
  * own identity — change `url` or call `refresh()` to re-fetch.
20
20
  */
21
21
  export declare function useJsonFetch<T>(url: string | null, opts?: RequestInit): UseJsonFetchResult<T>;
22
+ /**
23
+ * `useJsonFetch` scoped to a plugin's own API: builds `/api/plugins/<id>/<path>`
24
+ * so components never hand-assemble the prefix. Pass `path = null` to skip.
25
+ */
26
+ export declare function usePluginJsonFetch<T>(pluginId: string, path: string | null, opts?: RequestInit): UseJsonFetchResult<T>;
@@ -4,11 +4,13 @@
4
4
  * - setValue uses router.replace (no history entry) — good for filters, search, view toggles
5
5
  * - pushValue uses router.push (creates history entry) — good for opening drawers/modals
6
6
  * When value equals defaultValue, the param is removed from the URL.
7
+ * Multiple setter calls in the same tick compose into one navigation.
7
8
  */
8
9
  export declare function useQueryState(key: string, defaultValue?: string): [string, (v: string) => void, (v: string) => void];
9
10
  /**
10
11
  * Syncs a string[] to a URL query parameter (comma-separated).
11
12
  * Returns [values, setValues] like useState.
12
13
  * When array is empty, the param is removed from the URL.
14
+ * Composes with other setter calls in the same tick (one navigation).
13
15
  */
14
16
  export declare function useQueryArrayState(key: string): [string[], (v: string[]) => void];
@@ -3,6 +3,8 @@ export interface ScheduleJob {
3
3
  displayName: string;
4
4
  description?: string;
5
5
  agentId?: string;
6
+ /** Team assignment (#189) — mutually exclusive with agentId. */
7
+ teamId?: string;
6
8
  humanSchedule: string;
7
9
  cron?: string;
8
10
  paused: boolean;
@@ -31,6 +33,9 @@ export interface ScheduleJob {
31
33
  lastRun?: string;
32
34
  createdAt?: string;
33
35
  updatedAt?: string;
36
+ /** One-shot ('at') job that has fired: disabled with its consumed instant. */
37
+ completed?: boolean;
38
+ completedAt?: string;
34
39
  }
35
40
  export interface RunEntry {
36
41
  runId: string;
@@ -45,7 +50,9 @@ interface UseScheduleOptions {
45
50
  }
46
51
  export declare function useScheduleJobs(options?: UseScheduleOptions): {
47
52
  jobs: ScheduleJob[];
53
+ allJobs: ScheduleJob[];
48
54
  loading: boolean;
55
+ fetchFailed: boolean;
49
56
  refresh: () => Promise<void>;
50
57
  pauseJob: (jobId: string, pauseUntil?: string) => Promise<boolean>;
51
58
  resumeJob: (jobId: string) => Promise<boolean>;
@@ -57,6 +64,44 @@ export declare function useScheduleJobs(options?: UseScheduleOptions): {
57
64
  skipNext: (jobId: string, n?: number) => Promise<boolean>;
58
65
  duplicateJob: (jobId: string, overrides?: Record<string, unknown>) => Promise<boolean>;
59
66
  };
67
+ /** A plugin-contributed dated event rendered alongside job occurrences (#191). */
68
+ export interface ScheduledDomainEvent {
69
+ id: string;
70
+ pluginId: string;
71
+ title: string;
72
+ startsAt?: string;
73
+ endsAt?: string;
74
+ dueAt?: string;
75
+ kind: string;
76
+ status?: string;
77
+ url?: string;
78
+ reschedulable?: boolean;
79
+ metadata?: Record<string, unknown>;
80
+ }
81
+ /** One server-computed calendar placement — see plugins/schedule/lib/occurrences.ts. */
82
+ export interface ScheduleOccurrence {
83
+ jobId: string;
84
+ /** Absolute instant, ISO-8601 UTC — render in the browser's local tz. */
85
+ at: string;
86
+ past: boolean;
87
+ /** Ledger disposition for past Bakin occurrences (absent = never claimed). */
88
+ disposition?: 'pending' | 'created' | 'skipped' | 'seeded';
89
+ taskId?: string;
90
+ skipReason?: string;
91
+ }
92
+ /**
93
+ * Server-computed occurrences for a time range — the ONLY placement source
94
+ * for the calendar views (kind-aware, timezone/DST-correct; the old client-
95
+ * side cron parsing is gone). Refetches on schedule SSE events.
96
+ */
97
+ export declare function useOccurrences(fromIso: string, toIso: string): {
98
+ occurrences: ScheduleOccurrence[];
99
+ events: ScheduledDomainEvent[];
100
+ unevaluated: string[];
101
+ droppedProviders: string[];
102
+ loading: boolean;
103
+ refresh: () => Promise<void>;
104
+ };
60
105
  export declare function useRunHistory(jobId: string | null, limit?: number): {
61
106
  runs: RunEntry[];
62
107
  loading: boolean;
@@ -4,7 +4,7 @@ export interface SearchResult {
4
4
  score: number;
5
5
  fields: Record<string, unknown>;
6
6
  _table?: string;
7
- /** Per-index score breakdown (e.g. { search: 0.8, embeddings: 0.6 }) */
7
+ /** Per-leg score breakdown keyed by neutral leg names (e.g. { full_text: 0.8, assets_visual: -0.2 }) */
8
8
  indexScores?: Record<string, number>;
9
9
  }
10
10
  export interface SearchResponse {
@@ -17,25 +17,39 @@ export interface SearchResponse {
17
17
  query: string;
18
18
  total: number;
19
19
  took_ms: number;
20
- source: 'search' | 'fallback';
20
+ source: 'search' | 'unavailable';
21
+ /** True when any source degraded/was omitted under the query budget. */
22
+ partial?: boolean;
23
+ tables?: Array<{
24
+ table: string;
25
+ hits: number;
26
+ took_ms: number;
27
+ budget?: 'degraded' | 'omitted';
28
+ }>;
21
29
  };
22
30
  }
31
+ /**
32
+ * Honest search lifecycle (spec D11). `unavailable` is the explicit
33
+ * engine-down signal (HTTP 503 `search_unavailable`) — render
34
+ * `<SearchUnavailable/>`, never a silent lower-quality substitute.
35
+ */
36
+ export type SearchStatus = 'idle' | 'loading' | 'ok' | 'unavailable' | 'error';
23
37
  export interface UseSearchOptions {
24
38
  /**
25
39
  * Plugin id to route the query to. When set, the hook fetches
26
40
  * `/api/plugins/{plugin}/search?q=...` — the plugin owns its table
27
41
  * name and the client never sees the raw `bakin_` prefix. Omit for
28
- * cross-plugin search, which falls back to `/api/search?q=...`.
42
+ * cross-plugin search via `/api/search?q=...`.
29
43
  */
30
44
  plugin?: string;
31
45
  /** Max results */
32
46
  limit?: number;
33
47
  /** Facet fields to include aggregation counts for */
34
48
  facets?: string[];
49
+ /** Restrict cross-plugin search to these content types (tables). */
50
+ types?: string[];
35
51
  /** Debounce delay in ms (default: 250) */
36
52
  debounce?: number;
37
- /** Fallback filter function when search returns no results or errors */
38
- fallback?: (query: string) => SearchResult[];
39
53
  }
40
54
  export interface UseSearchReturn {
41
55
  results: SearchResult[];
@@ -43,11 +57,15 @@ export interface UseSearchReturn {
43
57
  value: string;
44
58
  count: number;
45
59
  }>>;
60
+ status: SearchStatus;
61
+ /** True while a request is in flight or debounce-pending (=== status 'loading'). */
46
62
  loading: boolean;
47
63
  error: string | null;
48
64
  meta: SearchResponse['meta'] | null;
49
65
  search: (query: string) => void;
50
66
  clear: () => void;
67
+ /** Re-run the last query immediately (Retry in the unavailable state). */
68
+ retry: () => void;
51
69
  }
52
70
  /**
53
71
  * Given a client-side filtered list and search results, reorder the list
@@ -58,8 +76,9 @@ export declare function reorderBySearchResults<T extends {
58
76
  id: string;
59
77
  }>(items: T[], searchResults: SearchResult[]): T[];
60
78
  /**
61
- * React hook for Bakin search with debouncing, AbortController, and an
62
- * optional client-side fallback. Scopes to a plugin via `plugin:` or
63
- * runs cross-plugin when omitted.
79
+ * React hook for Bakin search with debouncing and AbortController.
80
+ * Scopes to a plugin via `plugin:` or runs cross-plugin when omitted.
81
+ * There is deliberately NO client-side fallback: engine-down is an
82
+ * explicit `unavailable` status the UI must surface (spec D11).
64
83
  */
65
84
  export declare function useSearch(options?: UseSearchOptions): UseSearchReturn;
@@ -7,10 +7,10 @@ export interface Toast {
7
7
  }
8
8
  interface ToastStore {
9
9
  toasts: Toast[];
10
- add: (toast: Omit<Toast, 'id'>) => void;
10
+ add: (toast: Omit<Toast, 'id'>) => string;
11
11
  dismiss: (id: string) => void;
12
12
  }
13
13
  export declare const useToastStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ToastStore>>;
14
- /** Convenience: call from anywhere without hooks */
15
- export declare function toast(message: ReactNode, type?: Toast['type'], duration?: number): void;
14
+ /** Convenience: call from anywhere without hooks. Returns the toast id for programmatic dismiss. */
15
+ export declare function toast(message: ReactNode, type?: Toast['type'], duration?: number): string;
16
16
  export {};
@@ -1,5 +1,16 @@
1
+ /**
2
+ * Navigate bridge — the host registers its router here at boot so
3
+ * notification clicks route client-side instead of full-reloading the shell.
4
+ * globalThis-based (like __bakinBroadcast) because every plugin bundle
5
+ * inlines its own copy of this module; a module-level variable would never
6
+ * reach those copies.
7
+ */
8
+ type NavigateFn = (url: string) => void;
9
+ export declare function setNotificationNavigator(navigate: NavigateFn): void;
10
+ export declare function navigateToUrl(url: string): void;
1
11
  export declare function isNotificationsSupported(): boolean;
2
12
  export declare function isNotificationsEnabled(): boolean;
3
13
  export declare function requestNotificationPermission(): Promise<boolean>;
4
14
  export declare function toggleNotifications(enabled: boolean): void;
5
- export declare function sendBrowserNotification(title: string, body: string): void;
15
+ export declare function sendBrowserNotification(title: string, body: string, url?: string): void;
16
+ export {};