






















@@ -237,16 +237,70 @@ export function formatCrestodianOverview(overview: CrestodianOverview): string {
237237238238export function recommendCrestodianNextStep(overview: CrestodianOverview): string {
239239if (!overview.config.exists) {
240-return 'say "setup" to create a starter config';
240+return 'run "setup" to create a starter config';
241241}
242242if (!overview.config.valid) {
243-return 'say "validate config" or "doctor" to inspect the config';
243+return 'run "validate config" or "doctor" to inspect the config';
244244}
245245if (!overview.defaultModel) {
246-return 'say "setup" or "set default model <provider/model>"';
246+return 'run "setup" or "set default model <provider/model>"';
247247}
248248if (!overview.gateway.reachable) {
249-return 'say "gateway status" or "restart gateway"';
249+return 'run "gateway status" or "restart gateway"';
250250}
251-return 'say "talk to agent" to enter your default agent';
251+return 'run "talk to agent" to enter your default agent';
252+}
253+254+function formatStartupConfigStatus(overview: CrestodianOverview): string {
255+if (!overview.config.exists) {
256+return "missing";
257+}
258+return overview.config.valid ? "valid" : "invalid";
259+}
260+261+function formatStartupUse(overview: CrestodianOverview): string {
262+if (overview.defaultModel) {
263+return `Using: ${overview.defaultModel} for fuzzy local planning.`;
264+}
265+return "Using: deterministic typed commands until we configure a model.";
266+}
267+268+function formatStartupGatewayStatus(overview: CrestodianOverview): string {
269+if (overview.gateway.reachable) {
270+return `Gateway: reachable at ${overview.gateway.url}.`;
271+}
272+return `Gateway: not reachable at ${overview.gateway.url}; I already did the first probe.`;
273+}
274+275+function formatStartupAction(overview: CrestodianOverview): string {
276+if (!overview.config.exists) {
277+return "I can start by creating a starter config with `setup`.";
278+}
279+if (!overview.config.valid) {
280+return "I can start debugging with `validate config` or `doctor`.";
281+}
282+if (!overview.defaultModel) {
283+return "I can start by choosing a model with `setup`.";
284+}
285+if (!overview.gateway.reachable) {
286+return "I can start debugging with `gateway status`, or queue `restart gateway` for approval.";
287+}
288+return "Everything basic is reachable. Use `talk to agent` when you want the normal agent.";
289+}
290+291+export function formatCrestodianStartupMessage(overview: CrestodianOverview): string {
292+const agent = overview.agents.find((entry) => entry.id === overview.defaultAgentId);
293+const agentLabel = agent?.name
294+ ? `${overview.defaultAgentId} (${agent.name})`
295+ : overview.defaultAgentId;
296+return [
297+"## Hi, I'm Crestodian.",
298+"",
299+"- Start me when setup, config, Gateway, model choice, or agent routing feels off.",
300+`- ${formatStartupUse(overview)}`,
301+`- Config: ${formatStartupConfigStatus(overview)}. Default agent: ${agentLabel}.`,
302+`- ${formatStartupGatewayStatus(overview)}`,
303+"",
304+formatStartupAction(overview),
305+].join("\n");
252306}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。