@makinbakin/sdk 0.0.1-rc.4 → 0.0.1-rc.40
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 +248 -3
- package/_internal/app/components/agent-avatar.d.ts +2 -1
- package/_internal/app/components/conversation/attention.d.ts +56 -0
- package/_internal/app/components/conversation/fold.d.ts +3 -0
- package/_internal/app/components/conversation/notification-sound.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/turn-recorder.d.ts +37 -0
- package/_internal/app/components/conversation/use-conversation-attention.d.ts +61 -0
- package/_internal/app/components/drawer.d.ts +27 -0
- package/_internal/app/components/ui/button.d.ts +2 -8
- package/_internal/app/components/ui/dialog.d.ts +2 -17
- package/_internal/app/components/ui/sheet.d.ts +2 -14
- package/_internal/app/core/conversation-turns.d.ts +229 -0
- package/_internal/app/core/logger.d.ts +1 -0
- package/_internal/app/core/tool-access.d.ts +42 -0
- package/_internal/app/hooks/use-available-models.d.ts +25 -0
- package/_internal/app/hooks/use-content-store.d.ts +0 -9
- package/_internal/app/hooks/use-history-back.d.ts +5 -0
- package/_internal/app/hooks/use-horizontal-resize.d.ts +21 -0
- package/_internal/app/hooks/use-json-fetch.d.ts +36 -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 +3 -12
- package/_internal/app/hooks/use-resizable-pane.d.ts +35 -0
- package/_internal/app/hooks/use-runtime-status.d.ts +22 -6
- 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 +13 -3
- package/_internal/app/lib/browser-notify.d.ts +12 -1
- package/_internal/app/types/index.d.ts +1 -105
- package/_internal/core/adapters/runtime/channels.d.ts +231 -0
- package/_internal/core/adapters/runtime/concepts.d.ts +794 -235
- package/_internal/core/adapters/runtime/errors.d.ts +105 -0
- package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
- package/_internal/core/adapters/runtime/index.d.ts +8 -2
- package/_internal/core/adapters/runtime/skill-files.d.ts +12 -0
- package/_internal/core/adapters/runtime/testing.d.ts +99 -0
- package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
- package/_internal/core/adapters/shared.d.ts +133 -12
- package/_internal/core/content-dir.d.ts +11 -0
- package/_internal/core/delivery/bridge.d.ts +36 -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 +25 -1
- package/_internal/core/health/observation-builders.d.ts +42 -0
- package/_internal/core/media/downscale.d.ts +18 -0
- package/_internal/core/media/pin-data.d.ts +36 -0
- package/_internal/core/media/pin.d.ts +22 -0
- package/_internal/core/media/sharp-import.d.ts +10 -0
- package/_internal/core/media/sharp-loader.d.ts +41 -0
- package/_internal/core/media/store.d.ts +21 -0
- package/_internal/core/plugin-types.d.ts +248 -500
- package/_internal/core/routing/define.d.ts +33 -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/host/ui/action-status.d.ts +13 -0
- package/_internal/host/ui/modals.d.ts +5 -0
- package/_internal/host/ui/resize.d.ts +2 -0
- package/_internal/plugins/team/types.d.ts +61 -4
- package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
- package/_internal/ui/behaviors/clipboard.d.ts +10 -0
- package/_internal/ui/behaviors/resize-handle.d.ts +15 -0
- package/_internal/ui/behaviors/selection-navigation.d.ts +5 -0
- package/_internal/ui/behaviors/use-persisted-leading-edge-resize.d.ts +31 -0
- package/_internal/ui/charts/area-chart.d.ts +27 -0
- package/_internal/ui/charts/axis.d.ts +13 -0
- package/_internal/ui/charts/bar-chart.d.ts +21 -0
- package/_internal/ui/charts/chart-data-table.d.ts +61 -0
- package/_internal/ui/charts/chart-explainer.d.ts +4 -0
- package/_internal/ui/charts/chart-tooltip.d.ts +8 -0
- package/_internal/ui/charts/composition-bar.d.ts +46 -0
- package/_internal/ui/charts/index.d.ts +24 -0
- package/_internal/ui/charts/line-chart.d.ts +26 -0
- package/_internal/ui/charts/monotone-curve.d.ts +23 -0
- package/_internal/ui/charts/palette.d.ts +32 -0
- package/_internal/ui/charts/pie-chart.d.ts +80 -0
- package/_internal/ui/charts/ranked-bar-chart.d.ts +41 -0
- package/_internal/ui/charts/sparkline.d.ts +16 -0
- package/_internal/ui/charts/stacked-column-chart.d.ts +33 -0
- package/_internal/ui/content/code-block.d.ts +43 -0
- package/_internal/ui/content/index.d.ts +2 -0
- package/_internal/ui/conversation/activity-group.d.ts +27 -0
- package/_internal/ui/conversation/agent-turn.d.ts +47 -0
- package/_internal/ui/conversation/composer.d.ts +62 -0
- package/_internal/ui/conversation/context-meter.d.ts +37 -0
- package/_internal/ui/conversation/conversation-empty-state.d.ts +13 -0
- package/_internal/ui/conversation/conversation-header.d.ts +26 -0
- package/_internal/ui/conversation/conversation-panel.d.ts +61 -0
- package/_internal/ui/conversation/conversation.d.ts +37 -0
- package/_internal/ui/conversation/fold.d.ts +150 -0
- package/_internal/ui/conversation/glyphs.d.ts +30 -0
- package/_internal/ui/conversation/index.d.ts +31 -0
- package/_internal/ui/conversation/queued-message-list.d.ts +22 -0
- package/_internal/ui/conversation/relative-time.d.ts +8 -0
- package/_internal/ui/conversation/tool-call-drawer.d.ts +14 -0
- package/_internal/ui/conversation/turn-controls.d.ts +9 -0
- package/_internal/ui/conversation/turn-output.d.ts +42 -0
- package/_internal/ui/conversation/turn-usage.d.ts +16 -0
- package/_internal/ui/conversation/user-message.d.ts +13 -0
- package/_internal/ui/forms/field.d.ts +30 -0
- package/_internal/ui/forms/fieldset.d.ts +10 -0
- package/_internal/ui/forms/form.d.ts +19 -0
- package/_internal/ui/forms/index.d.ts +6 -0
- package/_internal/ui/index.d.ts +89 -0
- package/_internal/ui/layout/bounded-overflow.d.ts +42 -0
- package/_internal/ui/layout/disclosure-panel.d.ts +24 -0
- package/_internal/ui/layout/flow.d.ts +27 -0
- package/_internal/ui/layout/grid.d.ts +16 -0
- package/_internal/ui/layout/index.d.ts +14 -0
- package/_internal/ui/layout/page-shell.d.ts +11 -0
- package/_internal/ui/layout/panel.d.ts +28 -0
- package/_internal/ui/layout/section.d.ts +15 -0
- package/_internal/ui/layout/sticky-overflow-scrollbar.d.ts +11 -0
- package/_internal/ui/layout/utils.d.ts +1 -0
- package/_internal/ui/patterns/agent-filter.d.ts +21 -0
- package/_internal/ui/patterns/calendar-grid.d.ts +80 -0
- package/_internal/ui/patterns/calendar-item.d.ts +42 -0
- package/_internal/ui/patterns/calendar-nav.d.ts +21 -0
- package/_internal/ui/patterns/confirm-dialog.d.ts +29 -0
- package/_internal/ui/patterns/copy-button.d.ts +15 -0
- package/_internal/ui/patterns/danger-zone.d.ts +17 -0
- package/_internal/ui/patterns/data-table.d.ts +157 -0
- package/_internal/ui/patterns/drawer-section.d.ts +11 -0
- package/_internal/ui/patterns/facet-filter.d.ts +22 -0
- package/_internal/ui/patterns/filter-indicator.d.ts +3 -0
- package/_internal/ui/patterns/guide-card.d.ts +33 -0
- package/_internal/ui/patterns/index.d.ts +75 -0
- package/_internal/ui/patterns/inspector-panel.d.ts +39 -0
- package/_internal/ui/patterns/kanban.d.ts +70 -0
- package/_internal/ui/patterns/key-value.d.ts +35 -0
- package/_internal/ui/patterns/list-rows.d.ts +111 -0
- package/_internal/ui/patterns/nav-list.d.ts +41 -0
- package/_internal/ui/patterns/node-card.d.ts +37 -0
- package/_internal/ui/patterns/page-aside.d.ts +49 -0
- package/_internal/ui/patterns/page-body.d.ts +49 -0
- package/_internal/ui/patterns/page-canvas.d.ts +12 -0
- package/_internal/ui/patterns/page-composer.d.ts +8 -0
- package/_internal/ui/patterns/page-controls.d.ts +33 -0
- package/_internal/ui/patterns/page-header.d.ts +40 -0
- package/_internal/ui/patterns/page-timeline.d.ts +18 -0
- package/_internal/ui/patterns/page.d.ts +32 -0
- package/_internal/ui/patterns/pagination.d.ts +23 -0
- package/_internal/ui/patterns/save-bar.d.ts +21 -0
- package/_internal/ui/patterns/search-input.d.ts +20 -0
- package/_internal/ui/patterns/segmented-control.d.ts +22 -0
- package/_internal/ui/patterns/sortable-head.d.ts +13 -0
- package/_internal/ui/patterns/stat-group.d.ts +8 -0
- package/_internal/ui/patterns/stat-tile.d.ts +25 -0
- package/_internal/ui/patterns/status-badge.d.ts +15 -0
- package/_internal/ui/patterns/status-marker.d.ts +10 -0
- package/_internal/ui/patterns/timeline.d.ts +59 -0
- package/_internal/ui/patterns/unsaved-changes-dialog.d.ts +22 -0
- package/_internal/ui/patterns/workspace-page.d.ts +76 -0
- package/_internal/ui/primitives/alert.d.ts +17 -0
- package/_internal/ui/primitives/avatar.d.ts +13 -0
- package/_internal/ui/primitives/badge.d.ts +27 -0
- package/_internal/ui/primitives/button.d.ts +32 -0
- package/_internal/ui/primitives/card.d.ts +55 -0
- package/_internal/ui/primitives/checkbox.d.ts +3 -0
- package/_internal/ui/primitives/collapsible.d.ts +7 -0
- package/_internal/ui/primitives/color-input.d.ts +21 -0
- package/_internal/ui/primitives/combobox.d.ts +40 -0
- package/_internal/ui/primitives/command.d.ts +36 -0
- package/_internal/ui/primitives/control-styles.d.ts +10 -0
- package/_internal/ui/primitives/dialog.d.ts +31 -0
- package/_internal/ui/primitives/dropdown-menu.d.ts +54 -0
- package/_internal/ui/primitives/file-input.d.ts +33 -0
- package/_internal/ui/primitives/input-group.d.ts +30 -0
- package/_internal/ui/primitives/input.d.ts +10 -0
- package/_internal/ui/primitives/interactive-surface.d.ts +24 -0
- package/_internal/ui/primitives/label.d.ts +3 -0
- package/_internal/ui/primitives/modal-context.d.ts +9 -0
- package/_internal/ui/primitives/option-list.d.ts +10 -0
- package/_internal/ui/primitives/popover.d.ts +18 -0
- package/_internal/ui/primitives/portal-ownership.d.ts +11 -0
- package/_internal/ui/primitives/progress.d.ts +38 -0
- package/_internal/ui/primitives/radio-group.d.ts +12 -0
- package/_internal/ui/primitives/select.d.ts +35 -0
- package/_internal/ui/primitives/separator.d.ts +7 -0
- package/_internal/ui/primitives/sheet.d.ts +34 -0
- package/_internal/ui/primitives/shimmer-text.d.ts +13 -0
- package/_internal/ui/primitives/skeleton.d.ts +6 -0
- package/_internal/ui/primitives/spinner.d.ts +31 -0
- package/_internal/ui/primitives/switch.d.ts +6 -0
- package/_internal/{app/components/ui → ui/primitives}/tabs.d.ts +1 -1
- package/_internal/ui/primitives/text.d.ts +43 -0
- package/_internal/ui/primitives/textarea.d.ts +19 -0
- package/_internal/ui/primitives/tooltip.d.ts +14 -0
- package/_internal/ui/primitives/use-textarea-autosize.d.ts +3 -0
- package/_internal/ui/private-ui-boundary-probe.d.ts +9 -0
- package/_internal/ui/states/banner.d.ts +15 -0
- package/_internal/ui/states/index.d.ts +6 -0
- package/_internal/ui/states/system-state.d.ts +88 -0
- package/_internal/ui/states/toast.d.ts +26 -0
- package/_internal/ui/utils.d.ts +14 -0
- package/bin/bakin-plugin-test-ui.js +6854 -0
- package/charts/index.d.ts +3 -0
- package/charts/index.js +2 -0
- package/content/index.d.ts +14 -0
- package/content/index.js +38 -0
- package/content/markdown-comparison.d.ts +12 -0
- package/content/markdown-content.d.ts +18 -0
- package/content/markdown-document.d.ts +4 -0
- package/content/markdown-editor.d.ts +35 -0
- package/conversation/index.d.ts +50 -0
- package/conversation/index.js +4 -0
- package/conversation/use-conversation-thread.d.ts +73 -0
- package/hooks/index.d.ts +86 -11
- package/hooks/index.js +1 -1747
- package/hooks/router.d.ts +4 -36
- package/index.d.ts +30 -6
- package/index.js +10 -14210
- package/internal/index.d.ts +74 -0
- package/internal/index.js +2 -0
- package/internal/lazy.d.ts +58 -0
- package/internal/plugin-ownership.d.ts +18 -0
- package/internal/private-ui-boundary-probe.d.ts +2 -0
- package/layout/index.d.ts +9 -0
- package/layout/index.js +2 -0
- package/metadata/index.d.ts +14 -1
- package/metadata/index.js +1 -30
- package/navigation/history-back.d.ts +5 -0
- package/navigation/index.d.ts +23 -0
- package/navigation/index.js +2 -0
- package/navigation/plugin-link.d.ts +11 -0
- package/navigation/query-state.d.ts +7 -0
- package/navigation/router.d.ts +35 -0
- package/navigation/search-params.d.ts +7 -0
- package/navigation/unsaved-changes-guard.d.ts +35 -0
- package/package.json +63 -10
- package/patterns/agent-patterns.d.ts +81 -0
- package/patterns/asset-library-picker.d.ts +38 -0
- package/patterns/channel-patterns.d.ts +32 -0
- package/patterns/index.d.ts +40 -0
- package/patterns/index.js +47 -0
- package/patterns/picker-patterns.d.ts +108 -0
- package/patterns/plugin-settings-renderer.d.ts +41 -0
- package/patterns/presentation-color.d.ts +2 -0
- package/patterns/search-patterns.d.ts +51 -0
- package/register.d.ts +63 -9
- package/routing/index.d.ts +6 -1
- package/routing/index.js +10 -14014
- package/slots/index.d.ts +12 -24
- package/slots/index.js +1 -91
- package/slots/registry.d.ts +45 -0
- package/styles.css +2 -0
- package/testing/index.d.ts +122 -0
- package/testing/index.js +93 -0
- package/testing/ui/conformance/cli.d.ts +2 -0
- package/testing/ui/conformance/contracts.d.ts +73 -0
- package/testing/ui/conformance/index.d.ts +11 -0
- package/testing/ui/conformance/index.js +85 -0
- package/testing/ui/conformance/plugin-css.d.ts +37 -0
- package/testing/ui/conformance/plugin-id.d.ts +6 -0
- package/testing/ui/conformance/runner.d.ts +13 -0
- package/testing/ui/index.d.ts +24 -0
- package/testing/ui/index.js +2 -0
- package/testing/ui/plugin-ui-fixture-host.d.ts +36 -0
- package/testing/ui/runtime.d.ts +70 -0
- package/types/api-route.d.ts +89 -0
- package/types/context.d.ts +166 -0
- package/types/conversation-turns.d.ts +229 -0
- package/types/events.d.ts +10 -0
- package/types/health.d.ts +376 -0
- package/types/index.d.ts +19 -919
- package/types/index.js +1 -0
- package/types/manifest.d.ts +255 -0
- package/types/primitives.d.ts +33 -0
- package/types/registration.d.ts +281 -0
- package/types/runtime.d.ts +292 -0
- package/types/scheduled-events.d.ts +80 -0
- package/types/services.d.ts +599 -0
- package/ui/index.d.ts +73 -31
- package/ui/index.js +38 -28704
- package/utils/asset-id.d.ts +15 -0
- package/utils/index.d.ts +27 -7
- package/utils/index.js +4 -2098
- package/utils/plugin-fetch.d.ts +44 -0
- package/_internal/app/components/agent-filter.d.ts +0 -8
- package/_internal/app/components/agent-select.d.ts +0 -15
- package/_internal/app/components/agent-status.d.ts +0 -8
- package/_internal/app/components/bakin-drawer.d.ts +0 -23
- package/_internal/app/components/color-picker.d.ts +0 -7
- package/_internal/app/components/empty-state.d.ts +0 -10
- package/_internal/app/components/error-banner.d.ts +0 -6
- package/_internal/app/components/error-state.d.ts +0 -8
- package/_internal/app/components/facet-filter.d.ts +0 -17
- 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/components/markdown-content.d.ts +0 -3
- package/_internal/app/components/markdown-editor.d.ts +0 -11
- package/_internal/app/components/model-select.d.ts +0 -9
- package/_internal/app/components/page-layout.d.ts +0 -9
- package/_internal/app/components/plugin-header.d.ts +0 -16
- package/_internal/app/components/plugin-settings-renderer.d.ts +0 -9
- package/_internal/app/components/sortable-head.d.ts +0 -13
- package/_internal/app/components/ui/alert.d.ts +0 -10
- package/_internal/app/components/ui/avatar.d.ts +0 -11
- package/_internal/app/components/ui/badge.d.ts +0 -7
- package/_internal/app/components/ui/card.d.ts +0 -11
- package/_internal/app/components/ui/checkbox.d.ts +0 -3
- package/_internal/app/components/ui/collapsible.d.ts +0 -5
- package/_internal/app/components/ui/command.d.ts +0 -19
- package/_internal/app/components/ui/dropdown-menu.d.ts +0 -29
- package/_internal/app/components/ui/form.d.ts +0 -23
- package/_internal/app/components/ui/input-group.d.ts +0 -18
- package/_internal/app/components/ui/input.d.ts +0 -3
- package/_internal/app/components/ui/label.d.ts +0 -3
- package/_internal/app/components/ui/popover.d.ts +0 -9
- package/_internal/app/components/ui/progress.d.ts +0 -7
- package/_internal/app/components/ui/select.d.ts +0 -15
- package/_internal/app/components/ui/separator.d.ts +0 -3
- package/_internal/app/components/ui/skeleton.d.ts +0 -2
- package/_internal/app/components/ui/switch.d.ts +0 -5
- package/_internal/app/components/ui/textarea.d.ts +0 -3
- package/_internal/app/components/ui/tooltip.d.ts +0 -6
- package/_internal/app/components/underline-tabs.d.ts +0 -15
- package/_internal/app/hooks/use-assets.d.ts +0 -25
- package/_internal/app/hooks/use-form-guard.d.ts +0 -5
- package/_internal/app/hooks/use-vertical-resize.d.ts +0 -22
- package/_internal/app/lib/utils.d.ts +0 -2
- package/_internal/plugins/workflows/hooks/channel-icon.d.ts +0 -6
- package/components/index.d.ts +0 -34
- package/components/index.js +0 -40175
- /package/_internal/{app/components/ui → ui/primitives}/table.d.ts +0 -0
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* from the schemas in the route literal.
|
|
9
9
|
*/
|
|
10
10
|
import type { APIRoute, CoreContext, PluginContextLite } from './types';
|
|
11
|
+
import type { ContentFile, NavItem, PluginSettingsSchema } from '../plugin-types';
|
|
11
12
|
/**
|
|
12
13
|
* Declare a plugin route. Handler `ctx` is bound to `PluginContextLite`. The
|
|
13
14
|
* three generics (P/Q/B) are inferred from `params`, `query`, and `body`
|
|
@@ -19,16 +20,45 @@ export declare function defineRoute<P = undefined, Q = undefined, B = undefined>
|
|
|
19
20
|
* Declare a core (host) route. Handler `ctx` is bound to `CoreContext`.
|
|
20
21
|
*/
|
|
21
22
|
export declare function defineCoreRoute<P = undefined, Q = undefined, B = undefined>(route: APIRoute<CoreContext, P, Q, B>): APIRoute<CoreContext, P, Q, B>;
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The exact shape a plugin definition may carry — the full `BakinPlugin`
|
|
25
|
+
* lifecycle surface plus declarative `routes`. Deliberately CLOSED (no index
|
|
26
|
+
* signature): a typo'd key (`settingSchema`, `onReadey`, …) fails typecheck
|
|
27
|
+
* at the `definePlugin` call site instead of silently doing nothing at
|
|
28
|
+
* runtime (audit 2026-07 H3).
|
|
29
|
+
*/
|
|
23
30
|
export interface DefinePluginInput {
|
|
24
31
|
id: string;
|
|
25
32
|
name: string;
|
|
26
33
|
version: string;
|
|
27
34
|
routes?: ReadonlyArray<APIRoute<PluginContextLite, any, any, any>>;
|
|
28
|
-
|
|
35
|
+
activate(ctx: any): void | Promise<void>;
|
|
36
|
+
onReady?(): void | Promise<void>;
|
|
37
|
+
onShutdown?(): void | Promise<void>;
|
|
38
|
+
onSettingsChange?(settings: Record<string, unknown>): void | Promise<void>;
|
|
39
|
+
validateSettings?(value: unknown): {
|
|
40
|
+
ok: true;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
error: string;
|
|
44
|
+
};
|
|
45
|
+
onUninstall?(ctx: any): void | Promise<void>;
|
|
46
|
+
beforeUninstall?(ctx: any): void | Promise<void>;
|
|
47
|
+
settingsSchema?: PluginSettingsSchema;
|
|
48
|
+
navItems?: NavItem[];
|
|
49
|
+
contentFiles?: ContentFile[];
|
|
29
50
|
}
|
|
30
51
|
/**
|
|
31
52
|
* Declare a plugin. Returns the input unchanged. Use this instead of a bare
|
|
32
53
|
* `BakinPlugin` annotation so `routes` keeps per-element inference.
|
|
54
|
+
*
|
|
55
|
+
* The `& { [K in Exclude<...>]: never }` intersection is the exactness
|
|
56
|
+
* enforcement: `T extends DefinePluginInput` alone would structurally admit
|
|
57
|
+
* excess keys, so a typo'd `settingSchema` would compile and silently do
|
|
58
|
+
* nothing. With the intersection, any key outside `DefinePluginInput` must
|
|
59
|
+
* be `never` — which no real value satisfies — so typos fail at the call
|
|
60
|
+
* site (audit 2026-07 H3).
|
|
33
61
|
*/
|
|
34
|
-
export declare function definePlugin<const T extends DefinePluginInput>(plugin: T
|
|
62
|
+
export declare function definePlugin<const T extends DefinePluginInput>(plugin: T & {
|
|
63
|
+
[K in Exclude<keyof T, keyof DefinePluginInput>]: never;
|
|
64
|
+
}): T;
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
* - In dev / test, validate the response body against `responses[status]`
|
|
12
12
|
* and surface mismatches (test → throw, dev → console.warn).
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* and legacy `APIRoute
|
|
16
|
-
* routes
|
|
17
|
-
*
|
|
14
|
+
* There is no legacy `input`/`output` adapter mapping here: `ctx.registerRoute`
|
|
15
|
+
* and the legacy `APIRoute` shape were deleted (T19) — declarative routes and
|
|
16
|
+
* core routes are the only producers, and both speak `body`/`responses`.
|
|
17
|
+
* (The OpenAPI builder keeps a read-side mapping for historical doc callers;
|
|
18
|
+
* see packages/core/src/openapi/operation.ts.)
|
|
18
19
|
*/
|
|
19
20
|
import { z } from 'zod';
|
|
20
21
|
import type { BodySpec, ResponseSpec } from './types';
|
|
@@ -32,8 +33,6 @@ export interface DispatchableRoute {
|
|
|
32
33
|
body?: BodySpec<unknown>;
|
|
33
34
|
responses?: Partial<Record<string | number, ResponseSpec>>;
|
|
34
35
|
handler: (req: Request, ctx: any, parsed?: any) => Response | Promise<Response>;
|
|
35
|
-
input?: z.ZodType<unknown>;
|
|
36
|
-
output?: z.ZodType<unknown>;
|
|
37
36
|
}
|
|
38
37
|
export interface DispatchInput {
|
|
39
38
|
req: Request;
|
|
@@ -42,3 +41,13 @@ export interface DispatchInput {
|
|
|
42
41
|
params: Record<string, string>;
|
|
43
42
|
}
|
|
44
43
|
export declare function dispatchRoute(input: DispatchInput): Promise<Response>;
|
|
44
|
+
/**
|
|
45
|
+
* Loudly reject malformed `body` specs. A typo'd contentType (`'json'`)
|
|
46
|
+
* previously fell through parseBodySpec as a silent pass-through with an
|
|
47
|
+
* undefined parsed body — the handler then read `parsed.body.title` off
|
|
48
|
+
* undefined at request time with no hint why. Definition/registration time
|
|
49
|
+
* is the right place to fail: defineRoute/defineCoreRoute call this at
|
|
50
|
+
* module eval, and the plugin registry calls it for bare-literal routes at
|
|
51
|
+
* activation. `label` names the route in the error (e.g. `POST /items`).
|
|
52
|
+
*/
|
|
53
|
+
export declare function assertValidBodySpec(body: unknown, label: string): void;
|
|
@@ -10,6 +10,6 @@ export type { DefinePluginInput } from './define';
|
|
|
10
10
|
export { RouteRegistry } from './registry';
|
|
11
11
|
export type { RouteScope, RegisteredRoute, RouteMatch } from './registry';
|
|
12
12
|
export { operationIdFor } from './operation-id';
|
|
13
|
-
export { dispatchRoute } from './dispatcher';
|
|
13
|
+
export { assertValidBodySpec, dispatchRoute } from './dispatcher';
|
|
14
14
|
export type { DispatchInput } from './dispatcher';
|
|
15
15
|
export { searchRoute } from './search-route';
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Routing primitives — typed route contracts that drive runtime dispatch and
|
|
3
3
|
* OpenAPI emission from a single source.
|
|
4
4
|
*
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
5
|
+
* The pure, context-free declarations (the generic `APIRoute`, body/response
|
|
6
|
+
* specs, `ParsedInput`) are DECLARED in `@makinbakin/sdk/types` (api-route.ts
|
|
7
|
+
* — a leaf module) and re-exported here bound to the core-tier
|
|
8
|
+
* `RouteContext`. That direction keeps the package DAG acyclic: core imports
|
|
9
|
+
* SDK types (as `plugin-types.ts` always has); the SDK never imports core
|
|
10
|
+
* from its types layer. Only the tier-specific route CONTEXTS live here.
|
|
9
11
|
*/
|
|
10
|
-
import type {
|
|
11
|
-
import type { ContractStability, ContractVisibility, DocsExample, SourceLocation } from '../docs';
|
|
12
|
+
import type { APIRoute as SdkAPIRoute } from '@makinbakin/sdk/types';
|
|
12
13
|
import type { AgentRuntimeAdapter } from '../adapters/runtime';
|
|
13
14
|
import type { StorageAdapter, EventBus, SearchAPI, ActivityAPI, HookAPI, AssetsAPI, PluginTaskService } from '../plugin-types';
|
|
14
|
-
export type HttpMethod
|
|
15
|
-
export type HttpStatus = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 409 | 410 | 415 | 422 | 429 | 500 | 502 | 503 | 504;
|
|
15
|
+
export type { HttpMethod, HttpStatus, JsonBodySpec, MultipartBodySpec, RawBodySpec, NoBodySpec, BodySpec, JsonResponseSpec, NoContentResponseSpec, NonJsonResponseSpec, ResponseSpec, ParsedInput, } from '@makinbakin/sdk/types';
|
|
16
16
|
/**
|
|
17
17
|
* Common surface every route handler can rely on, regardless of origin.
|
|
18
18
|
* `PluginContext` and `CoreContext` extend this with their own additions.
|
|
@@ -46,69 +46,13 @@ export interface PluginContextLite extends RouteContext {
|
|
|
46
46
|
* `packages/host/src/core-routes/`.
|
|
47
47
|
*/
|
|
48
48
|
export type CoreContext = RouteContext;
|
|
49
|
-
export interface JsonBodySpec<B = unknown> {
|
|
50
|
-
contentType: 'application/json';
|
|
51
|
-
schema: z.ZodType<B>;
|
|
52
|
-
}
|
|
53
|
-
export interface MultipartBodySpec<B = unknown> {
|
|
54
|
-
contentType: 'multipart/form-data';
|
|
55
|
-
schema?: z.ZodType<B>;
|
|
56
|
-
}
|
|
57
|
-
export interface RawBodySpec<B = unknown> {
|
|
58
|
-
contentType: '*/*';
|
|
59
|
-
schema?: z.ZodType<B>;
|
|
60
|
-
}
|
|
61
|
-
export interface NoBodySpec {
|
|
62
|
-
contentType: 'none';
|
|
63
|
-
}
|
|
64
49
|
/**
|
|
65
|
-
* `
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* - none → dispatcher rejects non-empty bodies with 415.
|
|
70
|
-
*
|
|
71
|
-
* Omit the field entirely on routes that don't consume a body.
|
|
50
|
+
* Same declaration as `@makinbakin/sdk/types`' `APIRoute`, with the core-tier
|
|
51
|
+
* `RouteContext` as the default context. An alias (not a copy): the two are
|
|
52
|
+
* mutually assignable by construction — pinned in
|
|
53
|
+
* tests/core/plugin-type-contract.test.ts.
|
|
72
54
|
*/
|
|
73
|
-
export type
|
|
74
|
-
export interface JsonResponseSpec {
|
|
75
|
-
contentType: 'application/json';
|
|
76
|
-
schema: z.ZodType;
|
|
77
|
-
}
|
|
78
|
-
export interface NoContentResponseSpec {
|
|
79
|
-
contentType: 'none';
|
|
80
|
-
}
|
|
81
|
-
export interface NonJsonResponseSpec {
|
|
82
|
-
contentType: 'text/event-stream' | 'text/html' | 'text/plain' | 'application/octet-stream' | 'image/png' | 'image/jpeg' | 'image/svg+xml' | (string & Record<never, never>);
|
|
83
|
-
schema?: z.ZodType;
|
|
84
|
-
}
|
|
85
|
-
export type ResponseSpec = z.ZodType | JsonResponseSpec | NoContentResponseSpec | NonJsonResponseSpec;
|
|
86
|
-
/** Helper: `{ body: B }` if B is declared (non-undefined), else no fields. */
|
|
87
|
-
type Field<K extends string, T> = [T] extends [undefined] ? unknown : {
|
|
88
|
-
[P in K]: T;
|
|
89
|
-
};
|
|
90
|
-
type Normalize<T> = {
|
|
91
|
-
[K in keyof T]: T[K];
|
|
92
|
-
};
|
|
93
|
-
export type ParsedInput<P, Q, B> = Normalize<Field<'params', P> & Field<'query', Q> & Field<'body', B>>;
|
|
94
|
-
export interface APIRoute<C extends RouteContext = RouteContext, P = undefined, Q = undefined, B = undefined> {
|
|
95
|
-
path: string;
|
|
96
|
-
method: HttpMethod;
|
|
97
|
-
summary?: string;
|
|
98
|
-
description?: string;
|
|
99
|
-
params?: z.ZodType<P>;
|
|
100
|
-
query?: z.ZodType<Q>;
|
|
101
|
-
body?: P extends never ? never : BodySpec<B>;
|
|
102
|
-
responses?: Partial<Record<HttpStatus, ResponseSpec>>;
|
|
103
|
-
visibility?: ContractVisibility;
|
|
104
|
-
stability?: ContractStability;
|
|
105
|
-
permissions?: string[];
|
|
106
|
-
examples?: DocsExample[];
|
|
107
|
-
operationId?: string;
|
|
108
|
-
tags?: string[];
|
|
109
|
-
source?: SourceLocation;
|
|
110
|
-
handler: (req: Request, ctx: C, parsed: ParsedInput<P, Q, B>) => Response | Promise<Response>;
|
|
111
|
-
}
|
|
55
|
+
export type APIRoute<C extends RouteContext = RouteContext, P = undefined, Q = undefined, B = undefined> = SdkAPIRoute<C, P, Q, B>;
|
|
112
56
|
/**
|
|
113
57
|
* Subset of plugin metadata `definePlugin` cares about. The full `BakinPlugin`
|
|
114
58
|
* interface lives in `../plugin-types.ts`; this declares the new fields the
|
|
@@ -120,4 +64,3 @@ export interface PluginWithRoutes {
|
|
|
120
64
|
version: string;
|
|
121
65
|
routes?: ReadonlyArray<APIRoute<PluginContextLite, any, any, any>>;
|
|
122
66
|
}
|
|
123
|
-
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AtomicWriteOptions {
|
|
2
|
+
/** Append a trailing newline. Default true (pretty JSON convention). */
|
|
3
|
+
trailingNewline?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** Atomically write `text` to `path` (temp file + rename), creating parent dirs. */
|
|
6
|
+
export declare function atomicWriteText(path: string, text: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Atomically write `value` as pretty-printed JSON. Adds a trailing newline by
|
|
9
|
+
* default; pass `{ trailingNewline: false }` to match callers that wrote none.
|
|
10
|
+
*/
|
|
11
|
+
export declare function atomicWriteJson(path: string, value: unknown, opts?: AtomicWriteOptions): void;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { TaskLogEntry } from '@makinbakin/sdk/types';
|
|
2
|
+
import type { Unsubscribe } from '../adapters/shared';
|
|
3
|
+
export type { TaskLogEntry } from '@makinbakin/sdk/types';
|
|
4
|
+
export interface BakinTask {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
agent?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Requested team assignment (#189). `team` alone = unresolved team task
|
|
11
|
+
* (the dispatch resolver picks a member); `team` + `agent` = resolved —
|
|
12
|
+
* team is retained so the record explains requested vs resolved.
|
|
13
|
+
* Exclusion semantics live in the app facade (src/core/task-store.ts).
|
|
14
|
+
*/
|
|
15
|
+
team?: string;
|
|
16
|
+
createdBy?: string;
|
|
17
|
+
column: string;
|
|
18
|
+
order: number;
|
|
19
|
+
tags: string[];
|
|
20
|
+
workflowId?: string;
|
|
21
|
+
scheduleJobId?: string;
|
|
22
|
+
projectId?: string;
|
|
23
|
+
/** Brand link (#419) — resolved lazily at dispatch, mirrors projectId. */
|
|
24
|
+
brandId?: string;
|
|
25
|
+
/** Repo binding override (same-agent-concurrency D6): dispatch worktree target; project binding via projects.getRepo otherwise. */
|
|
26
|
+
repoPath?: string;
|
|
27
|
+
parentId?: string | null;
|
|
28
|
+
dependsOn?: string;
|
|
29
|
+
availableAt?: string;
|
|
30
|
+
dueAt?: string;
|
|
31
|
+
source?: TaskSource;
|
|
32
|
+
date?: string;
|
|
33
|
+
blockedReason?: string;
|
|
34
|
+
blockedBy: string[];
|
|
35
|
+
blocking: string[];
|
|
36
|
+
comments: TaskComment[];
|
|
37
|
+
pendingDelete: boolean;
|
|
38
|
+
log: TaskLogEntry[];
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
/**
|
|
42
|
+
* Optimistic concurrency counter — bumped on every write. Absent on
|
|
43
|
+
* pre-upgrade tasks (treated as 0; lazy-stamped on the next write).
|
|
44
|
+
* API mutations may send expectedVersion and get a 409 when stale.
|
|
45
|
+
*/
|
|
46
|
+
version?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface TaskSource {
|
|
49
|
+
pluginId?: string;
|
|
50
|
+
entityType?: string;
|
|
51
|
+
entityId?: string;
|
|
52
|
+
purpose?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface CreateBakinTaskInput {
|
|
55
|
+
id?: string;
|
|
56
|
+
title: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
agent?: string;
|
|
59
|
+
team?: string;
|
|
60
|
+
createdBy?: string;
|
|
61
|
+
column?: string;
|
|
62
|
+
order?: number;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
workflowId?: string;
|
|
65
|
+
scheduleJobId?: string;
|
|
66
|
+
projectId?: string;
|
|
67
|
+
brandId?: string;
|
|
68
|
+
/** Repo binding override (same-agent-concurrency D6): dispatch worktree target; project binding via projects.getRepo otherwise. */
|
|
69
|
+
repoPath?: string;
|
|
70
|
+
parentId?: string | null;
|
|
71
|
+
dependsOn?: string;
|
|
72
|
+
availableAt?: string;
|
|
73
|
+
dueAt?: string;
|
|
74
|
+
source?: TaskSource;
|
|
75
|
+
}
|
|
76
|
+
export type BakinTaskPatch = Partial<Pick<BakinTask, 'title' | 'description' | 'agent' | 'team' | 'createdBy' | 'column' | 'order' | 'tags' | 'workflowId' | 'scheduleJobId' | 'projectId' | 'brandId' | 'repoPath' | 'parentId' | 'dependsOn' | 'availableAt' | 'dueAt' | 'source' | 'date' | 'blockedReason' | 'blockedBy' | 'blocking' | 'pendingDelete'>>;
|
|
77
|
+
export interface TaskListOpts {
|
|
78
|
+
column?: string;
|
|
79
|
+
agent?: string;
|
|
80
|
+
projectId?: string;
|
|
81
|
+
brandId?: string;
|
|
82
|
+
/** Repo binding override (same-agent-concurrency D6): dispatch worktree target; project binding via projects.getRepo otherwise. */
|
|
83
|
+
repoPath?: string;
|
|
84
|
+
includePendingDelete?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface TaskComment {
|
|
87
|
+
id: string;
|
|
88
|
+
author: string;
|
|
89
|
+
body: string;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
}
|
|
92
|
+
export interface TaskDependencyPatch {
|
|
93
|
+
blockedBy?: string[];
|
|
94
|
+
blocking?: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface BakinTaskStoreEvent {
|
|
97
|
+
type: 'created' | 'updated' | 'deleted';
|
|
98
|
+
taskId: string;
|
|
99
|
+
task?: BakinTask;
|
|
100
|
+
}
|
|
101
|
+
export interface BakinTaskStore {
|
|
102
|
+
create(input: CreateBakinTaskInput): Promise<BakinTask>;
|
|
103
|
+
get(id: string): Promise<BakinTask | null>;
|
|
104
|
+
list(opts?: TaskListOpts): Promise<BakinTask[]>;
|
|
105
|
+
update(id: string, patch: BakinTaskPatch): Promise<BakinTask>;
|
|
106
|
+
move(id: string, column: string, order?: number): Promise<BakinTask>;
|
|
107
|
+
remove(id: string): Promise<void>;
|
|
108
|
+
appendLog(id: string, entry: TaskLogEntry): Promise<void>;
|
|
109
|
+
addComment(id: string, comment: TaskComment): Promise<void>;
|
|
110
|
+
setDependencies(id: string, deps: TaskDependencyPatch): Promise<BakinTask>;
|
|
111
|
+
markPendingDelete(id: string, pending: boolean): Promise<BakinTask>;
|
|
112
|
+
subscribe(handler: (event: BakinTaskStoreEvent) => void): Unsubscribe;
|
|
113
|
+
}
|
|
114
|
+
export interface SyncBakinTaskStore extends BakinTaskStore {
|
|
115
|
+
createSync(input: CreateBakinTaskInput): BakinTask;
|
|
116
|
+
getSync(id: string): BakinTask | null;
|
|
117
|
+
findSync(identifier: string): BakinTask | null;
|
|
118
|
+
listSync(opts?: TaskListOpts): BakinTask[];
|
|
119
|
+
updateSync(id: string, patch: BakinTaskPatch): BakinTask;
|
|
120
|
+
removeSync(id: string): void;
|
|
121
|
+
appendLogSync(id: string, entry: TaskLogEntry): void;
|
|
122
|
+
addCommentSync(id: string, comment: TaskComment): void;
|
|
123
|
+
setDependenciesSync(id: string, deps: TaskDependencyPatch): BakinTask;
|
|
124
|
+
markPendingDeleteSync(id: string, pending: boolean): BakinTask;
|
|
125
|
+
/** Index-backed column count (excludes pendingDelete, matching listSync). Zero file reads. */
|
|
126
|
+
countByColumnSync(column: string): number;
|
|
127
|
+
}
|
|
128
|
+
export declare function createEmptyBakinTask(input: CreateBakinTaskInput, now?: string): BakinTask;
|
|
129
|
+
export declare function createFileBakinTaskStore(root: string): SyncBakinTaskStore;
|
package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts
RENAMED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* here. Plugin ids are auto-namespaced as `{pluginId}.{id}` to avoid
|
|
9
9
|
* cross-plugin collisions with the shared builtin ids.
|
|
10
10
|
*/
|
|
11
|
-
import type { NotificationChannelDef, PluginNotificationChannelInput } from '
|
|
11
|
+
import type { NotificationChannelDef, PluginNotificationChannelInput } from '../plugin-types';
|
|
12
12
|
export type { NotificationChannelDef, PluginNotificationChannelInput };
|
|
13
13
|
export declare function registerNotificationChannel(def: NotificationChannelDef): void;
|
|
14
14
|
export declare function getNotificationChannel(id: string): NotificationChannelDef | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy host bridge for root `src/components/ui/*` compatibility shims.
|
|
3
|
+
* Product and plugin consumers should use their existing supported imports;
|
|
4
|
+
* only the host package and SDK may reach the private implementation.
|
|
5
|
+
*/
|
|
6
|
+
export { Button, buttonVariants } from '../../ui/index';
|
|
7
|
+
export type { ButtonProps, ButtonSize, ButtonVariant, ButtonVariantOptions, LegacyButtonSize, LegacyButtonVariant, } from '../../ui/index';
|
|
8
|
+
export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, } from '../../ui/index';
|
|
9
|
+
export type { ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressTone, ProgressTrackProps, } from '../../ui/index';
|
|
10
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle, alertVariants } from '../../ui/index';
|
|
11
|
+
export type { AlertProps, AlertTone, AlertVariantOptions, LegacyAlertVariant, } from '../../ui/index';
|
|
12
|
+
export { Badge, badgeVariants } from '../../ui/index';
|
|
13
|
+
export type { BadgeProps, BadgeSize, BadgeTone, BadgeVariant, BadgeVariantOptions, LegacyBadgeVariant, } from '../../ui/index';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Legacy host bridge for the canonical modal and side-overlay primitives. */
|
|
2
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, } from '../../ui/index';
|
|
3
|
+
export { UnsavedChangesDialog } from '../../ui/patterns/unsaved-changes-dialog';
|
|
4
|
+
export type { UnsavedChangesDialogProps } from '../../ui/patterns/unsaved-changes-dialog';
|
|
5
|
+
export type { DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogOverlayProps, DialogPortalProps, DialogProps, DialogTitleProps, DialogTriggerProps, SheetCloseProps, SheetContentProps, SheetDescriptionProps, SheetFooterProps, SheetHeaderProps, SheetOverlayProps, SheetPortalProps, SheetProps, SheetSide, SheetTitleProps, SheetTriggerProps, } from '../../ui/index';
|
|
@@ -66,13 +66,14 @@ export interface SkillSummary {
|
|
|
66
66
|
* the server-side `AgentStateInfo` shape but stays self-contained so the
|
|
67
67
|
* client doesn't reach across the package boundary for types.
|
|
68
68
|
*
|
|
69
|
-
* The server today returns
|
|
70
|
-
* `drifted` and `update-available` are
|
|
71
|
-
*
|
|
69
|
+
* The server today returns 3 states (`absent | unmanaged | managed`).
|
|
70
|
+
* `drifted` and `update-available` are display states layered on top of the
|
|
71
|
+
* server row when diagnostics or update checks report additional status.
|
|
72
72
|
*/
|
|
73
73
|
export interface PackageStateRow {
|
|
74
74
|
agentId: string;
|
|
75
|
-
state: 'absent' | 'unmanaged' | '
|
|
75
|
+
state: 'absent' | 'unmanaged' | 'managed' | 'drifted' | 'update-available';
|
|
76
|
+
version?: string;
|
|
76
77
|
packageId?: string;
|
|
77
78
|
entry?: {
|
|
78
79
|
source: string;
|
|
@@ -82,6 +83,15 @@ export interface PackageStateRow {
|
|
|
82
83
|
version?: string;
|
|
83
84
|
dependencies?: string[];
|
|
84
85
|
};
|
|
86
|
+
updateStatus?: {
|
|
87
|
+
currentVersion: string;
|
|
88
|
+
latestVersion: string | null;
|
|
89
|
+
currentCommitSha: string;
|
|
90
|
+
latestCommitSha: string | null;
|
|
91
|
+
upgradeAvailable: boolean;
|
|
92
|
+
checkedAt: string;
|
|
93
|
+
error?: string;
|
|
94
|
+
};
|
|
85
95
|
}
|
|
86
96
|
/**
|
|
87
97
|
* Single message from a runtime session JSONL. Used by the Active Context
|
|
@@ -129,3 +139,50 @@ export interface HeartbeatRaw {
|
|
|
129
139
|
content: string;
|
|
130
140
|
lastUpdated: string | null;
|
|
131
141
|
}
|
|
142
|
+
/** Client mirror of a sync-scanner finding (GET /api/agent-packages/{id}/scan). */
|
|
143
|
+
export interface ScanFinding {
|
|
144
|
+
type: string;
|
|
145
|
+
severity: 'warn' | 'error';
|
|
146
|
+
autoFixable: boolean;
|
|
147
|
+
message: string;
|
|
148
|
+
agentId?: string;
|
|
149
|
+
packageId?: string;
|
|
150
|
+
file?: string;
|
|
151
|
+
target?: string;
|
|
152
|
+
staleInputs?: string[];
|
|
153
|
+
hint?: string;
|
|
154
|
+
}
|
|
155
|
+
/** Client mirror of one timeline event (GET /:agentId/timeline). */
|
|
156
|
+
export type TimelineEventView = {
|
|
157
|
+
type: 'run';
|
|
158
|
+
ts: number;
|
|
159
|
+
runId: string;
|
|
160
|
+
taskId: string;
|
|
161
|
+
taskTitle: string | null;
|
|
162
|
+
seq: number;
|
|
163
|
+
status: 'running' | 'settled' | 'superseded' | 'lost';
|
|
164
|
+
settleReason: string | null;
|
|
165
|
+
startedAt: number;
|
|
166
|
+
settledAt: number | null;
|
|
167
|
+
durationMs: number | null;
|
|
168
|
+
model: string | null;
|
|
169
|
+
inputTokens: number | null;
|
|
170
|
+
outputTokens: number | null;
|
|
171
|
+
totalTokens: number | null;
|
|
172
|
+
costUsdMicros: number | null;
|
|
173
|
+
/** Route receipt (null = pre-migration rows). */
|
|
174
|
+
workClass: string | null;
|
|
175
|
+
routeSource: string | null;
|
|
176
|
+
logs: Array<{
|
|
177
|
+
ts: string;
|
|
178
|
+
message: string;
|
|
179
|
+
}>;
|
|
180
|
+
logsTruncated: boolean;
|
|
181
|
+
} | {
|
|
182
|
+
type: 'event';
|
|
183
|
+
ts: number;
|
|
184
|
+
event: string;
|
|
185
|
+
severity: 'info' | 'warn';
|
|
186
|
+
message: string;
|
|
187
|
+
taskId: string | null;
|
|
188
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NotificationChannelDef } from '
|
|
1
|
+
import type { NotificationChannelDef } from '../../../core/workflows/notification-channel-registry';
|
|
2
2
|
export declare function useNotificationChannels(): NotificationChannelDef[];
|
|
3
3
|
export declare function getChannelLabel(id: string, channels: NotificationChannelDef[]): string;
|
|
4
4
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clipboard write that works OUTSIDE secure contexts. Bakin is served over
|
|
3
|
+
* plain HTTP on the tailnet, where `navigator.clipboard` is UNDEFINED — the
|
|
4
|
+
* old `navigator.clipboard?.writeText(...)` pattern silently no-opped on
|
|
5
|
+
* every copy button (the 2026-07-25 chat copy bug). Async Clipboard API
|
|
6
|
+
* when available, legacy execCommand('copy') via an off-screen textarea
|
|
7
|
+
* otherwise. Returns whether the copy actually happened so UIs only show
|
|
8
|
+
* the success check for a real copy.
|
|
9
|
+
*/
|
|
10
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PersistedResizeHandleProps } from './use-persisted-leading-edge-resize';
|
|
2
|
+
/** Props for the shared grab-bar chrome over `usePersistedLeadingEdgeResize`. */
|
|
3
|
+
export interface ResizeHandleProps {
|
|
4
|
+
/** Direction of the grab bar itself: `horizontal` resizes height, `vertical` resizes width. */
|
|
5
|
+
orientation: 'horizontal' | 'vertical';
|
|
6
|
+
handleProps: PersistedResizeHandleProps;
|
|
7
|
+
/** Accessible name for the separator, e.g. "Resize message input". */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Keep a quiet grab bar visible for panel and drawer boundaries. */
|
|
10
|
+
visibleAtRest?: boolean;
|
|
11
|
+
/** Site-owned layout, positioning, and cursor classes. */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** One resize grab bar; every consumer keeps its own positioning and cursor rules. */
|
|
15
|
+
export declare function ResizeHandle({ orientation, handleProps, label, visibleAtRest, className }: ResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type HorizontalSelectionKey = 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End';
|
|
2
|
+
export type VerticalSelectionKey = 'ArrowUp' | 'ArrowDown' | 'Home' | 'End';
|
|
3
|
+
export declare function horizontalSelectionIndex(disabled: readonly boolean[], currentIndex: number, key: HorizontalSelectionKey): number | undefined;
|
|
4
|
+
/** Vertical twin of `horizontalSelectionIndex` — same wrap and disabled-skip rules. */
|
|
5
|
+
export declare function verticalSelectionIndex(disabled: readonly boolean[], currentIndex: number, key: VerticalSelectionKey): number | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type KeyboardEvent, type PointerEvent } from 'react';
|
|
2
|
+
type ResizeAxis = 'x' | 'y';
|
|
3
|
+
interface PersistedResizeOptions {
|
|
4
|
+
axis: ResizeAxis;
|
|
5
|
+
defaultSize: number;
|
|
6
|
+
minSize: number;
|
|
7
|
+
maxSize: number;
|
|
8
|
+
storageKey?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface PersistedResizeHandleProps {
|
|
12
|
+
role: 'separator';
|
|
13
|
+
tabIndex: number;
|
|
14
|
+
'aria-orientation': 'horizontal' | 'vertical';
|
|
15
|
+
'aria-valuemin': number;
|
|
16
|
+
'aria-valuemax': number;
|
|
17
|
+
'aria-valuenow': number;
|
|
18
|
+
'data-resizing': boolean;
|
|
19
|
+
onPointerDown: (event: PointerEvent<HTMLDivElement>) => void;
|
|
20
|
+
onPointerMove: (event: PointerEvent<HTMLDivElement>) => void;
|
|
21
|
+
onPointerUp: (event: PointerEvent<HTMLDivElement>) => void;
|
|
22
|
+
onPointerCancel: (event: PointerEvent<HTMLDivElement>) => void;
|
|
23
|
+
onLostPointerCapture: (event: PointerEvent<HTMLDivElement>) => void;
|
|
24
|
+
onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
25
|
+
}
|
|
26
|
+
/** Private shared mechanics for a pane resized from its leading edge. */
|
|
27
|
+
export declare function usePersistedLeadingEdgeResize({ axis, defaultSize, minSize, maxSize, storageKey, disabled, }: PersistedResizeOptions): {
|
|
28
|
+
size: number;
|
|
29
|
+
handleProps: PersistedResizeHandleProps;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ChartDatum, type ChartSeries } from './chart-data-table';
|
|
2
|
+
export interface AreaChartProps {
|
|
3
|
+
data: readonly ChartDatum[];
|
|
4
|
+
series: readonly ChartSeries[];
|
|
5
|
+
/** Accessible name for the plot and basis for its exact-data caption. */
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
height?: number;
|
|
9
|
+
/** Stack non-negative series into cumulative bands instead of overlaying them. */
|
|
10
|
+
stacked?: boolean;
|
|
11
|
+
formatValue?: (value: number) => string;
|
|
12
|
+
emptyLabel?: string;
|
|
13
|
+
/** Disable only when an equivalent exact table is rendered beside the chart. */
|
|
14
|
+
showDataTable?: boolean;
|
|
15
|
+
/** Collapse the exact-data table behind its disclosure for space-tight contexts. */
|
|
16
|
+
compactData?: boolean;
|
|
17
|
+
/** When false, the exact-data table renders statically with no disclosure. */
|
|
18
|
+
dataTableExpandable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Dependency-free cumulative-magnitude trend chart sharing LineChart's exact
|
|
22
|
+
* data, missing-value, and focus-equivalence contract. A single-series gap
|
|
23
|
+
* breaks the fill; a stacked column cannot honestly show a mid-stack gap, so
|
|
24
|
+
* the missing series is omitted from that column's band boundaries and the
|
|
25
|
+
* omission is surfaced through the exact table's missing labels.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AreaChart({ data, series, label, description, height, stacked, formatValue, emptyLabel, compactData, showDataTable, dataTableExpandable, }: AreaChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared axis and series-geometry helpers for the hand-rolled SVG chart kit.
|
|
3
|
+
* Chart-specific value semantics (stacked coercion, negative handling) stay
|
|
4
|
+
* local to the chart that owns them.
|
|
5
|
+
*/
|
|
6
|
+
/** Non-negative reported value; negative and non-finite readings are explicit gaps. */
|
|
7
|
+
export declare function reportedValue(value: number | undefined): number | null;
|
|
8
|
+
/** Thin dense x-axes to at most ~6 labels while always keeping the last one. */
|
|
9
|
+
export declare function shouldRenderXLabel(index: number, count: number): boolean;
|
|
10
|
+
/** Ellipsize long axis labels so dense axes stay legible. */
|
|
11
|
+
export declare function axisLabel(label: string): string;
|
|
12
|
+
/** Split a point series on gaps (nulls) into contiguous drawable runs. */
|
|
13
|
+
export declare function contiguousSegments<P>(points: readonly (P | null)[]): P[][];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ChartDatum, type ChartSeries } from './chart-data-table';
|
|
2
|
+
export interface BarChartProps {
|
|
3
|
+
data: readonly ChartDatum[];
|
|
4
|
+
series: readonly ChartSeries[];
|
|
5
|
+
/** Accessible name for the plot and basis for its exact-data caption. */
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
height?: number;
|
|
9
|
+
/** Stack non-negative series within each x-axis bucket instead of grouping them. */
|
|
10
|
+
stacked?: boolean;
|
|
11
|
+
formatValue?: (value: number) => string;
|
|
12
|
+
emptyLabel?: string;
|
|
13
|
+
/** Disable only when an equivalent exact table is rendered beside the chart. */
|
|
14
|
+
showDataTable?: boolean;
|
|
15
|
+
/** Collapse the exact-data table behind its disclosure for space-tight contexts. */
|
|
16
|
+
compactData?: boolean;
|
|
17
|
+
/** When false, the exact-data table renders statically with no disclosure. */
|
|
18
|
+
dataTableExpandable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Dependency-free grouped or stacked non-negative comparison chart with exact data. */
|
|
21
|
+
export declare function BarChart({ data, series, label, description, height, stacked, formatValue, emptyLabel, showDataTable, compactData, dataTableExpandable, }: BarChartProps): import("react/jsx-runtime").JSX.Element;
|