@fayz-ai/plugin-scribe 0.12.0 → 0.12.2

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.
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import type { ScribeLabels } from '../types';
3
2
  export interface ScribeHeaderActionProps {
4
3
  labels: ScribeLabels;
@@ -9,7 +8,9 @@ export interface ScribeHeaderActionProps {
9
8
  name?: string;
10
9
  full_name?: string;
11
10
  };
11
+ /** Which entity's detail this is — the zone is registered per entity. */
12
+ entityId?: string;
12
13
  embedded?: boolean;
13
14
  }
14
- export declare function ScribeHeaderAction({ labels, item, embedded }: ScribeHeaderActionProps): React.JSX.Element | null;
15
+ export declare function ScribeHeaderAction({ labels, item, entityId }: ScribeHeaderActionProps): null;
15
16
  //# sourceMappingURL=ScribeHeaderAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScribeHeaderAction.d.ts","sourceRoot":"","sources":["../../src/components/ScribeHeaderAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAc5C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,uBAAuB,4BAoBrF"}
1
+ {"version":3,"file":"ScribeHeaderAction.d.ts","sourceRoot":"","sources":["../../src/components/ScribeHeaderAction.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAc5C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,uBAAuB,QA8BrF"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { createPortal } from 'react-dom';
6
6
  import { Mic, FileText, Sparkles, Loader2, Pause, Play, Square, Settings2, AlertTriangle, RefreshCw, Trash2, Check } from 'lucide-react';
7
7
  import { Button, toast, Skeleton, Badge, Tabs, TabsList, TabsTrigger, TabsContent, Card, CardContent, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Checkbox, ModalFooter, MarkdownEditor } from '@fayz-ai/ui/primitives';
8
8
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
- import { openAssistantAs, useAgentSurface, registerTimelineSource, useAccessOptional, useAuth, usePublishAssistantActivity, useRegisterAssistantLauncher, resolveFayzAgentConnection } from '@fayz-ai/admin';
9
+ import { openAssistantAs, useAgentSurface, registerTimelineSource, useAccessOptional, useHeaderAction, useAuth, usePublishAssistantActivity, useRegisterAssistantLauncher, resolveFayzAgentConnection } from '@fayz-ai/admin';
10
10
  import { SubpageHeader } from '@fayz-ai/ui/layout';
11
11
 
12
12
  // src/index.ts
@@ -2631,22 +2631,24 @@ function statusLabel(status) {
2631
2631
  };
2632
2632
  return map[status] ?? status;
2633
2633
  }
2634
- function ScribeHeaderAction({ labels, item, embedded }) {
2634
+ function ScribeHeaderAction({ labels, item, entityId }) {
2635
2635
  const subjectId = item?.personId ?? item?.id;
2636
2636
  const subjectName = item?.name ?? item?.full_name;
2637
2637
  const { entitled } = useAccessOptional();
2638
- if (!subjectId) return null;
2639
- if (!entitled("scribe")) return null;
2640
- if (!isCaptureSupported()) return null;
2641
- return /* @__PURE__ */ jsx(
2642
- ScribeStartButton,
2643
- {
2644
- labels,
2645
- variant: "outline",
2646
- size: embedded ? "sm" : "sm",
2647
- onStart: () => startScribeSession({ subjectId, subjectName })
2648
- }
2638
+ const busy = useScribeStore((s) => s.state === "recording" || s.state === "paused" || s.state === "interrupted" || s.state === "requesting");
2639
+ const available = !!subjectId && entitled("scribe") && isCaptureSupported();
2640
+ useHeaderAction(
2641
+ entityId ? `${entityId}.detail.header.actions` : "",
2642
+ available ? {
2643
+ id: "scribe-start",
2644
+ label: labels.start,
2645
+ icon: Mic,
2646
+ intent: "secondary",
2647
+ disabled: busy,
2648
+ onSelect: () => startScribeSession({ subjectId, subjectName })
2649
+ } : null
2649
2650
  );
2651
+ return null;
2650
2652
  }
2651
2653
 
2652
2654
  // src/migrations/index.ts