@getcatalystiq/agent-plane-ui 0.1.4 → 0.1.5

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.
@@ -0,0 +1,35 @@
1
+ import CodeMirror from '@uiw/react-codemirror';
2
+ import { markdown } from '@codemirror/lang-markdown';
3
+ import { javascript } from '@codemirror/lang-javascript';
4
+ import { json } from '@codemirror/lang-json';
5
+ import { oneDark } from '@codemirror/theme-one-dark';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ function getLanguage(filename) {
9
+ if (filename.endsWith(".md")) return markdown();
10
+ if (filename.endsWith(".json")) return json();
11
+ if (filename.endsWith(".js") || filename.endsWith(".ts") || filename.endsWith(".tsx")) return javascript({ typescript: filename.endsWith(".ts") || filename.endsWith(".tsx") });
12
+ return markdown();
13
+ }
14
+ function CodeEditor({ value, onChange, filename }) {
15
+ return /* @__PURE__ */ jsx(
16
+ CodeMirror,
17
+ {
18
+ value,
19
+ onChange,
20
+ extensions: [getLanguage(filename)],
21
+ theme: oneDark,
22
+ height: "100%",
23
+ minHeight: "300px",
24
+ basicSetup: {
25
+ lineNumbers: true,
26
+ foldGutter: true,
27
+ highlightActiveLine: true,
28
+ autocompletion: false
29
+ },
30
+ className: "text-sm rounded overflow-hidden border border-border"
31
+ }
32
+ );
33
+ }
34
+
35
+ export { CodeEditor as default };
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var CodeMirror = require('@uiw/react-codemirror');
4
+ var langMarkdown = require('@codemirror/lang-markdown');
5
+ var langJavascript = require('@codemirror/lang-javascript');
6
+ var langJson = require('@codemirror/lang-json');
7
+ var themeOneDark = require('@codemirror/theme-one-dark');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var CodeMirror__default = /*#__PURE__*/_interopDefault(CodeMirror);
13
+
14
+ function getLanguage(filename) {
15
+ if (filename.endsWith(".md")) return langMarkdown.markdown();
16
+ if (filename.endsWith(".json")) return langJson.json();
17
+ if (filename.endsWith(".js") || filename.endsWith(".ts") || filename.endsWith(".tsx")) return langJavascript.javascript({ typescript: filename.endsWith(".ts") || filename.endsWith(".tsx") });
18
+ return langMarkdown.markdown();
19
+ }
20
+ function CodeEditor({ value, onChange, filename }) {
21
+ return /* @__PURE__ */ jsxRuntime.jsx(
22
+ CodeMirror__default.default,
23
+ {
24
+ value,
25
+ onChange,
26
+ extensions: [getLanguage(filename)],
27
+ theme: themeOneDark.oneDark,
28
+ height: "100%",
29
+ minHeight: "300px",
30
+ basicSetup: {
31
+ lineNumbers: true,
32
+ foldGutter: true,
33
+ highlightActiveLine: true,
34
+ autocompletion: false
35
+ },
36
+ className: "text-sm rounded overflow-hidden border border-border"
37
+ }
38
+ );
39
+ }
40
+
41
+ module.exports = CodeEditor;
package/dist/index.cjs CHANGED
@@ -3099,6 +3099,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
3099
3099
  )
3100
3100
  ] });
3101
3101
  }
3102
+ var CodeEditor = React3.lazy(() => import('./code-editor-ZD5ZILTM.cjs'));
3102
3103
  function AgentSkillManager({ agentId, initialSkills, onSaved }) {
3103
3104
  const client = useAgentPlaneClient();
3104
3105
  const initialFiles = React3.useMemo(
@@ -3210,15 +3211,14 @@ function AgentSkillManager({ agentId, initialSkills, onSaved }) {
3210
3211
  },
3211
3212
  f.path
3212
3213
  )) }),
3213
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: selectedFile ? /* @__PURE__ */ jsxRuntime.jsx(
3214
- Textarea,
3214
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: selectedFile ? /* @__PURE__ */ jsxRuntime.jsx(React3.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[300px] animate-pulse bg-muted/50 rounded" }), children: /* @__PURE__ */ jsxRuntime.jsx(
3215
+ CodeEditor,
3215
3216
  {
3216
3217
  value: selectedFile.content,
3217
- onChange: (e) => updateFileContent(selectedFile.path, e.target.value),
3218
- className: "h-full min-h-[300px] font-mono text-xs resize-y",
3219
- placeholder: "Enter skill content..."
3218
+ onChange: (val) => updateFileContent(selectedFile.path, val),
3219
+ filename: selectedFile.path
3220
3220
  }
3221
- ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Select a file to edit" }) })
3221
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Select a file to edit" }) })
3222
3222
  ] })
3223
3223
  ] });
3224
3224
  }
@@ -3377,141 +3377,6 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
3377
3377
  ] })
3378
3378
  ] });
3379
3379
  }
3380
- var FREQUENCIES = [
3381
- { value: "manual", label: "Manual (no schedule)" },
3382
- { value: "hourly", label: "Hourly" },
3383
- { value: "daily", label: "Daily" },
3384
- { value: "weekdays", label: "Weekdays (Mon-Fri)" },
3385
- { value: "weekly", label: "Weekly" }
3386
- ];
3387
- var DAYS_OF_WEEK = [
3388
- { value: 0, label: "Sunday" },
3389
- { value: 1, label: "Monday" },
3390
- { value: 2, label: "Tuesday" },
3391
- { value: 3, label: "Wednesday" },
3392
- { value: 4, label: "Thursday" },
3393
- { value: 5, label: "Friday" },
3394
- { value: 6, label: "Saturday" }
3395
- ];
3396
- function formatTimeForInput(time) {
3397
- if (!time) return "09:00";
3398
- return time.slice(0, 5);
3399
- }
3400
- function AgentScheduleForm({ initialSchedules, timezone }) {
3401
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
3402
- /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Schedules", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
3403
- "Timezone: ",
3404
- timezone
3405
- ] }) }),
3406
- initialSchedules.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No schedules configured." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: initialSchedules.map((schedule) => /* @__PURE__ */ jsxRuntime.jsx(
3407
- ScheduleCard,
3408
- {
3409
- schedule,
3410
- timezone
3411
- },
3412
- schedule.id
3413
- )) })
3414
- ] });
3415
- }
3416
- function ScheduleCard({
3417
- schedule,
3418
- timezone
3419
- }) {
3420
- const [frequency, setFrequency] = React3.useState(schedule.frequency);
3421
- const [time, setTime] = React3.useState(formatTimeForInput(schedule.time));
3422
- const [dayOfWeek, setDayOfWeek] = React3.useState(schedule.day_of_week ?? 1);
3423
- const [prompt, setPrompt] = React3.useState(schedule.prompt ?? "");
3424
- const [enabled, setEnabled] = React3.useState(schedule.enabled);
3425
- const [name, setName] = React3.useState(schedule.name ?? "");
3426
- const showTimePicker = ["daily", "weekdays", "weekly"].includes(frequency);
3427
- const showDayPicker = frequency === "weekly";
3428
- const canEnable = frequency !== "manual";
3429
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded border border-muted-foreground/15 p-4 space-y-3", children: [
3430
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
3431
- /* @__PURE__ */ jsxRuntime.jsx(
3432
- Input,
3433
- {
3434
- value: name,
3435
- onChange: (e) => setName(e.target.value),
3436
- placeholder: "Schedule name (optional)",
3437
- className: "max-w-xs text-sm"
3438
- }
3439
- ),
3440
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children: canEnable && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
3441
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: enabled ? "Enabled" : "Disabled" }),
3442
- /* @__PURE__ */ jsxRuntime.jsx(
3443
- "button",
3444
- {
3445
- type: "button",
3446
- role: "switch",
3447
- "aria-checked": enabled,
3448
- onClick: () => setEnabled(!enabled),
3449
- className: `relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${enabled ? "bg-primary" : "bg-muted"}`,
3450
- children: /* @__PURE__ */ jsxRuntime.jsx(
3451
- "span",
3452
- {
3453
- className: `pointer-events-none inline-block h-4 w-4 transform rounded-full bg-background shadow-lg ring-0 transition-transform ${enabled ? "translate-x-4" : "translate-x-0"}`
3454
- }
3455
- )
3456
- }
3457
- )
3458
- ] }) })
3459
- ] }),
3460
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3461
- /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Frequency", children: /* @__PURE__ */ jsxRuntime.jsx(
3462
- Select,
3463
- {
3464
- value: frequency,
3465
- onChange: (e) => {
3466
- const newFreq = e.target.value;
3467
- setFrequency(newFreq);
3468
- if (newFreq === "manual") setEnabled(false);
3469
- else setEnabled(true);
3470
- },
3471
- children: FREQUENCIES.map((f) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: f.value, children: f.label }, f.value))
3472
- }
3473
- ) }),
3474
- showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: `Time (${timezone})`, children: /* @__PURE__ */ jsxRuntime.jsx(
3475
- Input,
3476
- {
3477
- type: "time",
3478
- value: time,
3479
- onChange: (e) => setTime(e.target.value)
3480
- }
3481
- ) }),
3482
- showDayPicker && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Day of Week", children: /* @__PURE__ */ jsxRuntime.jsx(
3483
- Select,
3484
- {
3485
- value: dayOfWeek.toString(),
3486
- onChange: (e) => setDayOfWeek(parseInt(e.target.value)),
3487
- children: DAYS_OF_WEEK.map((d) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: d.value, children: d.label }, d.value))
3488
- }
3489
- ) })
3490
- ] }),
3491
- frequency !== "manual" && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Prompt", children: /* @__PURE__ */ jsxRuntime.jsx(
3492
- Textarea,
3493
- {
3494
- value: prompt,
3495
- onChange: (e) => setPrompt(e.target.value),
3496
- rows: 3,
3497
- placeholder: "Enter the prompt to send on each scheduled run...",
3498
- className: "resize-y min-h-[60px]"
3499
- }
3500
- ) }),
3501
- (schedule.last_run_at || schedule.next_run_at) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-6 text-sm text-muted-foreground pt-1", children: [
3502
- schedule.last_run_at && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3503
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Last run:" }),
3504
- " ",
3505
- /* @__PURE__ */ jsxRuntime.jsx(LocalDate, { value: schedule.last_run_at })
3506
- ] }),
3507
- schedule.next_run_at && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3508
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Next run:" }),
3509
- " ",
3510
- /* @__PURE__ */ jsxRuntime.jsx(LocalDate, { value: schedule.next_run_at })
3511
- ] })
3512
- ] })
3513
- ] });
3514
- }
3515
3380
  function AgentRuns({ agentId }) {
3516
3381
  const { LinkComponent, basePath } = useNavigation();
3517
3382
  const { data, error, isLoading } = useApi(
@@ -3751,7 +3616,7 @@ function AgentA2aInfo({
3751
3616
  ] })
3752
3617
  ] });
3753
3618
  }
3754
- function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone = "UTC" }) {
3619
+ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
3755
3620
  const { LinkComponent, basePath } = useNavigation();
3756
3621
  const { mutate } = useSWR.useSWRConfig();
3757
3622
  const cacheKey = `agent-${agentId}`;
@@ -3854,16 +3719,6 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone = "UTC" })
3854
3719
  }
3855
3720
  )
3856
3721
  },
3857
- {
3858
- label: "Schedules",
3859
- content: /* @__PURE__ */ jsxRuntime.jsx(
3860
- AgentScheduleForm,
3861
- {
3862
- initialSchedules: [],
3863
- timezone
3864
- }
3865
- )
3866
- },
3867
3722
  {
3868
3723
  label: "Runs",
3869
3724
  content: /* @__PURE__ */ jsxRuntime.jsx(AgentRuns, { agentId: agent.id })
@@ -3873,6 +3728,141 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone = "UTC" })
3873
3728
  )
3874
3729
  ] });
3875
3730
  }
3731
+ var FREQUENCIES = [
3732
+ { value: "manual", label: "Manual (no schedule)" },
3733
+ { value: "hourly", label: "Hourly" },
3734
+ { value: "daily", label: "Daily" },
3735
+ { value: "weekdays", label: "Weekdays (Mon-Fri)" },
3736
+ { value: "weekly", label: "Weekly" }
3737
+ ];
3738
+ var DAYS_OF_WEEK = [
3739
+ { value: 0, label: "Sunday" },
3740
+ { value: 1, label: "Monday" },
3741
+ { value: 2, label: "Tuesday" },
3742
+ { value: 3, label: "Wednesday" },
3743
+ { value: 4, label: "Thursday" },
3744
+ { value: 5, label: "Friday" },
3745
+ { value: 6, label: "Saturday" }
3746
+ ];
3747
+ function formatTimeForInput(time) {
3748
+ if (!time) return "09:00";
3749
+ return time.slice(0, 5);
3750
+ }
3751
+ function AgentScheduleForm({ initialSchedules, timezone }) {
3752
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
3753
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Schedules", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
3754
+ "Timezone: ",
3755
+ timezone
3756
+ ] }) }),
3757
+ initialSchedules.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No schedules configured." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: initialSchedules.map((schedule) => /* @__PURE__ */ jsxRuntime.jsx(
3758
+ ScheduleCard,
3759
+ {
3760
+ schedule,
3761
+ timezone
3762
+ },
3763
+ schedule.id
3764
+ )) })
3765
+ ] });
3766
+ }
3767
+ function ScheduleCard({
3768
+ schedule,
3769
+ timezone
3770
+ }) {
3771
+ const [frequency, setFrequency] = React3.useState(schedule.frequency);
3772
+ const [time, setTime] = React3.useState(formatTimeForInput(schedule.time));
3773
+ const [dayOfWeek, setDayOfWeek] = React3.useState(schedule.day_of_week ?? 1);
3774
+ const [prompt, setPrompt] = React3.useState(schedule.prompt ?? "");
3775
+ const [enabled, setEnabled] = React3.useState(schedule.enabled);
3776
+ const [name, setName] = React3.useState(schedule.name ?? "");
3777
+ const showTimePicker = ["daily", "weekdays", "weekly"].includes(frequency);
3778
+ const showDayPicker = frequency === "weekly";
3779
+ const canEnable = frequency !== "manual";
3780
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded border border-muted-foreground/15 p-4 space-y-3", children: [
3781
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
3782
+ /* @__PURE__ */ jsxRuntime.jsx(
3783
+ Input,
3784
+ {
3785
+ value: name,
3786
+ onChange: (e) => setName(e.target.value),
3787
+ placeholder: "Schedule name (optional)",
3788
+ className: "max-w-xs text-sm"
3789
+ }
3790
+ ),
3791
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children: canEnable && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
3792
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: enabled ? "Enabled" : "Disabled" }),
3793
+ /* @__PURE__ */ jsxRuntime.jsx(
3794
+ "button",
3795
+ {
3796
+ type: "button",
3797
+ role: "switch",
3798
+ "aria-checked": enabled,
3799
+ onClick: () => setEnabled(!enabled),
3800
+ className: `relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${enabled ? "bg-primary" : "bg-muted"}`,
3801
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3802
+ "span",
3803
+ {
3804
+ className: `pointer-events-none inline-block h-4 w-4 transform rounded-full bg-background shadow-lg ring-0 transition-transform ${enabled ? "translate-x-4" : "translate-x-0"}`
3805
+ }
3806
+ )
3807
+ }
3808
+ )
3809
+ ] }) })
3810
+ ] }),
3811
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3812
+ /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Frequency", children: /* @__PURE__ */ jsxRuntime.jsx(
3813
+ Select,
3814
+ {
3815
+ value: frequency,
3816
+ onChange: (e) => {
3817
+ const newFreq = e.target.value;
3818
+ setFrequency(newFreq);
3819
+ if (newFreq === "manual") setEnabled(false);
3820
+ else setEnabled(true);
3821
+ },
3822
+ children: FREQUENCIES.map((f) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: f.value, children: f.label }, f.value))
3823
+ }
3824
+ ) }),
3825
+ showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: `Time (${timezone})`, children: /* @__PURE__ */ jsxRuntime.jsx(
3826
+ Input,
3827
+ {
3828
+ type: "time",
3829
+ value: time,
3830
+ onChange: (e) => setTime(e.target.value)
3831
+ }
3832
+ ) }),
3833
+ showDayPicker && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Day of Week", children: /* @__PURE__ */ jsxRuntime.jsx(
3834
+ Select,
3835
+ {
3836
+ value: dayOfWeek.toString(),
3837
+ onChange: (e) => setDayOfWeek(parseInt(e.target.value)),
3838
+ children: DAYS_OF_WEEK.map((d) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: d.value, children: d.label }, d.value))
3839
+ }
3840
+ ) })
3841
+ ] }),
3842
+ frequency !== "manual" && /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Prompt", children: /* @__PURE__ */ jsxRuntime.jsx(
3843
+ Textarea,
3844
+ {
3845
+ value: prompt,
3846
+ onChange: (e) => setPrompt(e.target.value),
3847
+ rows: 3,
3848
+ placeholder: "Enter the prompt to send on each scheduled run...",
3849
+ className: "resize-y min-h-[60px]"
3850
+ }
3851
+ ) }),
3852
+ (schedule.last_run_at || schedule.next_run_at) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-6 text-sm text-muted-foreground pt-1", children: [
3853
+ schedule.last_run_at && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3854
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Last run:" }),
3855
+ " ",
3856
+ /* @__PURE__ */ jsxRuntime.jsx(LocalDate, { value: schedule.last_run_at })
3857
+ ] }),
3858
+ schedule.next_run_at && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3859
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Next run:" }),
3860
+ " ",
3861
+ /* @__PURE__ */ jsxRuntime.jsx(LocalDate, { value: schedule.next_run_at })
3862
+ ] })
3863
+ ] })
3864
+ ] });
3865
+ }
3876
3866
 
3877
3867
  exports.AdminTable = AdminTable;
3878
3868
  exports.AdminTableHead = AdminTableHead;
package/dist/index.d.cts CHANGED
@@ -526,10 +526,8 @@ interface AgentDetailPageProps {
526
526
  a2aBaseUrl?: string;
527
527
  /** Tenant slug (needed for A2A URLs) */
528
528
  tenantSlug?: string;
529
- /** Tenant timezone (for schedule display) */
530
- timezone?: string;
531
529
  }
532
- declare function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
530
+ declare function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
533
531
 
534
532
  interface Agent {
535
533
  id: string;
package/dist/index.d.ts CHANGED
@@ -526,10 +526,8 @@ interface AgentDetailPageProps {
526
526
  a2aBaseUrl?: string;
527
527
  /** Tenant slug (needed for A2A URLs) */
528
528
  tenantSlug?: string;
529
- /** Tenant timezone (for schedule display) */
530
- timezone?: string;
531
529
  }
532
- declare function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
530
+ declare function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
533
531
 
534
532
  interface Agent {
535
533
  id: string;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React3 from 'react';
2
- import React3__default, { createContext, useRef, useMemo, useContext, useState, useCallback, useEffect } from 'react';
2
+ import React3__default, { createContext, lazy, useRef, useMemo, useContext, useState, useCallback, useEffect, Suspense } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import useSWR, { useSWRConfig } from 'swr';
5
5
  import { clsx } from 'clsx';
@@ -3073,6 +3073,7 @@ function AgentConnectorsManager({ agentId, toolkits: initialToolkits, composioAl
3073
3073
  )
3074
3074
  ] });
3075
3075
  }
3076
+ var CodeEditor = lazy(() => import('./code-editor-E7L6Y3LM.js'));
3076
3077
  function AgentSkillManager({ agentId, initialSkills, onSaved }) {
3077
3078
  const client = useAgentPlaneClient();
3078
3079
  const initialFiles = useMemo(
@@ -3184,15 +3185,14 @@ function AgentSkillManager({ agentId, initialSkills, onSaved }) {
3184
3185
  },
3185
3186
  f.path
3186
3187
  )) }),
3187
- /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: selectedFile ? /* @__PURE__ */ jsx(
3188
- Textarea,
3188
+ /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: selectedFile ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { className: "h-[300px] animate-pulse bg-muted/50 rounded" }), children: /* @__PURE__ */ jsx(
3189
+ CodeEditor,
3189
3190
  {
3190
3191
  value: selectedFile.content,
3191
- onChange: (e) => updateFileContent(selectedFile.path, e.target.value),
3192
- className: "h-full min-h-[300px] font-mono text-xs resize-y",
3193
- placeholder: "Enter skill content..."
3192
+ onChange: (val) => updateFileContent(selectedFile.path, val),
3193
+ filename: selectedFile.path
3194
3194
  }
3195
- ) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Select a file to edit" }) })
3195
+ ) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Select a file to edit" }) })
3196
3196
  ] })
3197
3197
  ] });
3198
3198
  }
@@ -3351,141 +3351,6 @@ function AgentPluginManager({ agentId, initialPlugins, onSaved }) {
3351
3351
  ] })
3352
3352
  ] });
3353
3353
  }
3354
- var FREQUENCIES = [
3355
- { value: "manual", label: "Manual (no schedule)" },
3356
- { value: "hourly", label: "Hourly" },
3357
- { value: "daily", label: "Daily" },
3358
- { value: "weekdays", label: "Weekdays (Mon-Fri)" },
3359
- { value: "weekly", label: "Weekly" }
3360
- ];
3361
- var DAYS_OF_WEEK = [
3362
- { value: 0, label: "Sunday" },
3363
- { value: 1, label: "Monday" },
3364
- { value: 2, label: "Tuesday" },
3365
- { value: 3, label: "Wednesday" },
3366
- { value: 4, label: "Thursday" },
3367
- { value: 5, label: "Friday" },
3368
- { value: 6, label: "Saturday" }
3369
- ];
3370
- function formatTimeForInput(time) {
3371
- if (!time) return "09:00";
3372
- return time.slice(0, 5);
3373
- }
3374
- function AgentScheduleForm({ initialSchedules, timezone }) {
3375
- return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
3376
- /* @__PURE__ */ jsx(SectionHeader, { title: "Schedules", children: /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
3377
- "Timezone: ",
3378
- timezone
3379
- ] }) }),
3380
- initialSchedules.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No schedules configured." }) : /* @__PURE__ */ jsx("div", { className: "space-y-4", children: initialSchedules.map((schedule) => /* @__PURE__ */ jsx(
3381
- ScheduleCard,
3382
- {
3383
- schedule,
3384
- timezone
3385
- },
3386
- schedule.id
3387
- )) })
3388
- ] });
3389
- }
3390
- function ScheduleCard({
3391
- schedule,
3392
- timezone
3393
- }) {
3394
- const [frequency, setFrequency] = useState(schedule.frequency);
3395
- const [time, setTime] = useState(formatTimeForInput(schedule.time));
3396
- const [dayOfWeek, setDayOfWeek] = useState(schedule.day_of_week ?? 1);
3397
- const [prompt, setPrompt] = useState(schedule.prompt ?? "");
3398
- const [enabled, setEnabled] = useState(schedule.enabled);
3399
- const [name, setName] = useState(schedule.name ?? "");
3400
- const showTimePicker = ["daily", "weekdays", "weekly"].includes(frequency);
3401
- const showDayPicker = frequency === "weekly";
3402
- const canEnable = frequency !== "manual";
3403
- return /* @__PURE__ */ jsxs("div", { className: "rounded border border-muted-foreground/15 p-4 space-y-3", children: [
3404
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
3405
- /* @__PURE__ */ jsx(
3406
- Input,
3407
- {
3408
- value: name,
3409
- onChange: (e) => setName(e.target.value),
3410
- placeholder: "Schedule name (optional)",
3411
- className: "max-w-xs text-sm"
3412
- }
3413
- ),
3414
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: canEnable && /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
3415
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: enabled ? "Enabled" : "Disabled" }),
3416
- /* @__PURE__ */ jsx(
3417
- "button",
3418
- {
3419
- type: "button",
3420
- role: "switch",
3421
- "aria-checked": enabled,
3422
- onClick: () => setEnabled(!enabled),
3423
- className: `relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${enabled ? "bg-primary" : "bg-muted"}`,
3424
- children: /* @__PURE__ */ jsx(
3425
- "span",
3426
- {
3427
- className: `pointer-events-none inline-block h-4 w-4 transform rounded-full bg-background shadow-lg ring-0 transition-transform ${enabled ? "translate-x-4" : "translate-x-0"}`
3428
- }
3429
- )
3430
- }
3431
- )
3432
- ] }) })
3433
- ] }),
3434
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3435
- /* @__PURE__ */ jsx(FormField, { label: "Frequency", children: /* @__PURE__ */ jsx(
3436
- Select,
3437
- {
3438
- value: frequency,
3439
- onChange: (e) => {
3440
- const newFreq = e.target.value;
3441
- setFrequency(newFreq);
3442
- if (newFreq === "manual") setEnabled(false);
3443
- else setEnabled(true);
3444
- },
3445
- children: FREQUENCIES.map((f) => /* @__PURE__ */ jsx("option", { value: f.value, children: f.label }, f.value))
3446
- }
3447
- ) }),
3448
- showTimePicker && /* @__PURE__ */ jsx(FormField, { label: `Time (${timezone})`, children: /* @__PURE__ */ jsx(
3449
- Input,
3450
- {
3451
- type: "time",
3452
- value: time,
3453
- onChange: (e) => setTime(e.target.value)
3454
- }
3455
- ) }),
3456
- showDayPicker && /* @__PURE__ */ jsx(FormField, { label: "Day of Week", children: /* @__PURE__ */ jsx(
3457
- Select,
3458
- {
3459
- value: dayOfWeek.toString(),
3460
- onChange: (e) => setDayOfWeek(parseInt(e.target.value)),
3461
- children: DAYS_OF_WEEK.map((d) => /* @__PURE__ */ jsx("option", { value: d.value, children: d.label }, d.value))
3462
- }
3463
- ) })
3464
- ] }),
3465
- frequency !== "manual" && /* @__PURE__ */ jsx(FormField, { label: "Prompt", children: /* @__PURE__ */ jsx(
3466
- Textarea,
3467
- {
3468
- value: prompt,
3469
- onChange: (e) => setPrompt(e.target.value),
3470
- rows: 3,
3471
- placeholder: "Enter the prompt to send on each scheduled run...",
3472
- className: "resize-y min-h-[60px]"
3473
- }
3474
- ) }),
3475
- (schedule.last_run_at || schedule.next_run_at) && /* @__PURE__ */ jsxs("div", { className: "flex gap-6 text-sm text-muted-foreground pt-1", children: [
3476
- schedule.last_run_at && /* @__PURE__ */ jsxs("div", { children: [
3477
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Last run:" }),
3478
- " ",
3479
- /* @__PURE__ */ jsx(LocalDate, { value: schedule.last_run_at })
3480
- ] }),
3481
- schedule.next_run_at && /* @__PURE__ */ jsxs("div", { children: [
3482
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Next run:" }),
3483
- " ",
3484
- /* @__PURE__ */ jsx(LocalDate, { value: schedule.next_run_at })
3485
- ] })
3486
- ] })
3487
- ] });
3488
- }
3489
3354
  function AgentRuns({ agentId }) {
3490
3355
  const { LinkComponent, basePath } = useNavigation();
3491
3356
  const { data, error, isLoading } = useApi(
@@ -3725,7 +3590,7 @@ function AgentA2aInfo({
3725
3590
  ] })
3726
3591
  ] });
3727
3592
  }
3728
- function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone = "UTC" }) {
3593
+ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
3729
3594
  const { LinkComponent, basePath } = useNavigation();
3730
3595
  const { mutate } = useSWRConfig();
3731
3596
  const cacheKey = `agent-${agentId}`;
@@ -3828,16 +3693,6 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone = "UTC" })
3828
3693
  }
3829
3694
  )
3830
3695
  },
3831
- {
3832
- label: "Schedules",
3833
- content: /* @__PURE__ */ jsx(
3834
- AgentScheduleForm,
3835
- {
3836
- initialSchedules: [],
3837
- timezone
3838
- }
3839
- )
3840
- },
3841
3696
  {
3842
3697
  label: "Runs",
3843
3698
  content: /* @__PURE__ */ jsx(AgentRuns, { agentId: agent.id })
@@ -3847,5 +3702,140 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, timezone = "UTC" })
3847
3702
  )
3848
3703
  ] });
3849
3704
  }
3705
+ var FREQUENCIES = [
3706
+ { value: "manual", label: "Manual (no schedule)" },
3707
+ { value: "hourly", label: "Hourly" },
3708
+ { value: "daily", label: "Daily" },
3709
+ { value: "weekdays", label: "Weekdays (Mon-Fri)" },
3710
+ { value: "weekly", label: "Weekly" }
3711
+ ];
3712
+ var DAYS_OF_WEEK = [
3713
+ { value: 0, label: "Sunday" },
3714
+ { value: 1, label: "Monday" },
3715
+ { value: 2, label: "Tuesday" },
3716
+ { value: 3, label: "Wednesday" },
3717
+ { value: 4, label: "Thursday" },
3718
+ { value: 5, label: "Friday" },
3719
+ { value: 6, label: "Saturday" }
3720
+ ];
3721
+ function formatTimeForInput(time) {
3722
+ if (!time) return "09:00";
3723
+ return time.slice(0, 5);
3724
+ }
3725
+ function AgentScheduleForm({ initialSchedules, timezone }) {
3726
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-muted-foreground/25 p-5", children: [
3727
+ /* @__PURE__ */ jsx(SectionHeader, { title: "Schedules", children: /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
3728
+ "Timezone: ",
3729
+ timezone
3730
+ ] }) }),
3731
+ initialSchedules.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No schedules configured." }) : /* @__PURE__ */ jsx("div", { className: "space-y-4", children: initialSchedules.map((schedule) => /* @__PURE__ */ jsx(
3732
+ ScheduleCard,
3733
+ {
3734
+ schedule,
3735
+ timezone
3736
+ },
3737
+ schedule.id
3738
+ )) })
3739
+ ] });
3740
+ }
3741
+ function ScheduleCard({
3742
+ schedule,
3743
+ timezone
3744
+ }) {
3745
+ const [frequency, setFrequency] = useState(schedule.frequency);
3746
+ const [time, setTime] = useState(formatTimeForInput(schedule.time));
3747
+ const [dayOfWeek, setDayOfWeek] = useState(schedule.day_of_week ?? 1);
3748
+ const [prompt, setPrompt] = useState(schedule.prompt ?? "");
3749
+ const [enabled, setEnabled] = useState(schedule.enabled);
3750
+ const [name, setName] = useState(schedule.name ?? "");
3751
+ const showTimePicker = ["daily", "weekdays", "weekly"].includes(frequency);
3752
+ const showDayPicker = frequency === "weekly";
3753
+ const canEnable = frequency !== "manual";
3754
+ return /* @__PURE__ */ jsxs("div", { className: "rounded border border-muted-foreground/15 p-4 space-y-3", children: [
3755
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
3756
+ /* @__PURE__ */ jsx(
3757
+ Input,
3758
+ {
3759
+ value: name,
3760
+ onChange: (e) => setName(e.target.value),
3761
+ placeholder: "Schedule name (optional)",
3762
+ className: "max-w-xs text-sm"
3763
+ }
3764
+ ),
3765
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: canEnable && /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
3766
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: enabled ? "Enabled" : "Disabled" }),
3767
+ /* @__PURE__ */ jsx(
3768
+ "button",
3769
+ {
3770
+ type: "button",
3771
+ role: "switch",
3772
+ "aria-checked": enabled,
3773
+ onClick: () => setEnabled(!enabled),
3774
+ className: `relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${enabled ? "bg-primary" : "bg-muted"}`,
3775
+ children: /* @__PURE__ */ jsx(
3776
+ "span",
3777
+ {
3778
+ className: `pointer-events-none inline-block h-4 w-4 transform rounded-full bg-background shadow-lg ring-0 transition-transform ${enabled ? "translate-x-4" : "translate-x-0"}`
3779
+ }
3780
+ )
3781
+ }
3782
+ )
3783
+ ] }) })
3784
+ ] }),
3785
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3786
+ /* @__PURE__ */ jsx(FormField, { label: "Frequency", children: /* @__PURE__ */ jsx(
3787
+ Select,
3788
+ {
3789
+ value: frequency,
3790
+ onChange: (e) => {
3791
+ const newFreq = e.target.value;
3792
+ setFrequency(newFreq);
3793
+ if (newFreq === "manual") setEnabled(false);
3794
+ else setEnabled(true);
3795
+ },
3796
+ children: FREQUENCIES.map((f) => /* @__PURE__ */ jsx("option", { value: f.value, children: f.label }, f.value))
3797
+ }
3798
+ ) }),
3799
+ showTimePicker && /* @__PURE__ */ jsx(FormField, { label: `Time (${timezone})`, children: /* @__PURE__ */ jsx(
3800
+ Input,
3801
+ {
3802
+ type: "time",
3803
+ value: time,
3804
+ onChange: (e) => setTime(e.target.value)
3805
+ }
3806
+ ) }),
3807
+ showDayPicker && /* @__PURE__ */ jsx(FormField, { label: "Day of Week", children: /* @__PURE__ */ jsx(
3808
+ Select,
3809
+ {
3810
+ value: dayOfWeek.toString(),
3811
+ onChange: (e) => setDayOfWeek(parseInt(e.target.value)),
3812
+ children: DAYS_OF_WEEK.map((d) => /* @__PURE__ */ jsx("option", { value: d.value, children: d.label }, d.value))
3813
+ }
3814
+ ) })
3815
+ ] }),
3816
+ frequency !== "manual" && /* @__PURE__ */ jsx(FormField, { label: "Prompt", children: /* @__PURE__ */ jsx(
3817
+ Textarea,
3818
+ {
3819
+ value: prompt,
3820
+ onChange: (e) => setPrompt(e.target.value),
3821
+ rows: 3,
3822
+ placeholder: "Enter the prompt to send on each scheduled run...",
3823
+ className: "resize-y min-h-[60px]"
3824
+ }
3825
+ ) }),
3826
+ (schedule.last_run_at || schedule.next_run_at) && /* @__PURE__ */ jsxs("div", { className: "flex gap-6 text-sm text-muted-foreground pt-1", children: [
3827
+ schedule.last_run_at && /* @__PURE__ */ jsxs("div", { children: [
3828
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Last run:" }),
3829
+ " ",
3830
+ /* @__PURE__ */ jsx(LocalDate, { value: schedule.last_run_at })
3831
+ ] }),
3832
+ schedule.next_run_at && /* @__PURE__ */ jsxs("div", { children: [
3833
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Next run:" }),
3834
+ " ",
3835
+ /* @__PURE__ */ jsx(LocalDate, { value: schedule.next_run_at })
3836
+ ] })
3837
+ ] })
3838
+ ] });
3839
+ }
3850
3840
 
3851
3841
  export { AdminTable, AdminTableHead, AdminTableRow, AgentA2aInfo, AgentConnectorsManager, AgentDetailPage, AgentEditForm, AgentListPage, AgentPlaneProvider, AgentPluginManager, AgentRuns, AgentScheduleForm, AgentSkillManager, Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, CopyButton, DashboardPage, DetailPageHeader, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyRow, FormError, FormField, Input, LocalDate, McpServerListPage, MetricCard, ModelSelector, PaginationBar, PluginMarketplaceDetailPage, PluginMarketplaceListPage, RunDetailPage, RunListPage, RunSourceBadge, RunStatusBadge, SectionHeader, Select, SettingsPage, Skeleton, Tabs, Textarea, Th, ToolkitMultiselect, TranscriptViewer, badgeVariants, buttonVariants, cn, parsePaginationParams, useAgentPlaneClient, useApi, useAuthError, useNavigation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getcatalystiq/agent-plane-ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Embeddable React component library for AgentPlane",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,7 +56,12 @@
56
56
  "@getcatalystiq/agent-plane": "*",
57
57
  "swr": "^2.0.0",
58
58
  "react-markdown": "^9.0.0",
59
- "recharts": "^2.0.0"
59
+ "recharts": "^2.0.0",
60
+ "@uiw/react-codemirror": "^4.0.0",
61
+ "@codemirror/lang-markdown": "^6.0.0",
62
+ "@codemirror/lang-javascript": "^6.0.0",
63
+ "@codemirror/lang-json": "^6.0.0",
64
+ "@codemirror/theme-one-dark": "^6.0.0"
60
65
  },
61
66
  "peerDependenciesMeta": {
62
67
  "react-markdown": {
@@ -64,6 +69,21 @@
64
69
  },
65
70
  "recharts": {
66
71
  "optional": true
72
+ },
73
+ "@uiw/react-codemirror": {
74
+ "optional": true
75
+ },
76
+ "@codemirror/lang-markdown": {
77
+ "optional": true
78
+ },
79
+ "@codemirror/lang-javascript": {
80
+ "optional": true
81
+ },
82
+ "@codemirror/lang-json": {
83
+ "optional": true
84
+ },
85
+ "@codemirror/theme-one-dark": {
86
+ "optional": true
67
87
  }
68
88
  },
69
89
  "dependencies": {