Fix onboarding default task text and launch redirect
This commit is contained in:
@@ -41,6 +41,10 @@ import {
|
|||||||
type Step = 1 | 2 | 3 | 4;
|
type Step = 1 | 2 | 3 | 4;
|
||||||
type AdapterType = "claude_local" | "codex_local" | "process" | "http" | "openclaw";
|
type AdapterType = "claude_local" | "codex_local" | "process" | "http" | "openclaw";
|
||||||
|
|
||||||
|
const DEFAULT_TASK_DESCRIPTION = `Setup yourself as the CEO. Use the ceo persona found here: [https://github.com/paperclipai/companies/blob/main/default/ceo/AGENTS.md](https://github.com/paperclipai/companies/blob/main/default/ceo/AGENTS.md)
|
||||||
|
|
||||||
|
Ensure you have a folder agents/ceo and then download this AGENTS.md as well as the sibling HEARTBEAT.md, SOUL.md, and TOOLS.md. and set that AGENTS.md as the path to your agents instruction file`;
|
||||||
|
|
||||||
export function OnboardingWizard() {
|
export function OnboardingWizard() {
|
||||||
const { onboardingOpen, closeOnboarding } = useDialog();
|
const { onboardingOpen, closeOnboarding } = useDialog();
|
||||||
const { setSelectedCompanyId } = useCompany();
|
const { setSelectedCompanyId } = useCompany();
|
||||||
@@ -67,11 +71,13 @@ export function OnboardingWizard() {
|
|||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
const [taskTitle, setTaskTitle] = useState("Create your CEO HEARTBEAT.md");
|
const [taskTitle, setTaskTitle] = useState("Create your CEO HEARTBEAT.md");
|
||||||
const [taskDescription, setTaskDescription] = useState("You're the CEO of the company, make sure you have a file agents/ceo/HEARTBEAT.md that tells you your core loop. You MUST use the Paperclip SKILL.");
|
const [taskDescription, setTaskDescription] = useState(DEFAULT_TASK_DESCRIPTION);
|
||||||
|
|
||||||
// Created entity IDs
|
// Created entity IDs
|
||||||
const [createdCompanyId, setCreatedCompanyId] = useState<string | null>(null);
|
const [createdCompanyId, setCreatedCompanyId] = useState<string | null>(null);
|
||||||
|
const [createdCompanyPrefix, setCreatedCompanyPrefix] = useState<string | null>(null);
|
||||||
const [createdAgentId, setCreatedAgentId] = useState<string | null>(null);
|
const [createdAgentId, setCreatedAgentId] = useState<string | null>(null);
|
||||||
|
const [createdIssueRef, setCreatedIssueRef] = useState<string | null>(null);
|
||||||
|
|
||||||
const { data: adapterModels } = useQuery({
|
const { data: adapterModels } = useQuery({
|
||||||
queryKey: ["adapter-models", adapterType],
|
queryKey: ["adapter-models", adapterType],
|
||||||
@@ -95,9 +101,11 @@ export function OnboardingWizard() {
|
|||||||
setArgs("");
|
setArgs("");
|
||||||
setUrl("");
|
setUrl("");
|
||||||
setTaskTitle("Create your CEO HEARTBEAT.md");
|
setTaskTitle("Create your CEO HEARTBEAT.md");
|
||||||
setTaskDescription("You're the CEO of the company, make sure you have a file agents/ceo/HEARTBEAT.md that tells you your core loop. You MUST use the Paperclip SKILL.");
|
setTaskDescription(DEFAULT_TASK_DESCRIPTION);
|
||||||
setCreatedCompanyId(null);
|
setCreatedCompanyId(null);
|
||||||
|
setCreatedCompanyPrefix(null);
|
||||||
setCreatedAgentId(null);
|
setCreatedAgentId(null);
|
||||||
|
setCreatedIssueRef(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
@@ -125,6 +133,7 @@ export function OnboardingWizard() {
|
|||||||
try {
|
try {
|
||||||
const company = await companiesApi.create({ name: companyName.trim() });
|
const company = await companiesApi.create({ name: companyName.trim() });
|
||||||
setCreatedCompanyId(company.id);
|
setCreatedCompanyId(company.id);
|
||||||
|
setCreatedCompanyPrefix(company.issuePrefix);
|
||||||
setSelectedCompanyId(company.id);
|
setSelectedCompanyId(company.id);
|
||||||
queryClient.invalidateQueries({ queryKey: queryKeys.companies.all });
|
queryClient.invalidateQueries({ queryKey: queryKeys.companies.all });
|
||||||
|
|
||||||
@@ -182,12 +191,13 @@ export function OnboardingWizard() {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
try {
|
try {
|
||||||
await issuesApi.create(createdCompanyId, {
|
const issue = await issuesApi.create(createdCompanyId, {
|
||||||
title: taskTitle.trim(),
|
title: taskTitle.trim(),
|
||||||
...(taskDescription.trim() ? { description: taskDescription.trim() } : {}),
|
...(taskDescription.trim() ? { description: taskDescription.trim() } : {}),
|
||||||
assigneeAgentId: createdAgentId,
|
assigneeAgentId: createdAgentId,
|
||||||
status: "todo",
|
status: "todo",
|
||||||
});
|
});
|
||||||
|
setCreatedIssueRef(issue.identifier ?? issue.id);
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: queryKeys.issues.list(createdCompanyId),
|
queryKey: queryKeys.issues.list(createdCompanyId),
|
||||||
});
|
});
|
||||||
@@ -211,7 +221,15 @@ export function OnboardingWizard() {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
reset();
|
reset();
|
||||||
closeOnboarding();
|
closeOnboarding();
|
||||||
navigate(`/agents/${createdAgentId}`);
|
if (createdCompanyPrefix && createdIssueRef) {
|
||||||
|
navigate(`/${createdCompanyPrefix}/issues/${createdIssueRef}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (createdCompanyPrefix) {
|
||||||
|
navigate(`/${createdCompanyPrefix}/dashboard`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigate("/dashboard");
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleKeyDown(e: React.KeyboardEvent) {
|
function handleKeyDown(e: React.KeyboardEvent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user