@arbidocs/blocks 0.5.116 → 0.5.118
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/dist/{ConnectedCallDock-WER7R222.cjs → ConnectedCallDock-E7RMQMMT.cjs} +12 -12
- package/dist/{ConnectedCallDock-WER7R222.cjs.map → ConnectedCallDock-E7RMQMMT.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-T7OBQTYP.cjs → ConnectedCallRoom-FF7X6LQ2.cjs} +12 -12
- package/dist/{ConnectedCallRoom-T7OBQTYP.cjs.map → ConnectedCallRoom-FF7X6LQ2.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-546ILGLW.cjs → ConnectedNativeDocxComparison-PB2LXT5U.cjs} +11 -11
- package/dist/{ConnectedNativeDocxComparison-546ILGLW.cjs.map → ConnectedNativeDocxComparison-PB2LXT5U.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-S2ZFZLZQ.cjs → ConnectedStreamedWordArtifact-S7ICDK5T.cjs} +11 -11
- package/dist/{ConnectedStreamedWordArtifact-S2ZFZLZQ.cjs.map → ConnectedStreamedWordArtifact-S7ICDK5T.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-ZSBZBGFK.cjs → DocumentReviewCard-L472OMQS.cjs} +5 -5
- package/dist/{DocumentReviewCard-ZSBZBGFK.cjs.map → DocumentReviewCard-L472OMQS.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-6UKR5WEF.cjs → FilesViewerDialog-JK25HKKF.cjs} +21 -21
- package/dist/{FilesViewerDialog-6UKR5WEF.cjs.map → FilesViewerDialog-JK25HKKF.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-J3C6VH4T.cjs → WorkspaceTableView-JCTDEMIL.cjs} +8 -8
- package/dist/{WorkspaceTableView-J3C6VH4T.cjs.map → WorkspaceTableView-JCTDEMIL.cjs.map} +1 -1
- package/dist/agents/index.cjs +187 -187
- package/dist/{ai-IM4A23YT.cjs → ai-OBS67QV4.cjs} +16 -16
- package/dist/ai-OBS67QV4.cjs.map +1 -0
- package/dist/calls/index.cjs +2 -2
- package/dist/{chunk-B3LZITVF.cjs → chunk-3LNUQYAF.cjs} +3 -3
- package/dist/{chunk-B3LZITVF.cjs.map → chunk-3LNUQYAF.cjs.map} +1 -1
- package/dist/{chunk-QHOHDNBU.cjs → chunk-5XAJ4N2S.cjs} +4 -4
- package/dist/{chunk-QHOHDNBU.cjs.map → chunk-5XAJ4N2S.cjs.map} +1 -1
- package/dist/{chunk-XKVPSOKP.cjs → chunk-6ULADDBW.cjs} +4 -4
- package/dist/{chunk-XKVPSOKP.cjs.map → chunk-6ULADDBW.cjs.map} +1 -1
- package/dist/{chunk-CPR6EHG7.cjs → chunk-7IPIKMCY.cjs} +3 -3
- package/dist/{chunk-CPR6EHG7.cjs.map → chunk-7IPIKMCY.cjs.map} +1 -1
- package/dist/{chunk-SB4M3ITT.cjs → chunk-CB3YYZAU.cjs} +9 -9
- package/dist/{chunk-SB4M3ITT.cjs.map → chunk-CB3YYZAU.cjs.map} +1 -1
- package/dist/{chunk-6UTKM5AB.cjs → chunk-JSQQV23D.cjs} +3 -3
- package/dist/{chunk-6UTKM5AB.cjs.map → chunk-JSQQV23D.cjs.map} +1 -1
- package/dist/{chunk-VGCTYTEW.cjs → chunk-K6AUKKUN.cjs} +6 -6
- package/dist/{chunk-VGCTYTEW.cjs.map → chunk-K6AUKKUN.cjs.map} +1 -1
- package/dist/{chunk-T23UTIRI.cjs → chunk-KHAO7ZTO.cjs} +5 -5
- package/dist/{chunk-T23UTIRI.cjs.map → chunk-KHAO7ZTO.cjs.map} +1 -1
- package/dist/{chunk-NJCK6V6U.cjs → chunk-L6APDO3Y.cjs} +3 -3
- package/dist/{chunk-NJCK6V6U.cjs.map → chunk-L6APDO3Y.cjs.map} +1 -1
- package/dist/{chunk-NIE3N6OM.cjs → chunk-MMVDVHKE.cjs} +5 -5
- package/dist/{chunk-NIE3N6OM.cjs.map → chunk-MMVDVHKE.cjs.map} +1 -1
- package/dist/{chunk-TDO5UWXF.cjs → chunk-O4F77VSO.cjs} +5 -5
- package/dist/{chunk-TDO5UWXF.cjs.map → chunk-O4F77VSO.cjs.map} +1 -1
- package/dist/{chunk-OEREKAAP.cjs → chunk-OPH4UZQN.cjs} +30 -30
- package/dist/{chunk-OEREKAAP.cjs.map → chunk-OPH4UZQN.cjs.map} +1 -1
- package/dist/{chunk-KTQOGT2L.cjs → chunk-P2MOLUFO.cjs} +6 -6
- package/dist/{chunk-KTQOGT2L.cjs.map → chunk-P2MOLUFO.cjs.map} +1 -1
- package/dist/{chunk-DDIW4HLU.cjs → chunk-PVPRVI54.cjs} +6 -6
- package/dist/{chunk-DDIW4HLU.cjs.map → chunk-PVPRVI54.cjs.map} +1 -1
- package/dist/{chunk-557MJ4IH.cjs → chunk-QOXK5O6M.cjs} +12 -12
- package/dist/{chunk-557MJ4IH.cjs.map → chunk-QOXK5O6M.cjs.map} +1 -1
- package/dist/{chunk-Y24V6HPR.cjs → chunk-SUYPXUE6.cjs} +4 -4
- package/dist/{chunk-Y24V6HPR.cjs.map → chunk-SUYPXUE6.cjs.map} +1 -1
- package/dist/{chunk-R7CJEIA5.cjs → chunk-XZYIS2JZ.cjs} +3 -3
- package/dist/{chunk-R7CJEIA5.cjs.map → chunk-XZYIS2JZ.cjs.map} +1 -1
- package/dist/{chunk-HB2O4THB.cjs → chunk-YDPLSXHB.cjs} +4 -4
- package/dist/{chunk-HB2O4THB.cjs.map → chunk-YDPLSXHB.cjs.map} +1 -1
- package/dist/{chunk-B2HNNG25.cjs → chunk-ZCIQBHH5.cjs} +35 -35
- package/dist/{chunk-B2HNNG25.cjs.map → chunk-ZCIQBHH5.cjs.map} +1 -1
- package/dist/connect/docx.cjs +14 -14
- package/dist/connect/index.cjs +625 -625
- package/dist/connect/viewer.cjs +11 -11
- package/dist/dashboards/index.cjs +1 -1
- package/dist/embed/index.cjs +21 -21
- package/dist/index.cjs +316 -316
- package/dist/settings/index.cjs +147 -147
- package/dist/shell/index.cjs +35 -35
- package/dist/studio/index.cjs +8 -8
- package/dist/workflow-canvas/index.cjs +27 -27
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-T6K2QYNZ.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-U4JZVSOE.js +1 -1
- package/package.json +5 -5
- package/dist/ai-IM4A23YT.cjs.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk7JLJH5CW_cjs = require('./chunk-7JLJH5CW.cjs');
|
|
5
|
-
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
6
5
|
var chunkQRAQZTJE_cjs = require('./chunk-QRAQZTJE.cjs');
|
|
6
|
+
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
7
7
|
var chunkTKHCIHE2_cjs = require('./chunk-TKHCIHE2.cjs');
|
|
8
8
|
var react = require('@arbidocs/react');
|
|
9
9
|
var react$1 = require('react');
|
|
@@ -189,5 +189,5 @@ exports.useUsableSkillListings = useUsableSkillListings;
|
|
|
189
189
|
exports.useWorkflowDefinitions = useWorkflowDefinitions;
|
|
190
190
|
exports.useWorkflowTasks = useWorkflowTasks;
|
|
191
191
|
exports.withoutMarketplace = withoutMarketplace;
|
|
192
|
-
//# sourceMappingURL=chunk-
|
|
193
|
-
//# sourceMappingURL=chunk-
|
|
192
|
+
//# sourceMappingURL=chunk-JSQQV23D.cjs.map
|
|
193
|
+
//# sourceMappingURL=chunk-JSQQV23D.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts","../src/connection/workflows/useWorkflowTasks.ts"],"names":["useArbiSession","useUserSettings","useHost","useMemo","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK","useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate"],"mappings":";;;;;;;;;;;AASO,IAAM,iBAAA,GAAoB,CAAC,IAAA,KAChC,CAAC,CAAC,SAAS,IAAA,CAAK,qBAAA,KAA0B,IAAA,IAAQ,IAAA,CAAK,SAAA,KAAc,UAAA;AAMhE,SAAS,oBAAA,GAAgC;AAC9C,EAAA,OAAO,iBAAA,CAAkBA,oBAAA,EAAe,CAAE,IAAI,CAAA;AAChD;AAGO,IAAM,kBAAA,GAAqB,CAA2C,QAAA,KAC3E,QAAA,CAAS,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,KAAe,QAAQ;ACZ3C,SAAS,gBAAA,GAA4B;AAC1C,EAAA,MAAM,EAAE,IAAA,EAAM,YAAA,EAAa,GAAIC,qBAAA,EAAgB;AAC/C,EAAA,OAAO,cAAc,WAAA,IAAe,KAAA;AACtC;AAMO,SAAS,kBAAA,GAA8B;AAC5C,EAAA,MAAM,gBAAgB,gBAAA,EAAiB;AACvC,EAAA,MAAM,aAAa,oBAAA,EAAqB;AACxC,EAAA,OAAO,iBAAiB,CAAC,UAAA;AAC3B;ACbA,IAAM,kBAAA,GAAqB,uBAAA;AAE3B,IAAM,WAAgC,EAAC;AAEhC,SAAS,aAAA,GAAqC;AACnD,EAAA,MAAM,KAAA,GAAQC,yBAAA,EAAQ,CAAE,SAAA,EAAW,UAAA;AACnC,EAAA,OAAOC,eAAA,CAAQ,MAAO,K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AAA,GACrB;AAGA,EAAA,MAAM,cAAA,GAAiBJ,mBAAA;AAAA,IACrB,OACE,UAGA,GAAA,KACG;AACH,MAAA,MAAM,KAAA,GAAQK,0CAAA,CAAyB,EAAE,GAAG,GAAA,EAAK,gBAAgB,IAAA,EAAM,GAAA,CAAI,IAAA,IAAQ,IAAA,EAAM,CAAA;AAEzF,MAAA,IAAI,QAAA,CAAS,QAAA,KAAa,KAAA,EAAO,OAAO,KAAA,CAAM,MAAA;AAC9C,MAAA,MAAM,WAAA,GAAc,SAAS,gBAAA,IAAoB,iBAAA;AACjD,MAAA,MAAM,OAAA,GAAU,MAAM,sBAAA,CAAuB,WAAA,CAAY;AAAA,QACvD,YAAY,QAAA,CAAS,WAAA;AAAA,QACrB;AAAA,OACD,CAAA;AAED,MAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,YAAA,IAAgB,KAAA,CAAM,gBAAgB,QAAA,CAAS,YAAA;AACvE,MAAA,IACE,QAAQ,SAAA,KAAc,qBAAA,IACtB,CAAC,OAAA,CAAQ,SAAA,IACT,WACA,WAAA,EACA;AACA,QAAA,MAAM,gBAAA,CAAiB,SAAS,WAAW,CAAA;AAAA,MAC7C;AAAA,IACF,CAAA;AAAA,IACA,CAAC,iBAAA,EAAmB,cAAA,EAAgB,gBAAA,EAAkB,sBAAsB;AAAA,GAC9E;AAEA,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA,EACE,WAAW,SAAA,IACX,UAAA,CAAW,aACX,cAAA,CAAe,SAAA,IACf,kBAAA,CAAmB,SAAA,IACnB,sBAAA,CAAuB;AAAA,GAC3B;AACF","file":"chunk-6UTKM5AB.cjs","sourcesContent":["import { useArbiSession } from '@arbidocs/react'\n\n/** The account fields that say it is an external one. */\ninterface AccountKind {\n temporary_access_only?: boolean | null\n user_type?: string | null\n}\n\n/** An external account: temporary access to shared workspaces only. */\nexport const isExternalAccount = (user: AccountKind | null | undefined): boolean =>\n !!user && (user.temporary_access_only === true || user.user_type === 'external')\n\n/**\n * Whether the signed-in person is an external guest. They get the built-in skills and the host's\n * skill packs, never the marketplace (the backend enforces it as well).\n */\nexport function useIsExternalAccount(): boolean {\n return isExternalAccount(useArbiSession().user)\n}\n\n/** Skill listings without the marketplace's (`visibility: global`): what an external guest gets. */\nexport const withoutMarketplace = <T extends { visibility?: string | null }>(listings: T[]): T[] =>\n listings.filter((s) => s.visibility !== 'global')\n","/**\n * The one gate for everything skill-shaped in the app: the empty chat's Start list, the skill\n * entries of the slash menu, the sidebar's Skills item, the Skills browser's entry points and the\n * typed `/skill` interception. It is the personal `show_skills` user setting, default off; the\n * switch lives in Settings, Experimental (developers only), so today only developers have it.\n */\n\nimport { useUserSettings } from '@arbidocs/react'\nimport { useIsExternalAccount } from '../useIsExternalAccount'\n\nexport function useSkillsEnabled(): boolean {\n const { data: userSettings } = useUserSettings()\n return userSettings?.show_skills ?? false\n}\n\n/**\n * Whether the Skills browser (the marketplace: \"Browse skills\", the Skills menu entry) is offered:\n * to skills users, never to an external guest (the backend enforces it as well).\n */\nexport function useCanBrowseSkills(): boolean {\n const skillsEnabled = useSkillsEnabled()\n const isExternal = useIsExternalAccount()\n return skillsEnabled && !isExternal\n}\n","/**\n * The host's skill packs (`host.workflows.skillPacks`) as the kit's workflows, and the `/` menu's\n * rows for them: one section per heading (a category, else a pack's label).\n */\nimport { useMemo } from 'react'\nimport { skillPackWorkflows, type SkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { useHost } from '../../provider/host'\n\n/** The section heading of a pack without a label or category. */\nconst DEFAULT_PACK_LABEL = 'Skills from this site'\n\nconst NO_PACKS: SkillPackWorkflow[] = []\n\nexport function useHostSkills(): SkillPackWorkflow[] {\n const packs = useHost().workflows?.skillPacks\n return useMemo(() => (packs?.length ? packs.flatMap(skillPackWorkflows) : NO_PACKS), [packs])\n}\n\n/**\n * A pack skill's `/` menu row. Its section is its heading (its category, else its pack's label), so\n * skills of several packs under one heading share one section.\n */\nexport function hostSkillItem(workflow: SkillPackWorkflow): SlashMenuItem {\n const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL\n return {\n name: workflow.id,\n description: workflow.description,\n kind: 'skill',\n group: { id: `pack-${label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`, label },\n }\n}\n","import { useMemo } from 'react'\nimport { useAssistantCopy } from '@arbidocs/react/shell'\nimport { nameBuiltinWorkflows } from '../../agents/workflows/catalogue/seed'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\n\n/** The seeded workflows in the host's assistant name (`nameBuiltinWorkflows`). */\nexport function useNamedWorkflows(\n workflows: ReadonlyArray<WorkflowDefinition>\n): WorkflowDefinition[] {\n const copy = useAssistantCopy()\n return useMemo(() => nameBuiltinWorkflows(workflows, copy), [workflows, copy])\n}\n","/**\n * The one list of workflows: the seeded ones plus every skill the user can invoke (each degraded\n * to a single-field form from its `arg_hint`). The dashboard tiles, the slash menu, tasks and\n * agents all read this.\n */\n\nimport { useMemo } from 'react'\nimport { useSkills } from '@arbidocs/react'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport {\n CUSTOM_TASK,\n DASHBOARD_OPERATIONS,\n DASHBOARD_PINNED,\n REMIND_TASK,\n} from '../../agents/workflows/catalogue/seed'\nimport { useSkillsEnabled } from './useSkillsEnabled'\nimport { useHostSkills } from './useHostSkills'\nimport { useIsExternalAccount, withoutMarketplace } from '../useIsExternalAccount'\nimport { sortByRecentUse, useWorkflowUsage } from '../../agents/workflows/catalogue/workflow-usage'\nimport { WEB_WORKFLOWS } from '../../agents/workflows/catalogue/registry'\nimport { useNamedWorkflows } from './useNamedWorkflows'\n\nexport interface UseWorkflowDefinitionsResult {\n /**\n * Every skill workflow of this host: built-ins, the host's skill packs, then the user's and the\n * marketplace's (one list).\n */\n skills: WorkflowDefinition[]\n /** The user has skills switched on (`show_skills`): the gate of every skill-shaped surface. */\n skillsEnabled: boolean\n /**\n * The empty chat's Start section: built-ins first (their own order), then the user's own and\n * marketplace skills by recent use, then name. EMPTY for users without skills enabled.\n */\n start: WorkflowDefinition[]\n /** The dashboard Start band: pinned skills in order, then the operation launchers. */\n dashboard: WorkflowDefinition[]\n /** What a task can run: schedulable skills plus a free instruction and a reminder. */\n forTasks: WorkflowDefinition[]\n}\n\n/**\n * The skill listings a person may use from the menus: a host pack's slug is the pack's (an\n * installed copy is the same skill), and an external guest gets no marketplace skills.\n */\nexport function useUsableSkillListings(hostSkills: ReadonlyArray<WorkflowDefinition>) {\n const { data: listings } = useSkills()\n const isExternal = useIsExternalAccount()\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n const usable = (listings ?? []).filter((s) => !packSlugs.has(s.slug))\n return isExternal ? withoutMarketplace(usable) : usable\n }, [listings, hostSkills, isExternal])\n}\n\nexport function useWorkflowDefinitions(): UseWorkflowDefinitionsResult {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const usage = useWorkflowUsage()\n const skillsEnabled = useSkillsEnabled()\n const web = useNamedWorkflows(WEB_WORKFLOWS)\n const operations = useNamedWorkflows(DASHBOARD_OPERATIONS)\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n // An uploaded skill of a built-in's slug is used instead of it.\n const { host: builtins, skills: fromServer } = mergeSkillWorkflows(\n web.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n // The host's packs sit with the built-ins; they are listed in the menus, not in Start.\n const all = [...builtins, ...hostSkills, ...fromServer]\n const byId = new Map(all.map((w) => [w.id, w]))\n const pinned = DASHBOARD_PINNED.flatMap((id) => {\n const w = byId.get(id)\n return w ? [w] : []\n })\n return {\n skills: all,\n skillsEnabled,\n start: skillsEnabled ? [...builtins, ...sortByRecentUse(fromServer, usage)] : [],\n dashboard: [...pinned, ...operations],\n forTasks: [CUSTOM_TASK, ...all.filter((w) => w.schedulable), REMIND_TASK],\n }\n }, [hostSkills, listings, usage, skillsEnabled, web, operations])\n}\n","/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // Standing access for a workflow's agent, so its unattended runs can read the workspace. An agent\n // that is already a member makes the server refuse the re-grant: that is no failure here.\n const { mutateAsync: grant } = useGrantAgentAccess()\n const grantAgentAccess = useCallback(\n (agentExtId: string, workspaceId: string) =>\n grant({ agentExtId, workspaceId }).then(\n () => undefined,\n () => undefined\n ),\n [grant]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n // Keep access: deposit the key for the agent the server assigned (the Assistant when none was\n // picked), while the owner is here, so unattended runs start on their own.\n const workspaceId = workflow.workspace_ext_id ?? request.body.workspace_ext_id\n if (\n workflow.auth_mode === 'scheduled_permanent' &&\n !workflow.on_demand &&\n workflow.agent_ext_id &&\n workspaceId\n ) {\n await grantAgentAccess(workflow.agent_ext_id, workspaceId)\n }\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n grantAgentAccess,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // The agent the server keeps (the Assistant when none was picked) gets the key for unattended runs.\n const agentId = updated.agent_ext_id ?? patch.agent_ext_id ?? workflow.agent_ext_id\n if (\n updated.auth_mode === 'scheduled_permanent' &&\n !updated.on_demand &&\n agentId &&\n workspaceId\n ) {\n await grantAgentAccess(agentId, workspaceId)\n }\n },\n [activeWorkspaceId, documentTitles, grantAgentAccess, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts","../src/connection/workflows/useWorkflowTasks.ts"],"names":["useArbiSession","useUserSettings","useHost","useMemo","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK","useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate"],"mappings":";;;;;;;;;;;AASO,IAAM,iBAAA,GAAoB,CAAC,IAAA,KAChC,CAAC,CAAC,SAAS,IAAA,CAAK,qBAAA,KAA0B,IAAA,IAAQ,IAAA,CAAK,SAAA,KAAc,UAAA;AAMhE,SAAS,oBAAA,GAAgC;AAC9C,EAAA,OAAO,iBAAA,CAAkBA,oBAAA,EAAe,CAAE,IAAI,CAAA;AAChD;AAGO,IAAM,kBAAA,GAAqB,CAA2C,QAAA,KAC3E,QAAA,CAAS,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,KAAe,QAAQ;ACZ3C,SAAS,gBAAA,GAA4B;AAC1C,EAAA,MAAM,EAAE,IAAA,EAAM,YAAA,EAAa,GAAIC,qBAAA,EAAgB;AAC/C,EAAA,OAAO,cAAc,WAAA,IAAe,KAAA;AACtC;AAMO,SAAS,kBAAA,GAA8B;AAC5C,EAAA,MAAM,g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AAA,IACX,UAAA,CAAW,aACX,cAAA,CAAe,SAAA,IACf,kBAAA,CAAmB,SAAA,IACnB,sBAAA,CAAuB;AAAA,GAC3B;AACF","file":"chunk-JSQQV23D.cjs","sourcesContent":["import { useArbiSession } from '@arbidocs/react'\n\n/** The account fields that say it is an external one. */\ninterface AccountKind {\n temporary_access_only?: boolean | null\n user_type?: string | null\n}\n\n/** An external account: temporary access to shared workspaces only. */\nexport const isExternalAccount = (user: AccountKind | null | undefined): boolean =>\n !!user && (user.temporary_access_only === true || user.user_type === 'external')\n\n/**\n * Whether the signed-in person is an external guest. They get the built-in skills and the host's\n * skill packs, never the marketplace (the backend enforces it as well).\n */\nexport function useIsExternalAccount(): boolean {\n return isExternalAccount(useArbiSession().user)\n}\n\n/** Skill listings without the marketplace's (`visibility: global`): what an external guest gets. */\nexport const withoutMarketplace = <T extends { visibility?: string | null }>(listings: T[]): T[] =>\n listings.filter((s) => s.visibility !== 'global')\n","/**\n * The one gate for everything skill-shaped in the app: the empty chat's Start list, the skill\n * entries of the slash menu, the sidebar's Skills item, the Skills browser's entry points and the\n * typed `/skill` interception. It is the personal `show_skills` user setting, default off; the\n * switch lives in Settings, Experimental (developers only), so today only developers have it.\n */\n\nimport { useUserSettings } from '@arbidocs/react'\nimport { useIsExternalAccount } from '../useIsExternalAccount'\n\nexport function useSkillsEnabled(): boolean {\n const { data: userSettings } = useUserSettings()\n return userSettings?.show_skills ?? false\n}\n\n/**\n * Whether the Skills browser (the marketplace: \"Browse skills\", the Skills menu entry) is offered:\n * to skills users, never to an external guest (the backend enforces it as well).\n */\nexport function useCanBrowseSkills(): boolean {\n const skillsEnabled = useSkillsEnabled()\n const isExternal = useIsExternalAccount()\n return skillsEnabled && !isExternal\n}\n","/**\n * The host's skill packs (`host.workflows.skillPacks`) as the kit's workflows, and the `/` menu's\n * rows for them: one section per heading (a category, else a pack's label).\n */\nimport { useMemo } from 'react'\nimport { skillPackWorkflows, type SkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { useHost } from '../../provider/host'\n\n/** The section heading of a pack without a label or category. */\nconst DEFAULT_PACK_LABEL = 'Skills from this site'\n\nconst NO_PACKS: SkillPackWorkflow[] = []\n\nexport function useHostSkills(): SkillPackWorkflow[] {\n const packs = useHost().workflows?.skillPacks\n return useMemo(() => (packs?.length ? packs.flatMap(skillPackWorkflows) : NO_PACKS), [packs])\n}\n\n/**\n * A pack skill's `/` menu row. Its section is its heading (its category, else its pack's label), so\n * skills of several packs under one heading share one section.\n */\nexport function hostSkillItem(workflow: SkillPackWorkflow): SlashMenuItem {\n const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL\n return {\n name: workflow.id,\n description: workflow.description,\n kind: 'skill',\n group: { id: `pack-${label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`, label },\n }\n}\n","import { useMemo } from 'react'\nimport { useAssistantCopy } from '@arbidocs/react/shell'\nimport { nameBuiltinWorkflows } from '../../agents/workflows/catalogue/seed'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\n\n/** The seeded workflows in the host's assistant name (`nameBuiltinWorkflows`). */\nexport function useNamedWorkflows(\n workflows: ReadonlyArray<WorkflowDefinition>\n): WorkflowDefinition[] {\n const copy = useAssistantCopy()\n return useMemo(() => nameBuiltinWorkflows(workflows, copy), [workflows, copy])\n}\n","/**\n * The one list of workflows: the seeded ones plus every skill the user can invoke (each degraded\n * to a single-field form from its `arg_hint`). The dashboard tiles, the slash menu, tasks and\n * agents all read this.\n */\n\nimport { useMemo } from 'react'\nimport { useSkills } from '@arbidocs/react'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport {\n CUSTOM_TASK,\n DASHBOARD_OPERATIONS,\n DASHBOARD_PINNED,\n REMIND_TASK,\n} from '../../agents/workflows/catalogue/seed'\nimport { useSkillsEnabled } from './useSkillsEnabled'\nimport { useHostSkills } from './useHostSkills'\nimport { useIsExternalAccount, withoutMarketplace } from '../useIsExternalAccount'\nimport { sortByRecentUse, useWorkflowUsage } from '../../agents/workflows/catalogue/workflow-usage'\nimport { WEB_WORKFLOWS } from '../../agents/workflows/catalogue/registry'\nimport { useNamedWorkflows } from './useNamedWorkflows'\n\nexport interface UseWorkflowDefinitionsResult {\n /**\n * Every skill workflow of this host: built-ins, the host's skill packs, then the user's and the\n * marketplace's (one list).\n */\n skills: WorkflowDefinition[]\n /** The user has skills switched on (`show_skills`): the gate of every skill-shaped surface. */\n skillsEnabled: boolean\n /**\n * The empty chat's Start section: built-ins first (their own order), then the user's own and\n * marketplace skills by recent use, then name. EMPTY for users without skills enabled.\n */\n start: WorkflowDefinition[]\n /** The dashboard Start band: pinned skills in order, then the operation launchers. */\n dashboard: WorkflowDefinition[]\n /** What a task can run: schedulable skills plus a free instruction and a reminder. */\n forTasks: WorkflowDefinition[]\n}\n\n/**\n * The skill listings a person may use from the menus: a host pack's slug is the pack's (an\n * installed copy is the same skill), and an external guest gets no marketplace skills.\n */\nexport function useUsableSkillListings(hostSkills: ReadonlyArray<WorkflowDefinition>) {\n const { data: listings } = useSkills()\n const isExternal = useIsExternalAccount()\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n const usable = (listings ?? []).filter((s) => !packSlugs.has(s.slug))\n return isExternal ? withoutMarketplace(usable) : usable\n }, [listings, hostSkills, isExternal])\n}\n\nexport function useWorkflowDefinitions(): UseWorkflowDefinitionsResult {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const usage = useWorkflowUsage()\n const skillsEnabled = useSkillsEnabled()\n const web = useNamedWorkflows(WEB_WORKFLOWS)\n const operations = useNamedWorkflows(DASHBOARD_OPERATIONS)\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n // An uploaded skill of a built-in's slug is used instead of it.\n const { host: builtins, skills: fromServer } = mergeSkillWorkflows(\n web.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n // The host's packs sit with the built-ins; they are listed in the menus, not in Start.\n const all = [...builtins, ...hostSkills, ...fromServer]\n const byId = new Map(all.map((w) => [w.id, w]))\n const pinned = DASHBOARD_PINNED.flatMap((id) => {\n const w = byId.get(id)\n return w ? [w] : []\n })\n return {\n skills: all,\n skillsEnabled,\n start: skillsEnabled ? [...builtins, ...sortByRecentUse(fromServer, usage)] : [],\n dashboard: [...pinned, ...operations],\n forTasks: [CUSTOM_TASK, ...all.filter((w) => w.schedulable), REMIND_TASK],\n }\n }, [hostSkills, listings, usage, skillsEnabled, web, operations])\n}\n","/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // Standing access for a workflow's agent, so its unattended runs can read the workspace. An agent\n // that is already a member makes the server refuse the re-grant: that is no failure here.\n const { mutateAsync: grant } = useGrantAgentAccess()\n const grantAgentAccess = useCallback(\n (agentExtId: string, workspaceId: string) =>\n grant({ agentExtId, workspaceId }).then(\n () => undefined,\n () => undefined\n ),\n [grant]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n // Keep access: deposit the key for the agent the server assigned (the Assistant when none was\n // picked), while the owner is here, so unattended runs start on their own.\n const workspaceId = workflow.workspace_ext_id ?? request.body.workspace_ext_id\n if (\n workflow.auth_mode === 'scheduled_permanent' &&\n !workflow.on_demand &&\n workflow.agent_ext_id &&\n workspaceId\n ) {\n await grantAgentAccess(workflow.agent_ext_id, workspaceId)\n }\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n grantAgentAccess,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // The agent the server keeps (the Assistant when none was picked) gets the key for unattended runs.\n const agentId = updated.agent_ext_id ?? patch.agent_ext_id ?? workflow.agent_ext_id\n if (\n updated.auth_mode === 'scheduled_permanent' &&\n !updated.on_demand &&\n agentId &&\n workspaceId\n ) {\n await grantAgentAccess(agentId, workspaceId)\n }\n },\n [activeWorkspaceId, documentTitles, grantAgentAccess, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n"]}
|
|
@@ -6,14 +6,14 @@ var chunkV3KLUWQQ_cjs = require('./chunk-V3KLUWQQ.cjs');
|
|
|
6
6
|
var chunkP5AQYC4D_cjs = require('./chunk-P5AQYC4D.cjs');
|
|
7
7
|
var chunkWAV762GP_cjs = require('./chunk-WAV762GP.cjs');
|
|
8
8
|
var chunkVKH3BEZE_cjs = require('./chunk-VKH3BEZE.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkXZYIS2JZ_cjs = require('./chunk-XZYIS2JZ.cjs');
|
|
10
10
|
var chunk3YEXZX4H_cjs = require('./chunk-3YEXZX4H.cjs');
|
|
11
11
|
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
12
|
+
var chunkQGVOT7E4_cjs = require('./chunk-QGVOT7E4.cjs');
|
|
13
|
+
var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
|
|
12
14
|
var chunkHQDR43JC_cjs = require('./chunk-HQDR43JC.cjs');
|
|
13
15
|
var chunkJR2YSBD5_cjs = require('./chunk-JR2YSBD5.cjs');
|
|
14
16
|
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
15
|
-
var chunkQGVOT7E4_cjs = require('./chunk-QGVOT7E4.cjs');
|
|
16
|
-
var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
|
|
17
17
|
var chunkTKHCIHE2_cjs = require('./chunk-TKHCIHE2.cjs');
|
|
18
18
|
var chunkLJJJ6CYH_cjs = require('./chunk-LJJJ6CYH.cjs');
|
|
19
19
|
var react$1 = require('react');
|
|
@@ -145,7 +145,7 @@ function ConnectedWorkflowsTable({
|
|
|
145
145
|
await act(workflow, () => remove.mutateAsync(workflow.external_id));
|
|
146
146
|
};
|
|
147
147
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
-
|
|
148
|
+
chunkXZYIS2JZ_cjs.WorkflowsTable,
|
|
149
149
|
{
|
|
150
150
|
...tableProps,
|
|
151
151
|
workflows,
|
|
@@ -486,5 +486,5 @@ exports.useConnectedNativeDocxAdapter = useConnectedNativeDocxAdapter;
|
|
|
486
486
|
exports.useConnectedWorkspaceRole = useConnectedWorkspaceRole;
|
|
487
487
|
exports.useDocxCommentTarget = useDocxCommentTarget;
|
|
488
488
|
exports.useNativeDocxSupport = useNativeDocxSupport;
|
|
489
|
-
//# sourceMappingURL=chunk-
|
|
490
|
-
//# sourceMappingURL=chunk-
|
|
489
|
+
//# sourceMappingURL=chunk-K6AUKKUN.cjs.map
|
|
490
|
+
//# sourceMappingURL=chunk-K6AUKKUN.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useConnectedWorkspace","useWorkspaceUsers","fmtDate","useBlocksEnvironment","useOpenWorkflow","useMemo","workflowSteps","useWorkflows","useConnectedConversations","useAgents","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","useState","isScheduledWorkflow","useEffect","jsx","WorkflowsTable","workflowSignal","workflowTriggerType","toWorkflowFieldDocument","DocumentPicker","useArbi","useListedDocuments","useRef","buildDeepLinkUrl","parseDeepLinkPath","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","isCandidate","useRegisterOpenDocument","jsxs","NativeDocxEditor","useQueryClient","useOptionalDocumentTools","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACIO,SAAS,yBAAA,GAA4B;AAC1C,EAAA,MAAM,EAAE,WAAA,EAAa,IAAA,EAAM,MAAA,EAAQ,mBAAA,KAAwBC,uCAAA,EAAsB;AACjF,EAAA,MAAM,EAAE,MAAM,OAAA,GAAU,IAAG,GAAIC,uBAAA,CAAkB,eAAe,MAAA,EAAW;AAAA,IACzE,OAAA,EAAS,IAAA,IAAQ,CAAC,CAAC,WAAA;AAAA,IACnB,WAAA,EAAa;AAAA,GACd,CAAA;AACD,EAAA,MAAM,IAAA,GAAO,QAAQ,IAAA,CAAK,CAAC,MAAM,CAAA,CAAE,IAAA,CAAK,WAAA,KAAgB,MAAM,CAAA,EAAG,IAAA;AACjE,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,IAAA;AAAA;AAAA,IAEA,aAAA,EAAe,IAAA,KAAS,OAAA,IAAW,IAAA,KAAS,cAAA;AAAA;AAAA,IAE5C,kBAAkB,IAAA,KAAS;AAAA,GAC7B;AACF;AAmBO,IAAM,wCAAA,GAA0E;AAAA,EACrF,YAAA,EAAc,+BAAA;AAAA,EACd,WAAA,EAAa,iBAAA;AAAA,EACb,SAAA,EAAW,CAAC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,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-VGCTYTEW.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n *\n * The host's catalogue (the host configuration's `workflows.catalogue`), when it has one, is listed\n * in its categories above the saved workflows: an entry opens in the builder (`onOpenTemplate`) or\n * runs (the environment's `openWorkflow(id, { view: 'run' })`). A filtered list (`filter`) is about\n * saved workflows only and leaves the catalogue out.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport type { WorkflowCatalogueRow } from '../agents/tasks/WorkflowCatalogueSections'\nimport {\n isScheduledWorkflow,\n workflowSignal,\n workflowTriggerType,\n} from '../agents/tasks/workflowRows'\nimport { workflowSteps } from '../agents/workflows/run'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useOpenWorkflow } from './workflows/useOpenWorkflow'\nimport { useHost } from '../provider/host'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n /** When a workflow that starts on a step signal starts (the default trigger text). */\n signalTrigger: (signal: string) => string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n signalTrigger: (signal) => `When a step signals ${signal}`,\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n | 'catalogue'\n | 'categories'\n | 'renderIcon'\n> {\n /**\n * Which saved workflows to list: `scheduled` (those that start on a date or a repeat), or a\n * predicate. Default: all.\n */\n filter?: 'scheduled' | ((workflow: WorkflowResponse) => boolean)\n /**\n * When a workflow starts, in the host's words. Default: the step signal it starts on, else its\n * trigger type.\n */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger,\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n onRunTemplate,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const openWorkflow = useOpenWorkflow()\n const host = useHost().workflows\n // A filtered list (the scheduled workflows) is about saved workflows only.\n const catalogueEntries = filter ? undefined : host?.catalogue\n const catalogue = useMemo(\n () =>\n catalogueEntries?.map(({ workflow, category, note, runnable }): WorkflowCatalogueRow => ({\n id: workflow.id,\n title: workflow.title,\n description: workflow.description,\n icon: workflow.icon,\n category,\n stepCount: workflowSteps(workflow).length,\n note,\n runnable,\n })),\n [catalogueEntries]\n )\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => {\n const keep = filter === 'scheduled' ? isScheduledWorkflow : filter\n return keep ? saved.filter(keep) : saved\n }, [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={\n describeTrigger ??\n ((w) => {\n const signal = workflowSignal(w)\n return signal ? l.signalTrigger(signal) : workflowTriggerType(w).replaceAll('_', ' ')\n })\n }\n catalogue={catalogue}\n categories={host?.categories}\n renderIcon={host?.renderIcon}\n onRunTemplate={onRunTemplate ?? (openWorkflow && ((id) => openWorkflow(id, { view: 'run' })))}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/content-path'\nimport type { HouseTemplate, HouseTemplateHost } from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n // The built-in template comes with the Word editor's template code: loaded on demand.\n return (await import('../../docx/template/HouseTemplate')).builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport type { NativeDocxAdapter, NativeDocxEditorProps } from '../../docx/NativeDocxEditor'\nimport { NativeDocxEditor } from '../../docx/lazy'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter' | 'compact'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => import('../../docx/fonts').then((m) => m.loadDocxFonts(fontBaseUrl)),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id, version) => {\n if (onDocumentsChanged) await onDocumentsChanged([id], 'version')\n if (version || !onDocumentsChanged) {\n const fresh = await refreshDocuments(queries, arbi, [id])\n if (\n version &&\n !fresh.some((doc) => doc.external_id === id && (doc.current_version ?? 0) >= version)\n ) {\n throw new Error(\n 'The version was saved, but its current status could not be confirmed. Please try again.'\n )\n }\n }\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useConnectedWorkspace","useWorkspaceUsers","fmtDate","useBlocksEnvironment","useOpenWorkflow","useMemo","workflowSteps","useWorkflows","useConnectedConversations","useAgents","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","useState","isScheduledWorkflow","useEffect","jsx","WorkflowsTable","workflowSignal","workflowTriggerType","toWorkflowFieldDocument","DocumentPicker","useArbi","useListedDocuments","useRef","buildDeepLinkUrl","parseDeepLinkPath","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","isCandidate","useRegisterOpenDoc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QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-K6AUKKUN.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n *\n * The host's catalogue (the host configuration's `workflows.catalogue`), when it has one, is listed\n * in its categories above the saved workflows: an entry opens in the builder (`onOpenTemplate`) or\n * runs (the environment's `openWorkflow(id, { view: 'run' })`). A filtered list (`filter`) is about\n * saved workflows only and leaves the catalogue out.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport type { WorkflowCatalogueRow } from '../agents/tasks/WorkflowCatalogueSections'\nimport {\n isScheduledWorkflow,\n workflowSignal,\n workflowTriggerType,\n} from '../agents/tasks/workflowRows'\nimport { workflowSteps } from '../agents/workflows/run'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useOpenWorkflow } from './workflows/useOpenWorkflow'\nimport { useHost } from '../provider/host'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n /** When a workflow that starts on a step signal starts (the default trigger text). */\n signalTrigger: (signal: string) => string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n signalTrigger: (signal) => `When a step signals ${signal}`,\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n | 'catalogue'\n | 'categories'\n | 'renderIcon'\n> {\n /**\n * Which saved workflows to list: `scheduled` (those that start on a date or a repeat), or a\n * predicate. Default: all.\n */\n filter?: 'scheduled' | ((workflow: WorkflowResponse) => boolean)\n /**\n * When a workflow starts, in the host's words. Default: the step signal it starts on, else its\n * trigger type.\n */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger,\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n onRunTemplate,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const openWorkflow = useOpenWorkflow()\n const host = useHost().workflows\n // A filtered list (the scheduled workflows) is about saved workflows only.\n const catalogueEntries = filter ? undefined : host?.catalogue\n const catalogue = useMemo(\n () =>\n catalogueEntries?.map(({ workflow, category, note, runnable }): WorkflowCatalogueRow => ({\n id: workflow.id,\n title: workflow.title,\n description: workflow.description,\n icon: workflow.icon,\n category,\n stepCount: workflowSteps(workflow).length,\n note,\n runnable,\n })),\n [catalogueEntries]\n )\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => {\n const keep = filter === 'scheduled' ? isScheduledWorkflow : filter\n return keep ? saved.filter(keep) : saved\n }, [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={\n describeTrigger ??\n ((w) => {\n const signal = workflowSignal(w)\n return signal ? l.signalTrigger(signal) : workflowTriggerType(w).replaceAll('_', ' ')\n })\n }\n catalogue={catalogue}\n categories={host?.categories}\n renderIcon={host?.renderIcon}\n onRunTemplate={onRunTemplate ?? (openWorkflow && ((id) => openWorkflow(id, { view: 'run' })))}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/content-path'\nimport type { HouseTemplate, HouseTemplateHost } from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n // The built-in template comes with the Word editor's template code: loaded on demand.\n return (await import('../../docx/template/HouseTemplate')).builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport type { NativeDocxAdapter, NativeDocxEditorProps } from '../../docx/NativeDocxEditor'\nimport { NativeDocxEditor } from '../../docx/lazy'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter' | 'compact'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => import('../../docx/fonts').then((m) => m.loadDocxFonts(fontBaseUrl)),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id, version) => {\n if (onDocumentsChanged) await onDocumentsChanged([id], 'version')\n if (version || !onDocumentsChanged) {\n const fresh = await refreshDocuments(queries, arbi, [id])\n if (\n version &&\n !fresh.some((doc) => doc.external_id === id && (doc.current_version ?? 0) >= version)\n ) {\n throw new Error(\n 'The version was saved, but its current status could not be confirmed. Please try again.'\n )\n }\n }\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkQOXK5O6M_cjs = require('./chunk-QOXK5O6M.cjs');
|
|
5
5
|
var chunk7JLJH5CW_cjs = require('./chunk-7JLJH5CW.cjs');
|
|
6
6
|
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
7
7
|
var chunk75BNMCUX_cjs = require('./chunk-75BNMCUX.cjs');
|
|
@@ -34,8 +34,8 @@ function useSlashField({
|
|
|
34
34
|
send
|
|
35
35
|
}) {
|
|
36
36
|
const { openSkillsBrowser } = chunkTKHCIHE2_cjs.useBlocksEnvironment();
|
|
37
|
-
const { slashToken, filteredItems, isOpen, canBrowseSkills } =
|
|
38
|
-
const slashWorkflows =
|
|
37
|
+
const { slashToken, filteredItems, isOpen, canBrowseSkills } = chunkQOXK5O6M_cjs.useSlashItems(text, chunk7JLJH5CW_cjs.BUILTIN_SKILLS);
|
|
38
|
+
const slashWorkflows = chunkQOXK5O6M_cjs.useSlashSkillWorkflows({ landing, send });
|
|
39
39
|
const insert = (item) => {
|
|
40
40
|
if (slashWorkflows.openFor(item)) {
|
|
41
41
|
setText("");
|
|
@@ -86,5 +86,5 @@ exports.DEFAULT_ASK_SUGGESTIONS = DEFAULT_ASK_SUGGESTIONS;
|
|
|
86
86
|
exports.DEFAULT_DOCUMENT_VIEWER_LABELS = DEFAULT_DOCUMENT_VIEWER_LABELS;
|
|
87
87
|
exports.DEFAULT_DOCUMENT_VIEWER_TABS = DEFAULT_DOCUMENT_VIEWER_TABS;
|
|
88
88
|
exports.useSlashField = useSlashField;
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-KHAO7ZTO.cjs.map
|
|
90
|
+
//# sourceMappingURL=chunk-KHAO7ZTO.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/viewer/documentViewerTabs.ts","../src/connection/ask/useSlashField.tsx"],"names":["useBlocksEnvironment","useSlashItems","BUILTIN_SKILLS","useSlashSkillWorkflows","useListKeyNav","jsx","SlashMenu"],"mappings":";;;;;;;;;;AASO,IAAM,4BAAA,GAA6D;AAAA,EACxE,QAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;AAaO,IAAM,8BAAA,GAAuE;AAAA,EAClF,MAAA,EAAQ,QAAA;AAAA,EACR,QAAA,EAAU,UAAA;AAAA,EACV,GAAA,EAAK,QAAA;AAAA,EACL,QAAA,EACE,4GAAA;AAAA,EACF,cAAA,EAAgB;AAClB;AAEO,IAAM,uBAAA,GAA6C;AAAA,EACxD,0BAAA;AAAA,EACA,0CAAA;AAAA,EACA;AACF;ACHO,SAAS,aAAA,CAAc;AAAA,EAC5B,IAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAAqC;AACnC,EAAA,MAAM,EAAE,iBAAA,EAAkB,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A,CAAe,YAAA,CAAa,QAAQ,GAAG,OAAO,KAAA;AACnD,MAAA,OAAA,CAAQ,EAAE,CAAA;AACV,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,IAAA,kBACEC,cAAA;AAAA,MAACC,2BAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,MAAA;AAAA,QACN,SAAA,EAAU,OAAA;AAAA,QACV,KAAA,EAAO,aAAA;AAAA,QACP,eAAe,QAAA,CAAS,aAAA;AAAA,QACxB,kBAAkB,QAAA,CAAS,gBAAA;AAAA,QAC3B,WAAW,QAAA,CAAS,SAAA;AAAA,QACpB,QAAA,EAAU,MAAA;AAAA,QACV,QAAA,EAAU,eAAA,IAAmB,iBAAA,GAAoB,MAAM,mBAAkB,GAAI;AAAA;AAAA;AAC/E,GAEJ;AACF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/connection/viewer/documentViewerTabs.ts","../src/connection/ask/useSlashField.tsx"],"names":["useBlocksEnvironment","useSlashItems","BUILTIN_SKILLS","useSlashSkillWorkflows","useListKeyNav","jsx","SlashMenu"],"mappings":";;;;;;;;;;AASO,IAAM,4BAAA,GAA6D;AAAA,EACxE,QAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;AAaO,IAAM,8BAAA,GAAuE;AAAA,EAClF,MAAA,EAAQ,QAAA;AAAA,EACR,QAAA,EAAU,UAAA;AAAA,EACV,GAAA,EAAK,QAAA;AAAA,EACL,QAAA,EACE,4GAAA;AAAA,EACF,cAAA,EAAgB;AAClB;AAEO,IAAM,uBAAA,GAA6C;AAAA,EACxD,0BAAA;AAAA,EACA,0CAAA;AAAA,EACA;AACF;ACHO,SAAS,aAAA,CAAc;AAAA,EAC5B,IAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAAqC;AACnC,EAAA,MAAM,EAAE,iBAAA,EAAkB,GAAIA,sCAAA,EAAqB;AACnD,EAAA,MAAM,E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AAA;AACnD,MAAA,OAAA,CAAQ,EAAE,CAAA;AACV,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,IAAA,kBACEC,cAAA;AAAA,MAACC,2BAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,MAAA;AAAA,QACN,SAAA,EAAU,OAAA;AAAA,QACV,KAAA,EAAO,aAAA;AAAA,QACP,eAAe,QAAA,CAAS,aAAA;AAAA,QACxB,kBAAkB,QAAA,CAAS,gBAAA;AAAA,QAC3B,WAAW,QAAA,CAAS,SAAA;AAAA,QACpB,QAAA,EAAU,MAAA;AAAA,QACV,QAAA,EAAU,eAAA,IAAmB,iBAAA,GAAoB,MAAM,mBAAkB,GAAI;AAAA;AAAA;AAC/E,GAEJ;AACF","file":"chunk-KHAO7ZTO.cjs","sourcesContent":["/** The views of the document dialog (`DocumentViewerDialog`, the files page's own viewer). */\n\n/**\n * - `review`: the parsed document with its AI findings, a cited passage marked;\n * - `document`: the whole viewer (PDF and text, markup, signing, versions, sharing);\n * - `ask`: a question about the document, which starts a thread about it.\n */\nexport type DocumentViewerTab = 'review' | 'document' | 'ask'\n\nexport const DEFAULT_DOCUMENT_VIEWER_TABS: readonly DocumentViewerTab[] = [\n 'review',\n 'document',\n 'ask',\n]\n\n/** The dialog's words; each has a neutral default. */\nexport interface DocumentViewerDialogLabels {\n review?: string\n document?: string\n ask?: string\n /** Above the ask bar. */\n askIntro?: string\n /** The ask bar's placeholder; `{title}` is the document's title. */\n askPlaceholder?: string\n}\n\nexport const DEFAULT_DOCUMENT_VIEWER_LABELS: Required<DocumentViewerDialogLabels> = {\n review: 'Review',\n document: 'Document',\n ask: 'Ask AI',\n askIntro:\n 'Your question starts a new thread about this document. The answer cites its passages and takes follow-ups.',\n askPlaceholder: 'Ask about {title}…',\n}\n\nexport const DEFAULT_ASK_SUGGESTIONS: readonly string[] = [\n 'Summarise the key points',\n 'List the dates and deadlines it mentions',\n 'Who are the people and organisations named, and what are their roles?',\n]\n","/**\n * The `/` menu of a one-line ask field (the workspace ask field, the document ask), the chat\n * composer's rules: `/` opens the menu over the same rows, arrows move, Enter/Tab insert the slug,\n * Escape clears the slash. A skill (picked, or typed as `/slug text` and submitted) opens its form\n * instead (`useSlashSkillWorkflows`).\n */\nimport type { KeyboardEvent, ReactNode, RefObject } from 'react'\nimport { SlashMenu, type SlashMenuItem } from '../../chat/SlashMenu'\nimport type { WorkflowLanding } from '../../agents/workflows/types'\nimport { useListKeyNav, type UseListKeyNav } from '../../lib/useListKeyNav'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useSlashItems } from '../conversation/useSlashItems'\nimport { BUILTIN_SKILLS } from '../../agents/workflows/catalogue/seed'\nimport { useSlashSkillWorkflows } from '../workflows/useSlashSkillWorkflows'\n\nexport interface UseSlashFieldOptions {\n text: string\n setText: (text: string) => void\n inputRef: RefObject<HTMLInputElement | null>\n /** Where a skill's run lands (`useSlashSkillWorkflows`). */\n landing: WorkflowLanding\n /** A skill run's own send, for a field that asks its own way (`useSlashSkillWorkflows`). */\n send?: (prompt: string) => void\n}\n\nexport interface SlashField {\n /** Render once beside the field (the skill's form). */\n launcher: ReactNode\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => void\n comboboxProps: UseListKeyNav['comboboxProps']\n /** A submitted question: true when it named a skill (its form opened), so nothing is asked. */\n startsSkill: (question: string) => boolean\n /** The menu, for the field's `menu` slot (it opens below the field). */\n menu: ReactNode\n}\n\nexport function useSlashField({\n text,\n setText,\n inputRef,\n landing,\n send,\n}: UseSlashFieldOptions): SlashField {\n const { openSkillsBrowser } = useBlocksEnvironment()\n const { slashToken, filteredItems, isOpen, canBrowseSkills } = useSlashItems(text, BUILTIN_SKILLS)\n const slashWorkflows = useSlashSkillWorkflows({ landing, send })\n\n const insert = (item: SlashMenuItem) => {\n if (slashWorkflows.openFor(item)) {\n setText('')\n return\n }\n const next = `/${item.name} `\n setText(next)\n requestAnimationFrame(() => {\n const input = inputRef.current\n if (!input) return\n input.focus()\n input.setSelectionRange(next.length, next.length)\n })\n }\n\n const slashNav = useListKeyNav({\n open: isOpen,\n items: filteredItems,\n onPick: insert,\n onDismiss: () => setText(''),\n resetKey: slashToken,\n })\n\n return {\n launcher: slashWorkflows.launcher,\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => void slashNav.handleKeyDown(event),\n comboboxProps: slashNav.comboboxProps,\n startsSkill: (question: string): boolean => {\n if (!slashWorkflows.openForDraft(question)) return false\n setText('')\n return true\n },\n menu: (\n <SlashMenu\n open={isOpen}\n placement=\"below\"\n items={filteredItems}\n selectedIndex={slashNav.selectedIndex}\n setSelectedIndex={slashNav.setSelectedIndex}\n listboxId={slashNav.listboxId}\n onSelect={insert}\n onBrowse={canBrowseSkills && openSkillsBrowser ? () => openSkillsBrowser() : undefined}\n />\n ),\n }\n}\n"]}
|
|
@@ -7,9 +7,9 @@ var chunkNWNVWO6L_cjs = require('./chunk-NWNVWO6L.cjs');
|
|
|
7
7
|
var chunkOEJQFPWO_cjs = require('./chunk-OEJQFPWO.cjs');
|
|
8
8
|
var chunkII2OEXHW_cjs = require('./chunk-II2OEXHW.cjs');
|
|
9
9
|
var chunkM74FWYNL_cjs = require('./chunk-M74FWYNL.cjs');
|
|
10
|
-
var chunkSJSGSHIT_cjs = require('./chunk-SJSGSHIT.cjs');
|
|
11
10
|
var chunkUDSHVNU3_cjs = require('./chunk-UDSHVNU3.cjs');
|
|
12
11
|
var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
|
|
12
|
+
var chunkSJSGSHIT_cjs = require('./chunk-SJSGSHIT.cjs');
|
|
13
13
|
var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
|
|
14
14
|
var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
|
|
15
15
|
var react = require('react');
|
|
@@ -5016,5 +5016,5 @@ exports.toActiveSessionViews = toActiveSessionViews;
|
|
|
5016
5016
|
exports.toDeleteBlockerViews = toDeleteBlockerViews;
|
|
5017
5017
|
exports.toLogoutSessionViews = toLogoutSessionViews;
|
|
5018
5018
|
exports.toNotificationCategories = toNotificationCategories;
|
|
5019
|
-
//# sourceMappingURL=chunk-
|
|
5020
|
-
//# sourceMappingURL=chunk-
|
|
5019
|
+
//# sourceMappingURL=chunk-L6APDO3Y.cjs.map
|
|
5020
|
+
//# sourceMappingURL=chunk-L6APDO3Y.cjs.map
|