@jiggai/kitchen 0.3.1 → 0.3.3
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/channels.html +2 -2
- package/.next/server/app/channels.rsc +1 -1
- package/.next/server/app/channels.segments/_full.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_index.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.html +1 -1
- package/.next/server/app/cron-jobs.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/cron-jobs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/cron-jobs.segment.rsc +1 -1
- package/.next/server/app/goals/new.html +2 -2
- package/.next/server/app/goals/new.rsc +1 -1
- package/.next/server/app/goals/new.segments/_full.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_index.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
- package/.next/server/app/goals.html +1 -1
- package/.next/server/app/goals.rsc +1 -1
- package/.next/server/app/goals.segments/_full.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_index.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +1 -1
- package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/package.json +1 -2
- package/src/app/HomeClient.tsx +0 -207
- package/src/app/agents/[agentId]/agent-editor-tabs.tsx +0 -298
- package/src/app/agents/[agentId]/agent-editor.tsx +0 -468
- package/src/app/agents/[agentId]/page.tsx +0 -32
- package/src/app/api/__tests__/agents-add-route.test.ts +0 -143
- package/src/app/api/__tests__/agents-file-route.test.ts +0 -117
- package/src/app/api/__tests__/agents-files-route.test.ts +0 -61
- package/src/app/api/__tests__/agents-id-route.test.ts +0 -104
- package/src/app/api/__tests__/agents-identity-route.test.ts +0 -92
- package/src/app/api/__tests__/agents-route.test.ts +0 -54
- package/src/app/api/__tests__/agents-skills-install-route.test.ts +0 -131
- package/src/app/api/__tests__/agents-skills-route.test.ts +0 -64
- package/src/app/api/__tests__/agents-update-route.test.ts +0 -95
- package/src/app/api/__tests__/channels-bindings-route.test.ts +0 -143
- package/src/app/api/__tests__/cron-delete-route.test.ts +0 -93
- package/src/app/api/__tests__/cron-job-route.test.ts +0 -78
- package/src/app/api/__tests__/cron-jobs-route.test.ts +0 -116
- package/src/app/api/__tests__/cron-recipe-installed-route.test.ts +0 -114
- package/src/app/api/__tests__/gateway-restart-route.test.ts +0 -36
- package/src/app/api/__tests__/goals-promote-route.test.ts +0 -200
- package/src/app/api/__tests__/goals-route.test.ts +0 -184
- package/src/app/api/__tests__/ids-check-route.test.ts +0 -188
- package/src/app/api/__tests__/marketplace-recipes-route.test.ts +0 -123
- package/src/app/api/__tests__/recipes-clone-route.test.ts +0 -221
- package/src/app/api/__tests__/recipes-delete-route.test.ts +0 -248
- package/src/app/api/__tests__/recipes-id-route.test.ts +0 -166
- package/src/app/api/__tests__/recipes-route.test.ts +0 -57
- package/src/app/api/__tests__/recipes-team-agents-route.test.ts +0 -135
- package/src/app/api/__tests__/scaffold-route.test.ts +0 -173
- package/src/app/api/__tests__/settings-cron-installation-route.test.ts +0 -82
- package/src/app/api/__tests__/skills-available-route.test.ts +0 -47
- package/src/app/api/__tests__/swarms-start-route.test.ts +0 -79
- package/src/app/api/__tests__/swarms-status-route.test.ts +0 -42
- package/src/app/api/__tests__/teams-file-route.test.ts +0 -129
- package/src/app/api/__tests__/teams-files-route.test.ts +0 -57
- package/src/app/api/__tests__/teams-meta-route.test.ts +0 -113
- package/src/app/api/__tests__/teams-orchestrator-install-route.test.ts +0 -66
- package/src/app/api/__tests__/teams-orchestrator-route.test.ts +0 -59
- package/src/app/api/__tests__/teams-remove-team-route.test.ts +0 -122
- package/src/app/api/__tests__/teams-skills-install-route.test.ts +0 -78
- package/src/app/api/__tests__/teams-skills-route.test.ts +0 -73
- package/src/app/api/__tests__/teams-workflow-runs-route.test.ts +0 -85
- package/src/app/api/__tests__/teams-workflows-route.test.ts +0 -110
- package/src/app/api/__tests__/tickets-move-route.test.ts +0 -60
- package/src/app/api/agents/[id]/route.ts +0 -83
- package/src/app/api/agents/add/route.ts +0 -114
- package/src/app/api/agents/file/route.ts +0 -45
- package/src/app/api/agents/files/route.ts +0 -23
- package/src/app/api/agents/identity/route.ts +0 -41
- package/src/app/api/agents/route.ts +0 -22
- package/src/app/api/agents/skills/install/route.ts +0 -34
- package/src/app/api/agents/skills/route.ts +0 -39
- package/src/app/api/agents/update/route.ts +0 -52
- package/src/app/api/channels/bindings/route.ts +0 -63
- package/src/app/api/cron/__tests__/helpers.test.ts +0 -164
- package/src/app/api/cron/delete/route.ts +0 -23
- package/src/app/api/cron/helpers.ts +0 -172
- package/src/app/api/cron/job/route.ts +0 -22
- package/src/app/api/cron/jobs/route.ts +0 -52
- package/src/app/api/cron/recipe-installed/route.ts +0 -65
- package/src/app/api/gateway/restart/route.ts +0 -20
- package/src/app/api/goals/[id]/promote/route.ts +0 -119
- package/src/app/api/goals/[id]/route.ts +0 -54
- package/src/app/api/goals/route.ts +0 -44
- package/src/app/api/ids/check/route.ts +0 -113
- package/src/app/api/marketplace/recipes/[slug]/route.ts +0 -16
- package/src/app/api/marketplace/recipes/route.ts +0 -22
- package/src/app/api/recipes/[id]/route.ts +0 -62
- package/src/app/api/recipes/clone/route.ts +0 -106
- package/src/app/api/recipes/custom-team/route.ts +0 -193
- package/src/app/api/recipes/delete/helpers.ts +0 -65
- package/src/app/api/recipes/delete/route.ts +0 -73
- package/src/app/api/recipes/route.ts +0 -21
- package/src/app/api/recipes/team-agents/__tests__/helpers.test.ts +0 -156
- package/src/app/api/recipes/team-agents/helpers.ts +0 -151
- package/src/app/api/recipes/team-agents/route.ts +0 -80
- package/src/app/api/scaffold/__tests__/helpers.test.ts +0 -186
- package/src/app/api/scaffold/helpers.ts +0 -214
- package/src/app/api/scaffold/route.ts +0 -95
- package/src/app/api/settings/cron-installation/route.ts +0 -58
- package/src/app/api/skills/available/route.ts +0 -23
- package/src/app/api/swarms/start/route.ts +0 -100
- package/src/app/api/swarms/status/route.ts +0 -31
- package/src/app/api/teams/[teamId]/tickets/assign/route.ts +0 -105
- package/src/app/api/teams/[teamId]/tickets/assignees/route.ts +0 -27
- package/src/app/api/teams/[teamId]/tickets/delete/route.ts +0 -55
- package/src/app/api/teams/[teamId]/tickets/move/route.ts +0 -70
- package/src/app/api/teams/[teamId]/tickets/move-to-goals/route.ts +0 -56
- package/src/app/api/teams/file/route.ts +0 -46
- package/src/app/api/teams/files/route.ts +0 -63
- package/src/app/api/teams/memory/route.ts +0 -250
- package/src/app/api/teams/meta/route.ts +0 -43
- package/src/app/api/teams/orchestrator/install/route.ts +0 -129
- package/src/app/api/teams/orchestrator/route.ts +0 -216
- package/src/app/api/teams/remove-team/route.ts +0 -37
- package/src/app/api/teams/skills/install/route.ts +0 -18
- package/src/app/api/teams/skills/route.ts +0 -25
- package/src/app/api/teams/workflow-runs/route.ts +0 -534
- package/src/app/api/teams/workflow-templates/route.ts +0 -71
- package/src/app/api/teams/workflows/route.ts +0 -55
- package/src/app/api/tickets/assign/route.ts +0 -94
- package/src/app/api/tickets/assignees/route.ts +0 -24
- package/src/app/api/tickets/move/route.ts +0 -69
- package/src/app/channels/channels-client.tsx +0 -271
- package/src/app/channels/page.tsx +0 -5
- package/src/app/cron-jobs/cron-jobs-client.tsx +0 -243
- package/src/app/cron-jobs/page.tsx +0 -34
- package/src/app/favicon.ico +0 -0
- package/src/app/global-error.tsx +0 -50
- package/src/app/globals.css +0 -153
- package/src/app/goals/[id]/goal-editor.tsx +0 -162
- package/src/app/goals/[id]/page.tsx +0 -6
- package/src/app/goals/goals-client.tsx +0 -201
- package/src/app/goals/new/page.tsx +0 -81
- package/src/app/goals/page.tsx +0 -10
- package/src/app/layout.tsx +0 -53
- package/src/app/manifest.ts +0 -15
- package/src/app/not-found.tsx +0 -8
- package/src/app/page.tsx +0 -33
- package/src/app/recipes/CreateAgentModal.tsx +0 -156
- package/src/app/recipes/CreateCustomTeamModal.tsx +0 -375
- package/src/app/recipes/CreateModalShell.tsx +0 -55
- package/src/app/recipes/CreateTeamModal.tsx +0 -91
- package/src/app/recipes/[id]/RecipeEditor/RecipeEditorCreateModal.tsx +0 -72
- package/src/app/recipes/[id]/RecipeEditor/RecipeEditorPanel.tsx +0 -216
- package/src/app/recipes/[id]/RecipeEditor/index.tsx +0 -271
- package/src/app/recipes/[id]/RecipeEditor/recipe-editor-utils.ts +0 -46
- package/src/app/recipes/[id]/RecipeEditor/types.ts +0 -52
- package/src/app/recipes/[id]/page.tsx +0 -37
- package/src/app/recipes/page.tsx +0 -101
- package/src/app/recipes/recipes-client.tsx +0 -620
- package/src/app/settings/page.tsx +0 -26
- package/src/app/settings/settings-client.tsx +0 -91
- package/src/app/teams/[teamId]/CloneTeamModal.tsx +0 -116
- package/src/app/teams/[teamId]/OrchestratorPanel.tsx +0 -255
- package/src/app/teams/[teamId]/OrchestratorSetupModal.tsx +0 -184
- package/src/app/teams/[teamId]/PublishChangesModal.tsx +0 -43
- package/src/app/teams/[teamId]/page.tsx +0 -49
- package/src/app/teams/[teamId]/team-editor/TeamAgentsTab.tsx +0 -145
- package/src/app/teams/[teamId]/team-editor/TeamCronTab.tsx +0 -72
- package/src/app/teams/[teamId]/team-editor/TeamFilesTab.tsx +0 -74
- package/src/app/teams/[teamId]/team-editor/TeamMemoryTab.tsx +0 -349
- package/src/app/teams/[teamId]/team-editor/TeamRecipeTab.tsx +0 -151
- package/src/app/teams/[teamId]/team-editor/TeamSkillsTab.tsx +0 -68
- package/src/app/teams/[teamId]/team-editor/index.tsx +0 -558
- package/src/app/teams/[teamId]/team-editor/team-editor-data.ts +0 -255
- package/src/app/teams/[teamId]/team-editor/team-editor-utils.ts +0 -78
- package/src/app/teams/[teamId]/team-editor/types.ts +0 -34
- package/src/app/teams/[teamId]/tickets/[ticket]/page.tsx +0 -35
- package/src/app/teams/[teamId]/tickets/page.tsx +0 -15
- package/src/app/teams/[teamId]/workflows/[workflowId]/WorkflowCanvas.tsx +0 -111
- package/src/app/teams/[teamId]/workflows/[workflowId]/page.tsx +0 -27
- package/src/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-client.tsx +0 -1608
- package/src/app/teams/[teamId]/workflows/page.tsx +0 -40
- package/src/app/teams/[teamId]/workflows/workflows-client.tsx +0 -494
- package/src/app/tickets/TicketDetailClient.tsx +0 -147
- package/src/app/tickets/TicketsBoardClient.tsx +0 -200
- package/src/app/tickets/[ticket]/TicketAssignControl.tsx +0 -112
- package/src/app/tickets/[ticket]/page.tsx +0 -36
- package/src/app/tickets/page.tsx +0 -10
- package/src/components/AppShell.tsx +0 -286
- package/src/components/ConfirmationModal.tsx +0 -81
- package/src/components/DeleteEntityModal.tsx +0 -41
- package/src/components/ErrorBoundary.tsx +0 -70
- package/src/components/FileListWithOptionalToggle.tsx +0 -86
- package/src/components/GoalFormFields.tsx +0 -163
- package/src/components/ScaffoldOverlay.tsx +0 -78
- package/src/components/ThemeToggle.tsx +0 -53
- package/src/components/ToastProvider.tsx +0 -163
- package/src/components/__tests__/ConfirmationModal.test.tsx +0 -109
- package/src/components/__tests__/ErrorBoundary.test.tsx +0 -39
- package/src/components/__tests__/FileListWithOptionalToggle.test.tsx +0 -109
- package/src/components/__tests__/GoalFormFields.test.tsx +0 -117
- package/src/components/delete-modals.tsx +0 -59
- package/src/components/icons.tsx +0 -48
- package/src/lib/__tests__/agent-workspace.test.ts +0 -44
- package/src/lib/__tests__/agents.test.ts +0 -36
- package/src/lib/__tests__/api-route-helpers.test.ts +0 -188
- package/src/lib/__tests__/cron.test.ts +0 -45
- package/src/lib/__tests__/editor-utils.test.ts +0 -38
- package/src/lib/__tests__/errors.test.ts +0 -15
- package/src/lib/__tests__/exec.test.ts +0 -13
- package/src/lib/__tests__/fetch-json.test.ts +0 -118
- package/src/lib/__tests__/gateway.test.ts +0 -234
- package/src/lib/__tests__/goal-promote.test.ts +0 -39
- package/src/lib/__tests__/goals-client.test.ts +0 -26
- package/src/lib/__tests__/goals.test.ts +0 -275
- package/src/lib/__tests__/json.test.ts +0 -15
- package/src/lib/__tests__/kitchen-api.test.ts +0 -32
- package/src/lib/__tests__/marketplace.test.ts +0 -116
- package/src/lib/__tests__/openclaw.test.ts +0 -129
- package/src/lib/__tests__/paths.test.ts +0 -136
- package/src/lib/__tests__/poll.test.ts +0 -26
- package/src/lib/__tests__/recipe-clone.test.ts +0 -85
- package/src/lib/__tests__/recipe-team-agents.test.ts +0 -70
- package/src/lib/__tests__/recipes.test.ts +0 -199
- package/src/lib/__tests__/scaffold-client.test.ts +0 -106
- package/src/lib/__tests__/scaffold.test.ts +0 -64
- package/src/lib/__tests__/slugify.test.ts +0 -23
- package/src/lib/__tests__/tickets.test.ts +0 -158
- package/src/lib/__tests__/type-guards.test.ts +0 -18
- package/src/lib/__tests__/use-slugified-id.test.tsx +0 -120
- package/src/lib/agent-workspace.ts +0 -14
- package/src/lib/agents.ts +0 -17
- package/src/lib/api-route-helpers.ts +0 -157
- package/src/lib/cron.ts +0 -40
- package/src/lib/editor-utils.ts +0 -18
- package/src/lib/errors.ts +0 -7
- package/src/lib/exec.ts +0 -4
- package/src/lib/fetch-json.ts +0 -29
- package/src/lib/gateway.ts +0 -100
- package/src/lib/goal-promote.ts +0 -27
- package/src/lib/goals-client.ts +0 -69
- package/src/lib/goals.ts +0 -171
- package/src/lib/json.ts +0 -10
- package/src/lib/kitchen-api.ts +0 -19
- package/src/lib/marketplace.ts +0 -46
- package/src/lib/openclaw.ts +0 -59
- package/src/lib/paths.ts +0 -69
- package/src/lib/poll.ts +0 -18
- package/src/lib/recipe-clone.ts +0 -42
- package/src/lib/recipe-team-agents.ts +0 -30
- package/src/lib/recipes.ts +0 -95
- package/src/lib/scaffold-client.ts +0 -31
- package/src/lib/scaffold.ts +0 -37
- package/src/lib/slugify.ts +0 -25
- package/src/lib/swarms.ts +0 -25
- package/src/lib/tickets.ts +0 -192
- package/src/lib/type-guards.ts +0 -3
- package/src/lib/use-slugified-id.ts +0 -35
- package/src/lib/workflows/README.md +0 -11
- package/src/lib/workflows/__tests__/storage.test.ts +0 -129
- package/src/lib/workflows/__tests__/validate.test.ts +0 -92
- package/src/lib/workflows/api-handlers.ts +0 -35
- package/src/lib/workflows/readdir.ts +0 -23
- package/src/lib/workflows/runs-storage.ts +0 -59
- package/src/lib/workflows/runs-types.ts +0 -42
- package/src/lib/workflows/storage.ts +0 -70
- package/src/lib/workflows/templates/index.ts +0 -1
- package/src/lib/workflows/templates/marketing-cadence-v1.ts +0 -142
- package/src/lib/workflows/types.ts +0 -48
- package/src/lib/workflows/validate.ts +0 -92
- package/src/proxy.ts +0 -28
- /package/.next/static/{z86RoqzzXXrWnpi229zP6 → Jrrrm9HH5bKkSrQhe1j93}/_buildManifest.js +0 -0
- /package/.next/static/{z86RoqzzXXrWnpi229zP6 → Jrrrm9HH5bKkSrQhe1j93}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{z86RoqzzXXrWnpi229zP6 → Jrrrm9HH5bKkSrQhe1j93}/_ssgManifest.js +0 -0
|
@@ -1,620 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import { useRouter } from "next/navigation";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
import { ScaffoldOverlay, type ScaffoldOverlayStep } from "@/components/ScaffoldOverlay";
|
|
7
|
-
import { fetchJsonWithStatus } from "@/lib/fetch-json";
|
|
8
|
-
import { pollUntil } from "@/lib/poll";
|
|
9
|
-
import { fetchScaffold } from "@/lib/scaffold-client";
|
|
10
|
-
import { useToast } from "@/components/ToastProvider";
|
|
11
|
-
import { CreateTeamModal } from "./CreateTeamModal";
|
|
12
|
-
import { CreateCustomTeamModal } from "./CreateCustomTeamModal";
|
|
13
|
-
import { CreateAgentModal } from "./CreateAgentModal";
|
|
14
|
-
import { DeleteRecipeModal } from "@/components/delete-modals";
|
|
15
|
-
import { errorMessage } from "@/lib/errors";
|
|
16
|
-
|
|
17
|
-
type Recipe = {
|
|
18
|
-
id: string;
|
|
19
|
-
name: string;
|
|
20
|
-
kind: "agent" | "team";
|
|
21
|
-
source: "builtin" | "workspace";
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function getEditLabel(isInstalledAgent: boolean, source: string): string {
|
|
25
|
-
if (isInstalledAgent) return "Edit agent";
|
|
26
|
-
if (source === "builtin") return "View recipe";
|
|
27
|
-
return "Edit recipe";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function RecipesSection({
|
|
31
|
-
title,
|
|
32
|
-
items,
|
|
33
|
-
onDelete,
|
|
34
|
-
onCreateTeam,
|
|
35
|
-
onCreateAgent,
|
|
36
|
-
installedAgentIds,
|
|
37
|
-
}: {
|
|
38
|
-
title: string;
|
|
39
|
-
items: Recipe[];
|
|
40
|
-
onDelete?: (id: string) => void;
|
|
41
|
-
onCreateTeam?: (r: Recipe) => void;
|
|
42
|
-
onCreateAgent?: (r: Recipe) => void;
|
|
43
|
-
installedAgentIds: string[];
|
|
44
|
-
}) {
|
|
45
|
-
return (
|
|
46
|
-
<section>
|
|
47
|
-
<h2 className="text-lg font-semibold tracking-tight text-[color:var(--ck-text-primary)]">{title}</h2>
|
|
48
|
-
|
|
49
|
-
{items.length === 0 ? (
|
|
50
|
-
<div className="mt-3 ck-glass px-4 py-3 text-sm text-[color:var(--ck-text-secondary)]">None yet.</div>
|
|
51
|
-
) : (
|
|
52
|
-
<div className="mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
53
|
-
{items.map((r) => {
|
|
54
|
-
const isInstalledAgent = r.kind === "agent" && installedAgentIds.includes(r.id);
|
|
55
|
-
const editHref = isInstalledAgent
|
|
56
|
-
? `/agents/${encodeURIComponent(r.id)}`
|
|
57
|
-
: `/recipes/${encodeURIComponent(r.id)}`;
|
|
58
|
-
const editLabel = getEditLabel(isInstalledAgent, r.source);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
key={`${r.source}:${r.id}`}
|
|
63
|
-
className="ck-glass flex flex-col gap-3 px-4 py-3"
|
|
64
|
-
>
|
|
65
|
-
<div>
|
|
66
|
-
<div className="font-medium text-[color:var(--ck-text-primary)] whitespace-normal break-words">
|
|
67
|
-
{r.name}
|
|
68
|
-
</div>
|
|
69
|
-
<div className="mt-1 text-xs text-[color:var(--ck-text-secondary)]">
|
|
70
|
-
<span className="font-mono">{r.id}</span> • {r.kind} • {r.source}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
75
|
-
{r.kind === "team" && onCreateTeam ? (
|
|
76
|
-
<button
|
|
77
|
-
type="button"
|
|
78
|
-
onClick={() => onCreateTeam(r)}
|
|
79
|
-
className="rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15"
|
|
80
|
-
>
|
|
81
|
-
Create team
|
|
82
|
-
</button>
|
|
83
|
-
) : null}
|
|
84
|
-
|
|
85
|
-
{r.kind === "agent" && onCreateAgent ? (
|
|
86
|
-
<button
|
|
87
|
-
type="button"
|
|
88
|
-
onClick={() => onCreateAgent(r)}
|
|
89
|
-
className="rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15"
|
|
90
|
-
>
|
|
91
|
-
Create agent
|
|
92
|
-
</button>
|
|
93
|
-
) : null}
|
|
94
|
-
|
|
95
|
-
<Link
|
|
96
|
-
className="rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15"
|
|
97
|
-
href={editHref}
|
|
98
|
-
>
|
|
99
|
-
{editLabel}
|
|
100
|
-
</Link>
|
|
101
|
-
|
|
102
|
-
{onDelete ? (
|
|
103
|
-
<button
|
|
104
|
-
type="button"
|
|
105
|
-
onClick={() => onDelete(r.id)}
|
|
106
|
-
className="rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10"
|
|
107
|
-
>
|
|
108
|
-
Delete
|
|
109
|
-
</button>
|
|
110
|
-
) : null}
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
);
|
|
114
|
-
})}
|
|
115
|
-
</div>
|
|
116
|
-
)}
|
|
117
|
-
</section>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export default function RecipesClient({
|
|
122
|
-
builtin,
|
|
123
|
-
customTeamRecipes,
|
|
124
|
-
customAgentRecipes,
|
|
125
|
-
installedAgentIds,
|
|
126
|
-
initialOpenCustomTeam = false,
|
|
127
|
-
}: {
|
|
128
|
-
builtin: Recipe[];
|
|
129
|
-
customTeamRecipes: Recipe[];
|
|
130
|
-
customAgentRecipes: Recipe[];
|
|
131
|
-
installedAgentIds: string[];
|
|
132
|
-
initialOpenCustomTeam?: boolean;
|
|
133
|
-
}) {
|
|
134
|
-
const toast = useToast();
|
|
135
|
-
|
|
136
|
-
const [overlayOpen, setOverlayOpen] = useState(false);
|
|
137
|
-
const [overlayStep, setOverlayStep] = useState<ScaffoldOverlayStep>(1);
|
|
138
|
-
const router = useRouter();
|
|
139
|
-
|
|
140
|
-
const [deleteOpen, setDeleteOpen] = useState(false);
|
|
141
|
-
const [deleteId, setDeleteId] = useState<string>("");
|
|
142
|
-
const [busy, setBusy] = useState(false);
|
|
143
|
-
const [modalError, setModalError] = useState<string | null>(null);
|
|
144
|
-
|
|
145
|
-
const [createOpen, setCreateOpen] = useState(false);
|
|
146
|
-
const [createRecipe, setCreateRecipe] = useState<Recipe | null>(null);
|
|
147
|
-
const [createTeamId, setCreateTeamId] = useState<string>("");
|
|
148
|
-
const [installCron, setInstallCron] = useState(true);
|
|
149
|
-
const [createBusy, setCreateBusy] = useState(false);
|
|
150
|
-
const [createError, setCreateError] = useState<string | null>(null);
|
|
151
|
-
|
|
152
|
-
const [createAgentOpen, setCreateAgentOpen] = useState(false);
|
|
153
|
-
const [createAgentRecipe, setCreateAgentRecipe] = useState<Recipe | null>(null);
|
|
154
|
-
const [createAgentId, setCreateAgentId] = useState<string>("");
|
|
155
|
-
const [createAgentName, setCreateAgentName] = useState<string>("");
|
|
156
|
-
const [createAgentBusy, setCreateAgentBusy] = useState(false);
|
|
157
|
-
const [createAgentError, setCreateAgentError] = useState<string | null>(null);
|
|
158
|
-
|
|
159
|
-
const [createCustomTeamOpen, setCreateCustomTeamOpen] = useState(initialOpenCustomTeam);
|
|
160
|
-
const [createCustomTeamId, setCreateCustomTeamId] = useState<string>("");
|
|
161
|
-
const [createCustomTeamBusy, setCreateCustomTeamBusy] = useState(false);
|
|
162
|
-
const [createCustomTeamError, setCreateCustomTeamError] = useState<string | null>(null);
|
|
163
|
-
const [customTeamRoles, setCustomTeamRoles] = useState<Array<{ agentId: string; roleId: string; displayName: string }>>(
|
|
164
|
-
[],
|
|
165
|
-
);
|
|
166
|
-
|
|
167
|
-
const onDelete = (id: string) => {
|
|
168
|
-
setDeleteId(id);
|
|
169
|
-
setModalError(null);
|
|
170
|
-
setDeleteOpen(true);
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const onCreateTeam = (r: Recipe) => {
|
|
174
|
-
setCreateRecipe(r);
|
|
175
|
-
setCreateTeamId("");
|
|
176
|
-
setInstallCron(true);
|
|
177
|
-
setCreateError(null);
|
|
178
|
-
setCreateOpen(true);
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const onCreateAgent = (r: Recipe) => {
|
|
182
|
-
setCreateAgentRecipe(r);
|
|
183
|
-
setCreateAgentId("");
|
|
184
|
-
setCreateAgentName("");
|
|
185
|
-
setCreateAgentError(null);
|
|
186
|
-
setCreateAgentOpen(true);
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
const onCreateCustomTeam = () => {
|
|
190
|
-
setCreateCustomTeamId("");
|
|
191
|
-
setCustomTeamRoles([]);
|
|
192
|
-
setCreateCustomTeamError(null);
|
|
193
|
-
setCreateCustomTeamOpen(true);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
async function confirmDelete() {
|
|
197
|
-
setBusy(true);
|
|
198
|
-
setModalError(null);
|
|
199
|
-
try {
|
|
200
|
-
const result = await fetchJsonWithStatus<{ ok?: boolean; error?: string }>("/api/recipes/delete", {
|
|
201
|
-
method: "POST",
|
|
202
|
-
headers: { "content-type": "application/json" },
|
|
203
|
-
body: JSON.stringify({ id: deleteId }),
|
|
204
|
-
});
|
|
205
|
-
if (!result.ok) {
|
|
206
|
-
if (result.status === 409) {
|
|
207
|
-
setModalError(result.error);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
throw new Error(result.error);
|
|
211
|
-
}
|
|
212
|
-
if (!result.data.ok) {
|
|
213
|
-
setModalError(result.data.error ?? "Delete failed");
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
toast.push({ kind: "success", message: `Deleted recipe: ${deleteId}` });
|
|
217
|
-
setDeleteOpen(false);
|
|
218
|
-
window.location.reload();
|
|
219
|
-
} catch (e: unknown) {
|
|
220
|
-
toast.push({ kind: "error", message: errorMessage(e) });
|
|
221
|
-
} finally {
|
|
222
|
-
setBusy(false);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
async function waitForKitchenHealthy(opts?: { timeoutMs?: number }) {
|
|
227
|
-
const timeoutMs = opts?.timeoutMs ?? 30_000;
|
|
228
|
-
const result = await pollUntil<boolean>(
|
|
229
|
-
async () => {
|
|
230
|
-
try {
|
|
231
|
-
const res = await fetch("/healthz", { cache: "no-store" });
|
|
232
|
-
return res.ok ? true : null;
|
|
233
|
-
} catch {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
{ timeoutMs }
|
|
238
|
-
);
|
|
239
|
-
return result ?? false;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
async function waitForTeamPageReady(teamId: string, opts?: { timeoutMs?: number }) {
|
|
243
|
-
const timeoutMs = opts?.timeoutMs ?? 30_000;
|
|
244
|
-
const result = await pollUntil<boolean>(
|
|
245
|
-
async () => {
|
|
246
|
-
try {
|
|
247
|
-
const [recipesRes, metaRes] = await Promise.all([
|
|
248
|
-
fetch("/api/recipes", { cache: "no-store" }),
|
|
249
|
-
fetch(`/api/teams/meta?teamId=${encodeURIComponent(teamId)}`, { cache: "no-store" }),
|
|
250
|
-
]);
|
|
251
|
-
|
|
252
|
-
const recipesJson = (await recipesRes.json()) as { recipes?: Array<{ id?: unknown; kind?: unknown }> };
|
|
253
|
-
const list = Array.isArray(recipesJson.recipes) ? recipesJson.recipes : [];
|
|
254
|
-
const hasRecipe = list.some((r) => String(r.id ?? "") === teamId && String(r.kind ?? "") === "team");
|
|
255
|
-
|
|
256
|
-
const metaJson = (await metaRes.json()) as { ok?: boolean; missing?: boolean };
|
|
257
|
-
const hasMeta = Boolean(metaRes.ok && metaJson.ok && !metaJson.missing);
|
|
258
|
-
|
|
259
|
-
return hasRecipe && hasMeta ? true : null;
|
|
260
|
-
} catch {
|
|
261
|
-
return null;
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
{ timeoutMs }
|
|
265
|
-
);
|
|
266
|
-
return result ?? false;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
async function attachTeamMeta(teamId: string, recipeId: string, recipeName: string) {
|
|
270
|
-
const res = await fetchJsonWithStatus<{ ok?: boolean; error?: string }>("/api/teams/meta", {
|
|
271
|
-
method: "POST",
|
|
272
|
-
headers: { "content-type": "application/json" },
|
|
273
|
-
body: JSON.stringify({ teamId, recipeId, recipeName }),
|
|
274
|
-
});
|
|
275
|
-
if (!res.ok) throw new Error(res.error);
|
|
276
|
-
if (!res.data.ok) throw new Error(res.data.error || "Failed to attach team meta");
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function validateTeamIdForCreate(recipe: { id: string } | null, teamId: string): string | null {
|
|
280
|
-
if (!recipe) return null;
|
|
281
|
-
const t = teamId.trim();
|
|
282
|
-
if (!t) return "Team id is required.";
|
|
283
|
-
if (!t.endsWith("-team")) return "Team id must end with -team.";
|
|
284
|
-
if (t === recipe.id) return `Team id cannot be the same as the recipe id (${recipe.id}). Choose a new team id.`;
|
|
285
|
-
return null;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
async function scaffoldWithOverlay(opts: {
|
|
289
|
-
kind: "team" | "agent";
|
|
290
|
-
recipeId: string;
|
|
291
|
-
teamId?: string;
|
|
292
|
-
agentId?: string;
|
|
293
|
-
name?: string;
|
|
294
|
-
cronInstallChoice?: "yes" | "no";
|
|
295
|
-
setBusy: (v: boolean) => void;
|
|
296
|
-
setError: (v: string | null) => void;
|
|
297
|
-
setModalOpen: (v: boolean) => void;
|
|
298
|
-
setOverlayOpen: (v: boolean) => void;
|
|
299
|
-
setOverlayStep: React.Dispatch<React.SetStateAction<ScaffoldOverlayStep>>;
|
|
300
|
-
successMessage: string;
|
|
301
|
-
navigateTo: string;
|
|
302
|
-
waitBeforeNavigate?: () => Promise<unknown>;
|
|
303
|
-
}) {
|
|
304
|
-
const {
|
|
305
|
-
kind,
|
|
306
|
-
recipeId,
|
|
307
|
-
teamId,
|
|
308
|
-
agentId,
|
|
309
|
-
name,
|
|
310
|
-
cronInstallChoice,
|
|
311
|
-
setBusy,
|
|
312
|
-
setError,
|
|
313
|
-
setModalOpen,
|
|
314
|
-
setOverlayOpen,
|
|
315
|
-
setOverlayStep,
|
|
316
|
-
successMessage,
|
|
317
|
-
navigateTo,
|
|
318
|
-
waitBeforeNavigate,
|
|
319
|
-
} = opts;
|
|
320
|
-
|
|
321
|
-
setBusy(true);
|
|
322
|
-
setError(null);
|
|
323
|
-
setModalOpen(false);
|
|
324
|
-
setOverlayOpen(true);
|
|
325
|
-
setOverlayStep(1);
|
|
326
|
-
|
|
327
|
-
let serveTimer: ReturnType<typeof setTimeout> | null = null;
|
|
328
|
-
|
|
329
|
-
try {
|
|
330
|
-
const body =
|
|
331
|
-
kind === "team"
|
|
332
|
-
? { kind: "team" as const, recipeId, teamId: teamId!, cronInstallChoice }
|
|
333
|
-
: { kind: "agent" as const, recipeId, agentId: agentId!, name };
|
|
334
|
-
const { res, json } = await fetchScaffold(body);
|
|
335
|
-
if (!res.ok || !(json as { ok?: boolean }).ok)
|
|
336
|
-
throw new Error(
|
|
337
|
-
String((json as { error?: string }).error || (kind === "team" ? "Create team failed" : "Create agent failed"))
|
|
338
|
-
);
|
|
339
|
-
|
|
340
|
-
setOverlayStep(2);
|
|
341
|
-
|
|
342
|
-
serveTimer = setTimeout(() => {
|
|
343
|
-
setOverlayStep((prev) => (prev < 3 ? 3 : prev));
|
|
344
|
-
}, 20_000);
|
|
345
|
-
|
|
346
|
-
const stderr = typeof (json as { stderr?: unknown }).stderr === "string" ? (json as { stderr: string }).stderr : "";
|
|
347
|
-
|
|
348
|
-
if (/Failed to start CLI:/i.test(stderr) || /\bError: /i.test(stderr)) {
|
|
349
|
-
throw new Error(stderr.trim() || "Scaffold failed");
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if (/Restart required:/i.test(stderr)) {
|
|
353
|
-
setOverlayStep(3);
|
|
354
|
-
try {
|
|
355
|
-
await fetch("/api/gateway/restart", { method: "POST" });
|
|
356
|
-
} catch {
|
|
357
|
-
// best-effort
|
|
358
|
-
}
|
|
359
|
-
await waitForKitchenHealthy({ timeoutMs: 60_000 });
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (waitBeforeNavigate) {
|
|
363
|
-
await waitBeforeNavigate();
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
if (serveTimer) clearTimeout(serveTimer);
|
|
367
|
-
|
|
368
|
-
toast.push({ kind: "success", message: successMessage });
|
|
369
|
-
setModalOpen(false);
|
|
370
|
-
|
|
371
|
-
router.push(navigateTo);
|
|
372
|
-
|
|
373
|
-
setTimeout(() => setOverlayOpen(false), 500);
|
|
374
|
-
} catch (e: unknown) {
|
|
375
|
-
if (serveTimer) clearTimeout(serveTimer);
|
|
376
|
-
setOverlayOpen(false);
|
|
377
|
-
const msg = errorMessage(e);
|
|
378
|
-
setError(msg);
|
|
379
|
-
toast.push({ kind: "error", message: msg });
|
|
380
|
-
} finally {
|
|
381
|
-
setBusy(false);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
async function confirmCreateTeam() {
|
|
386
|
-
const recipe = createRecipe;
|
|
387
|
-
const err = validateTeamIdForCreate(recipe, createTeamId);
|
|
388
|
-
if (err) {
|
|
389
|
-
setCreateError(err);
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
if (!recipe) return;
|
|
393
|
-
|
|
394
|
-
const t = createTeamId.trim();
|
|
395
|
-
await scaffoldWithOverlay({
|
|
396
|
-
kind: "team",
|
|
397
|
-
recipeId: recipe.id,
|
|
398
|
-
teamId: t,
|
|
399
|
-
cronInstallChoice: installCron ? "yes" : "no",
|
|
400
|
-
setBusy: setCreateBusy,
|
|
401
|
-
setError: setCreateError,
|
|
402
|
-
setModalOpen: setCreateOpen,
|
|
403
|
-
setOverlayOpen,
|
|
404
|
-
setOverlayStep,
|
|
405
|
-
successMessage: `Created team: ${t}`,
|
|
406
|
-
navigateTo: `/teams/${encodeURIComponent(t)}`,
|
|
407
|
-
waitBeforeNavigate: () => waitForTeamPageReady(t, { timeoutMs: 60_000 }),
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
async function confirmCreateAgent() {
|
|
412
|
-
const recipe = createAgentRecipe;
|
|
413
|
-
if (!recipe) return;
|
|
414
|
-
|
|
415
|
-
const a = createAgentId.trim();
|
|
416
|
-
if (!a) {
|
|
417
|
-
setCreateAgentError("Agent id is required.");
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
if (a === recipe.id) {
|
|
421
|
-
setCreateAgentError(`Agent id cannot be the same as the recipe id (${recipe.id}). Choose a new agent id.`);
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
await scaffoldWithOverlay({
|
|
426
|
-
kind: "agent",
|
|
427
|
-
recipeId: recipe.id,
|
|
428
|
-
agentId: a,
|
|
429
|
-
name: createAgentName.trim() || undefined,
|
|
430
|
-
setBusy: setCreateAgentBusy,
|
|
431
|
-
setError: setCreateAgentError,
|
|
432
|
-
setModalOpen: setCreateAgentOpen,
|
|
433
|
-
setOverlayOpen,
|
|
434
|
-
setOverlayStep,
|
|
435
|
-
successMessage: `Created agent: ${a}`,
|
|
436
|
-
navigateTo: `/agents/${encodeURIComponent(a)}`,
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
async function confirmCreateCustomTeam() {
|
|
441
|
-
const teamId = createCustomTeamId.trim();
|
|
442
|
-
if (!teamId) {
|
|
443
|
-
setCreateCustomTeamError("Team id is required.");
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
const recipeId = teamId.endsWith("-team") ? teamId.slice(0, -"-team".length) : teamId;
|
|
447
|
-
if (!recipeId) {
|
|
448
|
-
setCreateCustomTeamError("Team id is invalid.");
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
if (customTeamRoles.length < 1) {
|
|
452
|
-
setCreateCustomTeamError("Select at least one agent.");
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
setCreateCustomTeamError(null);
|
|
457
|
-
|
|
458
|
-
try {
|
|
459
|
-
setCreateCustomTeamBusy(true);
|
|
460
|
-
const createRes = await fetchJsonWithStatus<{ ok?: boolean; error?: string; recipeId?: string }>(
|
|
461
|
-
"/api/recipes/custom-team",
|
|
462
|
-
{
|
|
463
|
-
method: "POST",
|
|
464
|
-
headers: { "content-type": "application/json" },
|
|
465
|
-
body: JSON.stringify({
|
|
466
|
-
recipeId,
|
|
467
|
-
teamId,
|
|
468
|
-
roles: customTeamRoles.map((r) => ({ roleId: r.roleId, displayName: r.displayName })),
|
|
469
|
-
}),
|
|
470
|
-
},
|
|
471
|
-
);
|
|
472
|
-
setCreateCustomTeamBusy(false);
|
|
473
|
-
|
|
474
|
-
if (!createRes.ok) {
|
|
475
|
-
throw new Error(createRes.error);
|
|
476
|
-
}
|
|
477
|
-
if (!createRes.data.ok) {
|
|
478
|
-
throw new Error(createRes.data.error || "Failed to create custom team recipe");
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
await scaffoldWithOverlay({
|
|
482
|
-
kind: "team",
|
|
483
|
-
recipeId,
|
|
484
|
-
teamId,
|
|
485
|
-
cronInstallChoice: "no",
|
|
486
|
-
setBusy: setCreateCustomTeamBusy,
|
|
487
|
-
setError: setCreateCustomTeamError,
|
|
488
|
-
setModalOpen: setCreateCustomTeamOpen,
|
|
489
|
-
setOverlayOpen,
|
|
490
|
-
setOverlayStep,
|
|
491
|
-
successMessage: `Created team: ${teamId}`,
|
|
492
|
-
navigateTo: `/teams/${encodeURIComponent(teamId)}`,
|
|
493
|
-
waitBeforeNavigate: async () => {
|
|
494
|
-
// Some scaffold paths may not persist team.json (meta) immediately.
|
|
495
|
-
// Ensure it exists so the team editor loads reliably.
|
|
496
|
-
await attachTeamMeta(teamId, recipeId, "Custom Team");
|
|
497
|
-
await waitForTeamPageReady(teamId, { timeoutMs: 60_000 });
|
|
498
|
-
},
|
|
499
|
-
});
|
|
500
|
-
} catch (e: unknown) {
|
|
501
|
-
setCreateCustomTeamBusy(false);
|
|
502
|
-
const msg = errorMessage(e);
|
|
503
|
-
setCreateCustomTeamError(msg);
|
|
504
|
-
toast.push({ kind: "error", message: msg });
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
return (
|
|
509
|
-
<>
|
|
510
|
-
<ScaffoldOverlay
|
|
511
|
-
open={overlayOpen}
|
|
512
|
-
step={overlayStep}
|
|
513
|
-
onDismiss={() => {
|
|
514
|
-
setOverlayOpen(false);
|
|
515
|
-
}}
|
|
516
|
-
/>
|
|
517
|
-
<div className="mt-8 space-y-10">
|
|
518
|
-
<section>
|
|
519
|
-
<div className="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
|
|
520
|
-
<div>
|
|
521
|
-
<h2 className="text-xl font-semibold tracking-tight text-[color:var(--ck-text-primary)]">Custom recipes</h2>
|
|
522
|
-
<p className="mt-1 text-sm text-[color:var(--ck-text-secondary)]">
|
|
523
|
-
Workspace recipes (editable) — stored under <code className="font-mono">~/.openclaw/workspace/recipes/</code>.
|
|
524
|
-
</p>
|
|
525
|
-
</div>
|
|
526
|
-
<button
|
|
527
|
-
type="button"
|
|
528
|
-
onClick={onCreateCustomTeam}
|
|
529
|
-
className="rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15"
|
|
530
|
-
>
|
|
531
|
-
Create custom team
|
|
532
|
-
</button>
|
|
533
|
-
</div>
|
|
534
|
-
|
|
535
|
-
<div className="mt-4 space-y-8">
|
|
536
|
-
<RecipesSection
|
|
537
|
-
title={`Teams (${customTeamRecipes.length})`}
|
|
538
|
-
items={customTeamRecipes}
|
|
539
|
-
onDelete={onDelete}
|
|
540
|
-
onCreateTeam={onCreateTeam}
|
|
541
|
-
installedAgentIds={installedAgentIds}
|
|
542
|
-
/>
|
|
543
|
-
<RecipesSection
|
|
544
|
-
title={`Agents (${customAgentRecipes.length})`}
|
|
545
|
-
items={customAgentRecipes}
|
|
546
|
-
onDelete={onDelete}
|
|
547
|
-
onCreateAgent={onCreateAgent}
|
|
548
|
-
installedAgentIds={installedAgentIds}
|
|
549
|
-
/>
|
|
550
|
-
</div>
|
|
551
|
-
</section>
|
|
552
|
-
|
|
553
|
-
<section>
|
|
554
|
-
<h2 className="text-xl font-semibold tracking-tight text-[color:var(--ck-text-primary)]">Builtin recipes</h2>
|
|
555
|
-
<p className="mt-1 text-sm text-[color:var(--ck-text-secondary)]">Bundled recipes shipped with the plugin.</p>
|
|
556
|
-
|
|
557
|
-
<div className="mt-4">
|
|
558
|
-
<RecipesSection
|
|
559
|
-
title={`All (${builtin.length})`}
|
|
560
|
-
items={builtin}
|
|
561
|
-
onCreateTeam={onCreateTeam}
|
|
562
|
-
onCreateAgent={onCreateAgent}
|
|
563
|
-
installedAgentIds={installedAgentIds}
|
|
564
|
-
/>
|
|
565
|
-
</div>
|
|
566
|
-
</section>
|
|
567
|
-
</div>
|
|
568
|
-
|
|
569
|
-
<DeleteRecipeModal
|
|
570
|
-
open={deleteOpen}
|
|
571
|
-
recipeId={deleteId}
|
|
572
|
-
busy={busy}
|
|
573
|
-
error={modalError}
|
|
574
|
-
onClose={() => setDeleteOpen(false)}
|
|
575
|
-
onConfirm={confirmDelete}
|
|
576
|
-
/>
|
|
577
|
-
|
|
578
|
-
<CreateCustomTeamModal
|
|
579
|
-
open={createCustomTeamOpen}
|
|
580
|
-
teamId={createCustomTeamId}
|
|
581
|
-
setTeamId={setCreateCustomTeamId}
|
|
582
|
-
busy={createCustomTeamBusy}
|
|
583
|
-
error={createCustomTeamError}
|
|
584
|
-
onRolesChange={setCustomTeamRoles}
|
|
585
|
-
onClose={() => setCreateCustomTeamOpen(false)}
|
|
586
|
-
onConfirm={confirmCreateCustomTeam}
|
|
587
|
-
/>
|
|
588
|
-
|
|
589
|
-
<CreateTeamModal
|
|
590
|
-
open={createOpen}
|
|
591
|
-
recipeId={createRecipe?.id ?? ""}
|
|
592
|
-
recipeName={createRecipe?.name ?? ""}
|
|
593
|
-
teamId={createTeamId}
|
|
594
|
-
setTeamId={setCreateTeamId}
|
|
595
|
-
installCron={installCron}
|
|
596
|
-
setInstallCron={setInstallCron}
|
|
597
|
-
busy={createBusy}
|
|
598
|
-
error={createError}
|
|
599
|
-
onClose={() => setCreateOpen(false)}
|
|
600
|
-
onConfirm={confirmCreateTeam}
|
|
601
|
-
/>
|
|
602
|
-
|
|
603
|
-
<CreateAgentModal
|
|
604
|
-
open={createAgentOpen}
|
|
605
|
-
recipeId={createAgentRecipe?.id ?? ""}
|
|
606
|
-
recipeName={createAgentRecipe?.name ?? ""}
|
|
607
|
-
agentId={createAgentId}
|
|
608
|
-
setAgentId={setCreateAgentId}
|
|
609
|
-
agentName={createAgentName}
|
|
610
|
-
setAgentName={setCreateAgentName}
|
|
611
|
-
existingRecipeIds={[...builtin, ...customTeamRecipes, ...customAgentRecipes].map((r) => r.id)}
|
|
612
|
-
existingAgentIds={installedAgentIds}
|
|
613
|
-
busy={createAgentBusy}
|
|
614
|
-
error={createAgentError}
|
|
615
|
-
onClose={() => setCreateAgentOpen(false)}
|
|
616
|
-
onConfirm={confirmCreateAgent}
|
|
617
|
-
/>
|
|
618
|
-
</>
|
|
619
|
-
);
|
|
620
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import SettingsClient from "./settings-client";
|
|
2
|
-
|
|
3
|
-
export default function SettingsPage() {
|
|
4
|
-
return (
|
|
5
|
-
<div className="ck-glass w-full p-6 sm:p-8">
|
|
6
|
-
<h1 className="text-2xl font-semibold tracking-tight">Settings</h1>
|
|
7
|
-
<p className="mt-2 text-sm text-[color:var(--ck-text-secondary)]">
|
|
8
|
-
Configuration that affects scaffold behavior and automation.
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<div className="mt-8">
|
|
12
|
-
<h2 className="text-lg font-semibold tracking-tight">Cron installation</h2>
|
|
13
|
-
<p className="mt-2 text-sm text-[color:var(--ck-text-secondary)]">
|
|
14
|
-
Recipes can declare cron jobs. This controls whether Kitchen installs/reconciles them during scaffold.
|
|
15
|
-
<span className="mt-2 block text-[color:var(--ck-text-tertiary)]">
|
|
16
|
-
Safety note: jobs can send messages / run automatically. Default should remain conservative.
|
|
17
|
-
</span>
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
<div className="mt-4">
|
|
21
|
-
<SettingsClient />
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
}
|