@arbidocs/blocks 0.5.195 → 0.5.196
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-L2ER6N2P.cjs → ConnectedCallDock-RRTYZERC.cjs} +22 -22
- package/dist/{ConnectedCallDock-L2ER6N2P.cjs.map → ConnectedCallDock-RRTYZERC.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-R6SHBOKX.cjs → ConnectedCallRoom-HFVIMBCN.cjs} +15 -15
- package/dist/{ConnectedCallRoom-R6SHBOKX.cjs.map → ConnectedCallRoom-HFVIMBCN.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-JNOAKSPK.cjs → ConnectedNativeDocxComparison-FSJQITYC.cjs} +18 -18
- package/dist/{ConnectedNativeDocxComparison-JNOAKSPK.cjs.map → ConnectedNativeDocxComparison-FSJQITYC.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-ZSB7454J.cjs → ConnectedPresentation-ZRCLFY43.cjs} +19 -19
- package/dist/{ConnectedPresentation-ZSB7454J.cjs.map → ConnectedPresentation-ZRCLFY43.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-SHDI7KP6.cjs → ConnectedProductionSetDialog-KT6BPSRE.cjs} +6 -6
- package/dist/{ConnectedProductionSetDialog-SHDI7KP6.cjs.map → ConnectedProductionSetDialog-KT6BPSRE.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-LCA3ZX5W.cjs → ConnectedSlidesTab-WCPQJZ3S.cjs} +16 -16
- package/dist/{ConnectedSlidesTab-LCA3ZX5W.cjs.map → ConnectedSlidesTab-WCPQJZ3S.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-J5HVQMUS.cjs → ConnectedStreamedWordArtifact-PJTPIXJU.cjs} +18 -18
- package/dist/{ConnectedStreamedWordArtifact-J5HVQMUS.cjs.map → ConnectedStreamedWordArtifact-PJTPIXJU.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-Q3NKJLSM.cjs → DocumentReviewCard-5LGKZ3QM.cjs} +20 -20
- package/dist/{DocumentReviewCard-Q3NKJLSM.cjs.map → DocumentReviewCard-5LGKZ3QM.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-O3ZTKELI.cjs → FilesViewerDialog-GICV5UY6.cjs} +52 -50
- package/dist/FilesViewerDialog-GICV5UY6.cjs.map +1 -0
- package/dist/{WorkspaceTableView-QT63XYII.cjs → WorkspaceTableView-FEP7EXL4.cjs} +11 -11
- package/dist/{WorkspaceTableView-QT63XYII.cjs.map → WorkspaceTableView-FEP7EXL4.cjs.map} +1 -1
- package/dist/agents/index.cjs +289 -289
- package/dist/{ai-I7QIW5OA.cjs → ai-BCZZFQUB.cjs} +25 -25
- package/dist/ai-BCZZFQUB.cjs.map +1 -0
- package/dist/auth/index.cjs +12 -12
- package/dist/calls/index.cjs +125 -125
- package/dist/chat/index.cjs +18 -18
- package/dist/{chunk-KD37PODE.cjs → chunk-2ET34WD5.cjs} +5 -5
- package/dist/{chunk-KD37PODE.cjs.map → chunk-2ET34WD5.cjs.map} +1 -1
- package/dist/{chunk-XYN3RP5W.cjs → chunk-2FBWSMAX.cjs} +26 -8
- package/dist/chunk-2FBWSMAX.cjs.map +1 -0
- package/dist/{chunk-LYDSETR7.cjs → chunk-33VS7HH4.cjs} +11 -228
- package/dist/chunk-33VS7HH4.cjs.map +1 -0
- package/dist/{chunk-5OD6DRG7.cjs → chunk-3P6KGC46.cjs} +3 -3
- package/dist/{chunk-5OD6DRG7.cjs.map → chunk-3P6KGC46.cjs.map} +1 -1
- package/dist/{chunk-AZUPMHZI.cjs → chunk-3U6XE7SF.cjs} +4 -4
- package/dist/{chunk-AZUPMHZI.cjs.map → chunk-3U6XE7SF.cjs.map} +1 -1
- package/dist/{chunk-HBY5PEMC.cjs → chunk-6CJBNRKW.cjs} +4 -4
- package/dist/{chunk-HBY5PEMC.cjs.map → chunk-6CJBNRKW.cjs.map} +1 -1
- package/dist/{chunk-VDHBLDQC.cjs → chunk-6N7QT2DH.cjs} +3 -3
- package/dist/{chunk-VDHBLDQC.cjs.map → chunk-6N7QT2DH.cjs.map} +1 -1
- package/dist/{chunk-VDT7TEAH.cjs → chunk-6ZJBUMNK.cjs} +3 -3
- package/dist/{chunk-VDT7TEAH.cjs.map → chunk-6ZJBUMNK.cjs.map} +1 -1
- package/dist/{chunk-V5VFRRLL.cjs → chunk-AZHIZRHN.cjs} +12 -12
- package/dist/{chunk-V5VFRRLL.cjs.map → chunk-AZHIZRHN.cjs.map} +1 -1
- package/dist/{chunk-P5DNNAUY.cjs → chunk-BCVC6PG5.cjs} +78 -78
- package/dist/{chunk-P5DNNAUY.cjs.map → chunk-BCVC6PG5.cjs.map} +1 -1
- package/dist/{chunk-X3SUQFY7.cjs → chunk-BR3XQ45B.cjs} +28 -28
- package/dist/{chunk-X3SUQFY7.cjs.map → chunk-BR3XQ45B.cjs.map} +1 -1
- package/dist/{chunk-5WCQ5Y77.cjs → chunk-BXHPV6QF.cjs} +4 -4
- package/dist/{chunk-5WCQ5Y77.cjs.map → chunk-BXHPV6QF.cjs.map} +1 -1
- package/dist/{chunk-EAH7LFJN.cjs → chunk-CUYELFKB.cjs} +4 -4
- package/dist/{chunk-EAH7LFJN.cjs.map → chunk-CUYELFKB.cjs.map} +1 -1
- package/dist/{chunk-HGH5FLYS.cjs → chunk-CZOHXTHJ.cjs} +6 -6
- package/dist/{chunk-HGH5FLYS.cjs.map → chunk-CZOHXTHJ.cjs.map} +1 -1
- package/dist/{chunk-XQPJWPWE.cjs → chunk-DJ7LSKBJ.cjs} +3 -3
- package/dist/{chunk-XQPJWPWE.cjs.map → chunk-DJ7LSKBJ.cjs.map} +1 -1
- package/dist/{chunk-6EATJW7T.cjs → chunk-DRQB5V5C.cjs} +7 -7
- package/dist/{chunk-6EATJW7T.cjs.map → chunk-DRQB5V5C.cjs.map} +1 -1
- package/dist/chunk-EEKY7VO3.cjs +58 -0
- package/dist/chunk-EEKY7VO3.cjs.map +1 -0
- package/dist/{chunk-SYUVP52B.cjs → chunk-G3SWFSPS.cjs} +69 -69
- package/dist/chunk-G3SWFSPS.cjs.map +1 -0
- package/dist/{chunk-633ZCYVN.cjs → chunk-GEVBY536.cjs} +37 -37
- package/dist/{chunk-633ZCYVN.cjs.map → chunk-GEVBY536.cjs.map} +1 -1
- package/dist/{chunk-EFV52SZ6.cjs → chunk-GY4T4JSC.cjs} +4 -4
- package/dist/{chunk-EFV52SZ6.cjs.map → chunk-GY4T4JSC.cjs.map} +1 -1
- package/dist/chunk-HYYYXHBK.cjs +393 -0
- package/dist/chunk-HYYYXHBK.cjs.map +1 -0
- package/dist/{chunk-YYK2CCMC.cjs → chunk-ICZBM35E.cjs} +7 -7
- package/dist/{chunk-YYK2CCMC.cjs.map → chunk-ICZBM35E.cjs.map} +1 -1
- package/dist/{chunk-YPSCG6ZW.cjs → chunk-IIAJVC3L.cjs} +15 -15
- package/dist/{chunk-YPSCG6ZW.cjs.map → chunk-IIAJVC3L.cjs.map} +1 -1
- package/dist/{chunk-6LNTU7DA.cjs → chunk-IRVSCMRW.cjs} +3 -3
- package/dist/{chunk-6LNTU7DA.cjs.map → chunk-IRVSCMRW.cjs.map} +1 -1
- package/dist/{chunk-V4XARTJ4.cjs → chunk-ISPDSFVM.cjs} +13 -13
- package/dist/{chunk-V4XARTJ4.cjs.map → chunk-ISPDSFVM.cjs.map} +1 -1
- package/dist/{chunk-KQJUY2OE.cjs → chunk-JGU6YLIA.cjs} +11 -11
- package/dist/{chunk-KQJUY2OE.cjs.map → chunk-JGU6YLIA.cjs.map} +1 -1
- package/dist/chunk-JOQDJRV2.cjs +25 -0
- package/dist/chunk-JOQDJRV2.cjs.map +1 -0
- package/dist/{chunk-L3MYUPSH.cjs → chunk-JYDVGZ62.cjs} +5 -5
- package/dist/{chunk-L3MYUPSH.cjs.map → chunk-JYDVGZ62.cjs.map} +1 -1
- package/dist/{chunk-VD3HI5RF.cjs → chunk-NS7PWOL7.cjs} +3 -3
- package/dist/{chunk-VD3HI5RF.cjs.map → chunk-NS7PWOL7.cjs.map} +1 -1
- package/dist/{chunk-HJAI3QNK.cjs → chunk-PUSCVYTH.cjs} +18 -18
- package/dist/{chunk-HJAI3QNK.cjs.map → chunk-PUSCVYTH.cjs.map} +1 -1
- package/dist/{chunk-SXC4ZIN4.cjs → chunk-QOTDPA62.cjs} +10 -10
- package/dist/{chunk-SXC4ZIN4.cjs.map → chunk-QOTDPA62.cjs.map} +1 -1
- package/dist/{chunk-3GI3UM2T.cjs → chunk-RR3QJM2Y.cjs} +52 -52
- package/dist/chunk-RR3QJM2Y.cjs.map +1 -0
- package/dist/{chunk-ELN3YOXF.cjs → chunk-SLVWSTFY.cjs} +28 -28
- package/dist/{chunk-ELN3YOXF.cjs.map → chunk-SLVWSTFY.cjs.map} +1 -1
- package/dist/{chunk-A7MGQMOV.cjs → chunk-SOJYSRO4.cjs} +10 -10
- package/dist/{chunk-A7MGQMOV.cjs.map → chunk-SOJYSRO4.cjs.map} +1 -1
- package/dist/{chunk-QXIWLWR2.cjs → chunk-SVHUSJFP.cjs} +4 -4
- package/dist/{chunk-QXIWLWR2.cjs.map → chunk-SVHUSJFP.cjs.map} +1 -1
- package/dist/{chunk-KHT2YJ5N.cjs → chunk-T7UGI2F2.cjs} +7 -7
- package/dist/{chunk-KHT2YJ5N.cjs.map → chunk-T7UGI2F2.cjs.map} +1 -1
- package/dist/{chunk-KC3HRFSO.cjs → chunk-UTDLO73D.cjs} +3 -3
- package/dist/{chunk-KC3HRFSO.cjs.map → chunk-UTDLO73D.cjs.map} +1 -1
- package/dist/{chunk-ZTR3SUN4.cjs → chunk-UYFHTF2G.cjs} +12 -12
- package/dist/{chunk-ZTR3SUN4.cjs.map → chunk-UYFHTF2G.cjs.map} +1 -1
- package/dist/chunk-VHC3B3R7.cjs +199 -0
- package/dist/chunk-VHC3B3R7.cjs.map +1 -0
- package/dist/{chunk-IOGN5UAT.cjs → chunk-VXCZFJU7.cjs} +3 -3
- package/dist/{chunk-IOGN5UAT.cjs.map → chunk-VXCZFJU7.cjs.map} +1 -1
- package/dist/{chunk-SDID4WK7.cjs → chunk-W365ZZTM.cjs} +49 -49
- package/dist/{chunk-SDID4WK7.cjs.map → chunk-W365ZZTM.cjs.map} +1 -1
- package/dist/{chunk-TLIZD6DV.cjs → chunk-W7TSEN3J.cjs} +6 -6
- package/dist/{chunk-TLIZD6DV.cjs.map → chunk-W7TSEN3J.cjs.map} +1 -1
- package/dist/{chunk-D4SJT3NG.cjs → chunk-WB5XAM77.cjs} +4 -4
- package/dist/{chunk-D4SJT3NG.cjs.map → chunk-WB5XAM77.cjs.map} +1 -1
- package/dist/{chunk-QSY2VW7V.cjs → chunk-WXRAU2FF.cjs} +6 -6
- package/dist/{chunk-QSY2VW7V.cjs.map → chunk-WXRAU2FF.cjs.map} +1 -1
- package/dist/{chunk-LYJFE37D.cjs → chunk-X6TSOKEP.cjs} +3 -3
- package/dist/{chunk-LYJFE37D.cjs.map → chunk-X6TSOKEP.cjs.map} +1 -1
- package/dist/{chunk-NSL5BCGH.cjs → chunk-XTEGQZM2.cjs} +6 -6
- package/dist/{chunk-NSL5BCGH.cjs.map → chunk-XTEGQZM2.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +13 -13
- package/dist/connect/docx.cjs +21 -21
- package/dist/connect/index.cjs +1171 -1163
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +40 -38
- package/dist/connection/ConnectedSignDocumentDialog.d.ts +8 -0
- package/dist/connection/ConnectedSignDocumentDialog.js +14 -0
- package/dist/connection/ConnectedSignDocumentDialog.js.map +7 -0
- package/dist/connection/WorkflowRunnerDialogs.js +2 -2
- package/dist/connection/WorkflowRunnerDialogs.js.map +2 -2
- package/dist/connection/useSigningIdentity.d.ts +10 -0
- package/dist/connection/useSigningIdentity.js +15 -0
- package/dist/connection/useSigningIdentity.js.map +7 -0
- package/dist/connection/viewer/ConnectedDocumentViewer.js +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/ConnectedSharedFileDialog.js +4 -0
- package/dist/connection/viewer/ConnectedSharedFileDialog.js.map +2 -2
- package/dist/connection/viewer/ConnectedSharedFilesPage.js +4 -0
- package/dist/connection/viewer/ConnectedSharedFilesPage.js.map +2 -2
- package/dist/dashboards/index.cjs +1 -1
- package/dist/document-tools/SignDocumentDialog.d.ts +10 -1
- package/dist/document-tools/SignDocumentDialog.js +116 -93
- package/dist/document-tools/SignDocumentDialog.js.map +2 -2
- package/dist/document-tools/index.cjs +10 -9
- package/dist/document-tools/useIdentityGate.d.ts +26 -0
- package/dist/document-tools/useIdentityGate.js +55 -0
- package/dist/document-tools/useIdentityGate.js.map +7 -0
- package/dist/document-tools/viewer/GuidedSigningViewer.d.ts +9 -1
- package/dist/document-tools/viewer/GuidedSigningViewer.js +19 -5
- package/dist/document-tools/viewer/GuidedSigningViewer.js.map +2 -2
- package/dist/document-tools/viewer/SharedFileView.d.ts +5 -1
- package/dist/document-tools/viewer/SharedFileView.js +5 -1
- package/dist/document-tools/viewer/SharedFileView.js.map +2 -2
- package/dist/document-tools/viewer/index.cjs +11 -9
- package/dist/document-tools/viewer/index.cjs.map +1 -1
- package/dist/embed/index.cjs +46 -46
- package/dist/facts/index.cjs +39 -39
- package/dist/files/index.cjs +221 -221
- package/dist/index.cjs +1773 -1773
- package/dist/pages/index.cjs +30 -30
- package/dist/settings/IdentityVerification.d.ts +2 -0
- package/dist/settings/IdentityVerification.js +8 -5
- package/dist/settings/IdentityVerification.js.map +2 -2
- package/dist/settings/index.cjs +156 -156
- package/dist/shell/index.cjs +81 -81
- package/dist/studio/index.cjs +28 -28
- package/dist/workflow-canvas/index.cjs +65 -63
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/FilesViewerDialog-O3ZTKELI.cjs.map +0 -1
- package/dist/ai-I7QIW5OA.cjs.map +0 -1
- package/dist/chunk-3GI3UM2T.cjs.map +0 -1
- package/dist/chunk-LYDSETR7.cjs.map +0 -1
- package/dist/chunk-OUYBYZ7Y.cjs +0 -176
- package/dist/chunk-OUYBYZ7Y.cjs.map +0 -1
- package/dist/chunk-QQMMCXBP.cjs +0 -173
- package/dist/chunk-QQMMCXBP.cjs.map +0 -1
- package/dist/chunk-SYUVP52B.cjs.map +0 -1
- package/dist/chunk-XYN3RP5W.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
4
5
|
var chunkQFSFTO7I_cjs = require('./chunk-QFSFTO7I.cjs');
|
|
5
6
|
var chunkVOGIYFNN_cjs = require('./chunk-VOGIYFNN.cjs');
|
|
6
|
-
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
7
7
|
var chunkHN56WWBR_cjs = require('./chunk-HN56WWBR.cjs');
|
|
8
8
|
var react = require('@arbidocs/react');
|
|
9
9
|
var ui = require('@arbidocs/react/ui');
|
|
@@ -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-IRVSCMRW.cjs.map
|
|
193
|
+
//# sourceMappingURL=chunk-IRVSCMRW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workflows/useWorkflowTasks.ts","../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts"],"names":["useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","useMemo","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate","useArbiSession","useUserSettings","useHost","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK"],"mappings":";;;;;;;;;;;AAuDO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,cAAcA,oBAAA,EAAe;AACnC,EAAA,MAAM,aAAaC,uBAAA,EAAkB;AACrC,EAAA,MAAM,iBAAiBC,uBAAA,EAAkB;AACzC,EAAA,MAAM,qBAAqBC,2BAAA,EAAsB;AACjD,EAAA,MAAM,yBAAyBC,uBAAA,EAAkB;AACjD,EAAA,MAAM,iBAAA,GAAoBC,yBAAA,CAAoB,CAAC,CAAA,KAAM,EAAE,WAAW,CAAA;AAClE,EAAA,MAAM,UAAA,GAAaC,mBAAA,CAAc,EAAE,WAAA,EAAa,mBAAmB,CAAA;AACnE,EAAA,MAAM,EAAE,SAAA,EAAU,GAAIC,sCAAA,EAAqB;AAI3C,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAM,GAAIC,yBAAA,EAAoB;AACnD,EAAA,MAAM,gBAAA,GAAmBC,mBAAA;AAAA,IACvB,CAAC,YAAoB,WAAA,KACnB,KAAA,CAAM,EAAE,UAAA,EAAY,WAAA,EAAa,CAAA,CAAE,IAAA;AAAA,MACjC,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,KACR;AAAA,IACF,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,GAAY,EAAC,KAAMC,kBAAA,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I,OAAO,CAAC,CAAA,KAAM,CAAC,SAAA,CAAU,GAAA,CAAI,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,MACtC;AAAA,KACF;AAEA,IAAA,MAAM,MAAM,CAAC,GAAG,UAAU,GAAG,UAAA,EAAY,GAAG,UAAU,CAAA;AACtD,IAAA,MAAM,IAAA,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,EAAA,EAAI,CAAC,CAAC,CAAC,CAAA;AAC9C,IAAA,MAAM,MAAA,GAASC,kCAAA,CAAiB,OAAA,CAAQ,CAAC,EAAA,KAAO;AAC9C,MAAA,MAAM,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA;AACrB,MAAA,OAAO,CAAA,GAAI,CAAC,CAAC,CAAA,GAAI,EAAC;AAAA,IACpB,CAAC,CAAA;AACD,IAAA,OAAO;AAAA,MACL,MAAA,EAAQ,GAAA;AAAA,MACR,aAAA;AAAA,MACA,KAAA,EAAO,aAAA,GAAgB,CAAC,GAAG,QAAA,EAAU,GAAGC,iCAAA,CAAgB,UAAA,EAAY,KAAK,CAAC,CAAA,GAAI,EAAC;AAAA,MAC/E,SAAA,EAAW,CAAC,GAAG,MAAA,EAAQ,GAAG,UAAU,CAAA;AAAA,MACpC,QAAA,EAAU,CAACC,6BAAA,EAAa,GAAG,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA,EAAGC,6BAAW;AAAA,KAC1E;AAAA,EACF,CAAA,EAAG,CAAC,UAAA,EAAY,QAAA,EAAU,OAAO,aAAA,EAAe,GAAA,EAAK,UAAU,CAAC,CAAA;AAClE","file":"chunk-6LNTU7DA.cjs","sourcesContent":["/**\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","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"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/workflows/useWorkflowTasks.ts","../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts"],"names":["useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","useMemo","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate","useArbiSession","useUserSettings","useHost","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK"],"mappings":";;;;;;;;;;;AAuDO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,cAAcA,oBAAA,EAAe;AACnC,EAAA,MAAM,aAAaC,uBAAA,EAAkB;AACrC,EAAA,MAAM,iBAAiBC,uBAAA,EAAkB;AACzC,EAAA,MAAM,qBAAqBC,2BAAA,EAAsB;AACjD,EAAA,MAAM,yBAAyBC,uBAAA,EAAkB;AACjD,EAAA,MAAM,iBAAA,GAAoBC,yBAAA,CAAoB,CAAC,CAAA,KAAM,EAAE,WAAW,CAAA;AAClE,EAAA,MAAM,UAAA,GAAaC,mBAAA,CAAc,EAAE,WAAA,EAAa,mBAAmB,CAAA;AACnE,EAAA,MAAM,EAAE,SAAA,EAAU,GAAIC,sCAAA,EAAqB;AAI3C,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAM,GAAIC,yBAA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A,EAAGC,6BAAW;AAAA,KAC1E;AAAA,EACF,CAAA,EAAG,CAAC,UAAA,EAAY,QAAA,EAAU,OAAO,aAAA,EAAe,GAAA,EAAK,UAAU,CAAC,CAAA;AAClE","file":"chunk-IRVSCMRW.cjs","sourcesContent":["/**\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","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"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
4
|
+
var chunkUYFHTF2G_cjs = require('./chunk-UYFHTF2G.cjs');
|
|
5
|
+
var chunkIRVSCMRW_cjs = require('./chunk-IRVSCMRW.cjs');
|
|
7
6
|
var chunkQFSFTO7I_cjs = require('./chunk-QFSFTO7I.cjs');
|
|
7
|
+
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
8
8
|
var chunkVOGIYFNN_cjs = require('./chunk-VOGIYFNN.cjs');
|
|
9
9
|
var react$1 = require('react');
|
|
10
10
|
var react = require('@arbidocs/react');
|
|
@@ -19,7 +19,7 @@ function canOpenSkill(workflow, skillsEnabled) {
|
|
|
19
19
|
return workflow.run.kind === "prompt" && (skillsEnabled || chunkQFSFTO7I_cjs.isSkillPackWorkflow(workflow));
|
|
20
20
|
}
|
|
21
21
|
function useSlashSkillWorkflows({ landing, send }) {
|
|
22
|
-
const { skills, skillsEnabled } =
|
|
22
|
+
const { skills, skillsEnabled } = chunkIRVSCMRW_cjs.useWorkflowDefinitions();
|
|
23
23
|
const { commands } = react.useBuiltinCommands();
|
|
24
24
|
const [active, setActive] = react$1.useState(null);
|
|
25
25
|
const open = react$1.useCallback(
|
|
@@ -67,7 +67,7 @@ function useSlashSkillWorkflows({ landing, send }) {
|
|
|
67
67
|
return field && active.text ? { [field]: active.text } : void 0;
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
-
|
|
70
|
+
chunkUYFHTF2G_cjs.ConnectedWorkflowStart,
|
|
71
71
|
{
|
|
72
72
|
workflows: skills,
|
|
73
73
|
showTiles: false,
|
|
@@ -83,11 +83,11 @@ function useSlashSkillWorkflows({ landing, send }) {
|
|
|
83
83
|
}
|
|
84
84
|
var NO_SKILLS = [];
|
|
85
85
|
function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
86
|
-
const hostSkills =
|
|
87
|
-
const listings =
|
|
88
|
-
const skillsEnabled =
|
|
86
|
+
const hostSkills = chunkIRVSCMRW_cjs.useHostSkills();
|
|
87
|
+
const listings = chunkIRVSCMRW_cjs.useUsableSkillListings(hostSkills);
|
|
88
|
+
const skillsEnabled = chunkIRVSCMRW_cjs.useSkillsEnabled();
|
|
89
89
|
const { commands } = react.useBuiltinCommands();
|
|
90
|
-
const builtins =
|
|
90
|
+
const builtins = chunkIRVSCMRW_cjs.useNamedWorkflows(builtinSkills);
|
|
91
91
|
const items = react$1.useMemo(() => {
|
|
92
92
|
const packSlugs = new Set(hostSkills.map((w) => w.id));
|
|
93
93
|
return chunk5F4DCIHS_cjs.buildSlashItems(
|
|
@@ -98,7 +98,7 @@ function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
|
98
98
|
kind: "command"
|
|
99
99
|
})),
|
|
100
100
|
[
|
|
101
|
-
...hostSkills.map(
|
|
101
|
+
...hostSkills.map(chunkIRVSCMRW_cjs.hostSkillItem),
|
|
102
102
|
...skillsEnabled ? skillItems(
|
|
103
103
|
builtins.filter((w) => !packSlugs.has(w.id)),
|
|
104
104
|
listings
|
|
@@ -106,7 +106,7 @@ function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
|
106
106
|
]
|
|
107
107
|
);
|
|
108
108
|
}, [commands, hostSkills, listings, skillsEnabled, builtins]);
|
|
109
|
-
return { items, canBrowseSkills:
|
|
109
|
+
return { items, canBrowseSkills: chunkIRVSCMRW_cjs.useCanBrowseSkills() };
|
|
110
110
|
}
|
|
111
111
|
function useSlashItems(text, builtinSkills = NO_SKILLS) {
|
|
112
112
|
const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills);
|
|
@@ -150,5 +150,5 @@ exports.parseTypedSkill = parseTypedSkill;
|
|
|
150
150
|
exports.useSlashItems = useSlashItems;
|
|
151
151
|
exports.useSlashMenuItems = useSlashMenuItems;
|
|
152
152
|
exports.useSlashSkillWorkflows = useSlashSkillWorkflows;
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-ISPDSFVM.cjs.map
|
|
154
|
+
//# sourceMappingURL=chunk-ISPDSFVM.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workflows/useSlashSkillWorkflows.tsx","../src/connection/conversation/useSlashItems.ts"],"names":["isSkillPackWorkflow","useWorkflowDefinitions","useBuiltinCommands","useState","useCallback","useMemo","promptFieldName","jsx","ConnectedWorkflowStart","useHostSkills","useUsableSkillListings","useSkillsEnabled","useNamedWorkflows","buildSlashItems","hostSkillItem","useCanBrowseSkills","parseSlashTokenInProgress","filterSlashItems","mergeSkillWorkflows"],"mappings":";;;;;;;;;;;AAiCA,IAAM,WAAA,GAAc,qDAAA;AAGb,SAAS,gBAAgB,KAAA,EAAsD;AACpF,EAAA,MAAM,CAAA,GAAI,WAAA,CAAY,IAAA,CAAK,KAAK,CAAA;AAChC,EAAA,OAAO,CAAA,GAAI,EAAE,IAAA,EAAM,CAAA,CAAE,CAAC,CAAA,CA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O,CAAC,GAAG,KAAA,IAAS,EAAA;AAAA,MAC/B,UAAA,EAAY,QAAA;AAAA,MACZ,IAAA,EAAM;AAAA,KACR,CAAE,CAAA;AAAA,IACF,GAAG,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,KAAqB;AAClC,MAAA,MAAM,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAE,EAAE,CAAA;AAC1B,MAAA,OAAO;AAAA,QACL,MAAM,CAAA,CAAE,EAAA;AAAA,QACR,WAAA,EAAa,GAAG,WAAA,KAAgB,CAAA,CAAE,UAAU,CAAA,CAAE,EAAA,GAAK,EAAE,KAAA,GAAQ,EAAA,CAAA;AAAA,QAC7D,OAAA,EAAS,GAAG,QAAA,IAAY,EAAA;AAAA,QACxB,UAAA,EAAY,CAAA,EAAG,UAAA,KAAe,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-V4XARTJ4.cjs","sourcesContent":["/**\n * Slash skills are launched prompt-first, through the one workflow launcher.\n *\n * A skill (or a prompt-style built-in such as Deep research) is run WITH a prompt, so it never\n * just executes:\n * - picking it in the slash menu opens its form (the prompt field first, focused, required);\n * - typing `/slug` and pressing Enter opens the same form with the field empty;\n * - typing `/slug some text` and pressing Enter opens it with the text already in the field.\n * The rule is the same for any recognised skill slug as the FIRST token of the draft; a backend\n * command (`/goal`, `/compact`, ...) is never a skill and is sent as typed. Nothing is sent from\n * the composer until the user starts it in the form. Without skills enabled (`show_skills`) this\n * applies to the host's skill packs only (`host.workflows.skillPacks`): the menu lists no other\n * skills and any other `/text` is sent as typed.\n *\n * The run lands where the surface says (`landing`), through the one launch handler. A chat that\n * is not the session's conversation (`ChatPage`, the document ask) passes `send`: the composed\n * prompt then goes to its own send, as a typed message would.\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from 'react'\nimport { promptFieldName } from '../../agents/workflows/workflow'\nimport { isSkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport { type SlashMenuItem } from '../../chat/SlashMenu'\nimport {\n type WorkflowDefinition,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport { ConnectedWorkflowStart } from './ConnectedWorkflowStart'\nimport { useWorkflowDefinitions } from './useWorkflowDefinitions'\n\n/** `/slug` or `/slug rest of the line`: the first token and the text after it. */\nconst TYPED_SKILL = /^\\s*\\/([a-zA-Z0-9][a-zA-Z0-9_-]*)(?:\\s+([\\s\\S]*))?$/\n\n/** What the typed draft names: its slug (lower-cased) and the text after it (trimmed). */\nexport function parseTypedSkill(draft: string): { slug: string; text: string } | null {\n const m = TYPED_SKILL.exec(draft)\n return m ? { slug: m[1].toLowerCase(), text: (m[2] ?? '').trim() } : null\n}\n\n/**\n * Whether a skill opens its form from a menu (the `/` menus, the command palette): a prompt skill,\n * and with skills switched off (`show_skills`) only the host's packs. The one gate both share.\n */\nexport function canOpenSkill(workflow: WorkflowDefinition, skillsEnabled: boolean): boolean {\n return workflow.run.kind === 'prompt' && (skillsEnabled || isSkillPackWorkflow(workflow))\n}\n\nexport interface UseSlashSkillWorkflowsOptions {\n landing: WorkflowLanding\n /** Where the composed prompt goes, for a chat that is not the session's conversation. */\n send?: (prompt: string) => void\n}\n\nexport function useSlashSkillWorkflows({ landing, send }: UseSlashSkillWorkflowsOptions): {\n /** Opens the launcher for a picked menu item. True when it did (the caller then clears the draft). */\n openFor: (item: SlashMenuItem) => boolean\n /**\n * Opens the launcher for a typed `/slug text` draft, text pre-filled. True when the draft names\n * a skill (the caller then clears the draft and sends nothing).\n */\n openForDraft: (draft: string) => boolean\n /**\n * Opens the launcher for a skill by id (a surface listing the skills itself, the command\n * palette). True when it is a skill this person may run here.\n */\n openSkill: (id: string) => boolean\n /** The skills this person may open here: the host's packs, and the rest with `show_skills`. */\n openable: WorkflowDefinition[]\n /** Render once, anywhere in the surface that hosts the slash menu. */\n launcher: ReactNode\n} {\n const { skills, skillsEnabled } = useWorkflowDefinitions()\n const { commands } = useBuiltinCommands()\n const [active, setActive] = useState<{ id: string; text: string } | null>(null)\n\n // Stable while the lists are, so a surface can memoise what it builds on them.\n const open = useCallback(\n (workflow: WorkflowDefinition | undefined, text: string): boolean => {\n if (!workflow || !canOpenSkill(workflow, skillsEnabled)) return false\n setActive({ id: workflow.id, text })\n return true\n },\n [skillsEnabled]\n )\n\n const openFor = useCallback(\n (item: SlashMenuItem): boolean =>\n item.kind === 'skill' &&\n open(\n skills.find((w) => w.id === item.name),\n ''\n ),\n [open, skills]\n )\n\n const openSkill = useCallback(\n (id: string): boolean =>\n open(\n skills.find((w) => w.id === id),\n ''\n ),\n [open, skills]\n )\n\n const openable = useMemo(\n () => skills.filter((w) => canOpenSkill(w, skillsEnabled)),\n [skills, skillsEnabled]\n )\n\n const openForDraft = useCallback(\n (draft: string): boolean => {\n const typed = parseTypedSkill(draft)\n if (!typed) return false\n // A backend command wins a name collision, as in the menu: it is sent as typed.\n if (commands.some((c) => c.name.toLowerCase() === typed.slug)) return false\n return open(\n skills.find((w) => w.id.toLowerCase() === typed.slug),\n typed.text\n )\n },\n [open, skills, commands]\n )\n\n // Mounted only while a workflow is open: the ask bar lives in every page's topbar, so the\n // launcher's data hooks (files, agents, tasks) must not run until it is needed.\n const launcher = useMemo(() => {\n if (active === null) return null\n const initialInputsFor = (\n workflow: WorkflowDefinition\n ): Partial<WorkflowInputs> | undefined => {\n const field = promptFieldName(workflow)\n return field && active.text ? { [field]: active.text } : undefined\n }\n return (\n <ConnectedWorkflowStart\n workflows={skills}\n showTiles={false}\n landing={landing}\n send={send}\n activeId={active.id}\n onActiveIdChange={(id) => id === null && setActive(null)}\n initialInputsFor={initialInputsFor}\n />\n )\n }, [active, skills, landing, send])\n\n return { openFor, openForDraft, openSkill, openable, launcher }\n}\n","/**\n * The slash menu's data, in one place for every surface that hosts it (the chat composers, the\n * workspace ask bar, the document ask and `ChatPage`): the backend's built-in commands, the host's\n * skill packs and the user's skills, filtered by the slash token in progress. Commands and the\n * user's skills are typed `/<slug>` and dispatched by the backend; a skill opens its form\n * (`useSlashSkillWorkflows`).\n */\n\nimport { useMemo } from 'react'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { buildSlashItems, filterSlashItems, parseSlashToken } from '../../chat/slash-menu-helpers'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\nimport { useCanBrowseSkills, useSkillsEnabled } from '../workflows/useSkillsEnabled'\nimport { hostSkillItem, useHostSkills } from '../workflows/useHostSkills'\nimport { useUsableSkillListings } from '../workflows/useWorkflowDefinitions'\nimport { useNamedWorkflows } from '../workflows/useNamedWorkflows'\n\nconst NO_SKILLS: ReadonlyArray<WorkflowDefinition> = []\n\n/**\n * Every row of the menu, unfiltered: commands, then the host's packs (always: the host offers\n * them), then, for skills users (`show_skills`), the built-in skills and the user's own.\n *\n * @param builtinSkills The built-in skills to offer (prompt workflows offered as `/slug`), for a\n * surface that can open their form; default none.\n */\nexport function useSlashMenuItems(builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS): {\n items: SlashMenuItem[]\n /** The menu's \"Browse all\" footer opens the Skills browser: skills users, never guests. */\n canBrowseSkills: boolean\n} {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const skillsEnabled = useSkillsEnabled()\n const { commands } = useBuiltinCommands()\n const builtins = useNamedWorkflows(builtinSkills)\n const items = useMemo<SlashMenuItem[]>(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n return buildSlashItems(\n commands.map((c) => ({\n name: c.name,\n description: c.description,\n argHint: c.arg_hint,\n kind: 'command' as const,\n })),\n [\n ...hostSkills.map(hostSkillItem),\n ...(skillsEnabled\n ? skillItems(\n builtins.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n : []),\n ]\n )\n }, [commands, hostSkills, listings, skillsEnabled, builtins])\n return { items, canBrowseSkills: useCanBrowseSkills() }\n}\n\n/**\n * @param text The draft.\n * @param builtinSkills The built-in skills (prompt workflows offered as `/slug`).\n */\nexport function useSlashItems(\n text: string,\n builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS\n) {\n const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills)\n const slashToken = parseSlashToken(text)\n const filteredItems = useMemo(\n () => (slashToken !== null ? filterSlashItems(items, slashToken) : []),\n [items, slashToken]\n )\n return {\n slashToken,\n filteredItems,\n isOpen: slashToken !== null && filteredItems.length > 0,\n canBrowseSkills,\n }\n}\n\ntype SkillListings = ReturnType<typeof useUsableSkillListings>\n\n/**\n * Built-in skills share the list and the `/slug` path; a same-slug skill of the user's own shadows\n * the built-in, as on the backend.\n */\nfunction skillItems(\n builtinSkills: ReadonlyArray<WorkflowDefinition>,\n listings: SkillListings\n): SlashMenuItem[] {\n const { host, skills } = mergeSkillWorkflows([...builtinSkills], listings)\n const listing = new Map(listings.map((s) => [s.slug, s]))\n return [\n ...host.map((w): SlashMenuItem => ({\n name: w.id,\n description: w.description,\n argHint: w.inputs[0]?.label ?? '',\n visibility: 'global',\n kind: 'skill',\n })),\n ...skills.map((w): SlashMenuItem => {\n const s = listing.get(w.id)\n return {\n name: w.id,\n description: s?.description || (w.title !== w.id ? w.title : ''),\n argHint: s?.arg_hint ?? '',\n visibility: s?.visibility === 'global' ? 'global' : 'mine',\n kind: 'skill',\n }\n }),\n ]\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/workflows/useSlashSkillWorkflows.tsx","../src/connection/conversation/useSlashItems.ts"],"names":["isSkillPackWorkflow","useWorkflowDefinitions","useBuiltinCommands","useState","useCallback","useMemo","promptFieldName","jsx","ConnectedWorkflowStart","useHostSkills","useUsableSkillListings","useSkillsEnabled","useNamedWorkflows","buildSlashItems","hostSkillItem","useCanBrowseSkills","parseSlashTokenInProgress","filterSlashItems","mergeSkillW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AE,IAAA,EAAM,CAAC,CAAC,CAAC,CAAA;AACxD,EAAA,OAAO;AAAA,IACL,GAAG,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,MAAsB;AAAA,MACjC,MAAM,CAAA,CAAE,EAAA;AAAA,MACR,aAAa,CAAA,CAAE,WAAA;AAAA,MACf,OAAA,EAAS,CAAA,CAAE,MAAA,CAAO,CAAC,GAAG,KAAA,IAAS,EAAA;AAAA,MAC/B,UAAA,EAAY,QAAA;AAAA,MACZ,IAAA,EAAM;AAAA,KACR,CAAE,CAAA;AAAA,IACF,GAAG,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,KAAqB;AAClC,MAAA,MAAM,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAE,EAAE,CAAA;AAC1B,MAAA,OAAO;AAAA,QACL,MAAM,CAAA,CAAE,EAAA;AAAA,QACR,WAAA,EAAa,GAAG,WAAA,KAAgB,CAAA,CAAE,UAAU,CAAA,CAAE,EAAA,GAAK,EAAE,KAAA,GAAQ,EAAA,CAAA;AAAA,QAC7D,OAAA,EAAS,GAAG,QAAA,IAAY,EAAA;AAAA,QACxB,UAAA,EAAY,CAAA,EAAG,UAAA,KAAe,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-ISPDSFVM.cjs","sourcesContent":["/**\n * Slash skills are launched prompt-first, through the one workflow launcher.\n *\n * A skill (or a prompt-style built-in such as Deep research) is run WITH a prompt, so it never\n * just executes:\n * - picking it in the slash menu opens its form (the prompt field first, focused, required);\n * - typing `/slug` and pressing Enter opens the same form with the field empty;\n * - typing `/slug some text` and pressing Enter opens it with the text already in the field.\n * The rule is the same for any recognised skill slug as the FIRST token of the draft; a backend\n * command (`/goal`, `/compact`, ...) is never a skill and is sent as typed. Nothing is sent from\n * the composer until the user starts it in the form. Without skills enabled (`show_skills`) this\n * applies to the host's skill packs only (`host.workflows.skillPacks`): the menu lists no other\n * skills and any other `/text` is sent as typed.\n *\n * The run lands where the surface says (`landing`), through the one launch handler. A chat that\n * is not the session's conversation (`ChatPage`, the document ask) passes `send`: the composed\n * prompt then goes to its own send, as a typed message would.\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from 'react'\nimport { promptFieldName } from '../../agents/workflows/workflow'\nimport { isSkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport { type SlashMenuItem } from '../../chat/SlashMenu'\nimport {\n type WorkflowDefinition,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport { ConnectedWorkflowStart } from './ConnectedWorkflowStart'\nimport { useWorkflowDefinitions } from './useWorkflowDefinitions'\n\n/** `/slug` or `/slug rest of the line`: the first token and the text after it. */\nconst TYPED_SKILL = /^\\s*\\/([a-zA-Z0-9][a-zA-Z0-9_-]*)(?:\\s+([\\s\\S]*))?$/\n\n/** What the typed draft names: its slug (lower-cased) and the text after it (trimmed). */\nexport function parseTypedSkill(draft: string): { slug: string; text: string } | null {\n const m = TYPED_SKILL.exec(draft)\n return m ? { slug: m[1].toLowerCase(), text: (m[2] ?? '').trim() } : null\n}\n\n/**\n * Whether a skill opens its form from a menu (the `/` menus, the command palette): a prompt skill,\n * and with skills switched off (`show_skills`) only the host's packs. The one gate both share.\n */\nexport function canOpenSkill(workflow: WorkflowDefinition, skillsEnabled: boolean): boolean {\n return workflow.run.kind === 'prompt' && (skillsEnabled || isSkillPackWorkflow(workflow))\n}\n\nexport interface UseSlashSkillWorkflowsOptions {\n landing: WorkflowLanding\n /** Where the composed prompt goes, for a chat that is not the session's conversation. */\n send?: (prompt: string) => void\n}\n\nexport function useSlashSkillWorkflows({ landing, send }: UseSlashSkillWorkflowsOptions): {\n /** Opens the launcher for a picked menu item. True when it did (the caller then clears the draft). */\n openFor: (item: SlashMenuItem) => boolean\n /**\n * Opens the launcher for a typed `/slug text` draft, text pre-filled. True when the draft names\n * a skill (the caller then clears the draft and sends nothing).\n */\n openForDraft: (draft: string) => boolean\n /**\n * Opens the launcher for a skill by id (a surface listing the skills itself, the command\n * palette). True when it is a skill this person may run here.\n */\n openSkill: (id: string) => boolean\n /** The skills this person may open here: the host's packs, and the rest with `show_skills`. */\n openable: WorkflowDefinition[]\n /** Render once, anywhere in the surface that hosts the slash menu. */\n launcher: ReactNode\n} {\n const { skills, skillsEnabled } = useWorkflowDefinitions()\n const { commands } = useBuiltinCommands()\n const [active, setActive] = useState<{ id: string; text: string } | null>(null)\n\n // Stable while the lists are, so a surface can memoise what it builds on them.\n const open = useCallback(\n (workflow: WorkflowDefinition | undefined, text: string): boolean => {\n if (!workflow || !canOpenSkill(workflow, skillsEnabled)) return false\n setActive({ id: workflow.id, text })\n return true\n },\n [skillsEnabled]\n )\n\n const openFor = useCallback(\n (item: SlashMenuItem): boolean =>\n item.kind === 'skill' &&\n open(\n skills.find((w) => w.id === item.name),\n ''\n ),\n [open, skills]\n )\n\n const openSkill = useCallback(\n (id: string): boolean =>\n open(\n skills.find((w) => w.id === id),\n ''\n ),\n [open, skills]\n )\n\n const openable = useMemo(\n () => skills.filter((w) => canOpenSkill(w, skillsEnabled)),\n [skills, skillsEnabled]\n )\n\n const openForDraft = useCallback(\n (draft: string): boolean => {\n const typed = parseTypedSkill(draft)\n if (!typed) return false\n // A backend command wins a name collision, as in the menu: it is sent as typed.\n if (commands.some((c) => c.name.toLowerCase() === typed.slug)) return false\n return open(\n skills.find((w) => w.id.toLowerCase() === typed.slug),\n typed.text\n )\n },\n [open, skills, commands]\n )\n\n // Mounted only while a workflow is open: the ask bar lives in every page's topbar, so the\n // launcher's data hooks (files, agents, tasks) must not run until it is needed.\n const launcher = useMemo(() => {\n if (active === null) return null\n const initialInputsFor = (\n workflow: WorkflowDefinition\n ): Partial<WorkflowInputs> | undefined => {\n const field = promptFieldName(workflow)\n return field && active.text ? { [field]: active.text } : undefined\n }\n return (\n <ConnectedWorkflowStart\n workflows={skills}\n showTiles={false}\n landing={landing}\n send={send}\n activeId={active.id}\n onActiveIdChange={(id) => id === null && setActive(null)}\n initialInputsFor={initialInputsFor}\n />\n )\n }, [active, skills, landing, send])\n\n return { openFor, openForDraft, openSkill, openable, launcher }\n}\n","/**\n * The slash menu's data, in one place for every surface that hosts it (the chat composers, the\n * workspace ask bar, the document ask and `ChatPage`): the backend's built-in commands, the host's\n * skill packs and the user's skills, filtered by the slash token in progress. Commands and the\n * user's skills are typed `/<slug>` and dispatched by the backend; a skill opens its form\n * (`useSlashSkillWorkflows`).\n */\n\nimport { useMemo } from 'react'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { buildSlashItems, filterSlashItems, parseSlashToken } from '../../chat/slash-menu-helpers'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\nimport { useCanBrowseSkills, useSkillsEnabled } from '../workflows/useSkillsEnabled'\nimport { hostSkillItem, useHostSkills } from '../workflows/useHostSkills'\nimport { useUsableSkillListings } from '../workflows/useWorkflowDefinitions'\nimport { useNamedWorkflows } from '../workflows/useNamedWorkflows'\n\nconst NO_SKILLS: ReadonlyArray<WorkflowDefinition> = []\n\n/**\n * Every row of the menu, unfiltered: commands, then the host's packs (always: the host offers\n * them), then, for skills users (`show_skills`), the built-in skills and the user's own.\n *\n * @param builtinSkills The built-in skills to offer (prompt workflows offered as `/slug`), for a\n * surface that can open their form; default none.\n */\nexport function useSlashMenuItems(builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS): {\n items: SlashMenuItem[]\n /** The menu's \"Browse all\" footer opens the Skills browser: skills users, never guests. */\n canBrowseSkills: boolean\n} {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const skillsEnabled = useSkillsEnabled()\n const { commands } = useBuiltinCommands()\n const builtins = useNamedWorkflows(builtinSkills)\n const items = useMemo<SlashMenuItem[]>(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n return buildSlashItems(\n commands.map((c) => ({\n name: c.name,\n description: c.description,\n argHint: c.arg_hint,\n kind: 'command' as const,\n })),\n [\n ...hostSkills.map(hostSkillItem),\n ...(skillsEnabled\n ? skillItems(\n builtins.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n : []),\n ]\n )\n }, [commands, hostSkills, listings, skillsEnabled, builtins])\n return { items, canBrowseSkills: useCanBrowseSkills() }\n}\n\n/**\n * @param text The draft.\n * @param builtinSkills The built-in skills (prompt workflows offered as `/slug`).\n */\nexport function useSlashItems(\n text: string,\n builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS\n) {\n const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills)\n const slashToken = parseSlashToken(text)\n const filteredItems = useMemo(\n () => (slashToken !== null ? filterSlashItems(items, slashToken) : []),\n [items, slashToken]\n )\n return {\n slashToken,\n filteredItems,\n isOpen: slashToken !== null && filteredItems.length > 0,\n canBrowseSkills,\n }\n}\n\ntype SkillListings = ReturnType<typeof useUsableSkillListings>\n\n/**\n * Built-in skills share the list and the `/slug` path; a same-slug skill of the user's own shadows\n * the built-in, as on the backend.\n */\nfunction skillItems(\n builtinSkills: ReadonlyArray<WorkflowDefinition>,\n listings: SkillListings\n): SlashMenuItem[] {\n const { host, skills } = mergeSkillWorkflows([...builtinSkills], listings)\n const listing = new Map(listings.map((s) => [s.slug, s]))\n return [\n ...host.map((w): SlashMenuItem => ({\n name: w.id,\n description: w.description,\n argHint: w.inputs[0]?.label ?? '',\n visibility: 'global',\n kind: 'skill',\n })),\n ...skills.map((w): SlashMenuItem => {\n const s = listing.get(w.id)\n return {\n name: w.id,\n description: s?.description || (w.title !== w.id ? w.title : ''),\n argHint: s?.arg_hint ?? '',\n visibility: s?.visibility === 'global' ? 'global' : 'mine',\n kind: 'skill',\n }\n }),\n ]\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk6ZJBUMNK_cjs = require('./chunk-6ZJBUMNK.cjs');
|
|
5
|
+
var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
|
|
5
6
|
var chunkDEXUL3T6_cjs = require('./chunk-DEXUL3T6.cjs');
|
|
6
7
|
var chunkYZSQ7F5K_cjs = require('./chunk-YZSQ7F5K.cjs');
|
|
7
8
|
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
8
|
-
var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
|
|
9
9
|
var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
var react = require('react');
|
|
@@ -25,18 +25,18 @@ function ShellSidebar({
|
|
|
25
25
|
...rootProps
|
|
26
26
|
}) {
|
|
27
27
|
if (controller.layout.hidden) return null;
|
|
28
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunk6ZJBUMNK_cjs.Sidebar.Root, { ...controller.rootProps, ...rootProps, children: [
|
|
29
29
|
controller.isDrawer && drawerLogo && /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
-
|
|
30
|
+
chunk6ZJBUMNK_cjs.Sidebar.DrawerHeader,
|
|
31
31
|
{
|
|
32
32
|
logo: drawerLogo,
|
|
33
33
|
onClose: controller.closeDrawer,
|
|
34
34
|
"data-testid": drawerCloseTestId
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
|
-
header && /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
-
(tips || footer) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37
|
+
header && /* @__PURE__ */ jsxRuntime.jsx(chunk6ZJBUMNK_cjs.Sidebar.Header, { children: header }),
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6ZJBUMNK_cjs.Sidebar.Nav, { items, sections, className: navClassName }),
|
|
39
|
+
(tips || footer) && /* @__PURE__ */ jsxRuntime.jsxs(chunk6ZJBUMNK_cjs.Sidebar.Footer, { children: [
|
|
40
40
|
controller.tipsVisible && tips,
|
|
41
41
|
footer
|
|
42
42
|
] })
|
|
@@ -185,7 +185,7 @@ function SidebarRowAction({
|
|
|
185
185
|
"data-testid": testId,
|
|
186
186
|
children
|
|
187
187
|
}) {
|
|
188
|
-
const rowHovered = react.useContext(
|
|
188
|
+
const rowHovered = react.useContext(chunk6ZJBUMNK_cjs.SidebarRowHoverContext);
|
|
189
189
|
const tone = active ? "text-accent-foreground hover:bg-background/60" : pulse ? `${PULSE_STYLES[pulse]} hover:bg-muted` : ui.cn(
|
|
190
190
|
"text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
191
191
|
rowHovered ? "opacity-100" : "opacity-70"
|
|
@@ -567,7 +567,7 @@ function OfflinePill({
|
|
|
567
567
|
}
|
|
568
568
|
),
|
|
569
569
|
!compact && onReconnect && // Forced visible (context true): there is no row to hover.
|
|
570
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
570
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6ZJBUMNK_cjs.SidebarRowHoverContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
571
571
|
SidebarRowAction,
|
|
572
572
|
{
|
|
573
573
|
label: labels?.reconnect ?? DEFAULT_OFFLINE_PILL_LABELS.reconnect,
|
|
@@ -905,5 +905,5 @@ exports.resolveSidebarLayout = resolveSidebarLayout;
|
|
|
905
905
|
exports.useCloseOnEscape = useCloseOnEscape;
|
|
906
906
|
exports.useSidebarController = useSidebarController;
|
|
907
907
|
exports.useSidebarSettle = useSidebarSettle;
|
|
908
|
-
//# sourceMappingURL=chunk-
|
|
909
|
-
//# sourceMappingURL=chunk-
|
|
908
|
+
//# sourceMappingURL=chunk-JGU6YLIA.cjs.map
|
|
909
|
+
//# sourceMappingURL=chunk-JGU6YLIA.cjs.map
|