-
Notifications
You must be signed in to change notification settings - Fork 34
feat(setup): add dashboard setup entry #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b801792
a119fc5
9f1adbb
ee3830a
e6924ef
c72923e
e855927
87c2339
9156644
a2036a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,6 +180,8 @@ export async function setupWizard(options: SetupWizardOptions, deps: SetupDeps): | |
| const requestedExtractionProvider = deps.normalizeChoice(rawExtractionProvider, EXTRACTION_PROVIDER_CHOICES); | ||
| const rawExtractionEndpoint = deps.normalizeStringValue(options.extractionEndpoint); | ||
| const requestedExtractionEndpoint = normalizeHttpEndpoint(rawExtractionEndpoint); | ||
| const rawSetupMode = deps.normalizeStringValue(options.setupMode); | ||
| const requestedSetupMode = deps.normalizeChoice(rawSetupMode, ["terminal", "dashboard"] as const); | ||
| const existingName = readString(existingConfig.name) ?? readString(existingAgent.name) ?? "My Agent"; | ||
| const existingDesc = | ||
| readString(existingConfig.description) ?? readString(existingAgent.description) ?? "Personal AI assistant"; | ||
|
|
@@ -228,6 +230,9 @@ export async function setupWizard(options: SetupWizardOptions, deps: SetupDeps): | |
| if (rawExtractionEndpoint && !requestedExtractionEndpoint) { | ||
| failSetupValidation("--extraction-endpoint must be an http:// or https:// URL."); | ||
| } | ||
| if (rawSetupMode && !requestedSetupMode) { | ||
| failSetupValidation(`Unknown --setup-mode value: ${rawSetupMode}. Valid choices: terminal, dashboard.`); | ||
| } | ||
| const unknownHarnessValues = findUnknownHarnessValues(options.harness, deps); | ||
| if (nonInteractive && unknownHarnessValues.length > 0) { | ||
| failNonInteractiveSetup( | ||
|
|
@@ -497,20 +502,78 @@ export async function setupWizard(options: SetupWizardOptions, deps: SetupDeps): | |
|
|
||
| const setupMethod = nonInteractive | ||
| ? "new" | ||
| : await select({ | ||
| message: "How would you like to set up?", | ||
| choices: [ | ||
| { value: "new", name: "Create new agent identity" }, | ||
| { value: "github", name: "Import from GitHub repository" }, | ||
| ], | ||
| }); | ||
| : requestedSetupMode === "dashboard" | ||
| ? "dashboard" | ||
| : await select({ | ||
| message: "How would you like to set up?", | ||
| choices: [ | ||
| { value: "new", name: "Create new agent identity in terminal" }, | ||
| { value: "dashboard", name: "Create defaults and finish in dashboard" }, | ||
| { value: "github", name: "Import from GitHub repository" }, | ||
| ], | ||
| }); | ||
|
|
||
| if (setupMethod === "github") { | ||
| mkdirSync(basePath, { recursive: true }); | ||
| mkdirSync(join(basePath, "memory"), { recursive: true }); | ||
| await deps.importFromGitHub(basePath); | ||
| return; | ||
| } | ||
| if (setupMethod === "dashboard") { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This dashboard-mode |
||
| const deploymentType = requestedDeploymentType ?? "local"; | ||
| const embeddingProvider = requestedEmbeddingProvider ?? defaultEmbeddingProviderForDeployment(deploymentType); | ||
| let embeddingModel = deps.normalizeStringValue(options.embeddingModel) || "nomic-embed-text-v1.5"; | ||
| let embeddingDimensions = getEmbeddingDimensions(embeddingModel); | ||
| if (embeddingProvider === "native") { | ||
| embeddingModel = "nomic-embed-text-v1.5"; | ||
| embeddingDimensions = 768; | ||
| } | ||
| const harnesses = normalizeHarnessList(options.harness, deps); | ||
| const extractionProvider = resolveSetupExtractionProvider({ | ||
| deploymentType, | ||
| requestedProvider: requestedExtractionProvider, | ||
| preserveExisting: false, | ||
| detectedProvider, | ||
| availableProviders: availableToolExtractionProviders, | ||
| preferredHarnesses: harnesses, | ||
| }); | ||
| const extractionModel = | ||
| deps.normalizeStringValue(options.extractionModel) || defaultExtractionModel(extractionProvider); | ||
| await runFreshSetup( | ||
| { | ||
| basePath, | ||
| agentName: deps.normalizeStringValue(options.name) || existingName, | ||
| agentDescription: deps.normalizeStringValue(options.description) || existingDesc, | ||
| networkMode: deps.normalizeChoice(options.networkMode, NETWORK_MODES) ?? "localhost", | ||
| harnesses, | ||
| openclawRuntimePath: deps.normalizeChoice(options.openclawRuntimePath, OPENCLAW_RUNTIME_CHOICES) ?? "plugin", | ||
| configureOpenClawWs: options.configureOpenclawWorkspace === true, | ||
| openclawConfigCount: new OpenClawConnector().getDiscoveredConfigPaths().length, | ||
| embeddingProvider, | ||
| embeddingModel, | ||
| embeddingDimensions, | ||
| extractionProvider, | ||
| extractionModel, | ||
| availableExtractionProviders: availableToolExtractionProviders, | ||
| acpxBin, | ||
| searchBalance: deps.parseSearchBalanceValue(options.searchBalance) ?? 0.7, | ||
| searchTopK: 20, | ||
| searchMinScore: 0.3, | ||
| memorySessionBudget: 2000, | ||
| memoryDecayRate: 0.95, | ||
| gitEnabled: options.skipGit !== true, | ||
| existingAgentsDir: existing.agentsDir, | ||
| nonInteractive: true, | ||
| openDashboard: true, | ||
| allowUnprotectedWorkspace: options.allowUnprotectedWorkspace === true, | ||
| createLocalBackup: options.createLocalBackup === true, | ||
| signetSecretsEnabled: await resolveSignetSecretsCorePluginSelection(basePath, true, options), | ||
| graphiqEnabled: await resolveGraphiqPluginSelection(basePath, true, options), | ||
| }, | ||
| deps, | ||
| ); | ||
| return; | ||
| } | ||
| console.log(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new dashboard setup branch calls
runFreshSetupwithout the requiredidentityPreset,startupIdentityFiles, andspecialIdentityFilesfields fromFreshSetupConfig. The normal setup path computes those later, but this early return bypasses that block. Unless the real branch has made those fields optional elsewhere,signet setup --setup-mode dashboardwill fail typecheck/build or handrunFreshSetupan incomplete config.