@arbidocs/blocks 0.4.91 → 0.4.93

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 (34) hide show
  1. package/dist/agents/index.cjs +280 -280
  2. package/dist/agents/index.js +4 -4
  3. package/dist/{chunk-ZPERNIMP.cjs → chunk-2WLXQGWC.cjs} +8 -3
  4. package/dist/chunk-2WLXQGWC.cjs.map +1 -0
  5. package/dist/{chunk-3US5OIDQ.cjs → chunk-3WW32OUU.cjs} +3 -3
  6. package/dist/{chunk-3US5OIDQ.cjs.map → chunk-3WW32OUU.cjs.map} +1 -1
  7. package/dist/{chunk-EHF63UYP.cjs → chunk-AMC5PMJ3.cjs} +5 -5
  8. package/dist/{chunk-EHF63UYP.cjs.map → chunk-AMC5PMJ3.cjs.map} +1 -1
  9. package/dist/{chunk-IC2VHFWR.js → chunk-JJA6GQKH.js} +8 -3
  10. package/dist/chunk-JJA6GQKH.js.map +1 -0
  11. package/dist/{chunk-DDYXFALG.cjs → chunk-MROSCSPW.cjs} +43 -43
  12. package/dist/{chunk-DDYXFALG.cjs.map → chunk-MROSCSPW.cjs.map} +1 -1
  13. package/dist/{chunk-PGDL26TQ.js → chunk-SF4BDUZS.js} +3 -3
  14. package/dist/{chunk-PGDL26TQ.js.map → chunk-SF4BDUZS.js.map} +1 -1
  15. package/dist/{chunk-5NQIBJPP.js → chunk-SJVUKXS6.js} +5 -5
  16. package/dist/{chunk-5NQIBJPP.js.map → chunk-SJVUKXS6.js.map} +1 -1
  17. package/dist/{chunk-5RQOVALO.js → chunk-UO74FLRK.js} +3 -3
  18. package/dist/{chunk-5RQOVALO.js.map → chunk-UO74FLRK.js.map} +1 -1
  19. package/dist/connect/index.cjs +27 -29
  20. package/dist/connect/index.cjs.map +1 -1
  21. package/dist/connect/index.js +7 -9
  22. package/dist/connect/index.js.map +1 -1
  23. package/dist/facts/index.cjs +2 -2
  24. package/dist/facts/index.js +1 -1
  25. package/dist/files/ViewToggle.d.ts +6 -1
  26. package/dist/files/index.cjs +4 -4
  27. package/dist/files/index.js +1 -1
  28. package/dist/index.cjs +315 -315
  29. package/dist/index.js +7 -7
  30. package/dist/workflow-canvas/index.cjs +47 -47
  31. package/dist/workflow-canvas/index.js +4 -4
  32. package/package.json +4 -4
  33. package/dist/chunk-IC2VHFWR.js.map +0 -1
  34. package/dist/chunk-ZPERNIMP.cjs.map +0 -1
@@ -8,14 +8,14 @@ var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
8
8
  var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
9
9
  require('../chunk-2ZDFVRGV.cjs');
10
10
  var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
11
- var chunkEHF63UYP_cjs = require('../chunk-EHF63UYP.cjs');
12
- var chunk3US5OIDQ_cjs = require('../chunk-3US5OIDQ.cjs');
11
+ var chunkAMC5PMJ3_cjs = require('../chunk-AMC5PMJ3.cjs');
12
+ var chunk3WW32OUU_cjs = require('../chunk-3WW32OUU.cjs');
13
13
  var chunkN26CXGXC_cjs = require('../chunk-N26CXGXC.cjs');
14
14
  var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
15
+ require('../chunk-7D737FLE.cjs');
15
16
  require('../chunk-DETZZBG2.cjs');
16
17
  require('../chunk-32HW2Q33.cjs');
17
18
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
18
- require('../chunk-7D737FLE.cjs');
19
19
  var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
20
20
  require('../chunk-ADOKTJHV.cjs');
21
21
  var chunkMP6FK43E_cjs = require('../chunk-MP6FK43E.cjs');
@@ -117,7 +117,7 @@ function ConnectedWorkspaceActivity({
117
117
  [feed.data]
118
118
  );
119
119
  return /* @__PURE__ */ jsxRuntime.jsx(
120
- chunkEHF63UYP_cjs.WorkspaceActivityList,
120
+ chunkAMC5PMJ3_cjs.WorkspaceActivityList,
121
121
  {
122
122
  ...listProps,
123
123
  items,
@@ -143,7 +143,7 @@ function ConnectedWorkspaceNotificationMenu({
143
143
  });
144
144
  if (!workspaceId) return null;
145
145
  return /* @__PURE__ */ jsxRuntime.jsx(
146
- chunkEHF63UYP_cjs.WorkspaceNotificationMenu,
146
+ chunkAMC5PMJ3_cjs.WorkspaceNotificationMenu,
147
147
  {
148
148
  ...menuProps,
149
149
  level,
@@ -162,7 +162,7 @@ function ConnectedThreadFollow({
162
162
  enabled: status === "authenticated"
163
163
  });
164
164
  if (!conversationId) return null;
165
- const Control = as === "menu-item" ? chunkEHF63UYP_cjs.ThreadFollowMenuItem : chunkEHF63UYP_cjs.ThreadFollowButton;
165
+ const Control = as === "menu-item" ? chunkAMC5PMJ3_cjs.ThreadFollowMenuItem : chunkAMC5PMJ3_cjs.ThreadFollowButton;
166
166
  return /* @__PURE__ */ jsxRuntime.jsx(
167
167
  Control,
168
168
  {
@@ -288,7 +288,7 @@ function StreamedArtifact({
288
288
  }
289
289
  var STARTING = /* @__PURE__ */ new Set(["pending", "running"]);
290
290
  function formValues(step, inputs) {
291
- const fields = chunk3US5OIDQ_cjs.stepFields(step);
291
+ const fields = chunk3WW32OUU_cjs.stepFields(step);
292
292
  if (!fields.length) return void 0;
293
293
  if (step.kind === "form")
294
294
  return Object.fromEntries(fields.map((f) => [f.name, inputs[f.name] ?? ""]));
@@ -326,7 +326,7 @@ function useWorkflowThread(workflow, options = {}) {
326
326
  const { wsId } = chunkXMBYDLZQ_cjs.useWorkspaceDocs();
327
327
  const [threadId, setThreadId] = react.useState(options.conversationId);
328
328
  const [localInputs, setLocalInputs] = react.useState(
329
- () => chunk3US5OIDQ_cjs.initialRunInputs(workflow, options.initialInputs)
329
+ () => chunk3WW32OUU_cjs.initialRunInputs(workflow, options.initialInputs)
330
330
  );
331
331
  const [edits, setEdits] = react.useState({});
332
332
  const [localStates, setLocalStates] = react.useState({});
@@ -346,12 +346,12 @@ function useWorkflowThread(workflow, options = {}) {
346
346
  );
347
347
  const conversation = conversations.data?.find((c) => c.external_id === threadId);
348
348
  const steps = react.useMemo(
349
- () => chunk3US5OIDQ_cjs.workflowSteps(workflow).length > 0 ? chunk3US5OIDQ_cjs.workflowSteps(workflow) : chunk3US5OIDQ_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
349
+ () => chunk3WW32OUU_cjs.workflowSteps(workflow).length > 0 ? chunk3WW32OUU_cjs.workflowSteps(workflow) : chunk3WW32OUU_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
350
350
  [workflow, conversation?.plan?.steps]
351
351
  );
352
352
  const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
353
353
  const serverStates = react.useMemo(
354
- () => chunk3US5OIDQ_cjs.stepStatesFromActivity(activity.data ?? []),
354
+ () => chunk3WW32OUU_cjs.stepStatesFromActivity(activity.data ?? []),
355
355
  [activity.data]
356
356
  );
357
357
  const working = steps.some(
@@ -394,7 +394,7 @@ function useWorkflowThread(workflow, options = {}) {
394
394
  async (values, done) => {
395
395
  await ensureWorkspaceOpen();
396
396
  const created = await createWork.mutateAsync({
397
- title: chunk3US5OIDQ_cjs.runThreadTitle(workflow, values).slice(0, 60),
397
+ title: chunk3WW32OUU_cjs.runThreadTitle(workflow, values).slice(0, 60),
398
398
  description: workflow.description || null,
399
399
  prompt: null,
400
400
  skill_ref: null,
@@ -406,7 +406,7 @@ function useWorkflowThread(workflow, options = {}) {
406
406
  criteria: [],
407
407
  max_passes: 3,
408
408
  documents: [],
409
- steps: chunk3US5OIDQ_cjs.toPlanSteps(workflow, {
409
+ steps: chunk3WW32OUU_cjs.toPlanSteps(workflow, {
410
410
  inputs: values,
411
411
  resolveWorkflow: options.resolveWorkflow,
412
412
  compose: options.compose
@@ -493,7 +493,7 @@ function useWorkflowThread(workflow, options = {}) {
493
493
  const anyRunning = Object.values(states).some((s) => s.status === "running");
494
494
  const needsStart = !threadId || idle && !anyRunning;
495
495
  const runError = idle ? conversation?.last_error ?? null : null;
496
- const view = chunk3US5OIDQ_cjs.useWorkflowView({
496
+ const view = chunk3WW32OUU_cjs.useWorkflowView({
497
497
  steps,
498
498
  states,
499
499
  inputs,
@@ -574,7 +574,7 @@ function WorkflowSignDialog({
574
574
  const arbi = react$1.useArbi();
575
575
  const { user, ensureWorkspaceOpen } = chunkMUMH3Z6K_cjs.useConnection();
576
576
  const tools = documentTools.useOptionalDocumentTools();
577
- const { id, version: stepVersion } = chunk3US5OIDQ_cjs.splitDocRef(docRef);
577
+ const { id, version: stepVersion } = chunk3WW32OUU_cjs.splitDocRef(docRef);
578
578
  const [version, setVersion] = react.useState(stepVersion);
579
579
  const [pdf, setPdf] = react.useState(null);
580
580
  const [preparing, setPreparing] = react.useState(false);
@@ -652,7 +652,7 @@ function WorkflowWordDialog({
652
652
  onClose,
653
653
  labels
654
654
  }) {
655
- const { id } = chunk3US5OIDQ_cjs.splitDocRef(docRef);
655
+ const { id } = chunk3WW32OUU_cjs.splitDocRef(docRef);
656
656
  return /* @__PURE__ */ jsxRuntime.jsx(
657
657
  chunkULWRNGGE_cjs.ModalScaffold,
658
658
  {
@@ -675,10 +675,8 @@ function WorkflowReviewGridDialog({
675
675
  const { workspaceId } = chunkMUMH3Z6K_cjs.useConnection();
676
676
  const allTags = react$1.useTags(workspaceId ?? void 0);
677
677
  const all = react$1.useDocuments(workspaceId ?? void 0);
678
- const docs = {
679
- isLoading: all.isLoading,
680
- data: (all.data ?? []).filter((d) => documents.includes(d.external_id))
681
- };
678
+ const isLoading = allTags.isLoading || all.isLoading || all.isFetching && !all.isFetchedAfterMount;
679
+ const docs = (all.data ?? []).filter((d) => documents.includes(d.external_id));
682
680
  const columns = react.useMemo(
683
681
  () => tags.map((id) => ({
684
682
  id,
@@ -696,7 +694,7 @@ function WorkflowReviewGridDialog({
696
694
  showDescription: true,
697
695
  size: "xl",
698
696
  testId: "workflow-review-grid",
699
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "overflow-auto", children: docs.isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
697
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "overflow-auto", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
700
698
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
701
699
  " ",
702
700
  labels.loadingDocument
@@ -712,7 +710,7 @@ function WorkflowReviewGridDialog({
712
710
  c.id
713
711
  ))
714
712
  ] }) }),
715
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: (docs.data ?? []).map((d) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { "data-testid": `workflow-review-grid-row-${d.external_id}`, children: [
713
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: docs.map((d) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { "data-testid": `workflow-review-grid-row-${d.external_id}`, children: [
716
714
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "sticky left-0 z-10 border-b border-border bg-background p-2 align-top", children: /* @__PURE__ */ jsxRuntime.jsx(DocumentName, { onClick: onOpenDocument && (() => onOpenDocument(d.external_id)), children: d.file_name ?? d.external_id }) }),
717
715
  columns.map((c) => {
718
716
  const note = d.doctags?.find((t) => t.tag_ext_id === c.id)?.note;
@@ -826,7 +824,7 @@ function ConnectedWorkflowRunner({
826
824
  () => ({
827
825
  me: user?.externalId,
828
826
  openDocument: onOpenDocument && ((ref) => {
829
- const { id, version } = chunk3US5OIDQ_cjs.splitDocRef(ref);
827
+ const { id, version } = chunk3WW32OUU_cjs.splitDocRef(ref);
830
828
  onOpenDocument(id, version);
831
829
  }),
832
830
  openDraft: onOpenDraft && ((draftId) => onOpenDraft(draftId)),
@@ -836,7 +834,7 @@ function ConnectedWorkflowRunner({
836
834
  const w = state.waiting;
837
835
  if (w?.doc_ext_id) setDialog({ kind: "sign", docRef: w.doc_ext_id });
838
836
  }),
839
- openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunk3US5OIDQ_cjs.splitDocRef(ref).id) ?? "" })),
837
+ openRedline: hostActions?.openRedline ?? ((ref) => setDialog({ kind: "word", docRef: ref, title: nameOfDoc(chunk3WW32OUU_cjs.splitDocRef(ref).id) ?? "" })),
840
838
  openReview: hostActions?.openReview ?? ((tags, documents) => setDialog({ kind: "review", tags, documents }))
841
839
  }),
842
840
  [user?.externalId, onOpenDocument, onOpenDraft, onOpenMessage, hostActions, nameOfDoc, inThread]
@@ -972,7 +970,7 @@ function ConnectedWorkflowRunner({
972
970
  );
973
971
  };
974
972
  const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
975
- chunk3US5OIDQ_cjs.WorkflowRunner,
973
+ chunk3WW32OUU_cjs.WorkflowRunner,
976
974
  {
977
975
  people,
978
976
  ...runnerProps,
@@ -1018,10 +1016,10 @@ function ConnectedWorkflowRunner({
1018
1016
  ) }),
1019
1017
  inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1020
1018
  /* @__PURE__ */ jsxRuntime.jsx(
1021
- chunk3US5OIDQ_cjs.WorkflowStepBar,
1019
+ chunk3WW32OUU_cjs.WorkflowStepBar,
1022
1020
  {
1023
1021
  run: view,
1024
- levels: chunk3US5OIDQ_cjs.stepLevels(view.steps),
1022
+ levels: chunk3WW32OUU_cjs.stepLevels(view.steps),
1025
1023
  doneTitle: (workflow.run.kind === "steps" ? workflow.run.completion?.title : void 0) ?? runnerProps.labels?.complete ?? "Done",
1026
1024
  icon: (key) => key && runnerProps.renderIcon ? runnerProps.renderIcon(key) : void 0,
1027
1025
  tid: (suffix) => `${testIdPrefix}-${suffix}`
@@ -1202,17 +1200,17 @@ function ConnectedTagTable({
1202
1200
  const fail = (e) => setError(e instanceof Error ? e.message : String(e));
1203
1201
  const snapshot = (data) => {
1204
1202
  const title = exportTitle ?? KIND_TITLES[kind];
1205
- const bytes = chunkEHF63UYP_cjs.tagTableDocx(data, {
1203
+ const bytes = chunkAMC5PMJ3_cjs.tagTableDocx(data, {
1206
1204
  title,
1207
1205
  nameOf: (id) => people.find((p) => p.value === id)?.label
1208
1206
  });
1209
1207
  const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
1210
1208
  const name = `${title.replace(/[\\/:*?"<>|]+/g, "-")} (${stamp}).docx`;
1211
- return { blob: new Blob([bytes], { type: chunkEHF63UYP_cjs.DOCX_MIME_TYPE }), name };
1209
+ return { blob: new Blob([bytes], { type: chunkAMC5PMJ3_cjs.DOCX_MIME_TYPE }), name };
1212
1210
  };
1213
1211
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1214
1212
  /* @__PURE__ */ jsxRuntime.jsx(
1215
- chunkEHF63UYP_cjs.TagTable,
1213
+ chunkAMC5PMJ3_cjs.TagTable,
1216
1214
  {
1217
1215
  ...props,
1218
1216
  table,