@arbidocs/blocks 0.4.2 → 0.4.4
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/README.md +42 -0
- package/dist/agents/definitions/AgentCreator.d.ts +11 -2
- package/dist/agents/definitions/index.d.ts +1 -0
- package/dist/agents/definitions/persona.d.ts +16 -0
- package/dist/agents/index.cjs +199 -146
- package/dist/agents/index.js +3 -2
- package/dist/agents/tasks/TaskRunsDialog.d.ts +15 -3
- package/dist/agents/tasks/index.d.ts +1 -0
- package/dist/agents/tasks/taskRequest.d.ts +61 -0
- package/dist/chat/AssistantDock.d.ts +39 -0
- package/dist/chat/ChatDocuments.d.ts +17 -0
- package/dist/chat/ChatPage.d.ts +16 -0
- package/dist/chat/ChatThreads.d.ts +28 -0
- package/dist/chat/chat-page-types.d.ts +121 -0
- package/dist/chat/chat-surface.d.ts +9 -0
- package/dist/chat/index.cjs +247 -205
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +4 -2
- package/dist/{chunk-OBLSURHV.js → chunk-2NNTQLBY.js} +3 -3
- package/dist/{chunk-OBLSURHV.js.map → chunk-2NNTQLBY.js.map} +1 -1
- package/dist/chunk-2VBJ763Y.js +296 -0
- package/dist/chunk-2VBJ763Y.js.map +1 -0
- package/dist/{chunk-2ORA62OF.js → chunk-67MKU5U7.js} +3 -3
- package/dist/{chunk-2ORA62OF.js.map → chunk-67MKU5U7.js.map} +1 -1
- package/dist/{chunk-AE5FHFZ5.cjs → chunk-6CHMNKXC.cjs} +6 -6
- package/dist/{chunk-AE5FHFZ5.cjs.map → chunk-6CHMNKXC.cjs.map} +1 -1
- package/dist/{chunk-TYZUCAT7.js → chunk-7YADKWZT.js} +43 -6
- package/dist/chunk-7YADKWZT.js.map +1 -0
- package/dist/chunk-ATXPAD6S.cjs +1952 -0
- package/dist/chunk-ATXPAD6S.cjs.map +1 -0
- package/dist/{chunk-YBXCZEWS.js → chunk-B673CCW5.js} +29 -6
- package/dist/chunk-B673CCW5.js.map +1 -0
- package/dist/{chunk-ITGHMJOM.js → chunk-BBEMPS6C.js} +169 -26
- package/dist/chunk-BBEMPS6C.js.map +1 -0
- package/dist/{chunk-XNBAXRY7.cjs → chunk-DGVKBOY5.cjs} +188 -32
- package/dist/chunk-DGVKBOY5.cjs.map +1 -0
- package/dist/{chunk-2K33YGM6.cjs → chunk-DN3NFNIA.cjs} +63 -294
- package/dist/chunk-DN3NFNIA.cjs.map +1 -0
- package/dist/{chunk-XQ7PKKDY.cjs → chunk-G4YOH5DU.cjs} +3 -3
- package/dist/{chunk-XQ7PKKDY.cjs.map → chunk-G4YOH5DU.cjs.map} +1 -1
- package/dist/{chunk-AXIZ2MDV.js → chunk-HER7MTRR.js} +3 -3
- package/dist/{chunk-AXIZ2MDV.js.map → chunk-HER7MTRR.js.map} +1 -1
- package/dist/{chunk-SYDHKKRZ.cjs → chunk-IZHWP6WQ.cjs} +47 -5
- package/dist/chunk-IZHWP6WQ.cjs.map +1 -0
- package/dist/chunk-JPO3F4J7.js +1899 -0
- package/dist/chunk-JPO3F4J7.js.map +1 -0
- package/dist/{chunk-WJMEXTVD.cjs → chunk-KDG6FER6.cjs} +28 -2
- package/dist/chunk-KDG6FER6.cjs.map +1 -0
- package/dist/chunk-KHX2BX3S.cjs +307 -0
- package/dist/chunk-KHX2BX3S.cjs.map +1 -0
- package/dist/{chunk-WTNMWEBC.js → chunk-NJL4LIXX.js} +4 -3
- package/dist/chunk-NJL4LIXX.js.map +1 -0
- package/dist/{chunk-J2BGSWXM.cjs → chunk-O637DUKS.cjs} +27 -27
- package/dist/{chunk-J2BGSWXM.cjs.map → chunk-O637DUKS.cjs.map} +1 -1
- package/dist/{chunk-WW6EOVZA.js → chunk-OXF2IFXG.js} +26 -3
- package/dist/chunk-OXF2IFXG.js.map +1 -0
- package/dist/{chunk-6HIPFEID.cjs → chunk-PBS5MFIY.cjs} +4 -4
- package/dist/{chunk-6HIPFEID.cjs.map → chunk-PBS5MFIY.cjs.map} +1 -1
- package/dist/{chunk-AZQDNYH4.js → chunk-RCP6THBS.js} +9 -1249
- package/dist/chunk-RCP6THBS.js.map +1 -0
- package/dist/{chunk-GDFWJ73C.cjs → chunk-RIL7G7AS.cjs} +4 -1286
- package/dist/chunk-RIL7G7AS.cjs.map +1 -0
- package/dist/{chunk-DREI7EQ2.cjs → chunk-SS23F63U.cjs} +9 -9
- package/dist/{chunk-DREI7EQ2.cjs.map → chunk-SS23F63U.cjs.map} +1 -1
- package/dist/{chunk-7PEELPMA.js → chunk-TI4UTYRL.js} +62 -285
- package/dist/chunk-TI4UTYRL.js.map +1 -0
- package/dist/{chunk-6P6AEQJB.js → chunk-WJZBJUPX.js} +4 -4
- package/dist/{chunk-6P6AEQJB.js.map → chunk-WJZBJUPX.js.map} +1 -1
- package/dist/{chunk-UFHMLHIR.cjs → chunk-XAJIKT6Y.cjs} +32 -11
- package/dist/chunk-XAJIKT6Y.cjs.map +1 -0
- package/dist/{chunk-G3G7LZPM.cjs → chunk-XKKGGUU2.cjs} +29 -3
- package/dist/chunk-XKKGGUU2.cjs.map +1 -0
- package/dist/{chunk-UWGIB3VQ.js → chunk-XNOASBGW.js} +33 -12
- package/dist/chunk-XNOASBGW.js.map +1 -0
- package/dist/{chunk-CTZ5745I.js → chunk-XQKGYGCJ.js} +3 -3
- package/dist/{chunk-CTZ5745I.js.map → chunk-XQKGYGCJ.js.map} +1 -1
- package/dist/{chunk-54Q3RNJU.cjs → chunk-ZVPTFTGV.cjs} +4 -3
- package/dist/chunk-ZVPTFTGV.cjs.map +1 -0
- package/dist/citations/index.cjs +11 -11
- package/dist/citations/index.js +2 -2
- package/dist/collaboration/contacts/AddContactsParts.d.ts +9 -4
- package/dist/collaboration/contacts/index.d.ts +1 -0
- package/dist/collaboration/contacts/parseEmails.d.ts +26 -0
- package/dist/collaboration/index.cjs +51 -31
- package/dist/collaboration/index.js +1 -1
- package/dist/components/MemberAvatarStack.d.ts +7 -2
- package/dist/connect/index.cjs +41 -12
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +3 -2
- package/dist/connect/index.js +20 -4
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectionProvider.d.ts +2 -0
- package/dist/connection/ai.d.ts +13 -1
- package/dist/connection/useConnectedShellWorkspaces.d.ts +15 -0
- package/dist/facts/index.cjs +3 -3
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.js +2 -2
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +4 -3
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +4 -3
- package/dist/files/index.js.map +1 -1
- package/dist/home/index.cjs +18 -17
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +3 -2
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +824 -695
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/lib/format.d.ts +31 -0
- package/dist/retrieval/index.cjs +36 -36
- package/dist/retrieval/index.js +1 -1
- package/dist/settings/index.cjs +13 -11
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +13 -11
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/SplitLayout.d.ts +32 -0
- package/dist/shell/index.cjs +72 -68
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.js +2 -2
- package/dist/site/index.cjs +71 -71
- package/dist/site/index.js +3 -3
- package/dist/studio/index.cjs +79 -76
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +9 -6
- package/dist/studio/index.js.map +1 -1
- package/dist/workspaces/WorkspaceGallery.d.ts +42 -0
- package/dist/workspaces/index.cjs +74 -7
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.d.ts +2 -0
- package/dist/workspaces/index.js +73 -7
- package/dist/workspaces/index.js.map +1 -1
- package/package.json +3 -3
- package/src/blocks.css +10 -13
- package/dist/chunk-2K33YGM6.cjs.map +0 -1
- package/dist/chunk-54Q3RNJU.cjs.map +0 -1
- package/dist/chunk-7PEELPMA.js.map +0 -1
- package/dist/chunk-AZQDNYH4.js.map +0 -1
- package/dist/chunk-G3G7LZPM.cjs.map +0 -1
- package/dist/chunk-GDFWJ73C.cjs.map +0 -1
- package/dist/chunk-ITGHMJOM.js.map +0 -1
- package/dist/chunk-SCFYPAG6.cjs +0 -18
- package/dist/chunk-SCFYPAG6.cjs.map +0 -1
- package/dist/chunk-SYDHKKRZ.cjs.map +0 -1
- package/dist/chunk-TYZUCAT7.js.map +0 -1
- package/dist/chunk-UFHMLHIR.cjs.map +0 -1
- package/dist/chunk-UWGIB3VQ.js.map +0 -1
- package/dist/chunk-WJMEXTVD.cjs.map +0 -1
- package/dist/chunk-WTNMWEBC.js.map +0 -1
- package/dist/chunk-WW6EOVZA.js.map +0 -1
- package/dist/chunk-XNBAXRY7.cjs.map +0 -1
- package/dist/chunk-YBXCZEWS.js.map +0 -1
- package/dist/chunk-YDHO4AVL.js +0 -16
- package/dist/chunk-YDHO4AVL.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { FoldSection, QuickActionDialogHeader, AddFilesFirst, StartTiles, ScopePicker } from './chunk-
|
|
2
|
+
import { FoldSection, QuickActionDialogHeader, AddFilesFirst, StartTiles, ScopePicker } from './chunk-NJL4LIXX.js';
|
|
3
3
|
import { MultiSelect } from './chunk-CQCC7LE7.js';
|
|
4
4
|
import { EmptyState } from './chunk-P6GHJSLR.js';
|
|
5
5
|
import { ActionLink } from './chunk-S7PSMMRG.js';
|
|
@@ -7,11 +7,12 @@ import { ModalHeader } from './chunk-TX2ZICS7.js';
|
|
|
7
7
|
import { SelectionBar, SelectionBarAction } from './chunk-NUNKSZKU.js';
|
|
8
8
|
import { TabHeader } from './chunk-UBNVIIBT.js';
|
|
9
9
|
import { useBlocksEnvironment } from './chunk-76JDDMSP.js';
|
|
10
|
+
import { formatCount } from './chunk-OXF2IFXG.js';
|
|
10
11
|
import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
|
|
11
12
|
import { memo, forwardRef, useState, useMemo, useId, useEffect, useRef, useCallback } from 'react';
|
|
12
13
|
import { cn, Label, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Textarea, Input, Switch, Button, Collapsible, CollapsibleTrigger, CollapsibleContent, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Tooltip, TooltipTrigger, TooltipContent, Badge, Slider, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@arbidocs/react/ui';
|
|
13
14
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
-
import { ChevronDown, ChevronRight, Plus, Trash2, Loader2, Play, Eye, ClipboardList, Pencil, Copy, Bot, Sparkles, Wand2, Globe, Download, Lock, ListChecks, AlertTriangle, FileX, SkipForward,
|
|
15
|
+
import { ChevronDown, ChevronRight, Plus, Trash2, Loader2, Play, Eye, ClipboardList, Pencil, Copy, Bot, Sparkles, Wand2, X, Globe, Download, Lock, ListChecks, AlertTriangle, FileX, SkipForward, Check, KeyRound, Pause, History, ListTodo, ChevronUp, Activity, Hourglass, MoreVertical, TriangleAlert, CheckSquare, Square, CheckCircle2, ArrowLeft, LayoutGrid, List } from 'lucide-react';
|
|
15
16
|
|
|
16
17
|
// src/agents/workflows/types.ts
|
|
17
18
|
var EMPTY_WORKFLOW_SCOPE = { folders: [], labels: [] };
|
|
@@ -859,7 +860,7 @@ var DEFAULT_AGENT_CARD_LABELS = {
|
|
|
859
860
|
running: "Running",
|
|
860
861
|
runningIndicator: "Running",
|
|
861
862
|
runningCount: (count) => `${count} running`,
|
|
862
|
-
taskCount: (count) => count > 0 ?
|
|
863
|
+
taskCount: (count) => count > 0 ? formatCount(count, { one: "task", other: "tasks" }) : "no tasks yet",
|
|
863
864
|
goalMet: (met, total) => `\u2713 ${met}/${total} met`,
|
|
864
865
|
watch: "Watch",
|
|
865
866
|
assignTask: "Assign task",
|
|
@@ -1219,6 +1220,7 @@ var DEFAULT_AGENT_CREATOR_LABELS = {
|
|
|
1219
1220
|
workspaceAccess: "Workspace access",
|
|
1220
1221
|
workspaceAccessHint: "Each workspace stays separate. The agent can only read the ones you tick here.",
|
|
1221
1222
|
workspaceAlready: "Already has access",
|
|
1223
|
+
revokeWorkspace: (name) => `Remove access to ${name}`,
|
|
1222
1224
|
noWorkspacesToGrant: "You have no workspaces yet.",
|
|
1223
1225
|
name: "Name",
|
|
1224
1226
|
nameHint: "Letters, digits, - and _ only; must start with a letter or digit.",
|
|
@@ -1294,6 +1296,8 @@ function AgentCreator({
|
|
|
1294
1296
|
models = [],
|
|
1295
1297
|
workspaces = [],
|
|
1296
1298
|
grantedWorkspaceIds = [],
|
|
1299
|
+
onRevokeWorkspace,
|
|
1300
|
+
revokingWorkspaceId,
|
|
1297
1301
|
avatar,
|
|
1298
1302
|
types,
|
|
1299
1303
|
values: valuesProp,
|
|
@@ -1484,26 +1488,40 @@ function AgentCreator({
|
|
|
1484
1488
|
workspaces.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: l.noWorkspacesToGrant }) : /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: workspaces.map((w) => {
|
|
1485
1489
|
const already = grantedWorkspaceIds.includes(w.id);
|
|
1486
1490
|
const on = already || values.workspaceIds.includes(w.id);
|
|
1487
|
-
return /* @__PURE__ */
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1491
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
|
|
1492
|
+
/* @__PURE__ */ jsx(
|
|
1493
|
+
"button",
|
|
1494
|
+
{
|
|
1495
|
+
type: "button",
|
|
1496
|
+
role: "checkbox",
|
|
1497
|
+
"aria-checked": on,
|
|
1498
|
+
disabled: already,
|
|
1499
|
+
title: already ? l.workspaceAlready : void 0,
|
|
1500
|
+
"data-testid": `${id}-workspace-${w.id}`,
|
|
1501
|
+
onClick: () => patch({
|
|
1502
|
+
workspaceIds: on ? values.workspaceIds.filter((x) => x !== w.id) : [...values.workspaceIds, w.id]
|
|
1503
|
+
}),
|
|
1504
|
+
className: cn(
|
|
1505
|
+
"rounded-md border px-3 py-1.5 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60 pointer-coarse:min-h-11",
|
|
1506
|
+
on ? "border-primary bg-primary/10 text-primary" : "border-border [&:hover:not(:disabled)]:bg-accent"
|
|
1507
|
+
),
|
|
1508
|
+
children: w.name
|
|
1509
|
+
}
|
|
1510
|
+
),
|
|
1511
|
+
already && onRevokeWorkspace && /* @__PURE__ */ jsx(
|
|
1512
|
+
"button",
|
|
1513
|
+
{
|
|
1514
|
+
type: "button",
|
|
1515
|
+
"aria-label": l.revokeWorkspace(w.name),
|
|
1516
|
+
title: l.revokeWorkspace(w.name),
|
|
1517
|
+
disabled: revokingWorkspaceId === w.id,
|
|
1518
|
+
"data-testid": `${id}-workspace-${w.id}-revoke`,
|
|
1519
|
+
onClick: () => onRevokeWorkspace(w.id),
|
|
1520
|
+
className: "flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 pointer-coarse:size-11",
|
|
1521
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": true })
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] }, w.id);
|
|
1507
1525
|
}) })
|
|
1508
1526
|
] }),
|
|
1509
1527
|
models.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -1560,6 +1578,31 @@ function AgentCreator({
|
|
|
1560
1578
|
}
|
|
1561
1579
|
) });
|
|
1562
1580
|
}
|
|
1581
|
+
|
|
1582
|
+
// src/agents/definitions/persona.ts
|
|
1583
|
+
function composePersona(name, description) {
|
|
1584
|
+
const body = description.trim();
|
|
1585
|
+
const preamble = `You are ${name}, an AI agent.`;
|
|
1586
|
+
return body ? `${preamble} ${body}` : preamble;
|
|
1587
|
+
}
|
|
1588
|
+
function stripPersonaPreamble(persona) {
|
|
1589
|
+
return persona.replace(/^You are .+?, an AI agent\.\s*/, "").trim();
|
|
1590
|
+
}
|
|
1591
|
+
function agentCreatorToConfigSection(values, capabilityKeys) {
|
|
1592
|
+
return {
|
|
1593
|
+
PERSONA: composePersona(values.name, values.persona),
|
|
1594
|
+
...values.modelName ? { AGENT_MODEL_NAME: values.modelName } : {},
|
|
1595
|
+
...Object.fromEntries(capabilityKeys.map((k) => [k, !!values.capabilities[k]]))
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
function agentConfigSectionToValues(section, capabilityKeys) {
|
|
1599
|
+
const s = section ?? {};
|
|
1600
|
+
return {
|
|
1601
|
+
persona: stripPersonaPreamble(String(s.PERSONA ?? "")),
|
|
1602
|
+
modelName: String(s.AGENT_MODEL_NAME ?? ""),
|
|
1603
|
+
capabilities: Object.fromEntries(capabilityKeys.map((k) => [k, Boolean(s[k])]))
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1563
1606
|
function SkillTypeBadge({ type, className }) {
|
|
1564
1607
|
return /* @__PURE__ */ jsx(
|
|
1565
1608
|
"span",
|
|
@@ -3865,6 +3908,106 @@ function TaskComposer({
|
|
|
3865
3908
|
}
|
|
3866
3909
|
) });
|
|
3867
3910
|
}
|
|
3911
|
+
|
|
3912
|
+
// src/agents/tasks/taskRequest.ts
|
|
3913
|
+
var TRIGGER_FOR = {
|
|
3914
|
+
now: "one_time",
|
|
3915
|
+
once: "one_time",
|
|
3916
|
+
repeat: "recurring",
|
|
3917
|
+
event: "event"
|
|
3918
|
+
};
|
|
3919
|
+
function authModeFor(values) {
|
|
3920
|
+
if (values.when === "now") return "run_now_temp";
|
|
3921
|
+
return values.access === "standing" ? "scheduled_permanent" : "scheduled_require_auth";
|
|
3922
|
+
}
|
|
3923
|
+
function localInputToIso(local) {
|
|
3924
|
+
const d = new Date(local);
|
|
3925
|
+
if (!local || Number.isNaN(d.getTime())) throw new Error("Pick a valid date and time.");
|
|
3926
|
+
return d.toISOString();
|
|
3927
|
+
}
|
|
3928
|
+
function isoToLocalInput(iso) {
|
|
3929
|
+
if (!iso) return "";
|
|
3930
|
+
const d = new Date(iso);
|
|
3931
|
+
if (Number.isNaN(d.getTime())) return "";
|
|
3932
|
+
return new Date(d.getTime() - d.getTimezoneOffset() * 6e4).toISOString().slice(0, 16);
|
|
3933
|
+
}
|
|
3934
|
+
function workflowTaskFields(workflow, inputs, name) {
|
|
3935
|
+
const typed = name?.trim();
|
|
3936
|
+
if (workflow.options?.agent === false) {
|
|
3937
|
+
const message = composeWorkflowPrompt(workflow, inputs);
|
|
3938
|
+
return { name: typed || message, action_type: "notify", prompt: "", skill_ref: null };
|
|
3939
|
+
}
|
|
3940
|
+
if (workflow.skill) {
|
|
3941
|
+
return {
|
|
3942
|
+
name: typed || workflow.title,
|
|
3943
|
+
action_type: "run_skill",
|
|
3944
|
+
prompt: typeof inputs.args === "string" ? inputs.args.trim() : "",
|
|
3945
|
+
skill_ref: workflow.skill
|
|
3946
|
+
};
|
|
3947
|
+
}
|
|
3948
|
+
return {
|
|
3949
|
+
name: typed || workflow.title,
|
|
3950
|
+
action_type: "agent_prompt",
|
|
3951
|
+
prompt: composeWorkflowPrompt(workflow, inputs),
|
|
3952
|
+
skill_ref: null
|
|
3953
|
+
};
|
|
3954
|
+
}
|
|
3955
|
+
var isAgenticWorkflow = (workflow) => workflow.options?.agent !== false;
|
|
3956
|
+
function taskComposerToCreateRequest({ workflow, values }, workspaceId) {
|
|
3957
|
+
const fields = workflowTaskFields(workflow, values.inputs, values.name);
|
|
3958
|
+
const agentic = isAgenticWorkflow(workflow);
|
|
3959
|
+
if (agentic && !workspaceId) throw new Error("Open a workspace to run an agent task.");
|
|
3960
|
+
return {
|
|
3961
|
+
name: fields.name,
|
|
3962
|
+
trigger_type: TRIGGER_FOR[values.when],
|
|
3963
|
+
timezone: values.timezone,
|
|
3964
|
+
action_type: fields.action_type,
|
|
3965
|
+
prompt: fields.prompt,
|
|
3966
|
+
rrule: values.when === "repeat" ? values.rrule.trim() : null,
|
|
3967
|
+
run_at: values.when === "once" ? localInputToIso(values.runAt) : values.when === "now" ? (/* @__PURE__ */ new Date()).toISOString() : null,
|
|
3968
|
+
event_kind: values.when === "event" ? values.eventKind.trim() : null,
|
|
3969
|
+
skill_ref: fields.skill_ref,
|
|
3970
|
+
notify_on_complete: values.notifyOnComplete,
|
|
3971
|
+
auth_mode: authModeFor(values),
|
|
3972
|
+
workspace_ext_id: agentic ? workspaceId ?? null : null,
|
|
3973
|
+
agent_ext_id: values.agentId || null
|
|
3974
|
+
};
|
|
3975
|
+
}
|
|
3976
|
+
function taskComposerToUpdateRequest({
|
|
3977
|
+
workflow,
|
|
3978
|
+
values
|
|
3979
|
+
}) {
|
|
3980
|
+
const fields = workflowTaskFields(workflow, values.inputs, values.name);
|
|
3981
|
+
return {
|
|
3982
|
+
name: fields.name,
|
|
3983
|
+
rrule: values.when === "repeat" ? values.rrule.trim() : null,
|
|
3984
|
+
run_at: values.when === "once" && values.runAt ? localInputToIso(values.runAt) : null,
|
|
3985
|
+
timezone: values.timezone,
|
|
3986
|
+
prompt: fields.prompt,
|
|
3987
|
+
skill_ref: fields.skill_ref,
|
|
3988
|
+
notify_on_complete: values.notifyOnComplete,
|
|
3989
|
+
auth_mode: authModeFor(values)
|
|
3990
|
+
};
|
|
3991
|
+
}
|
|
3992
|
+
var taskNeedsAccess = (task) => !!task.pending_auth_request_id;
|
|
3993
|
+
function taskToComposerValues(task, workflows) {
|
|
3994
|
+
const reminder = task.action_type === "notify";
|
|
3995
|
+
const auth = task.auth_mode ?? "scheduled_permanent";
|
|
3996
|
+
const when = auth === "run_now_temp" ? "now" : task.trigger_type === "recurring" ? "repeat" : task.trigger_type === "event" ? "event" : "once";
|
|
3997
|
+
return {
|
|
3998
|
+
workflowId: reminder ? workflows.reminderWorkflowId : workflows.customWorkflowId,
|
|
3999
|
+
inputs: reminder ? { message: task.name } : { instruction: task.prompt },
|
|
4000
|
+
when,
|
|
4001
|
+
runAt: isoToLocalInput(task.run_at),
|
|
4002
|
+
rrule: task.rrule ?? "",
|
|
4003
|
+
timezone: task.timezone,
|
|
4004
|
+
eventKind: task.event_kind ?? "user_message",
|
|
4005
|
+
agentId: task.agent_ext_id ?? "",
|
|
4006
|
+
name: task.name,
|
|
4007
|
+
notifyOnComplete: task.notify_on_complete ?? false,
|
|
4008
|
+
access: auth === "scheduled_permanent" ? "standing" : "ask_each_run"
|
|
4009
|
+
};
|
|
4010
|
+
}
|
|
3868
4011
|
var DEFAULT_TUPLE_ARRAY_FIELD_LABELS = {
|
|
3869
4012
|
addRow: "Add Row",
|
|
3870
4013
|
empty: 'No examples added yet. Click "Add Row" to start.',
|
|
@@ -5523,6 +5666,6 @@ function AgentCreateView({
|
|
|
5523
5666
|
] });
|
|
5524
5667
|
}
|
|
5525
5668
|
|
|
5526
|
-
export { ACTION_LABELS, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_LIVE_RUNS_BANNER_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COLUMN_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_ROW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, EMPTY_WORKFLOW_SCOPE, GoalCriteria, LiveRunsBanner, NewTaskEmptyAction, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TRIGGER_LABELS, TaskComposer, TaskPlan, TaskRowActions, TaskRunsDialog, TasksBulkBar, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WorkflowConfigDialog, WorkflowLauncher, buildLaunch, buildRRule, composeWorkflowPrompt, createTaskColumns, defaultInputs, defaultTaskComposerValues, deriveAgentName, describeRRule, formatElapsed, goalProgress, humanizeSection, inferType, inputsFromContext, isEmptyWorkflowScope, isOutOfBounds, isValidAgentName, isWorkflowScope, nextCriterionId, parseRRule, prettifyKey, promptFieldName, skillToWorkflow, statusBadgeVariant, summarizeAgent, summarizeCapabilities, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowsAccepting, workflowsForHost };
|
|
5527
|
-
//# sourceMappingURL=chunk-
|
|
5528
|
-
//# sourceMappingURL=chunk-
|
|
5669
|
+
export { ACTION_LABELS, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_LIVE_RUNS_BANNER_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COLUMN_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_ROW_ACTIONS_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, EMPTY_WORKFLOW_SCOPE, GoalCriteria, LiveRunsBanner, NewTaskEmptyAction, RecurrenceBuilder, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STATUS_LABELS, SchemaForm, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TRIGGER_LABELS, TaskComposer, TaskPlan, TaskRowActions, TaskRunsDialog, TasksBulkBar, TasksToolbar, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WorkflowConfigDialog, WorkflowLauncher, agentConfigSectionToValues, agentCreatorToConfigSection, authModeFor, buildLaunch, buildRRule, composePersona, composeWorkflowPrompt, createTaskColumns, defaultInputs, defaultTaskComposerValues, deriveAgentName, describeRRule, formatElapsed, goalProgress, humanizeSection, inferType, inputsFromContext, isAgenticWorkflow, isEmptyWorkflowScope, isOutOfBounds, isValidAgentName, isWorkflowScope, isoToLocalInput, localInputToIso, nextCriterionId, parseRRule, prettifyKey, promptFieldName, skillToWorkflow, statusBadgeVariant, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, validateInputs, workflowAccepts, workflowFromFrontmatter, workflowTaskFields, workflowsAccepting, workflowsForHost };
|
|
5670
|
+
//# sourceMappingURL=chunk-BBEMPS6C.js.map
|
|
5671
|
+
//# sourceMappingURL=chunk-BBEMPS6C.js.map
|