@makinbakin/sdk 0.0.1-rc.17 → 0.0.1-rc.18

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.
@@ -35,9 +35,10 @@ export interface ScheduleJob {
35
35
  export interface RunEntry {
36
36
  runId: string;
37
37
  timestamp: string;
38
- status: 'success' | 'failure' | 'skipped';
38
+ status: 'success' | 'failure' | 'skipped' | 'pending';
39
39
  taskId?: string;
40
40
  error?: string;
41
+ skippedReason?: string;
41
42
  }
42
43
  interface UseScheduleOptions {
43
44
  agent?: string;
@@ -0,0 +1,17 @@
1
+ /** One dispatch attempt for a task (mirrors plugins/tasks TaskRunEntry). */
2
+ export interface TaskRunEntry {
3
+ runId: string;
4
+ taskId: string;
5
+ seq: number;
6
+ agent: string;
7
+ status: 'running' | 'settled' | 'superseded' | 'lost';
8
+ startedAt: string;
9
+ settledAt?: string;
10
+ settleReason?: string;
11
+ durationMs?: number;
12
+ }
13
+ /** Fetch a task's dispatch run history (newest-first) from the execution ledger. */
14
+ export declare function useTaskRunHistory(taskId: string | null, limit?: number): {
15
+ runs: TaskRunEntry[];
16
+ loading: boolean;
17
+ };
@@ -59,7 +59,7 @@ var require_use_sync_external_store_shim_development = __commonJS((exports) => {
59
59
  var cachedValue = getSnapshot();
60
60
  objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
61
61
  }
62
- cachedValue = useState12({
62
+ cachedValue = useState13({
63
63
  inst: { value, getSnapshot }
64
64
  });
65
65
  var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
@@ -68,7 +68,7 @@ var require_use_sync_external_store_shim_development = __commonJS((exports) => {
68
68
  inst.getSnapshot = getSnapshot;
69
69
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
70
70
  }, [subscribe, value, getSnapshot]);
71
- useEffect14(function() {
71
+ useEffect15(function() {
72
72
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
73
73
  return subscribe(function() {
74
74
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
@@ -91,7 +91,7 @@ var require_use_sync_external_store_shim_development = __commonJS((exports) => {
91
91
  return getSnapshot();
92
92
  }
93
93
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
94
- var objectIs = typeof Object.is === "function" ? Object.is : is, useState12 = React16.useState, useEffect14 = React16.useEffect, useLayoutEffect4 = React16.useLayoutEffect, useDebugValue2 = React16.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? useSyncExternalStore$1 : useSyncExternalStore$2;
94
+ var objectIs = typeof Object.is === "function" ? Object.is : is, useState13 = React16.useState, useEffect15 = React16.useEffect, useLayoutEffect4 = React16.useLayoutEffect, useDebugValue2 = React16.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? useSyncExternalStore$1 : useSyncExternalStore$2;
95
95
  exports.useSyncExternalStore = React16.useSyncExternalStore !== undefined ? React16.useSyncExternalStore : shim;
96
96
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
97
97
  })();
@@ -112,7 +112,7 @@ var require_with_selector_development = __commonJS((exports) => {
112
112
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
113
113
  }
114
114
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
115
- var shim = require_shim(), objectIs = typeof Object.is === "function" ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef9 = React17.useRef, useEffect14 = React17.useEffect, useMemo4 = React17.useMemo, useDebugValue2 = React17.useDebugValue;
115
+ var shim = require_shim(), objectIs = typeof Object.is === "function" ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef9 = React17.useRef, useEffect15 = React17.useEffect, useMemo4 = React17.useMemo, useDebugValue2 = React17.useDebugValue;
116
116
  exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
117
117
  var instRef = useRef9(null);
118
118
  if (instRef.current === null) {
@@ -153,7 +153,7 @@ var require_with_selector_development = __commonJS((exports) => {
153
153
  ];
154
154
  }, [getSnapshot, getServerSnapshot, selector, isEqual]);
155
155
  var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
156
- useEffect14(function() {
156
+ useEffect15(function() {
157
157
  inst.hasValue = true;
158
158
  inst.value = value;
159
159
  }, [value]);
@@ -1830,7 +1830,7 @@ var require_extend = __commonJS((exports, module) => {
1830
1830
  });
1831
1831
 
1832
1832
  // src/components/agent-avatar.tsx
1833
- import { useState as useState11 } from "react";
1833
+ import { useState as useState12 } from "react";
1834
1834
  // node_modules/.bun/lucide-react@0.577.0+b1ab299f0a400331/node_modules/lucide-react/dist/esm/createLucideIcon.js
1835
1835
  import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
1836
1836
 
@@ -19141,14 +19141,17 @@ import { useCallback as useCallback2, useMemo as useMemo2, useRef as useRef3 } f
19141
19141
  // src/hooks/use-schedule.ts
19142
19142
  import { useState as useState6, useEffect as useEffect7, useCallback as useCallback3, useRef as useRef4 } from "react";
19143
19143
  "use client";
19144
+ // src/hooks/use-task-run-history.ts
19145
+ import { useState as useState7, useEffect as useEffect8 } from "react";
19146
+ "use client";
19144
19147
  // src/hooks/use-search.ts
19145
- import { useState as useState7, useEffect as useEffect8, useCallback as useCallback4, useRef as useRef5 } from "react";
19148
+ import { useState as useState8, useEffect as useEffect9, useCallback as useCallback4, useRef as useRef5 } from "react";
19146
19149
  "use client";
19147
19150
  // src/hooks/use-sidebar.ts
19148
- import { useState as useState8, useEffect as useEffect9 } from "react";
19151
+ import { useState as useState9, useEffect as useEffect10 } from "react";
19149
19152
  "use client";
19150
19153
  // src/hooks/use-sse.ts
19151
- import { useEffect as useEffect10, useRef as useRef6 } from "react";
19154
+ import { useEffect as useEffect11, useRef as useRef6 } from "react";
19152
19155
  "use client";
19153
19156
  // src/hooks/use-toast.ts
19154
19157
  var DEFAULT_DURATION = {
@@ -19169,7 +19172,7 @@ var useToastStore = create((set3) => ({
19169
19172
  dismiss: (id) => set3((s) => ({ toasts: s.toasts.filter((t) => t.id !== id) }))
19170
19173
  }));
19171
19174
  // src/hooks/use-vertical-resize.ts
19172
- import { useCallback as useCallback5, useEffect as useEffect11, useRef as useRef7, useState as useState9 } from "react";
19175
+ import { useCallback as useCallback5, useEffect as useEffect12, useRef as useRef7, useState as useState10 } from "react";
19173
19176
  "use client";
19174
19177
  var STORAGE_PREFIX = "bakin-vresize:";
19175
19178
  function clamp(n, min, max) {
@@ -19189,12 +19192,12 @@ function readStored(defaultHeight, min, max, storageKey) {
19189
19192
  }
19190
19193
  }
19191
19194
  function useVerticalResize({ defaultHeight, minHeight, maxHeight, storageKey }) {
19192
- const [height, setHeightState] = useState9(() => readStored(defaultHeight, minHeight, maxHeight, storageKey));
19195
+ const [height, setHeightState] = useState10(() => readStored(defaultHeight, minHeight, maxHeight, storageKey));
19193
19196
  const heightRef = useRef7(height);
19194
19197
  const dragging = useRef7(false);
19195
19198
  const startY = useRef7(0);
19196
19199
  const startHeight = useRef7(0);
19197
- useEffect11(() => {
19200
+ useEffect12(() => {
19198
19201
  heightRef.current = height;
19199
19202
  }, [height]);
19200
19203
  const persist = useCallback5((h) => {
@@ -19369,7 +19372,7 @@ function useAgentDisplayName(agentId) {
19369
19372
  return useAgentStore((s) => s.displaySettings[agentId]?.displayName);
19370
19373
  }
19371
19374
  // plugins/workflows/hooks/use-notification-channels.ts
19372
- import { useEffect as useEffect12, useState as useState10 } from "react";
19375
+ import { useEffect as useEffect13, useState as useState11 } from "react";
19373
19376
  "use client";
19374
19377
  var cached2 = null;
19375
19378
  var inFlight = null;
@@ -19391,8 +19394,8 @@ function fetchChannels() {
19391
19394
  return inFlight;
19392
19395
  }
19393
19396
  function useNotificationChannels() {
19394
- const [channels, setChannels] = useState10(() => cached2 ?? []);
19395
- useEffect12(() => {
19397
+ const [channels, setChannels] = useState11(() => cached2 ?? []);
19398
+ useEffect13(() => {
19396
19399
  if (cached2)
19397
19400
  return;
19398
19401
  let cancelled = false;
@@ -19431,7 +19434,7 @@ function AgentAvatar({
19431
19434
  status,
19432
19435
  className
19433
19436
  }) {
19434
- const [imgError, setImgError] = useState11(false);
19437
+ const [imgError, setImgError] = useState12(false);
19435
19438
  const agent = useAgent(agentId);
19436
19439
  const accentColor = useAgentColor(agentId);
19437
19440
  const config2 = SIZE_CONFIG[size];
@@ -32222,7 +32225,7 @@ function AgentStatus({ name, heartbeat }) {
32222
32225
  }, undefined, true, undefined, this);
32223
32226
  }
32224
32227
  // src/components/bakin-drawer.tsx
32225
- import { useRef as useRef43, useState as useState30, useCallback as useCallback22, useEffect as useEffect28 } from "react";
32228
+ import { useRef as useRef43, useState as useState31, useCallback as useCallback22, useEffect as useEffect29 } from "react";
32226
32229
 
32227
32230
  // node_modules/.bun/@base-ui+react@1.4.1+0ea9ec2a211d4613/node_modules/@base-ui/react/esm/dialog/index.parts.js
32228
32231
  var exports_index_parts4 = {};
@@ -33303,16 +33306,16 @@ function BakinDrawer({
33303
33306
  onBack,
33304
33307
  dirty = false
33305
33308
  }) {
33306
- const [width, setWidth] = useState30(() => getStoredDrawerWidth(defaultWidth, storageKey));
33307
- const [showDirtyConfirm, setShowDirtyConfirm] = useState30(false);
33309
+ const [width, setWidth] = useState31(() => getStoredDrawerWidth(defaultWidth, storageKey));
33310
+ const [showDirtyConfirm, setShowDirtyConfirm] = useState31(false);
33308
33311
  const dragging = useRef43(false);
33309
33312
  const startX = useRef43(0);
33310
33313
  const startWidth = useRef43(0);
33311
33314
  const widthRef = useRef43(width);
33312
- useEffect28(() => {
33315
+ useEffect29(() => {
33313
33316
  setWidth(getStoredDrawerWidth(defaultWidth, storageKey));
33314
33317
  }, [defaultWidth, storageKey]);
33315
- useEffect28(() => {
33318
+ useEffect29(() => {
33316
33319
  widthRef.current = width;
33317
33320
  }, [width]);
33318
33321
  const persistWidth = useCallback22((nextWidth) => {
@@ -33594,7 +33597,7 @@ function ErrorState({ title = "Something went wrong", message, retry, className
33594
33597
  }, undefined, true, undefined, this);
33595
33598
  }
33596
33599
  // src/components/facet-filter.tsx
33597
- import { useState as useState45 } from "react";
33600
+ import { useState as useState46 } from "react";
33598
33601
 
33599
33602
  // node_modules/.bun/@base-ui+react@1.4.1+0ea9ec2a211d4613/node_modules/@base-ui/react/esm/popover/index.parts.js
33600
33603
  var exports_index_parts5 = {};
@@ -35687,9 +35690,9 @@ function assignRef(ref, value) {
35687
35690
  }
35688
35691
 
35689
35692
  // node_modules/.bun/use-callback-ref@1.3.3+26a211c426f3f87c/node_modules/use-callback-ref/dist/es2015/useRef.js
35690
- import { useState as useState38 } from "react";
35693
+ import { useState as useState39 } from "react";
35691
35694
  function useCallbackRef2(initialValue, callback) {
35692
- var ref = useState38(function() {
35695
+ var ref = useState39(function() {
35693
35696
  return {
35694
35697
  value: initialValue,
35695
35698
  callback,
@@ -38407,7 +38410,7 @@ function Badge({
38407
38410
  import { jsxDEV as jsxDEV21 } from "react/jsx-dev-runtime";
38408
38411
  "use client";
38409
38412
  function FacetFilter({ label, options: options2, selected, onChange, searchThreshold = 6, counts }) {
38410
- const [open, setOpen] = useState45(false);
38413
+ const [open, setOpen] = useState46(false);
38411
38414
  const showSearch = options2.length > searchThreshold;
38412
38415
  function toggle(value) {
38413
38416
  if (selected.includes(value)) {
@@ -38512,7 +38515,7 @@ function FacetFilter({ label, options: options2, selected, onChange, searchThres
38512
38515
  }, undefined, true, undefined, this);
38513
38516
  }
38514
38517
  // src/components/integrated-brainstorm/index.tsx
38515
- import { useCallback as useCallback36, useEffect as useEffect45, useId as useId3, useRef as useRef66, useState as useState48 } from "react";
38518
+ import { useCallback as useCallback36, useEffect as useEffect46, useId as useId3, useRef as useRef66, useState as useState49 } from "react";
38516
38519
 
38517
38520
  // src/components/integrated-brainstorm/collapsed-header.tsx
38518
38521
  import { jsxDEV as jsxDEV22 } from "react/jsx-dev-runtime";
@@ -38618,7 +38621,7 @@ function DefaultEmptyState({ agentId }) {
38618
38621
  }
38619
38622
 
38620
38623
  // src/components/integrated-brainstorm/input-row.tsx
38621
- import { forwardRef as forwardRef72, useImperativeHandle as useImperativeHandle8, useRef as useRef64, useState as useState46 } from "react";
38624
+ import { forwardRef as forwardRef72, useImperativeHandle as useImperativeHandle8, useRef as useRef64, useState as useState47 } from "react";
38622
38625
 
38623
38626
  // src/components/integrated-brainstorm/use-auto-grow.ts
38624
38627
  import { useLayoutEffect as useLayoutEffect7, useRef as useRef63 } from "react";
@@ -38642,7 +38645,7 @@ function useAutoGrow(value, maxHeight) {
38642
38645
  import { jsxDEV as jsxDEV24 } from "react/jsx-dev-runtime";
38643
38646
  "use client";
38644
38647
  var InputRow = forwardRef72(function InputRow2({ placeholder, disabled: disabled2, status, maxInputHeight, agentId, onAgentChange, onSubmit, onAbort }, ref) {
38645
- const [value, setValue] = useState46("");
38648
+ const [value, setValue] = useState47("");
38646
38649
  const taRef = useAutoGrow(value, maxInputHeight);
38647
38650
  const composingRef = useRef64(false);
38648
38651
  useImperativeHandle8(ref, () => ({
@@ -39210,7 +39213,7 @@ function AbortedNotice() {
39210
39213
  }
39211
39214
 
39212
39215
  // src/components/integrated-brainstorm/use-brainstorm-state.ts
39213
- import { useCallback as useCallback35, useRef as useRef65, useState as useState47 } from "react";
39216
+ import { useCallback as useCallback35, useRef as useRef65, useState as useState48 } from "react";
39214
39217
 
39215
39218
  // src/components/integrated-brainstorm/session.ts
39216
39219
  var ACTIVITY_CONTENT_MAX_CHARS = 500;
@@ -39385,11 +39388,11 @@ function useBrainstormState({
39385
39388
  onSend,
39386
39389
  defaultAgentId
39387
39390
  }) {
39388
- const [status, setStatus] = useState47("idle");
39389
- const [streamingContent, setStreamingContent] = useState47("");
39390
- const [thinkingVerb, setThinkingVerb] = useState47(() => pickVerb());
39391
- const [errorMessage, setErrorMessage] = useState47(null);
39392
- const [wasAborted, setWasAborted] = useState47(false);
39391
+ const [status, setStatus] = useState48("idle");
39392
+ const [streamingContent, setStreamingContent] = useState48("");
39393
+ const [thinkingVerb, setThinkingVerb] = useState48(() => pickVerb());
39394
+ const [errorMessage, setErrorMessage] = useState48(null);
39395
+ const [wasAborted, setWasAborted] = useState48(false);
39393
39396
  const abortRef = useRef65(null);
39394
39397
  const sendingRef = useRef65(false);
39395
39398
  const send = useCallback35(async (prompt, options2) => {
@@ -39604,7 +39607,7 @@ function IntegratedBrainstorm({
39604
39607
  readOnlyNotice,
39605
39608
  transformAssistantMessage
39606
39609
  }) {
39607
- const [open, setOpen] = useState48(defaultOpen);
39610
+ const [open, setOpen] = useState49(defaultOpen);
39608
39611
  const bodyId = useId3();
39609
39612
  const endRef = useRef66(null);
39610
39613
  const inputRef = useRef66(null);
@@ -39629,19 +39632,19 @@ function IntegratedBrainstorm({
39629
39632
  const replyCount = messages.filter((m2) => m2.role === "assistant").length;
39630
39633
  const isOpen = collapsible ? open : true;
39631
39634
  const resolvedPlaceholder = placeholder ?? `Ask ${agentName}\u2026`;
39632
- useEffect45(() => {
39635
+ useEffect46(() => {
39633
39636
  if (!isOpen)
39634
39637
  return;
39635
39638
  endRef.current?.scrollIntoView({ behavior: "smooth" });
39636
39639
  }, [messages.length, streamingContent, isOpen]);
39637
- useEffect45(() => {
39640
+ useEffect46(() => {
39638
39641
  if (isOpen && !wasOpenRef.current) {
39639
39642
  inputRef.current?.focus();
39640
39643
  }
39641
39644
  wasOpenRef.current = isOpen;
39642
39645
  }, [isOpen]);
39643
39646
  const prevStatusRef = useRef66(status);
39644
- useEffect45(() => {
39647
+ useEffect46(() => {
39645
39648
  if (prevStatusRef.current !== "idle" && status === "idle" && isOpen && !readOnly) {
39646
39649
  const active = document.activeElement;
39647
39650
  if (!active || active === document.body) {
@@ -41429,7 +41432,7 @@ var urlAttributes = {
41429
41432
  };
41430
41433
  // node_modules/.bun/react-markdown@10.1.0+26a211c426f3f87c/node_modules/react-markdown/lib/index.js
41431
41434
  import { Fragment as Fragment15, jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
41432
- import { useEffect as useEffect46, useState as useState49 } from "react";
41435
+ import { useEffect as useEffect47, useState as useState50 } from "react";
41433
41436
 
41434
41437
  // node_modules/.bun/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
41435
41438
  var emptyOptions2 = {};
@@ -53387,12 +53390,12 @@ function PageLayout({ title, subtitle, actions, className, children }) {
53387
53390
  }, undefined, true, undefined, this);
53388
53391
  }
53389
53392
  // src/components/plugin-header.tsx
53390
- import { useState as useState50, useEffect as useEffect47, useRef as useRef67, useCallback as useCallback37 } from "react";
53393
+ import { useState as useState51, useEffect as useEffect48, useRef as useRef67, useCallback as useCallback37 } from "react";
53391
53394
  import { jsxDEV as jsxDEV32 } from "react/jsx-dev-runtime";
53392
53395
  function DebouncedSearchInput({ value, onChange, placeholder, debounce = 300 }) {
53393
- const [local, setLocal] = useState50(value);
53396
+ const [local, setLocal] = useState51(value);
53394
53397
  const timerRef = useRef67(null);
53395
- useEffect47(() => {
53398
+ useEffect48(() => {
53396
53399
  setLocal(value);
53397
53400
  }, [value]);
53398
53401
  const handleChange = useCallback37((e) => {
@@ -53402,7 +53405,7 @@ function DebouncedSearchInput({ value, onChange, placeholder, debounce = 300 })
53402
53405
  clearTimeout(timerRef.current);
53403
53406
  timerRef.current = setTimeout(() => onChange(v), debounce);
53404
53407
  }, [onChange, debounce]);
53405
- useEffect47(() => {
53408
+ useEffect48(() => {
53406
53409
  return () => {
53407
53410
  if (timerRef.current)
53408
53411
  clearTimeout(timerRef.current);
@@ -53462,7 +53465,7 @@ function PluginHeader({ title, subtitle, count: count3, actions, meta: meta3, se
53462
53465
  }, undefined, true, undefined, this);
53463
53466
  }
53464
53467
  // src/components/plugin-settings-renderer.tsx
53465
- import { useMemo as useMemo48, useState as useState52 } from "react";
53468
+ import { useMemo as useMemo48, useState as useState53 } from "react";
53466
53469
 
53467
53470
  // src/components/ui/label.tsx
53468
53471
  import { jsxDEV as jsxDEV33 } from "react/jsx-dev-runtime";
@@ -53880,8 +53883,8 @@ function validateList(field, value) {
53880
53883
  return null;
53881
53884
  }
53882
53885
  function PluginSettingsRenderer({ pluginId, schema, values: values2, onSave }) {
53883
- const [formValues, setFormValues] = useState52(() => buildInitialValues(schema, values2));
53884
- const [saving, setSaving] = useState52(false);
53886
+ const [formValues, setFormValues] = useState53(() => buildInitialValues(schema, values2));
53887
+ const [saving, setSaving] = useState53(false);
53885
53888
  const add = useToastStore((s) => s.add);
53886
53889
  const initial = useMemo48(() => buildInitialValues(schema, values2), [schema, values2]);
53887
53890
  const isDirty = schema.fields.some((f) => JSON.stringify(formValues[f.key]) !== JSON.stringify(initial[f.key]));
package/hooks/index.d.ts CHANGED
@@ -25,6 +25,9 @@ export { useScheduleJobs } from '../_internal/app/hooks/use-schedule';
25
25
  /** Fetch run history for a scheduled job. */
26
26
  export { useRunHistory } from '../_internal/app/hooks/use-schedule';
27
27
  export type { ScheduleJob, RunEntry } from '../_internal/app/hooks/use-schedule';
28
+ /** Fetch dispatch run history for a task. */
29
+ export { useTaskRunHistory } from '../_internal/app/hooks/use-task-run-history';
30
+ export type { TaskRunEntry } from '../_internal/app/hooks/use-task-run-history';
28
31
  /** Hybrid full-text + semantic search across plugins with facet filtering. */
29
32
  export { useSearch } from '../_internal/app/hooks/use-search';
30
33
  /** Re-rank a local list to match the order returned by a search query. */
package/hooks/index.js CHANGED
@@ -58,7 +58,7 @@ var require_use_sync_external_store_shim_development = __commonJS((exports) => {
58
58
  var cachedValue = getSnapshot();
59
59
  objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
60
60
  }
61
- cachedValue = useState8({
61
+ cachedValue = useState9({
62
62
  inst: { value, getSnapshot }
63
63
  });
64
64
  var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
@@ -67,7 +67,7 @@ var require_use_sync_external_store_shim_development = __commonJS((exports) => {
67
67
  inst.getSnapshot = getSnapshot;
68
68
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
69
69
  }, [subscribe, value, getSnapshot]);
70
- useEffect11(function() {
70
+ useEffect12(function() {
71
71
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
72
72
  return subscribe(function() {
73
73
  checkIfSnapshotChanged(inst) && forceUpdate({ inst });
@@ -90,7 +90,7 @@ var require_use_sync_external_store_shim_development = __commonJS((exports) => {
90
90
  return getSnapshot();
91
91
  }
92
92
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
93
- var objectIs = typeof Object.is === "function" ? Object.is : is, useState8 = React2.useState, useEffect11 = React2.useEffect, useLayoutEffect2 = React2.useLayoutEffect, useDebugValue2 = React2.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? useSyncExternalStore$1 : useSyncExternalStore$2;
93
+ var objectIs = typeof Object.is === "function" ? Object.is : is, useState9 = React2.useState, useEffect12 = React2.useEffect, useLayoutEffect2 = React2.useLayoutEffect, useDebugValue2 = React2.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? useSyncExternalStore$1 : useSyncExternalStore$2;
94
94
  exports.useSyncExternalStore = React2.useSyncExternalStore !== undefined ? React2.useSyncExternalStore : shim;
95
95
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
96
96
  })();
@@ -111,7 +111,7 @@ var require_with_selector_development = __commonJS((exports) => {
111
111
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
112
112
  }
113
113
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
114
- var shim = require_shim(), objectIs = typeof Object.is === "function" ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef7 = React3.useRef, useEffect11 = React3.useEffect, useMemo3 = React3.useMemo, useDebugValue2 = React3.useDebugValue;
114
+ var shim = require_shim(), objectIs = typeof Object.is === "function" ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef7 = React3.useRef, useEffect12 = React3.useEffect, useMemo3 = React3.useMemo, useDebugValue2 = React3.useDebugValue;
115
115
  exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
116
116
  var instRef = useRef7(null);
117
117
  if (instRef.current === null) {
@@ -152,7 +152,7 @@ var require_with_selector_development = __commonJS((exports) => {
152
152
  ];
153
153
  }, [getSnapshot, getServerSnapshot, selector, isEqual]);
154
154
  var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
155
- useEffect11(function() {
155
+ useEffect12(function() {
156
156
  inst.hasValue = true;
157
157
  inst.value = value;
158
158
  }, [value]);
@@ -14801,8 +14801,27 @@ function useRunHistory(jobId, limit = 20) {
14801
14801
  }, [jobId, limit]);
14802
14802
  return { runs, loading };
14803
14803
  }
14804
+ // src/hooks/use-task-run-history.ts
14805
+ import { useState as useState3, useEffect as useEffect5 } from "react";
14806
+ "use client";
14807
+ function useTaskRunHistory(taskId, limit = 50) {
14808
+ const [runs, setRuns] = useState3([]);
14809
+ const [loading, setLoading] = useState3(false);
14810
+ useEffect5(() => {
14811
+ if (!taskId) {
14812
+ setRuns([]);
14813
+ return;
14814
+ }
14815
+ setLoading(true);
14816
+ fetch(`/api/plugins/tasks/${taskId}/runs?limit=${limit}`).then((res) => res.ok ? res.json() : null).then((data) => {
14817
+ if (data)
14818
+ setRuns(data.runs || []);
14819
+ }).catch(() => {}).finally(() => setLoading(false));
14820
+ }, [taskId, limit]);
14821
+ return { runs, loading };
14822
+ }
14804
14823
  // src/hooks/use-search.ts
14805
- import { useState as useState3, useEffect as useEffect5, useCallback as useCallback4, useRef as useRef3 } from "react";
14824
+ import { useState as useState4, useEffect as useEffect6, useCallback as useCallback4, useRef as useRef3 } from "react";
14806
14825
  "use client";
14807
14826
  function reorderBySearchResults(items, searchResults) {
14808
14827
  if (!searchResults.length)
@@ -14831,16 +14850,16 @@ function useSearch(options = {}) {
14831
14850
  debounce: debounceMs = 250,
14832
14851
  fallback
14833
14852
  } = options;
14834
- const [results, setResults] = useState3([]);
14835
- const [aggregations, setAggregations] = useState3({});
14836
- const [loading, setLoading] = useState3(false);
14837
- const [error48, setError] = useState3(null);
14838
- const [meta3, setMeta] = useState3(null);
14839
- const [, setQuery] = useState3("");
14853
+ const [results, setResults] = useState4([]);
14854
+ const [aggregations, setAggregations] = useState4({});
14855
+ const [loading, setLoading] = useState4(false);
14856
+ const [error48, setError] = useState4(null);
14857
+ const [meta3, setMeta] = useState4(null);
14858
+ const [, setQuery] = useState4("");
14840
14859
  const abortRef = useRef3(null);
14841
14860
  const timerRef = useRef3(null);
14842
14861
  const mountedRef = useRef3(true);
14843
- useEffect5(() => {
14862
+ useEffect6(() => {
14844
14863
  mountedRef.current = true;
14845
14864
  return () => {
14846
14865
  mountedRef.current = false;
@@ -14936,11 +14955,11 @@ function useSearch(options = {}) {
14936
14955
  return { results, aggregations, loading, error: error48, meta: meta3, search, clear };
14937
14956
  }
14938
14957
  // src/hooks/use-sidebar.ts
14939
- import { useState as useState4, useEffect as useEffect6 } from "react";
14958
+ import { useState as useState5, useEffect as useEffect7 } from "react";
14940
14959
  "use client";
14941
14960
  function useSidebar() {
14942
- const [collapsed, setCollapsed] = useState4(false);
14943
- useEffect6(() => {
14961
+ const [collapsed, setCollapsed] = useState5(false);
14962
+ useEffect7(() => {
14944
14963
  const stored = localStorage.getItem("sidebar-collapsed");
14945
14964
  if (stored === "true")
14946
14965
  setCollapsed(true);
@@ -14952,7 +14971,7 @@ function useSidebar() {
14952
14971
  return { collapsed, toggle };
14953
14972
  }
14954
14973
  // src/hooks/use-sse.ts
14955
- import { useEffect as useEffect7, useRef as useRef4 } from "react";
14974
+ import { useEffect as useEffect8, useRef as useRef4 } from "react";
14956
14975
 
14957
14976
  // src/lib/browser-notify.ts
14958
14977
  var STORAGE_KEY = "bakin-notifications-enabled";
@@ -14995,7 +15014,7 @@ function useSSE() {
14995
15014
  const retryRef = useRef4(0);
14996
15015
  const timeoutRef = useRef4(null);
14997
15016
  const hbTimerRef = useRef4(null);
14998
- useEffect7(() => {
15017
+ useEffect8(() => {
14999
15018
  initialize();
15000
15019
  function connect() {
15001
15020
  if (esRef.current) {
@@ -15182,7 +15201,7 @@ function toast(message, type = "info", duration3) {
15182
15201
  useToastStore.getState().add({ message, type, ...duration3 ? { duration: duration3 } : {} });
15183
15202
  }
15184
15203
  // src/hooks/use-vertical-resize.ts
15185
- import { useCallback as useCallback5, useEffect as useEffect8, useRef as useRef5, useState as useState5 } from "react";
15204
+ import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef5, useState as useState6 } from "react";
15186
15205
  "use client";
15187
15206
  var STORAGE_PREFIX = "bakin-vresize:";
15188
15207
  function clamp(n, min, max) {
@@ -15202,12 +15221,12 @@ function readStored(defaultHeight, min, max, storageKey) {
15202
15221
  }
15203
15222
  }
15204
15223
  function useVerticalResize({ defaultHeight, minHeight, maxHeight, storageKey }) {
15205
- const [height, setHeightState] = useState5(() => readStored(defaultHeight, minHeight, maxHeight, storageKey));
15224
+ const [height, setHeightState] = useState6(() => readStored(defaultHeight, minHeight, maxHeight, storageKey));
15206
15225
  const heightRef = useRef5(height);
15207
15226
  const dragging = useRef5(false);
15208
15227
  const startY = useRef5(0);
15209
15228
  const startHeight = useRef5(0);
15210
- useEffect8(() => {
15229
+ useEffect9(() => {
15211
15230
  heightRef.current = height;
15212
15231
  }, [height]);
15213
15232
  const persist = useCallback5((h) => {
@@ -15397,7 +15416,7 @@ function hexToMuted(hex3, opacity = 0.2) {
15397
15416
  return `rgba(${r}, ${g}, ${b}, ${opacity})`;
15398
15417
  }
15399
15418
  // plugins/workflows/hooks/use-notification-channels.ts
15400
- import { useEffect as useEffect9, useState as useState6 } from "react";
15419
+ import { useEffect as useEffect10, useState as useState7 } from "react";
15401
15420
  "use client";
15402
15421
  var cached2 = null;
15403
15422
  var inFlight = null;
@@ -15419,8 +15438,8 @@ function fetchChannels() {
15419
15438
  return inFlight;
15420
15439
  }
15421
15440
  function useNotificationChannels() {
15422
- const [channels, setChannels] = useState6(() => cached2 ?? []);
15423
- useEffect9(() => {
15441
+ const [channels, setChannels] = useState7(() => cached2 ?? []);
15442
+ useEffect10(() => {
15424
15443
  if (cached2)
15425
15444
  return;
15426
15445
  let cancelled = false;
@@ -15722,6 +15741,7 @@ function useParams2() {
15722
15741
  export {
15723
15742
  useVerticalResize,
15724
15743
  useToastStore,
15744
+ useTaskRunHistory,
15725
15745
  useSidebar,
15726
15746
  useSearchParams,
15727
15747
  useSearch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makinbakin/sdk",
3
- "version": "0.0.1-rc.17",
3
+ "version": "0.0.1-rc.18",
4
4
  "description": "SDK for building Bakin plugins — UI components, slot types, hooks, and the runtime registerPlugin helper.",
5
5
  "type": "module",
6
6
  "sideEffects": false,