Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { BookOpen, Play, Workflow } from "lucide-react";

import { SLASH_COMMAND_HINTS } from "@/common/constants/slashCommandHints";
import type { AvailableWorkflow, WorkflowArgSummary } from "@/common/types/workflow";

import { WorkflowScopeBadge } from "./WorkflowBadges";
Expand Down Expand Up @@ -231,11 +232,12 @@ export const WorkflowEmptyState: React.FC<WorkflowEmptyStateProps> = (props) =>
)}

<div className="text-muted pt-1 text-center text-[11.5px]">
Or start one from chat with{" "}
Start one from chat with{" "}
<span className="border-border bg-surface-secondary rounded border px-1.5 py-px font-mono">
/
{`/workflow ${SLASH_COMMAND_HINTS.workflow}`}
</span>
, or author one in <span className="text-content-secondary font-mono">.mux/workflows/</span>
; workspace <span className="text-content-secondary font-mono">.js</span> workflows are
loaded by explicit path.
</div>
</div>
);
Expand Down
11 changes: 11 additions & 0 deletions src/browser/utils/slashCommands/ghostHint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ describe("getCommandGhostHint", () => {
).toBe(SLASH_COMMAND_HINTS.heartbeat);
});

it("returns only workflow args after the typed /workflow command", () => {
const enabledExperiments = new Set<ExperimentId>([EXPERIMENT_IDS.DYNAMIC_WORKFLOWS]);

const hint = getCommandGhostHint("/workflow ", false, {
isExperimentEnabled: (experimentId) => enabledExperiments.has(experimentId),
});

expect(hint).toBe("<script_path> [args]");
expect(hint).not.toContain("/workflow");
});

it("returns goal hints regardless of experiment state after GA", () => {
expect(
getCommandGhostHint("/goal ", false, {
Expand Down
4 changes: 2 additions & 2 deletions src/browser/utils/slashCommands/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,13 @@ const btwCommandDefinition: SlashCommandDefinition = {
},
};

const WORKFLOW_COMMAND_USAGE = "/workflow <script_path> [args]";
const WORKFLOW_COMMAND_USAGE = `/workflow ${SLASH_COMMAND_HINTS.workflow}`;

const workflowCommandDefinition: SlashCommandDefinition = {
key: "workflow",
description: "Run an explicit workflow by script path",
experimentGate: EXPERIMENT_IDS.DYNAMIC_WORKFLOWS,
inputHint: WORKFLOW_COMMAND_USAGE,
inputHint: SLASH_COMMAND_HINTS.workflow,
handler: ({ rawInput }): ParsedCommand => {
const trimmed = rawInput.trim();
if (!trimmed) {
Expand Down
1 change: 1 addition & 0 deletions src/common/constants/slashCommandHints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export const SLASH_COMMAND_HINTS = {
heartbeat: "<minutes>|off",
goal: "[-b <amount>] [--turns <n>] <objective>|budget <amount>|clear",
btw: "<question>",
workflow: "<script_path> [args]",
} as const satisfies Readonly<Record<string, string>>;
Loading